Version Description
- 2020-06-23 =
- bug: Cart and Checkout blocks display shipping methods with tax rates if that's how it's set in the settings. #2748
- bug: Fix an error appearing in the Product Categories List block with Full Width align. #2700
- enhancement: Added aria-expanded attribute to Change address button in the Cart block #2603
- enhancement: Fix updating the
wc_reserve_stock
stock_quantity value after making changes to the cart inbetween checkouts. #2747 - enhancement: Remove background color from Express checkout title. #2704
- enhancement: Several style enhancements to the Cart and Checkout blocks sidebar. #2694
- enhancement: The Cart and Checkout blocks now use the font colors provided by the theme. #2745
- enhancement: Update some class names to match the new guidelines. Check the docs in order to see which class names have been updated. #2691 [DN]
- enhancement: Blocks now respect the product image cropping settings. For the All Products block, the user can switch between the cropped thumbnail and the full size image. #2755
Download this release
Release Info
Developer | assassinateur |
Plugin | WooCommerce Gutenberg Products Block |
Version | 2.8.0 |
Comparing to | |
See all releases |
Code changes from version 2.7.1 to 2.8.0
- assets/css/abstracts/_mixins.scss +21 -0
- assets/js/atomic/blocks/component-init.js +80 -0
- assets/js/atomic/blocks/index.js +4 -0
- assets/js/atomic/blocks/product/add-to-cart/attributes.js +8 -0
- assets/js/atomic/blocks/product/add-to-cart/block.js +86 -0
- assets/js/atomic/blocks/product/add-to-cart/edit.js +59 -0
- assets/js/atomic/blocks/product/add-to-cart/frontend.js +13 -0
- assets/js/atomic/blocks/product/add-to-cart/index.js +32 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/external.js +13 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/grouped/group-list/index.js +14 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/grouped/index.js +13 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/index.js +4 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/simple.js +54 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/variable/index.js +60 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/attribute-picker.js +115 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/attribute-select-control.js +36 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/index.js +37 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/style.scss +18 -0
- assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/utils.js +107 -0
- assets/js/atomic/blocks/product/add-to-cart/shared/add-to-cart-button.js +114 -0
- assets/js/atomic/blocks/product/add-to-cart/shared/index.js +3 -0
- assets/js/atomic/blocks/product/add-to-cart/shared/product-unavailable.js +19 -0
- assets/js/atomic/blocks/product/add-to-cart/shared/quantity-input.js +21 -0
- assets/js/atomic/blocks/product/add-to-cart/style.scss +45 -0
- assets/js/atomic/blocks/product/button/block.js +3 -1
- assets/js/atomic/blocks/product/category-list/block.js +65 -0
- assets/js/atomic/blocks/product/category-list/edit.js +21 -0
- assets/js/atomic/blocks/product/category-list/index.js +30 -0
- assets/js/atomic/blocks/product/category-list/style.scss +23 -0
- assets/js/atomic/blocks/product/image/attributes.js +4 -0
- assets/js/atomic/blocks/product/image/block.js +22 -10
- assets/js/atomic/blocks/product/image/edit.js +52 -1
- assets/js/atomic/blocks/product/sku/edit.js +1 -5
- assets/js/atomic/blocks/product/sku/index.js +2 -2
- assets/js/atomic/blocks/product/stock-indicator/block.js +84 -0
- assets/js/atomic/blocks/product/stock-indicator/edit.js +18 -0
- assets/js/atomic/blocks/product/stock-indicator/index.js +30 -0
- assets/js/atomic/blocks/product/stock-indicator/style.scss +19 -0
- assets/js/atomic/blocks/product/tag-list/block.js +65 -0
- assets/js/atomic/blocks/product/tag-list/edit.js +21 -0
- assets/js/atomic/blocks/product/tag-list/index.js +30 -0
- assets/js/atomic/blocks/product/tag-list/style.scss +23 -0
- assets/js/atomic/utils/get-block-map.js +6 -22
- assets/js/base/components/block-error-boundary/block-error.js +12 -6
- assets/js/base/components/block-error-boundary/style.scss +7 -7
- assets/js/base/components/button/index.js +48 -0
- assets/js/base/components/button/stories/index.js +15 -0
- assets/js/base/components/button/style.scss +73 -0
- assets/js/base/components/cart-checkout/address-form/index.js +2 -2
- assets/js/base/components/cart-checkout/form-step/index.js +10 -7
- assets/js/base/components/cart-checkout/form-step/style.scss +21 -19
- assets/js/base/components/cart-checkout/form/index.js +4 -1
- assets/js/base/components/cart-checkout/form/style.scss +1 -1
- assets/js/base/components/cart-checkout/order-summary/style.scss +11 -7
- assets/js/base/components/cart-checkout/payment-method-icons/index.js +9 -4
- assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.js +1 -1
- assets/js/base/components/cart-checkout/payment-method-icons/style.scss +6 -6
- assets/js/base/components/cart-checkout/payment-method-label/index.js +2 -2
- assets/js/base/components/cart-checkout/payment-method-label/style.scss +2 -2
- assets/js/base/components/cart-checkout/product-image/index.js +2 -6
- assets/js/base/components/cart-checkout/product-low-stock-badge/index.js +1 -1
- assets/js/base/components/cart-checkout/product-low-stock-badge/style.scss +5 -6
- assets/js/base/components/cart-checkout/product-metadata/index.js +6 -2
- assets/js/base/components/cart-checkout/product-metadata/style.scss +3 -4
- assets/js/base/components/cart-checkout/product-name/index.js +1 -1
- assets/js/base/components/cart-checkout/product-name/style.scss +1 -1
- assets/js/base/components/cart-checkout/product-price/index.js +42 -22
- assets/js/base/components/cart-checkout/product-price/style.scss +1 -8
- assets/js/base/components/cart-checkout/product-sale-badge/index.js +2 -2
- assets/js/base/components/cart-checkout/product-sale-badge/style.scss +2 -4
- assets/js/base/components/cart-checkout/product-summary/index.js +12 -2
- assets/js/base/components/cart-checkout/product-variation-data/index.js +8 -2
- assets/js/base/components/cart-checkout/return-to-cart-button/style.scss +1 -1
- assets/js/base/components/cart-checkout/shipping-calculator/address.js +2 -2
- assets/js/base/components/cart-checkout/shipping-calculator/index.js +1 -1
- assets/js/base/components/cart-checkout/shipping-calculator/style.scss +3 -3
- assets/js/base/components/cart-checkout/shipping-location/index.js +1 -1
- assets/js/base/components/cart-checkout/shipping-rates-control/package-options.js +1 -1
- assets/js/base/components/cart-checkout/shipping-rates-control/package.js +6 -5
- assets/js/base/components/cart-checkout/shipping-rates-control/packages.js +1 -1
- assets/js/base/components/cart-checkout/shipping-rates-control/style.scss +9 -38
- assets/js/base/components/cart-checkout/totals/totals-coupon-code-input/index.js +7 -6
- assets/js/base/components/cart-checkout/totals/totals-coupon-code-input/style.scss +5 -5
- assets/js/base/components/cart-checkout/totals/totals-discount-item/index.js +4 -2
- assets/js/base/components/cart-checkout/totals/totals-discount-item/style.scss +5 -0
- assets/js/base/components/cart-checkout/totals/totals-fees-item/index.js +1 -0
- assets/js/base/components/cart-checkout/totals/totals-footer-item/index.js +3 -3
- assets/js/base/components/cart-checkout/totals/totals-footer-item/style.scss +5 -6
- assets/js/base/components/cart-checkout/totals/totals-item/index.js +10 -5
- assets/js/base/components/cart-checkout/totals/totals-item/style.scss +4 -4
- assets/js/base/components/cart-checkout/totals/totals-shipping-item/index.js +5 -4
- assets/js/base/components/cart-checkout/totals/totals-shipping-item/shipping-rate-selector.js +26 -18
- assets/js/base/components/cart-checkout/totals/totals-shipping-item/style.scss +21 -12
- assets/js/base/components/cart-checkout/totals/totals-taxes-item/index.js +3 -0
- assets/js/base/components/cart-checkout/totals/totals-taxes-item/style.scss +3 -0
- assets/js/base/components/checkbox-control/index.js +8 -3
- assets/js/base/components/checkbox-control/style.scss +3 -3
- assets/js/base/components/checkbox-list/index.js +1 -0
- assets/js/base/components/checkbox-list/style.scss +2 -2
- assets/js/base/components/country-input/country-input.js +6 -1
- assets/js/base/components/dropdown-selector/index.js +9 -4
- assets/js/base/components/dropdown-selector/input-wrapper.js +1 -1
- assets/js/base/components/dropdown-selector/input.js +2 -1
- assets/js/base/components/dropdown-selector/menu.js +3 -1
- assets/js/base/components/dropdown-selector/selected-chip.js +3 -3
- assets/js/base/components/dropdown-selector/selected-value.js +3 -3
- assets/js/base/components/dropdown-selector/style.scss +18 -18
- assets/js/base/components/filter-submit-button/index.js +1 -0
- assets/js/base/components/filter-submit-button/style.scss +1 -1
- assets/js/base/components/formatted-monetary-amount/index.js +5 -1
- assets/js/base/components/formatted-monetary-amount/style.scss +1 -1
- assets/js/base/components/load-more-button/index.js +1 -1
- assets/js/base/components/load-more-button/style.scss +1 -1
- assets/js/base/components/loading-mask/index.js +7 -2
- assets/js/base/components/loading-mask/style.scss +2 -2
- assets/js/base/components/pagination/index.js +35 -16
- assets/js/base/components/pagination/style.scss +6 -6
- assets/js/base/components/panel/index.js +5 -1
- assets/js/base/components/panel/style.scss +10 -0
- assets/js/base/components/payment-methods/express-checkout.js +11 -6
- assets/js/base/components/payment-methods/payment-methods.js +1 -1
- assets/js/base/components/payment-methods/style.scss +63 -18
- assets/js/base/components/price-slider/index.js +13 -9
- assets/js/base/components/price-slider/style.scss +27 -27
- assets/js/base/components/product-sort-select/index.js +1 -1
- assets/js/base/components/product-sort-select/style.scss +1 -1
- assets/js/base/components/quantity-selector/index.js +7 -4
- assets/js/base/components/quantity-selector/style.scss +5 -5
- assets/js/base/components/radio-control/_mixin.scss +20 -21
- assets/js/base/components/radio-control/index.js +4 -1
- assets/js/base/components/radio-control/option-layout.js +7 -7
- assets/js/base/components/radio-control/option.js +2 -2
- assets/js/base/components/reviews/review-list-item/index.js +21 -21
- assets/js/base/components/reviews/review-list-item/style.scss +43 -34
- assets/js/base/components/reviews/review-list/index.js +1 -1
- assets/js/base/components/reviews/review-list/style.scss +2 -2
- assets/js/base/components/reviews/review-sort-select/index.js +1 -1
- assets/js/base/components/reviews/review-sort-select/style.scss +1 -1
- assets/js/base/components/select/index.js +1 -1
- assets/js/base/components/select/style.scss +1 -1
- assets/js/base/components/sidebar-layout/main.js +1 -1
- assets/js/base/components/sidebar-layout/sidebar-layout.js +4 -1
- assets/js/base/components/sidebar-layout/sidebar.js +3 -1
- assets/js/base/components/sidebar-layout/style.scss +9 -16
- assets/js/base/components/sort-select/index.js +11 -4
- assets/js/base/components/sort-select/style.scss +3 -3
- assets/js/base/components/store-notices-container/snackbar-notices.js +1 -1
- assets/js/base/components/store-notices-container/style.scss +1 -1
- assets/js/base/components/tabs/style.scss +6 -7
- assets/js/base/components/text-input/index.js +8 -4
- assets/js/base/components/text-input/style.scss +1 -1
- assets/js/base/components/title/index.js +1 -1
- assets/js/base/components/title/style.scss +2 -2
- assets/js/base/components/validation/style.scss +2 -2
- assets/js/base/components/validation/validation-input-error.js +1 -1
- assets/js/base/context/add-to-cart-form-context.js +155 -0
- assets/js/base/context/index.js +1 -0
- assets/js/base/hooks/cart/test/use-store-cart.js +1 -0
- assets/js/base/hooks/cart/use-store-cart-coupons.js +1 -1
- assets/js/base/hooks/cart/use-store-cart-item-quantity.js +1 -1
- assets/js/base/hooks/cart/use-store-cart.js +3 -3
- assets/js/base/hooks/index.js +1 -0
- assets/js/base/hooks/shipping/use-select-shipping-rate.js +1 -1
- assets/js/base/hooks/use-store-add-to-cart.js +5 -3
- assets/js/base/hooks/use-trigger-fragment-refresh.js +22 -0
- assets/js/base/utils/get-valid-block-attributes.js +3 -1
- assets/js/blocks-registry/block-components/get-registered-block-components.js +52 -0
- assets/js/blocks-registry/block-components/index.js +2 -0
- assets/js/blocks-registry/block-components/register-block-component.js +82 -0
- assets/js/blocks-registry/block-components/registered-block-components-init.js +3 -0
- assets/js/blocks-registry/block-components/test/index.js +82 -0
- assets/js/blocks-registry/get-registered-inner-blocks.js +0 -19
- assets/js/blocks-registry/index.js +1 -2
- assets/js/blocks-registry/register-inner-block.js +0 -43
- assets/js/blocks-registry/registered-blocks-init.js +0 -3
- assets/js/blocks-registry/test/index.js +0 -43
- assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.js +4 -1
- assets/js/blocks/cart-checkout/cart/full-cart/product-image.js +0 -21
- assets/js/blocks/cart-checkout/cart/full-cart/product-low-stock-badge.js +0 -25
- assets/js/blocks/cart-checkout/cart/full-cart/product-variation-data.js +0 -29
- assets/js/blocks/cart-checkout/cart/full-cart/style.scss +33 -44
- assets/js/blocks/cart-checkout/cart/test/block.js +58 -0
- assets/js/blocks/cart-checkout/checkout/block.js +18 -12
- assets/js/blocks/cart-checkout/checkout/editor.scss +1 -1
- assets/js/blocks/cart-checkout/checkout/style.scss +24 -28
- assets/js/blocks/product-categories/index.js +7 -0
- assets/js/blocks/single-product/constants.js +7 -1
- assets/js/components/block-title/editor.scss +1 -1
- assets/js/components/block-title/index.js +1 -1
- assets/js/components/edit-product-link/index.js +12 -1
- assets/js/data/cart/reducers.js +2 -48
- assets/js/data/default-states.js +45 -0
- assets/js/hocs/test/with-product-variations.js +5 -2
- assets/js/hocs/with-attributes.js +1 -1
- assets/js/hocs/with-product-variations.js +2 -1
- assets/js/icons/index.js +1 -0
- assets/js/icons/library/barcode.js +1 -4
- assets/js/icons/library/box.js +18 -0
- assets/js/previews/cart.js +1 -1
- assets/js/type-defs/contexts.js +29 -4
- build/active-filters-frontend.asset.php +1 -1
- build/active-filters-frontend.js +2 -2
- build/active-filters.asset.php +1 -1
- build/active-filters.js +1 -1
- build/all-products-frontend.asset.php +1 -1
- build/all-products-frontend.js +2 -2
- build/all-products.asset.php +1 -1
- build/all-products.js +1 -1
- build/all-reviews-legacy.asset.php +1 -1
- build/all-reviews-legacy.js +1 -1
- build/all-reviews.asset.php +1 -1
- build/all-reviews.js +1 -1
- build/attribute-filter-frontend.asset.php +1 -1
- build/attribute-filter-frontend.js +3 -3
assets/css/abstracts/_mixins.scss
CHANGED
@@ -122,6 +122,27 @@ $fontSizes: (
|
|
122 |
-ms-word-break: break-all;
|
123 |
}
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
// Converts a px unit to em.
|
126 |
@function em($size, $base: 16px) {
|
127 |
@return $size / $base * 1em;
|
122 |
-ms-word-break: break-all;
|
123 |
}
|
124 |
|
125 |
+
// Shows a border with the current color and a custom opacity. That can't be achieved
|
126 |
+
// with normal border because `currentColor` doesn't allow tweaking the opacity, and
|
127 |
+
// setting the opacity of the entire element would change the children's opacity too.
|
128 |
+
@mixin with-translucent-border($border-width: 1px, $opacity: 0.3) {
|
129 |
+
position: relative;
|
130 |
+
|
131 |
+
&::after {
|
132 |
+
border-style: solid;
|
133 |
+
border-width: $border-width;
|
134 |
+
bottom: 0;
|
135 |
+
content: "";
|
136 |
+
display: block;
|
137 |
+
left: 0;
|
138 |
+
opacity: $opacity;
|
139 |
+
pointer-events: none;
|
140 |
+
position: absolute;
|
141 |
+
right: 0;
|
142 |
+
top: 0;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
// Converts a px unit to em.
|
147 |
@function em($size, $base: 16px) {
|
148 |
@return $size / $base * 1em;
|
assets/js/atomic/blocks/component-init.js
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { registerBlockComponent } from '@woocommerce/blocks-registry';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import ProductButton from './product/button/block';
|
10 |
+
import ProductImage from './product/image/frontend';
|
11 |
+
import ProductPrice from './product/price/block';
|
12 |
+
import ProductRating from './product/rating/block';
|
13 |
+
import ProductSaleBadge from './product/sale-badge/block';
|
14 |
+
import ProductSummary from './product/summary/block';
|
15 |
+
import ProductTitle from './product/title/frontend';
|
16 |
+
import ProductSku from './product/sku/block';
|
17 |
+
import ProductCategoryList from './product/category-list/block';
|
18 |
+
import ProductTagList from './product/tag-list/block';
|
19 |
+
import ProductStockIndicator from './product/stock-indicator/block';
|
20 |
+
import ProductAddToCart from './product/add-to-cart/frontend';
|
21 |
+
|
22 |
+
registerBlockComponent( {
|
23 |
+
blockName: 'woocommerce/product-price',
|
24 |
+
component: ProductPrice,
|
25 |
+
} );
|
26 |
+
|
27 |
+
registerBlockComponent( {
|
28 |
+
blockName: 'woocommerce/product-image',
|
29 |
+
component: ProductImage,
|
30 |
+
} );
|
31 |
+
|
32 |
+
registerBlockComponent( {
|
33 |
+
blockName: 'woocommerce/product-title',
|
34 |
+
component: ProductTitle,
|
35 |
+
} );
|
36 |
+
|
37 |
+
registerBlockComponent( {
|
38 |
+
blockName: 'woocommerce/product-rating',
|
39 |
+
component: ProductRating,
|
40 |
+
} );
|
41 |
+
|
42 |
+
registerBlockComponent( {
|
43 |
+
blockName: 'woocommerce/product-button',
|
44 |
+
component: ProductButton,
|
45 |
+
} );
|
46 |
+
|
47 |
+
registerBlockComponent( {
|
48 |
+
blockName: 'woocommerce/product-summary',
|
49 |
+
component: ProductSummary,
|
50 |
+
} );
|
51 |
+
|
52 |
+
registerBlockComponent( {
|
53 |
+
blockName: 'woocommerce/product-sale-badge',
|
54 |
+
component: ProductSaleBadge,
|
55 |
+
} );
|
56 |
+
|
57 |
+
registerBlockComponent( {
|
58 |
+
blockName: 'woocommerce/product-sku',
|
59 |
+
component: ProductSku,
|
60 |
+
} );
|
61 |
+
|
62 |
+
registerBlockComponent( {
|
63 |
+
blockName: 'woocommerce/product-category-list',
|
64 |
+
component: ProductCategoryList,
|
65 |
+
} );
|
66 |
+
|
67 |
+
registerBlockComponent( {
|
68 |
+
blockName: 'woocommerce/product-tag-list',
|
69 |
+
component: ProductTagList,
|
70 |
+
} );
|
71 |
+
|
72 |
+
registerBlockComponent( {
|
73 |
+
blockName: 'woocommerce/product-stock-indicator',
|
74 |
+
component: ProductStockIndicator,
|
75 |
+
} );
|
76 |
+
|
77 |
+
registerBlockComponent( {
|
78 |
+
blockName: 'woocommerce/product-add-to-cart',
|
79 |
+
component: ProductAddToCart,
|
80 |
+
} );
|
assets/js/atomic/blocks/index.js
CHANGED
@@ -9,3 +9,7 @@ import './product/button';
|
|
9 |
import './product/summary';
|
10 |
import './product/sale-badge';
|
11 |
import './product/sku';
|
|
|
|
|
|
|
|
9 |
import './product/summary';
|
10 |
import './product/sale-badge';
|
11 |
import './product/sku';
|
12 |
+
import './product/category-list';
|
13 |
+
import './product/tag-list';
|
14 |
+
import './product/stock-indicator';
|
15 |
+
import './product/add-to-cart';
|
assets/js/atomic/blocks/product/add-to-cart/attributes.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export const blockAttributes = {
|
2 |
+
showFormElements: {
|
3 |
+
type: 'boolean',
|
4 |
+
default: false,
|
5 |
+
},
|
6 |
+
};
|
7 |
+
|
8 |
+
export default blockAttributes;
|
assets/js/atomic/blocks/product/add-to-cart/block.js
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import PropTypes from 'prop-types';
|
5 |
+
import classnames from 'classnames';
|
6 |
+
import { AddToCartFormContextProvider } from '@woocommerce/base-context';
|
7 |
+
import { useProductDataContext } from '@woocommerce/shared-context';
|
8 |
+
import { isEmpty } from 'lodash';
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Internal dependencies
|
12 |
+
*/
|
13 |
+
import './style.scss';
|
14 |
+
import { AddToCartButton } from './shared';
|
15 |
+
import {
|
16 |
+
SimpleProductForm,
|
17 |
+
VariableProductForm,
|
18 |
+
ExternalProductForm,
|
19 |
+
GroupedProductForm,
|
20 |
+
} from './product-types';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Product Add to Form Block Component.
|
24 |
+
*
|
25 |
+
* @param {Object} props Incoming props.
|
26 |
+
* @param {string} [props.className] CSS Class name for the component.
|
27 |
+
* @param {boolean} [props.showFormElements] Should form elements be shown?
|
28 |
+
* @param {Object} [props.product] Optional product object. Product from context will be
|
29 |
+
* used if this is not provided.
|
30 |
+
* @return {*} The component.
|
31 |
+
*/
|
32 |
+
const Block = ( { className, showFormElements, ...props } ) => {
|
33 |
+
const productDataContext = useProductDataContext();
|
34 |
+
const product = props.product || productDataContext.product || {};
|
35 |
+
const componentClass = classnames(
|
36 |
+
className,
|
37 |
+
'wc-block-components-product-add-to-cart',
|
38 |
+
{
|
39 |
+
'wc-block-components-product-add-to-cart--placeholder': isEmpty(
|
40 |
+
product
|
41 |
+
),
|
42 |
+
}
|
43 |
+
);
|
44 |
+
|
45 |
+
return (
|
46 |
+
<AddToCartFormContextProvider
|
47 |
+
product={ product }
|
48 |
+
showFormElements={ showFormElements }
|
49 |
+
>
|
50 |
+
<div className={ componentClass }>
|
51 |
+
<>
|
52 |
+
{ showFormElements ? (
|
53 |
+
<AddToCartForm
|
54 |
+
productType={ product.type || 'simple' }
|
55 |
+
/>
|
56 |
+
) : (
|
57 |
+
<AddToCartButton />
|
58 |
+
) }
|
59 |
+
</>
|
60 |
+
</div>
|
61 |
+
</AddToCartFormContextProvider>
|
62 |
+
);
|
63 |
+
};
|
64 |
+
|
65 |
+
const AddToCartForm = ( { productType } ) => {
|
66 |
+
if ( productType === 'variable' ) {
|
67 |
+
return <VariableProductForm />;
|
68 |
+
}
|
69 |
+
if ( productType === 'grouped' ) {
|
70 |
+
return <GroupedProductForm />;
|
71 |
+
}
|
72 |
+
if ( productType === 'external' ) {
|
73 |
+
return <ExternalProductForm />;
|
74 |
+
}
|
75 |
+
if ( productType === 'simple' || productType === 'variation' ) {
|
76 |
+
return <SimpleProductForm />;
|
77 |
+
}
|
78 |
+
return null;
|
79 |
+
};
|
80 |
+
|
81 |
+
Block.propTypes = {
|
82 |
+
className: PropTypes.string,
|
83 |
+
product: PropTypes.object,
|
84 |
+
};
|
85 |
+
|
86 |
+
export default Block;
|
assets/js/atomic/blocks/product/add-to-cart/edit.js
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import EditProductLink from '@woocommerce/block-components/edit-product-link';
|
6 |
+
import { useProductDataContext } from '@woocommerce/shared-context';
|
7 |
+
import classnames from 'classnames';
|
8 |
+
import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
|
9 |
+
import { InspectorControls } from '@wordpress/block-editor';
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Internal dependencies
|
13 |
+
*/
|
14 |
+
import './style.scss';
|
15 |
+
import Block from './block';
|
16 |
+
|
17 |
+
export default ( { attributes, setAttributes } ) => {
|
18 |
+
const productDataContext = useProductDataContext();
|
19 |
+
const product = productDataContext.product || {};
|
20 |
+
const { className, showFormElements } = attributes;
|
21 |
+
|
22 |
+
return (
|
23 |
+
<div
|
24 |
+
className={ classnames(
|
25 |
+
className,
|
26 |
+
'wc-block-components-product-add-to-cart'
|
27 |
+
) }
|
28 |
+
>
|
29 |
+
<EditProductLink productId={ product.id || 0 } />
|
30 |
+
{ product.type !== 'external' && (
|
31 |
+
<InspectorControls>
|
32 |
+
<PanelBody
|
33 |
+
title={ __( 'Layout', 'woo-gutenberg-products-block' ) }
|
34 |
+
>
|
35 |
+
<ToggleControl
|
36 |
+
label={ __(
|
37 |
+
'Display form elements',
|
38 |
+
'woo-gutenberg-products-block'
|
39 |
+
) }
|
40 |
+
help={ __(
|
41 |
+
'Depending on product type, allow customers to select a quantity, variations etc.',
|
42 |
+
'woo-gutenberg-products-block'
|
43 |
+
) }
|
44 |
+
checked={ showFormElements }
|
45 |
+
onChange={ () =>
|
46 |
+
setAttributes( {
|
47 |
+
showFormElements: ! showFormElements,
|
48 |
+
} )
|
49 |
+
}
|
50 |
+
/>
|
51 |
+
</PanelBody>
|
52 |
+
</InspectorControls>
|
53 |
+
) }
|
54 |
+
<Disabled>
|
55 |
+
<Block { ...attributes } />
|
56 |
+
</Disabled>
|
57 |
+
</div>
|
58 |
+
);
|
59 |
+
};
|
assets/js/atomic/blocks/product/add-to-cart/frontend.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { compose } from '@wordpress/compose';
|
5 |
+
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Internal dependencies
|
9 |
+
*/
|
10 |
+
import Block from './block';
|
11 |
+
import attributes from './attributes';
|
12 |
+
|
13 |
+
export default compose( withFilteredAttributes( attributes ) )( Block );
|
assets/js/atomic/blocks/product/add-to-cart/index.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { registerExperimentalBlockType } from '@woocommerce/block-settings';
|
6 |
+
import { Icon, cart } from '@woocommerce/icons';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Internal dependencies
|
10 |
+
*/
|
11 |
+
import sharedConfig from '../shared-config';
|
12 |
+
import edit from './edit';
|
13 |
+
import attributes from './attributes';
|
14 |
+
|
15 |
+
const blockConfig = {
|
16 |
+
title: __( 'Add to Cart', 'woo-gutenberg-products-block' ),
|
17 |
+
description: __(
|
18 |
+
'Displays an add to cart button. Optionally displays other add to cart form elements.',
|
19 |
+
'woo-gutenberg-products-block'
|
20 |
+
),
|
21 |
+
icon: {
|
22 |
+
src: <Icon srcElement={ cart } />,
|
23 |
+
foreground: '#96588a',
|
24 |
+
},
|
25 |
+
edit,
|
26 |
+
attributes,
|
27 |
+
};
|
28 |
+
|
29 |
+
registerExperimentalBlockType( 'woocommerce/product-add-to-cart', {
|
30 |
+
...sharedConfig,
|
31 |
+
...blockConfig,
|
32 |
+
} );
|
assets/js/atomic/blocks/product/add-to-cart/product-types/external.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Internal dependencies
|
3 |
+
*/
|
4 |
+
import AddToCartButton from '../shared/add-to-cart-button';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* External Product Add To Cart Form
|
8 |
+
*/
|
9 |
+
const External = () => {
|
10 |
+
return <AddToCartButton />;
|
11 |
+
};
|
12 |
+
|
13 |
+
export default External;
|
assets/js/atomic/blocks/product/add-to-cart/product-types/grouped/group-list/index.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { Placeholder } from '@wordpress/components';
|
5 |
+
|
6 |
+
const GroupedProducts = () => {
|
7 |
+
return (
|
8 |
+
<Placeholder className="wc-block-components-product-add-to-cart-group-list">
|
9 |
+
This is a placeholder for the grouped products form element.
|
10 |
+
</Placeholder>
|
11 |
+
);
|
12 |
+
};
|
13 |
+
|
14 |
+
export default GroupedProducts;
|
assets/js/atomic/blocks/product/add-to-cart/product-types/grouped/index.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Internal dependencies
|
3 |
+
*/
|
4 |
+
import GroupList from './group-list';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Grouped Product Add To Cart Form
|
8 |
+
*/
|
9 |
+
const Grouped = () => {
|
10 |
+
return <GroupList />;
|
11 |
+
};
|
12 |
+
|
13 |
+
export default Grouped;
|
assets/js/atomic/blocks/product/add-to-cart/product-types/index.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
export { default as SimpleProductForm } from './simple';
|
2 |
+
export { default as VariableProductForm } from './variable/index';
|
3 |
+
export { default as ExternalProductForm } from './external';
|
4 |
+
export { default as GroupedProductForm } from './grouped/index';
|
assets/js/atomic/blocks/product/add-to-cart/product-types/simple.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { useAddToCartFormContext } from '@woocommerce/base-context';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Internal dependencies
|
9 |
+
*/
|
10 |
+
import { AddToCartButton, QuantityInput, ProductUnavailable } from '../shared';
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Simple Product Add To Cart Form
|
14 |
+
*/
|
15 |
+
const Simple = () => {
|
16 |
+
const {
|
17 |
+
product,
|
18 |
+
quantity,
|
19 |
+
minQuantity,
|
20 |
+
maxQuantity,
|
21 |
+
setQuantity,
|
22 |
+
formDisabled,
|
23 |
+
} = useAddToCartFormContext();
|
24 |
+
|
25 |
+
if ( product.id && ! product.is_purchasable ) {
|
26 |
+
return <ProductUnavailable />;
|
27 |
+
}
|
28 |
+
|
29 |
+
if ( product.id && ! product.is_in_stock ) {
|
30 |
+
return (
|
31 |
+
<ProductUnavailable
|
32 |
+
reason={ __(
|
33 |
+
'This product is currently out of stock and cannot be purchased.',
|
34 |
+
'woo-gutenberg-products-block'
|
35 |
+
) }
|
36 |
+
/>
|
37 |
+
);
|
38 |
+
}
|
39 |
+
|
40 |
+
return (
|
41 |
+
<>
|
42 |
+
<QuantityInput
|
43 |
+
value={ quantity }
|
44 |
+
min={ minQuantity }
|
45 |
+
max={ maxQuantity }
|
46 |
+
disabled={ formDisabled }
|
47 |
+
onChange={ setQuantity }
|
48 |
+
/>
|
49 |
+
<AddToCartButton />
|
50 |
+
</>
|
51 |
+
);
|
52 |
+
};
|
53 |
+
|
54 |
+
export default Simple;
|
assets/js/atomic/blocks/product/add-to-cart/product-types/variable/index.js
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { useAddToCartFormContext } from '@woocommerce/base-context';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Internal dependencies
|
9 |
+
*/
|
10 |
+
import {
|
11 |
+
AddToCartButton,
|
12 |
+
QuantityInput,
|
13 |
+
ProductUnavailable,
|
14 |
+
} from '../../shared';
|
15 |
+
import VariationAttributes from './variation-attributes';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Variable Product Add To Cart Form
|
19 |
+
*/
|
20 |
+
const Variable = () => {
|
21 |
+
const {
|
22 |
+
product,
|
23 |
+
quantity,
|
24 |
+
minQuantity,
|
25 |
+
maxQuantity,
|
26 |
+
setQuantity,
|
27 |
+
formDisabled,
|
28 |
+
} = useAddToCartFormContext();
|
29 |
+
|
30 |
+
if ( product.id && ! product.is_purchasable ) {
|
31 |
+
return <ProductUnavailable />;
|
32 |
+
}
|
33 |
+
|
34 |
+
if ( product.id && ! product.is_in_stock ) {
|
35 |
+
return (
|
36 |
+
<ProductUnavailable
|
37 |
+
reason={ __(
|
38 |
+
'This product is currently out of stock and cannot be purchased.',
|
39 |
+
'woo-gutenberg-products-block'
|
40 |
+
) }
|
41 |
+
/>
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
+
return (
|
46 |
+
<>
|
47 |
+
<VariationAttributes product={ product } />
|
48 |
+
<QuantityInput
|
49 |
+
value={ quantity }
|
50 |
+
min={ minQuantity }
|
51 |
+
max={ maxQuantity }
|
52 |
+
disabled={ formDisabled }
|
53 |
+
onChange={ setQuantity }
|
54 |
+
/>
|
55 |
+
<AddToCartButton />
|
56 |
+
</>
|
57 |
+
);
|
58 |
+
};
|
59 |
+
|
60 |
+
export default Variable;
|
assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/attribute-picker.js
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { useState, useEffect, useMemo } from '@wordpress/element';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import AttributeSelectControl from './attribute-select-control';
|
10 |
+
import {
|
11 |
+
getVariationsMatchingSelectedAttributes,
|
12 |
+
getSelectControlOptions,
|
13 |
+
} from './utils';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* AttributePicker component.
|
17 |
+
*
|
18 |
+
* @param {*} props Component props.
|
19 |
+
*/
|
20 |
+
const AttributePicker = ( { attributes, variationAttributes } ) => {
|
21 |
+
const [ variationId, setVariationId ] = useState( 0 );
|
22 |
+
|
23 |
+
// @todo Support default selected attributes in Variation Picker.
|
24 |
+
const [ selectedAttributes, setSelectedAttributes ] = useState( [] );
|
25 |
+
|
26 |
+
const attributeNames = Object.keys( attributes );
|
27 |
+
const hasSelectedAttributes =
|
28 |
+
Object.values( selectedAttributes ).filter( Boolean ).length > 0;
|
29 |
+
const hasSelectedAllAttributes =
|
30 |
+
Object.values( selectedAttributes ).filter(
|
31 |
+
( selected ) => selected !== ''
|
32 |
+
).length === attributeNames.length;
|
33 |
+
|
34 |
+
// Gets valid attribute options for the picker taking current selections into account.
|
35 |
+
const filteredAttributeOptions = useMemo( () => {
|
36 |
+
const options = [];
|
37 |
+
|
38 |
+
attributeNames.forEach( ( attributeName ) => {
|
39 |
+
const currentAttribute = attributes[ attributeName ];
|
40 |
+
const attributeNamesExcludingCurrentAttribute = attributeNames.filter(
|
41 |
+
( name ) => name !== attributeName
|
42 |
+
);
|
43 |
+
const matchingVariationIds = hasSelectedAttributes
|
44 |
+
? getVariationsMatchingSelectedAttributes( {
|
45 |
+
selectedAttributes,
|
46 |
+
variationAttributes,
|
47 |
+
attributeNames: attributeNamesExcludingCurrentAttribute,
|
48 |
+
} )
|
49 |
+
: null;
|
50 |
+
const validAttributeTerms =
|
51 |
+
matchingVariationIds !== null
|
52 |
+
? matchingVariationIds.map(
|
53 |
+
( varId ) =>
|
54 |
+
variationAttributes[ varId ][ attributeName ]
|
55 |
+
)
|
56 |
+
: null;
|
57 |
+
options[ attributeName ] = getSelectControlOptions(
|
58 |
+
currentAttribute.terms,
|
59 |
+
validAttributeTerms
|
60 |
+
);
|
61 |
+
} );
|
62 |
+
|
63 |
+
return options;
|
64 |
+
}, [
|
65 |
+
attributes,
|
66 |
+
variationAttributes,
|
67 |
+
attributeNames,
|
68 |
+
selectedAttributes,
|
69 |
+
hasSelectedAttributes,
|
70 |
+
] );
|
71 |
+
|
72 |
+
// Select variation when selections change.
|
73 |
+
useEffect( () => {
|
74 |
+
if ( ! hasSelectedAllAttributes ) {
|
75 |
+
setVariationId( 0 );
|
76 |
+
return;
|
77 |
+
}
|
78 |
+
|
79 |
+
const matchingVariationIds = getVariationsMatchingSelectedAttributes( {
|
80 |
+
selectedAttributes,
|
81 |
+
variationAttributes,
|
82 |
+
attributeNames,
|
83 |
+
} );
|
84 |
+
|
85 |
+
setVariationId( matchingVariationIds[ 0 ] || 0 );
|
86 |
+
}, [
|
87 |
+
selectedAttributes,
|
88 |
+
variationAttributes,
|
89 |
+
attributeNames,
|
90 |
+
hasSelectedAllAttributes,
|
91 |
+
] );
|
92 |
+
|
93 |
+
// @todo Hook up Variation Picker with Cart Form.
|
94 |
+
return (
|
95 |
+
<div className="wc-block-components-product-add-to-cart-attribute-picker">
|
96 |
+
{ attributeNames.map( ( attributeName ) => (
|
97 |
+
<AttributeSelectControl
|
98 |
+
key={ attributeName }
|
99 |
+
attributeName={ attributeName }
|
100 |
+
options={ filteredAttributeOptions[ attributeName ] }
|
101 |
+
selected={ selectedAttributes[ attributeName ] }
|
102 |
+
onChange={ ( selected ) => {
|
103 |
+
setSelectedAttributes( {
|
104 |
+
...selectedAttributes,
|
105 |
+
[ attributeName ]: selected,
|
106 |
+
} );
|
107 |
+
} }
|
108 |
+
/>
|
109 |
+
) ) }
|
110 |
+
<p>Matched variation ID: { variationId }</p>
|
111 |
+
</div>
|
112 |
+
);
|
113 |
+
};
|
114 |
+
|
115 |
+
export default AttributePicker;
|
assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/attribute-select-control.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { decodeEntities } from '@wordpress/html-entities';
|
6 |
+
import { SelectControl } from '@wordpress/components';
|
7 |
+
|
8 |
+
// Default option for select boxes.
|
9 |
+
const selectAnOption = {
|
10 |
+
value: '',
|
11 |
+
label: __( 'Select an option', 'woo-gutenberg-products-block' ),
|
12 |
+
};
|
13 |
+
|
14 |
+
/**
|
15 |
+
* VariationAttributeSelect component.
|
16 |
+
*
|
17 |
+
* @param {*} props Component props.
|
18 |
+
*/
|
19 |
+
const AttributeSelectControl = ( {
|
20 |
+
attributeName,
|
21 |
+
options = [],
|
22 |
+
selected = '',
|
23 |
+
onChange = () => {},
|
24 |
+
} ) => {
|
25 |
+
return (
|
26 |
+
<SelectControl
|
27 |
+
className="wc-block-components-product-add-to-cart-attribute-picker__select"
|
28 |
+
label={ decodeEntities( attributeName ) }
|
29 |
+
value={ selected || '' }
|
30 |
+
options={ [ selectAnOption, ...options ] }
|
31 |
+
onChange={ onChange }
|
32 |
+
/>
|
33 |
+
);
|
34 |
+
};
|
35 |
+
|
36 |
+
export default AttributeSelectControl;
|
assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/index.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Internal dependencies
|
3 |
+
*/
|
4 |
+
import './style.scss';
|
5 |
+
import AttributePicker from './attribute-picker';
|
6 |
+
import { getAttributes, getVariationAttributes } from './utils';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* VariationAttributes component.
|
10 |
+
*
|
11 |
+
* @param {*} props Component props.
|
12 |
+
*/
|
13 |
+
const VariationAttributes = ( { product } ) => {
|
14 |
+
const {
|
15 |
+
attributes: productAttributes = {},
|
16 |
+
variations: productVariations = [],
|
17 |
+
} = product;
|
18 |
+
|
19 |
+
const attributes = getAttributes( productAttributes );
|
20 |
+
const variationAttributes = getVariationAttributes( productVariations );
|
21 |
+
|
22 |
+
if (
|
23 |
+
Object.keys( attributes ).length === 0 ||
|
24 |
+
variationAttributes.length === 0
|
25 |
+
) {
|
26 |
+
return null;
|
27 |
+
}
|
28 |
+
|
29 |
+
return (
|
30 |
+
<AttributePicker
|
31 |
+
attributes={ attributes }
|
32 |
+
variationAttributes={ variationAttributes }
|
33 |
+
/>
|
34 |
+
);
|
35 |
+
};
|
36 |
+
|
37 |
+
export default VariationAttributes;
|
assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/style.scss
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wc-block-components-product-add-to-cart-attribute-picker {
|
2 |
+
margin: 0;
|
3 |
+
flex-basis: 100%;
|
4 |
+
|
5 |
+
label {
|
6 |
+
display: block;
|
7 |
+
@include font-size(regular);
|
8 |
+
}
|
9 |
+
|
10 |
+
.wc-block-components-product-add-to-cart-attribute-picker__select {
|
11 |
+
margin: 0 0 em($gap-small) 0;
|
12 |
+
|
13 |
+
select {
|
14 |
+
min-width: 60%;
|
15 |
+
min-height: 1.75em;
|
16 |
+
}
|
17 |
+
}
|
18 |
+
}
|
assets/js/atomic/blocks/product/add-to-cart/product-types/variable/variation-attributes/utils.js
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { keyBy } from 'lodash';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Key an array of attributes by name,
|
8 |
+
*
|
9 |
+
* @param {Object} attributes Attributes array.
|
10 |
+
*/
|
11 |
+
export const getAttributes = ( attributes ) => {
|
12 |
+
return attributes
|
13 |
+
? keyBy(
|
14 |
+
Object.values( attributes ).filter(
|
15 |
+
( { has_variations: hasVariations } ) => hasVariations
|
16 |
+
),
|
17 |
+
'name'
|
18 |
+
)
|
19 |
+
: [];
|
20 |
+
};
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Format variations from the API into a map of just the attribute names and values.
|
24 |
+
*
|
25 |
+
* @param {Array} variations Variations array.
|
26 |
+
*/
|
27 |
+
export const getVariationAttributes = ( variations ) => {
|
28 |
+
if ( ! variations ) {
|
29 |
+
return {};
|
30 |
+
}
|
31 |
+
|
32 |
+
const attributesMap = {};
|
33 |
+
|
34 |
+
variations.forEach( ( { id, attributes } ) => {
|
35 |
+
attributesMap[ id ] = attributes.reduce( ( acc, { name, value } ) => {
|
36 |
+
acc[ name ] = value;
|
37 |
+
return acc;
|
38 |
+
}, [] );
|
39 |
+
} );
|
40 |
+
|
41 |
+
return attributesMap;
|
42 |
+
};
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Given a list of terms, filter them and return options for the select boxes.
|
46 |
+
*
|
47 |
+
* @param {Object} attributeTerms List of attribute term objects.
|
48 |
+
* @param {?Array} validAttributeTerms Valid values if selections have been made already.
|
49 |
+
* @return {Array} Value/Label pairs of select box options.
|
50 |
+
*/
|
51 |
+
export const getSelectControlOptions = (
|
52 |
+
attributeTerms,
|
53 |
+
validAttributeTerms = null
|
54 |
+
) => {
|
55 |
+
return Object.values( attributeTerms )
|
56 |
+
.map( ( { name, slug } ) => {
|
57 |
+
if (
|
58 |
+
validAttributeTerms === null ||
|
59 |
+
validAttributeTerms.includes( null ) ||
|
60 |
+
validAttributeTerms.includes( slug )
|
61 |
+
) {
|
62 |
+
return {
|
63 |
+
value: slug,
|
64 |
+
label: name,
|
65 |
+
};
|
66 |
+
}
|
67 |
+
return null;
|
68 |
+
} )
|
69 |
+
.filter( Boolean );
|
70 |
+
};
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Given a list of variations and a list of attribute values, return variations which match.
|
74 |
+
*
|
75 |
+
* Allows an attribute to be excluded by name. This is used to filter displayed options for
|
76 |
+
* individual attribute selects.
|
77 |
+
*
|
78 |
+
* @param {Object} props
|
79 |
+
* @param {Object} props.selectedAttributes List of selected attributes.
|
80 |
+
* @param {Object} props.variationAttributes List of variations and their attributes.
|
81 |
+
* @param {Object} props.attributeNames List of all possible attribute names.
|
82 |
+
* @return {Array} List of matching variation IDs.
|
83 |
+
*/
|
84 |
+
export const getVariationsMatchingSelectedAttributes = ( {
|
85 |
+
selectedAttributes,
|
86 |
+
variationAttributes,
|
87 |
+
attributeNames,
|
88 |
+
} ) => {
|
89 |
+
return Object.keys( variationAttributes ).filter( ( variationId ) =>
|
90 |
+
attributeNames.every( ( attributeName ) => {
|
91 |
+
const selectedAttribute = selectedAttributes[ attributeName ] || '';
|
92 |
+
const variationAttribute =
|
93 |
+
variationAttributes[ variationId ][ attributeName ];
|
94 |
+
|
95 |
+
// If there is no selected attribute, consider this a match.
|
96 |
+
if ( selectedAttribute === '' ) {
|
97 |
+
return true;
|
98 |
+
}
|
99 |
+
// If the variation attributes for this attribute are set to null, it matches all values.
|
100 |
+
if ( variationAttribute === null ) {
|
101 |
+
return true;
|
102 |
+
}
|
103 |
+
// Otherwise, only match if the selected values are the same.
|
104 |
+
return variationAttribute === selectedAttribute;
|
105 |
+
} )
|
106 |
+
);
|
107 |
+
};
|
assets/js/atomic/blocks/product/add-to-cart/shared/add-to-cart-button.js
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
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 } from '@wordpress/element';
|
8 |
+
import { useAddToCartFormContext } from '@woocommerce/base-context';
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Add to Cart Form Button Component.
|
12 |
+
*/
|
13 |
+
const AddToCartButton = () => {
|
14 |
+
const {
|
15 |
+
showFormElements,
|
16 |
+
product,
|
17 |
+
quantityInCart,
|
18 |
+
formDisabled,
|
19 |
+
formSubmitting,
|
20 |
+
onSubmit,
|
21 |
+
} = useAddToCartFormContext();
|
22 |
+
|
23 |
+
const {
|
24 |
+
is_purchasable: isPurchasable = true,
|
25 |
+
has_options: hasOptions,
|
26 |
+
add_to_cart: addToCartButtonData = {
|
27 |
+
url: '',
|
28 |
+
text: '',
|
29 |
+
},
|
30 |
+
} = product;
|
31 |
+
|
32 |
+
// If we are showing form elements, OR if the product has no additional form options, we can show
|
33 |
+
// a functional direct add to cart button, provided that the product is purchasable.
|
34 |
+
// No link is required to the full form under these circumstances.
|
35 |
+
if ( ( showFormElements || ! hasOptions ) && isPurchasable ) {
|
36 |
+
return (
|
37 |
+
<ButtonComponent
|
38 |
+
className="wc-block-components-product-add-to-cart-button"
|
39 |
+
quantityInCart={ quantityInCart }
|
40 |
+
disabled={ formDisabled }
|
41 |
+
loading={ formSubmitting }
|
42 |
+
onClick={ onSubmit }
|
43 |
+
/>
|
44 |
+
);
|
45 |
+
}
|
46 |
+
|
47 |
+
return (
|
48 |
+
<LinkComponent
|
49 |
+
className="wc-block-components-product-add-to-cart-button"
|
50 |
+
href={ addToCartButtonData.url }
|
51 |
+
text={
|
52 |
+
addToCartButtonData.text ||
|
53 |
+
__( 'View Product', 'woo-gutenberg-products-block' )
|
54 |
+
}
|
55 |
+
/>
|
56 |
+
);
|
57 |
+
};
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Button for non-purchasable products.
|
61 |
+
*/
|
62 |
+
const LinkComponent = ( { className, href, text } ) => {
|
63 |
+
return (
|
64 |
+
<Button className={ className } href={ href } rel="nofollow">
|
65 |
+
{ text }
|
66 |
+
</Button>
|
67 |
+
);
|
68 |
+
};
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Button for purchasable products.
|
72 |
+
*/
|
73 |
+
const ButtonComponent = ( {
|
74 |
+
className,
|
75 |
+
quantityInCart,
|
76 |
+
loading,
|
77 |
+
disabled,
|
78 |
+
onClick,
|
79 |
+
} ) => {
|
80 |
+
const [ wasClicked, setWasClicked ] = useState( false );
|
81 |
+
|
82 |
+
return (
|
83 |
+
<Button
|
84 |
+
className={ className }
|
85 |
+
disabled={ disabled }
|
86 |
+
showSpinner={ loading }
|
87 |
+
onClick={ () => {
|
88 |
+
onClick();
|
89 |
+
setWasClicked( true );
|
90 |
+
} }
|
91 |
+
>
|
92 |
+
{ quantityInCart > 0
|
93 |
+
? sprintf(
|
94 |
+
// translators: %s number of products in cart.
|
95 |
+
_n(
|
96 |
+
'%d in cart',
|
97 |
+
'%d in cart',
|
98 |
+
quantityInCart,
|
99 |
+
'woo-gutenberg-products-block'
|
100 |
+
),
|
101 |
+
quantityInCart
|
102 |
+
)
|
103 |
+
: __( 'Add to cart', 'woo-gutenberg-products-block' ) }
|
104 |
+
{ wasClicked && (
|
105 |
+
<Icon
|
106 |
+
srcElement={ doneIcon }
|
107 |
+
alt={ __( 'Done', 'woo-gutenberg-products-block' ) }
|
108 |
+
/>
|
109 |
+
) }
|
110 |
+
</Button>
|
111 |
+
);
|
112 |
+
};
|
113 |
+
|
114 |
+
export default AddToCartButton;
|
assets/js/atomic/blocks/product/add-to-cart/shared/index.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
export { default as AddToCartButton } from './add-to-cart-button';
|
2 |
+
export { default as QuantityInput } from './quantity-input';
|
3 |
+
export { default as ProductUnavailable } from './product-unavailable';
|
assets/js/atomic/blocks/product/add-to-cart/shared/product-unavailable.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
|
6 |
+
const ProductUnavailable = ( {
|
7 |
+
reason = __(
|
8 |
+
'Sorry, this product cannot be purchased.',
|
9 |
+
'woo-gutenberg-products-block'
|
10 |
+
),
|
11 |
+
} ) => {
|
12 |
+
return (
|
13 |
+
<div className="wc-block-components-product-add-to-cart-unavailable">
|
14 |
+
{ reason }
|
15 |
+
</div>
|
16 |
+
);
|
17 |
+
};
|
18 |
+
|
19 |
+
export default ProductUnavailable;
|
assets/js/atomic/blocks/product/add-to-cart/shared/quantity-input.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Quantity Input Component.
|
3 |
+
*/
|
4 |
+
const QuantityInput = ( { disabled, min, max, value, onChange } ) => {
|
5 |
+
return (
|
6 |
+
<input
|
7 |
+
className="wc-block-components-product-add-to-cart-quantity"
|
8 |
+
type="number"
|
9 |
+
value={ value }
|
10 |
+
min={ min }
|
11 |
+
max={ max }
|
12 |
+
hidden={ max === 1 }
|
13 |
+
disabled={ disabled }
|
14 |
+
onChange={ ( e ) => {
|
15 |
+
onChange( e.target.value );
|
16 |
+
} }
|
17 |
+
/>
|
18 |
+
);
|
19 |
+
};
|
20 |
+
|
21 |
+
export default QuantityInput;
|
assets/js/atomic/blocks/product/add-to-cart/style.scss
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wc-block-layout {
|
2 |
+
.wc-block-components-product-add-to-cart {
|
3 |
+
margin: 0;
|
4 |
+
display: flex;
|
5 |
+
flex-wrap: wrap;
|
6 |
+
|
7 |
+
.wc-block-components-product-add-to-cart-button {
|
8 |
+
margin: 0 0 em($gap-small) 0;
|
9 |
+
|
10 |
+
.wc-block-components-button__text {
|
11 |
+
display: block;
|
12 |
+
|
13 |
+
> svg {
|
14 |
+
fill: currentColor;
|
15 |
+
vertical-align: top;
|
16 |
+
width: 1.5em;
|
17 |
+
height: 1.5em;
|
18 |
+
margin: -0.25em 0 -0.25em 0.5em;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
.wc-block-components-product-add-to-cart-quantity {
|
24 |
+
margin: 0 1em em($gap-small) 0;
|
25 |
+
width: 5em;
|
26 |
+
padding: 0.618em;
|
27 |
+
background: $white;
|
28 |
+
border: 1px solid #ccc;
|
29 |
+
border-radius: 2px;
|
30 |
+
color: #43454b;
|
31 |
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.125);
|
32 |
+
text-align: center;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
.wc-block-components-product-add-to-cart--placeholder {
|
36 |
+
.wc-block-components-product-add-to-cart-quantity,
|
37 |
+
.wc-block-components-product-add-to-cart-button {
|
38 |
+
@include placeholder();
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
.wc-block-grid .wc-block-components-product-add-to-cart {
|
43 |
+
justify-content: center;
|
44 |
+
}
|
45 |
+
}
|
assets/js/atomic/blocks/product/button/block.js
CHANGED
@@ -101,7 +101,9 @@ const AddToCartButton = ( { product } ) => {
|
|
101 |
buttonProps.href = permalink;
|
102 |
buttonProps.rel = 'nofollow';
|
103 |
} else {
|
104 |
-
buttonProps.onClick =
|
|
|
|
|
105 |
}
|
106 |
|
107 |
return (
|
101 |
buttonProps.href = permalink;
|
102 |
buttonProps.rel = 'nofollow';
|
103 |
} else {
|
104 |
+
buttonProps.onClick = () => {
|
105 |
+
addToCart();
|
106 |
+
};
|
107 |
}
|
108 |
|
109 |
return (
|
assets/js/atomic/blocks/product/category-list/block.js
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import PropTypes from 'prop-types';
|
6 |
+
import classnames from 'classnames';
|
7 |
+
import {
|
8 |
+
useInnerBlockLayoutContext,
|
9 |
+
useProductDataContext,
|
10 |
+
} from '@woocommerce/shared-context';
|
11 |
+
import { isEmpty } from 'lodash';
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Internal dependencies
|
15 |
+
*/
|
16 |
+
import './style.scss';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Product Category Block Component.
|
20 |
+
*
|
21 |
+
* @param {Object} props Incoming props.
|
22 |
+
* @param {string} [props.className] CSS Class name for the component.
|
23 |
+
* @param {Object} [props.product] Optional product object. Product from context will be used if
|
24 |
+
* this is not provided.
|
25 |
+
* @return {*} The component.
|
26 |
+
*/
|
27 |
+
const Block = ( { className, ...props } ) => {
|
28 |
+
const { parentClassName } = useInnerBlockLayoutContext();
|
29 |
+
const productDataContext = useProductDataContext();
|
30 |
+
const { product } = productDataContext || props || {};
|
31 |
+
|
32 |
+
if ( isEmpty( product ) || isEmpty( product.categories ) ) {
|
33 |
+
return null;
|
34 |
+
}
|
35 |
+
|
36 |
+
return (
|
37 |
+
<div
|
38 |
+
className={ classnames(
|
39 |
+
className,
|
40 |
+
'wc-block-components-product-category-list',
|
41 |
+
`${ parentClassName }__product-category-list`
|
42 |
+
) }
|
43 |
+
>
|
44 |
+
{ __( 'Categories:', 'woo-gutenberg-products-block' ) }{ ' ' }
|
45 |
+
<ul>
|
46 |
+
{ Object.values( product.categories ).map(
|
47 |
+
( { name, link, slug } ) => {
|
48 |
+
return (
|
49 |
+
<li key={ `category-list-item-${ slug }` }>
|
50 |
+
<a href={ link }>{ name }</a>
|
51 |
+
</li>
|
52 |
+
);
|
53 |
+
}
|
54 |
+
) }
|
55 |
+
</ul>
|
56 |
+
</div>
|
57 |
+
);
|
58 |
+
};
|
59 |
+
|
60 |
+
Block.propTypes = {
|
61 |
+
className: PropTypes.string,
|
62 |
+
product: PropTypes.object,
|
63 |
+
};
|
64 |
+
|
65 |
+
export default Block;
|
assets/js/atomic/blocks/product/category-list/edit.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { Disabled } from '@wordpress/components';
|
5 |
+
import EditProductLink from '@woocommerce/block-components/edit-product-link';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Internal dependencies
|
9 |
+
*/
|
10 |
+
import Block from './block';
|
11 |
+
|
12 |
+
export default ( { attributes } ) => {
|
13 |
+
return (
|
14 |
+
<>
|
15 |
+
<EditProductLink />
|
16 |
+
<Disabled>
|
17 |
+
<Block { ...attributes } />
|
18 |
+
</Disabled>
|
19 |
+
</>
|
20 |
+
);
|
21 |
+
};
|
assets/js/atomic/blocks/product/category-list/index.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { registerExperimentalBlockType } from '@woocommerce/block-settings';
|
6 |
+
import { Icon, folder } from '@woocommerce/icons';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Internal dependencies
|
10 |
+
*/
|
11 |
+
import sharedConfig from '../shared-config';
|
12 |
+
import edit from './edit';
|
13 |
+
|
14 |
+
const blockConfig = {
|
15 |
+
title: __( 'Product Category List', 'woo-gutenberg-products-block' ),
|
16 |
+
description: __(
|
17 |
+
'Display a list of categories belonging to a product.',
|
18 |
+
'woo-gutenberg-products-block'
|
19 |
+
),
|
20 |
+
icon: {
|
21 |
+
src: <Icon srcElement={ folder } />,
|
22 |
+
foreground: '#96588a',
|
23 |
+
},
|
24 |
+
edit,
|
25 |
+
};
|
26 |
+
|
27 |
+
registerExperimentalBlockType( 'woocommerce/product-category-list', {
|
28 |
+
...sharedConfig,
|
29 |
+
...blockConfig,
|
30 |
+
} );
|
assets/js/atomic/blocks/product/category-list/style.scss
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wc-block-layout .wc-block-components-product-category-list {
|
2 |
+
margin-top: 0;
|
3 |
+
margin-bottom: em($gap-small);
|
4 |
+
|
5 |
+
ul {
|
6 |
+
margin: 0;
|
7 |
+
padding: 0;
|
8 |
+
display: inline;
|
9 |
+
|
10 |
+
li {
|
11 |
+
display: inline;
|
12 |
+
list-style: none;
|
13 |
+
}
|
14 |
+
|
15 |
+
li::after {
|
16 |
+
content: ", ";
|
17 |
+
}
|
18 |
+
|
19 |
+
li:last-child::after {
|
20 |
+
content: "";
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
assets/js/atomic/blocks/product/image/attributes.js
CHANGED
@@ -11,6 +11,10 @@ export const blockAttributes = {
|
|
11 |
type: 'string',
|
12 |
default: 'right',
|
13 |
},
|
|
|
|
|
|
|
|
|
14 |
};
|
15 |
|
16 |
export default blockAttributes;
|
11 |
type: 'string',
|
12 |
default: 'right',
|
13 |
},
|
14 |
+
imageSizing: {
|
15 |
+
type: 'string',
|
16 |
+
default: 'full-size',
|
17 |
+
},
|
18 |
};
|
19 |
|
20 |
export default blockAttributes;
|
assets/js/atomic/blocks/product/image/block.js
CHANGED
@@ -30,6 +30,7 @@ import './style.scss';
|
|
30 |
*/
|
31 |
const Block = ( {
|
32 |
className,
|
|
|
33 |
productLink = true,
|
34 |
showSaleBadge,
|
35 |
saleBadgeAlign = 'right',
|
@@ -78,6 +79,7 @@ const Block = ( {
|
|
78 |
image={ image }
|
79 |
onLoad={ () => setImageLoaded( true ) }
|
80 |
loaded={ imageLoaded }
|
|
|
81 |
/>
|
82 |
</a>
|
83 |
) : (
|
@@ -92,6 +94,7 @@ const Block = ( {
|
|
92 |
image={ image }
|
93 |
onLoad={ () => setImageLoaded( true ) }
|
94 |
loaded={ imageLoaded }
|
|
|
95 |
/>
|
96 |
</>
|
97 |
) }
|
@@ -103,19 +106,28 @@ const ImagePlaceholder = () => {
|
|
103 |
return <img src={ PLACEHOLDER_IMG_SRC } alt="" />;
|
104 |
};
|
105 |
|
106 |
-
const Image = ( { image, onLoad, loaded } ) => {
|
107 |
-
const { thumbnail, srcset, sizes, alt } = image || {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
return (
|
110 |
<>
|
111 |
-
|
112 |
-
|
113 |
-
srcSet={ srcset }
|
114 |
-
sizes={ sizes }
|
115 |
-
alt={ alt }
|
116 |
-
onLoad={ onLoad }
|
117 |
-
hidden={ ! loaded }
|
118 |
-
/>
|
119 |
{ ! loaded && <ImagePlaceholder /> }
|
120 |
</>
|
121 |
);
|
30 |
*/
|
31 |
const Block = ( {
|
32 |
className,
|
33 |
+
imageSizing = 'full-size',
|
34 |
productLink = true,
|
35 |
showSaleBadge,
|
36 |
saleBadgeAlign = 'right',
|
79 |
image={ image }
|
80 |
onLoad={ () => setImageLoaded( true ) }
|
81 |
loaded={ imageLoaded }
|
82 |
+
showFullSize={ imageSizing !== 'cropped' }
|
83 |
/>
|
84 |
</a>
|
85 |
) : (
|
94 |
image={ image }
|
95 |
onLoad={ () => setImageLoaded( true ) }
|
96 |
loaded={ imageLoaded }
|
97 |
+
showFullSize={ imageSizing !== 'cropped' }
|
98 |
/>
|
99 |
</>
|
100 |
) }
|
106 |
return <img src={ PLACEHOLDER_IMG_SRC } alt="" />;
|
107 |
};
|
108 |
|
109 |
+
const Image = ( { image, onLoad, loaded, showFullSize } ) => {
|
110 |
+
const { thumbnail, src, srcset, sizes, alt } = image || {};
|
111 |
+
|
112 |
+
let imageProps = {
|
113 |
+
alt,
|
114 |
+
onLoad,
|
115 |
+
hidden: ! loaded,
|
116 |
+
src: thumbnail,
|
117 |
+
};
|
118 |
+
if ( showFullSize ) {
|
119 |
+
imageProps = {
|
120 |
+
...imageProps,
|
121 |
+
src,
|
122 |
+
srcSet: srcset,
|
123 |
+
sizes,
|
124 |
+
};
|
125 |
+
}
|
126 |
|
127 |
return (
|
128 |
<>
|
129 |
+
{ /* eslint-disable-next-line jsx-a11y/alt-text */ }
|
130 |
+
<img { ...imageProps } />
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
{ ! loaded && <ImagePlaceholder /> }
|
132 |
</>
|
133 |
);
|
assets/js/atomic/blocks/product/image/edit.js
CHANGED
@@ -4,7 +4,9 @@
|
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
|
6 |
import { InspectorControls } from '@wordpress/block-editor';
|
|
|
7 |
import ToggleButtonControl from '@woocommerce/block-components/toggle-button-control';
|
|
|
8 |
|
9 |
/**
|
10 |
* Internal dependencies
|
@@ -12,7 +14,12 @@ import ToggleButtonControl from '@woocommerce/block-components/toggle-button-con
|
|
12 |
import Block from './block';
|
13 |
|
14 |
export default ( { attributes, setAttributes } ) => {
|
15 |
-
const {
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
return (
|
18 |
<>
|
@@ -87,6 +94,50 @@ export default ( { attributes, setAttributes } ) => {
|
|
87 |
}
|
88 |
/>
|
89 |
) }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
</PanelBody>
|
91 |
</InspectorControls>
|
92 |
<Disabled>
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
|
6 |
import { InspectorControls } from '@wordpress/block-editor';
|
7 |
+
import { __experimentalCreateInterpolateElement } from 'wordpress-element';
|
8 |
import ToggleButtonControl from '@woocommerce/block-components/toggle-button-control';
|
9 |
+
import { getAdminLink } from '@woocommerce/settings';
|
10 |
|
11 |
/**
|
12 |
* Internal dependencies
|
14 |
import Block from './block';
|
15 |
|
16 |
export default ( { attributes, setAttributes } ) => {
|
17 |
+
const {
|
18 |
+
productLink,
|
19 |
+
imageSizing,
|
20 |
+
showSaleBadge,
|
21 |
+
saleBadgeAlign,
|
22 |
+
} = attributes;
|
23 |
|
24 |
return (
|
25 |
<>
|
94 |
}
|
95 |
/>
|
96 |
) }
|
97 |
+
<ToggleButtonControl
|
98 |
+
label={ __(
|
99 |
+
'Image Sizing',
|
100 |
+
'woo-gutenberg-products-block'
|
101 |
+
) }
|
102 |
+
help={ __experimentalCreateInterpolateElement(
|
103 |
+
__(
|
104 |
+
'Product image cropping can be modified in the <a>Customizer</a>.',
|
105 |
+
'woo-gutenberg-products-block'
|
106 |
+
),
|
107 |
+
{
|
108 |
+
a: (
|
109 |
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
110 |
+
<a
|
111 |
+
href={ `${ getAdminLink(
|
112 |
+
'customize.php'
|
113 |
+
) }?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images` }
|
114 |
+
target="_blank"
|
115 |
+
rel="noopener noreferrer"
|
116 |
+
/>
|
117 |
+
),
|
118 |
+
}
|
119 |
+
) }
|
120 |
+
value={ imageSizing }
|
121 |
+
options={ [
|
122 |
+
{
|
123 |
+
label: __(
|
124 |
+
'Full Size',
|
125 |
+
'woo-gutenberg-products-block'
|
126 |
+
),
|
127 |
+
value: 'full-size',
|
128 |
+
},
|
129 |
+
{
|
130 |
+
label: __(
|
131 |
+
'Cropped',
|
132 |
+
'woo-gutenberg-products-block'
|
133 |
+
),
|
134 |
+
value: 'cropped',
|
135 |
+
},
|
136 |
+
] }
|
137 |
+
onChange={ ( value ) =>
|
138 |
+
setAttributes( { imageSizing: value } )
|
139 |
+
}
|
140 |
+
/>
|
141 |
</PanelBody>
|
142 |
</InspectorControls>
|
143 |
<Disabled>
|
assets/js/atomic/blocks/product/sku/edit.js
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import EditProductLink from '@woocommerce/block-components/edit-product-link';
|
5 |
-
import { useProductDataContext } from '@woocommerce/shared-context';
|
6 |
|
7 |
/**
|
8 |
* Internal dependencies
|
@@ -10,12 +9,9 @@ import { useProductDataContext } from '@woocommerce/shared-context';
|
|
10 |
import Block from './block';
|
11 |
|
12 |
export default ( { attributes } ) => {
|
13 |
-
const productDataContext = useProductDataContext();
|
14 |
-
const product = productDataContext.product || {};
|
15 |
-
|
16 |
return (
|
17 |
<>
|
18 |
-
<EditProductLink
|
19 |
<Block { ...attributes } />
|
20 |
</>
|
21 |
);
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import EditProductLink from '@woocommerce/block-components/edit-product-link';
|
|
|
5 |
|
6 |
/**
|
7 |
* Internal dependencies
|
9 |
import Block from './block';
|
10 |
|
11 |
export default ( { attributes } ) => {
|
|
|
|
|
|
|
12 |
return (
|
13 |
<>
|
14 |
+
<EditProductLink />
|
15 |
<Block { ...attributes } />
|
16 |
</>
|
17 |
);
|
assets/js/atomic/blocks/product/sku/index.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
-
import { registerBlockType } from '@wordpress/blocks';
|
6 |
import { Icon, barcode } from '@woocommerce/icons';
|
|
|
7 |
|
8 |
/**
|
9 |
* Internal dependencies
|
@@ -24,7 +24,7 @@ const blockConfig = {
|
|
24 |
edit,
|
25 |
};
|
26 |
|
27 |
-
|
28 |
...sharedConfig,
|
29 |
...blockConfig,
|
30 |
} );
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
|
|
5 |
import { Icon, barcode } from '@woocommerce/icons';
|
6 |
+
import { registerExperimentalBlockType } from '@woocommerce/block-settings';
|
7 |
|
8 |
/**
|
9 |
* Internal dependencies
|
24 |
edit,
|
25 |
};
|
26 |
|
27 |
+
registerExperimentalBlockType( 'woocommerce/product-sku', {
|
28 |
...sharedConfig,
|
29 |
...blockConfig,
|
30 |
} );
|
assets/js/atomic/blocks/product/stock-indicator/block.js
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __, sprintf } from '@wordpress/i18n';
|
5 |
+
import PropTypes from 'prop-types';
|
6 |
+
import classnames from 'classnames';
|
7 |
+
import {
|
8 |
+
useInnerBlockLayoutContext,
|
9 |
+
useProductDataContext,
|
10 |
+
} from '@woocommerce/shared-context';
|
11 |
+
import { isEmpty } from 'lodash';
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Internal dependencies
|
15 |
+
*/
|
16 |
+
import './style.scss';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Product Stock Indicator Block Component.
|
20 |
+
*
|
21 |
+
* @param {Object} props Incoming props.
|
22 |
+
* @param {string} [props.className] CSS Class name for the component.
|
23 |
+
* @param {Object} [props.product] Optional product object. Product from context will be used if
|
24 |
+
* this is not provided.
|
25 |
+
* @return {*} The component.
|
26 |
+
*/
|
27 |
+
const Block = ( { className, ...props } ) => {
|
28 |
+
const { parentClassName } = useInnerBlockLayoutContext();
|
29 |
+
const productDataContext = useProductDataContext();
|
30 |
+
const product = props.product || productDataContext.product || {};
|
31 |
+
|
32 |
+
if ( isEmpty( product ) || ! product.is_purchasable ) {
|
33 |
+
return null;
|
34 |
+
}
|
35 |
+
|
36 |
+
const inStock = !! product.is_in_stock;
|
37 |
+
const lowStock = product.low_stock_remaining;
|
38 |
+
const isBackordered = product.is_on_backorder;
|
39 |
+
|
40 |
+
return (
|
41 |
+
<div
|
42 |
+
className={ classnames(
|
43 |
+
className,
|
44 |
+
'wc-block-components-product-stock-indicator',
|
45 |
+
`${ parentClassName }__stock-indicator`,
|
46 |
+
{
|
47 |
+
'wc-block-components-product-stock-indicator--in-stock': inStock,
|
48 |
+
'wc-block-components-product-stock-indicator--out-of-stock': ! inStock,
|
49 |
+
'wc-block-components-product-stock-indicator--low-stock': !! lowStock,
|
50 |
+
'wc-block-components-product-stock-indicator--available-on-backorder': !! isBackordered,
|
51 |
+
}
|
52 |
+
) }
|
53 |
+
>
|
54 |
+
{ lowStock
|
55 |
+
? lowStockText( lowStock )
|
56 |
+
: stockText( inStock, isBackordered ) }
|
57 |
+
</div>
|
58 |
+
);
|
59 |
+
};
|
60 |
+
|
61 |
+
const lowStockText = ( lowStock ) => {
|
62 |
+
return sprintf(
|
63 |
+
/* translators: %d stock amount (number of items in stock for product) */
|
64 |
+
__( '%d left in stock', 'woo-gutenberg-products-block' ),
|
65 |
+
lowStock
|
66 |
+
);
|
67 |
+
};
|
68 |
+
|
69 |
+
const stockText = ( inStock, isBackordered ) => {
|
70 |
+
if ( isBackordered ) {
|
71 |
+
return __( 'Available on backorder', 'woo-gutenberg-products-block' );
|
72 |
+
}
|
73 |
+
|
74 |
+
return inStock
|
75 |
+
? __( 'In Stock', 'woo-gutenberg-products-block' )
|
76 |
+
: __( 'Out of Stock', 'woo-gutenberg-products-block' );
|
77 |
+
};
|
78 |
+
|
79 |
+
Block.propTypes = {
|
80 |
+
className: PropTypes.string,
|
81 |
+
product: PropTypes.object,
|
82 |
+
};
|
83 |
+
|
84 |
+
export default Block;
|
assets/js/atomic/blocks/product/stock-indicator/edit.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import EditProductLink from '@woocommerce/block-components/edit-product-link';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import Block from './block';
|
10 |
+
|
11 |
+
export default ( { attributes } ) => {
|
12 |
+
return (
|
13 |
+
<>
|
14 |
+
<EditProductLink />
|
15 |
+
<Block { ...attributes } />
|
16 |
+
</>
|
17 |
+
);
|
18 |
+
};
|
assets/js/atomic/blocks/product/stock-indicator/index.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { registerExperimentalBlockType } from '@woocommerce/block-settings';
|
6 |
+
import { Icon, box } from '@woocommerce/icons';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Internal dependencies
|
10 |
+
*/
|
11 |
+
import sharedConfig from '../shared-config';
|
12 |
+
import edit from './edit';
|
13 |
+
|
14 |
+
const blockConfig = {
|
15 |
+
title: __( 'Product Stock Indicator', 'woo-gutenberg-products-block' ),
|
16 |
+
description: __(
|
17 |
+
'Display product stock status.',
|
18 |
+
'woo-gutenberg-products-block'
|
19 |
+
),
|
20 |
+
icon: {
|
21 |
+
src: <Icon srcElement={ box } />,
|
22 |
+
foreground: '#96588a',
|
23 |
+
},
|
24 |
+
edit,
|
25 |
+
};
|
26 |
+
|
27 |
+
registerExperimentalBlockType( 'woocommerce/product-stock-indicator', {
|
28 |
+
...sharedConfig,
|
29 |
+
...blockConfig,
|
30 |
+
} );
|
assets/js/atomic/blocks/product/stock-indicator/style.scss
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wc-block-layout {
|
2 |
+
.wc-block-components-product-stock-indicator {
|
3 |
+
margin-top: 0;
|
4 |
+
margin-bottom: em($gap-small);
|
5 |
+
display: block;
|
6 |
+
@include font-size(small);
|
7 |
+
|
8 |
+
&--in-stock {
|
9 |
+
color: $valid-green;
|
10 |
+
}
|
11 |
+
&--out-of-stock {
|
12 |
+
color: $error-red;
|
13 |
+
}
|
14 |
+
&--low-stock,
|
15 |
+
&--available-on-backorder {
|
16 |
+
color: $notice-yellow;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
assets/js/atomic/blocks/product/tag-list/block.js
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import PropTypes from 'prop-types';
|
6 |
+
import classnames from 'classnames';
|
7 |
+
import {
|
8 |
+
useInnerBlockLayoutContext,
|
9 |
+
useProductDataContext,
|
10 |
+
} from '@woocommerce/shared-context';
|
11 |
+
import { isEmpty } from 'lodash';
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Internal dependencies
|
15 |
+
*/
|
16 |
+
import './style.scss';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Product Tag List Block Component.
|
20 |
+
*
|
21 |
+
* @param {Object} props Incoming props.
|
22 |
+
* @param {string} [props.className] CSS Class name for the component.
|
23 |
+
* @param {Object} [props.product] Optional product object. Product from context will be used if
|
24 |
+
* this is not provided.
|
25 |
+
* @return {*} The component.
|
26 |
+
*/
|
27 |
+
const Block = ( { className, ...props } ) => {
|
28 |
+
const { parentClassName } = useInnerBlockLayoutContext();
|
29 |
+
const productDataContext = useProductDataContext();
|
30 |
+
const { product } = productDataContext || props || {};
|
31 |
+
|
32 |
+
if ( isEmpty( product ) || isEmpty( product.tags ) ) {
|
33 |
+
return null;
|
34 |
+
}
|
35 |
+
|
36 |
+
return (
|
37 |
+
<div
|
38 |
+
className={ classnames(
|
39 |
+
className,
|
40 |
+
'wc-block-components-product-tag-list',
|
41 |
+
`${ parentClassName }__product-tag-list`
|
42 |
+
) }
|
43 |
+
>
|
44 |
+
{ __( 'Tags:', 'woo-gutenberg-products-block' ) }{ ' ' }
|
45 |
+
<ul>
|
46 |
+
{ Object.values( product.tags ).map(
|
47 |
+
( { name, link, slug } ) => {
|
48 |
+
return (
|
49 |
+
<li key={ `tag-list-item-${ slug }` }>
|
50 |
+
<a href={ link }>{ name }</a>
|
51 |
+
</li>
|
52 |
+
);
|
53 |
+
}
|
54 |
+
) }
|
55 |
+
</ul>
|
56 |
+
</div>
|
57 |
+
);
|
58 |
+
};
|
59 |
+
|
60 |
+
Block.propTypes = {
|
61 |
+
className: PropTypes.string,
|
62 |
+
product: PropTypes.object,
|
63 |
+
};
|
64 |
+
|
65 |
+
export default Block;
|
assets/js/atomic/blocks/product/tag-list/edit.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { Disabled } from '@wordpress/components';
|
5 |
+
import EditProductLink from '@woocommerce/block-components/edit-product-link';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Internal dependencies
|
9 |
+
*/
|
10 |
+
import Block from './block';
|
11 |
+
|
12 |
+
export default ( { attributes } ) => {
|
13 |
+
return (
|
14 |
+
<>
|
15 |
+
<EditProductLink />
|
16 |
+
<Disabled>
|
17 |
+
<Block { ...attributes } />
|
18 |
+
</Disabled>
|
19 |
+
</>
|
20 |
+
);
|
21 |
+
};
|
assets/js/atomic/blocks/product/tag-list/index.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { Icon, tag } from '@woocommerce/icons';
|
6 |
+
import { registerExperimentalBlockType } from '@woocommerce/block-settings';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Internal dependencies
|
10 |
+
*/
|
11 |
+
import sharedConfig from '../shared-config';
|
12 |
+
import edit from './edit';
|
13 |
+
|
14 |
+
const blockConfig = {
|
15 |
+
title: __( 'Product Tag List', 'woo-gutenberg-products-block' ),
|
16 |
+
description: __(
|
17 |
+
'Display a list of tags belonging to a product.',
|
18 |
+
'woo-gutenberg-products-block'
|
19 |
+
),
|
20 |
+
icon: {
|
21 |
+
src: <Icon srcElement={ tag } />,
|
22 |
+
foreground: '#96588a',
|
23 |
+
},
|
24 |
+
edit,
|
25 |
+
};
|
26 |
+
|
27 |
+
registerExperimentalBlockType( 'woocommerce/product-tag-list', {
|
28 |
+
...sharedConfig,
|
29 |
+
...blockConfig,
|
30 |
+
} );
|
assets/js/atomic/blocks/product/tag-list/style.scss
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wc-block-layout .wc-block-components-product-tag-list {
|
2 |
+
margin-top: 0;
|
3 |
+
margin-bottom: em($gap-small);
|
4 |
+
|
5 |
+
ul {
|
6 |
+
margin: 0;
|
7 |
+
padding: 0;
|
8 |
+
display: inline;
|
9 |
+
|
10 |
+
li {
|
11 |
+
display: inline;
|
12 |
+
list-style: none;
|
13 |
+
}
|
14 |
+
|
15 |
+
li::after {
|
16 |
+
content: ", ";
|
17 |
+
}
|
18 |
+
|
19 |
+
li:last-child::after {
|
20 |
+
content: "";
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
assets/js/atomic/utils/get-block-map.js
CHANGED
@@ -1,33 +1,17 @@
|
|
1 |
/**
|
2 |
* External dependencies
|
3 |
*/
|
4 |
-
import {
|
5 |
|
6 |
/**
|
7 |
* Internal dependencies
|
8 |
*/
|
9 |
-
import
|
10 |
-
import ProductImage from '../blocks/product/image/frontend';
|
11 |
-
import ProductPrice from '../blocks/product/price/block';
|
12 |
-
import ProductRating from '../blocks/product/rating/block';
|
13 |
-
import ProductSaleBadge from '../blocks/product/sale-badge/block';
|
14 |
-
import ProductSummary from '../blocks/product/summary/block';
|
15 |
-
import ProductTitle from '../blocks/product/title/frontend';
|
16 |
-
import ProductSku from '../blocks/product/sku/block';
|
17 |
|
18 |
/**
|
19 |
-
* Map
|
20 |
*
|
21 |
-
* @param {string} blockName Name of the parent block.
|
22 |
*/
|
23 |
-
export const getBlockMap = ( blockName ) =>
|
24 |
-
|
25 |
-
'woocommerce/product-image': ProductImage,
|
26 |
-
'woocommerce/product-title': ProductTitle,
|
27 |
-
'woocommerce/product-rating': ProductRating,
|
28 |
-
'woocommerce/product-button': ProductButton,
|
29 |
-
'woocommerce/product-summary': ProductSummary,
|
30 |
-
'woocommerce/product-sale-badge': ProductSaleBadge,
|
31 |
-
'woocommerce/product-sku': ProductSku,
|
32 |
-
...getRegisteredInnerBlocks( blockName ),
|
33 |
-
} );
|
1 |
/**
|
2 |
* External dependencies
|
3 |
*/
|
4 |
+
import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';
|
5 |
|
6 |
/**
|
7 |
* Internal dependencies
|
8 |
*/
|
9 |
+
import '../blocks/component-init';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
/**
|
12 |
+
* Map named Blocks to defined React Components to render on the frontend.
|
13 |
*
|
14 |
+
* @param {string} blockName Name of the parent block.
|
15 |
*/
|
16 |
+
export const getBlockMap = ( blockName ) =>
|
17 |
+
getRegisteredBlockComponents( blockName );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/base/components/block-error-boundary/block-error.js
CHANGED
@@ -16,21 +16,27 @@ const BlockError = ( {
|
|
16 |
errorMessagePrefix = __( 'Error:', 'woo-gutenberg-products-block' ),
|
17 |
} ) => {
|
18 |
return (
|
19 |
-
<div className="wc-block-error">
|
20 |
{ imageUrl && (
|
21 |
<img
|
22 |
-
className="wc-block-error__image"
|
23 |
src={ imageUrl }
|
24 |
alt=""
|
25 |
/>
|
26 |
) }
|
27 |
-
<div className="wc-block-error__content">
|
28 |
{ header && (
|
29 |
-
<p className="wc-block-error__header">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
) }
|
31 |
-
{ text && <p className="wc-block-error__text">{ text }</p> }
|
32 |
{ errorMessage && (
|
33 |
-
<p className="wc-block-error__message">
|
34 |
{ errorMessagePrefix ? errorMessagePrefix + ' ' : '' }
|
35 |
{ errorMessage }
|
36 |
</p>
|
16 |
errorMessagePrefix = __( 'Error:', 'woo-gutenberg-products-block' ),
|
17 |
} ) => {
|
18 |
return (
|
19 |
+
<div className="wc-block-error wc-block-components-error">
|
20 |
{ imageUrl && (
|
21 |
<img
|
22 |
+
className="wc-block-error__image wc-block-components-error__image"
|
23 |
src={ imageUrl }
|
24 |
alt=""
|
25 |
/>
|
26 |
) }
|
27 |
+
<div className="wc-block-error__content wc-block-components-error__content">
|
28 |
{ header && (
|
29 |
+
<p className="wc-block-error__header wc-block-components-error__header">
|
30 |
+
{ header }
|
31 |
+
</p>
|
32 |
+
) }
|
33 |
+
{ text && (
|
34 |
+
<p className="wc-block-error__text wc-block-components-error__text">
|
35 |
+
{ text }
|
36 |
+
</p>
|
37 |
) }
|
|
|
38 |
{ errorMessage && (
|
39 |
+
<p className="wc-block-error__message wc-block-components-error__message">
|
40 |
{ errorMessagePrefix ? errorMessagePrefix + ' ' : '' }
|
41 |
{ errorMessage }
|
42 |
</p>
|
assets/js/base/components/block-error-boundary/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-error {
|
2 |
display: flex;
|
3 |
background-color: #f3f3f4;
|
4 |
border-left: 4px solid #6d6d6d;
|
@@ -8,29 +8,29 @@
|
|
8 |
flex-direction: column;
|
9 |
}
|
10 |
|
11 |
-
.wc-block-error__header {
|
12 |
@include font-size(larger);
|
13 |
font-weight: bold;
|
14 |
margin: 0;
|
15 |
}
|
16 |
|
17 |
-
.wc-block-error__image {
|
18 |
max-width: 25%;
|
19 |
}
|
20 |
-
.wc-block-error__text {
|
21 |
margin: 0;
|
22 |
}
|
23 |
-
.wc-block-error__message {
|
24 |
margin: 1em 0 0 0;
|
25 |
font-style: italic;
|
26 |
}
|
27 |
|
28 |
@include breakpoint( ">480px" ) {
|
29 |
-
.wc-block-error {
|
30 |
flex-direction: row;
|
31 |
}
|
32 |
|
33 |
-
.wc-block-error__image + .wc-block-error__content {
|
34 |
margin-left: $gap-large;
|
35 |
}
|
36 |
}
|
1 |
+
.wc-block-components-error {
|
2 |
display: flex;
|
3 |
background-color: #f3f3f4;
|
4 |
border-left: 4px solid #6d6d6d;
|
8 |
flex-direction: column;
|
9 |
}
|
10 |
|
11 |
+
.wc-block-components-error__header {
|
12 |
@include font-size(larger);
|
13 |
font-weight: bold;
|
14 |
margin: 0;
|
15 |
}
|
16 |
|
17 |
+
.wc-block-components-error__image {
|
18 |
max-width: 25%;
|
19 |
}
|
20 |
+
.wc-block-components-error__text {
|
21 |
margin: 0;
|
22 |
}
|
23 |
+
.wc-block-components-error__message {
|
24 |
margin: 1em 0 0 0;
|
25 |
font-style: italic;
|
26 |
}
|
27 |
|
28 |
@include breakpoint( ">480px" ) {
|
29 |
+
.wc-block-components-error {
|
30 |
flex-direction: row;
|
31 |
}
|
32 |
|
33 |
+
.wc-block-components-error__image + .wc-block-components-error__content {
|
34 |
margin-left: $gap-large;
|
35 |
}
|
36 |
}
|
assets/js/base/components/button/index.js
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { Button as WPButton } from 'wordpress-components';
|
5 |
+
import PropTypes from 'prop-types';
|
6 |
+
import classNames from 'classnames';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Internal dependencies
|
10 |
+
*/
|
11 |
+
import './style.scss';
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Component that visually renders a button but semantically might be `<button>` or `<a>` depending on the props.
|
15 |
+
*
|
16 |
+
* @todo Update cart and checkout button component. Cart and checkout should use base/components/button instead of cart-checkout/button.
|
17 |
+
*/
|
18 |
+
const Button = ( { className, showSpinner = false, children, ...props } ) => {
|
19 |
+
const buttonClassName = classNames(
|
20 |
+
'wc-block-components-button',
|
21 |
+
className,
|
22 |
+
{
|
23 |
+
'wc-block-components-button--loading': showSpinner,
|
24 |
+
}
|
25 |
+
);
|
26 |
+
|
27 |
+
return (
|
28 |
+
<WPButton className={ buttonClassName } { ...props }>
|
29 |
+
{ showSpinner && (
|
30 |
+
<span
|
31 |
+
className="wc-block-components-button__spinner"
|
32 |
+
aria-hidden="true"
|
33 |
+
/>
|
34 |
+
) }
|
35 |
+
<span className="wc-block-components-button__text">
|
36 |
+
{ children }
|
37 |
+
</span>
|
38 |
+
</WPButton>
|
39 |
+
);
|
40 |
+
};
|
41 |
+
|
42 |
+
Button.propTypes = {
|
43 |
+
className: PropTypes.string,
|
44 |
+
showSpinner: PropTypes.bool,
|
45 |
+
children: PropTypes.node,
|
46 |
+
};
|
47 |
+
|
48 |
+
export default Button;
|
assets/js/base/components/button/stories/index.js
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Internal dependencies
|
3 |
+
*/
|
4 |
+
import Button from '../';
|
5 |
+
|
6 |
+
export default {
|
7 |
+
title: 'WooCommerce Blocks/@base-components/cart-checkout/Button',
|
8 |
+
component: Button,
|
9 |
+
};
|
10 |
+
|
11 |
+
export const Default = () => (
|
12 |
+
<div className="wc-block-cart">
|
13 |
+
<Button>Buy now</Button>
|
14 |
+
</div>
|
15 |
+
);
|
assets/js/base/components/button/style.scss
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wc-block-components-button:not(.is-link) {
|
2 |
+
@include reset-typography();
|
3 |
+
align-items: center;
|
4 |
+
background-color: $black;
|
5 |
+
color: $white;
|
6 |
+
display: inline-flex;
|
7 |
+
font-weight: bold;
|
8 |
+
min-height: 3em;
|
9 |
+
justify-content: center;
|
10 |
+
line-height: 1;
|
11 |
+
padding: 0 em($gap);
|
12 |
+
text-align: center;
|
13 |
+
text-decoration: none;
|
14 |
+
text-transform: none;
|
15 |
+
position: relative;
|
16 |
+
|
17 |
+
&:disabled,
|
18 |
+
&:hover,
|
19 |
+
&:focus,
|
20 |
+
&:active {
|
21 |
+
background-color: $black;
|
22 |
+
color: $white;
|
23 |
+
}
|
24 |
+
|
25 |
+
.wc-block-components-button__text {
|
26 |
+
display: block;
|
27 |
+
|
28 |
+
> svg {
|
29 |
+
fill: currentColor;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
.wc-block-components-button__spinner {
|
33 |
+
width: 1em;
|
34 |
+
height: 1em;
|
35 |
+
position: absolute;
|
36 |
+
top: 50%;
|
37 |
+
left: 0;
|
38 |
+
width: 100%;
|
39 |
+
height: 100%;
|
40 |
+
margin-top: -0.5em;
|
41 |
+
color: inherit;
|
42 |
+
box-sizing: content-box;
|
43 |
+
|
44 |
+
&::after {
|
45 |
+
content: " ";
|
46 |
+
display: inline-block;
|
47 |
+
margin: 0 auto;
|
48 |
+
width: 1em;
|
49 |
+
height: 1em;
|
50 |
+
box-sizing: border-box;
|
51 |
+
transform-origin: 50% 50%;
|
52 |
+
transform: translateZ(0) scale(0.5);
|
53 |
+
backface-visibility: hidden;
|
54 |
+
border-radius: 50%;
|
55 |
+
border: 0.2em solid currentColor;
|
56 |
+
border-left-color: transparent;
|
57 |
+
animation: wc-block-components-button__spinner__animation 1s infinite linear;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
.wc-block-components-button__spinner + .wc-block-components-button__text {
|
61 |
+
visibility: hidden;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
@keyframes wc-block-components-button__spinner__animation {
|
66 |
+
0% {
|
67 |
+
animation-timing-function: cubic-bezier(0.5856, 0.0703, 0.4143, 0.9297);
|
68 |
+
transform: rotate(0deg);
|
69 |
+
}
|
70 |
+
100% {
|
71 |
+
transform: rotate(360deg);
|
72 |
+
}
|
73 |
+
}
|
assets/js/base/components/cart-checkout/address-form/index.js
CHANGED
@@ -100,7 +100,7 @@ const AddressForm = ( {
|
|
100 |
id = id || instanceId;
|
101 |
|
102 |
return (
|
103 |
-
<div id={ id } className="wc-block-address-form">
|
104 |
{ sortedAddressFields.map( ( field ) => {
|
105 |
if ( field.hidden ) {
|
106 |
return null;
|
@@ -175,7 +175,7 @@ const AddressForm = ( {
|
|
175 |
<ValidatedTextInput
|
176 |
key={ field.key }
|
177 |
id={ `${ id }-${ field.key }` }
|
178 |
-
className={ `wc-block-address-form__${ field.key }` }
|
179 |
label={
|
180 |
field.required ? field.label : field.optionalLabel
|
181 |
}
|
100 |
id = id || instanceId;
|
101 |
|
102 |
return (
|
103 |
+
<div id={ id } className="wc-block-components-address-form">
|
104 |
{ sortedAddressFields.map( ( field ) => {
|
105 |
if ( field.hidden ) {
|
106 |
return null;
|
175 |
<ValidatedTextInput
|
176 |
key={ field.key }
|
177 |
id={ `${ id }-${ field.key }` }
|
178 |
+
className={ `wc-block-components-address-form__${ field.key }` }
|
179 |
label={
|
180 |
field.required ? field.label : field.optionalLabel
|
181 |
}
|
assets/js/base/components/cart-checkout/form-step/index.js
CHANGED
@@ -11,16 +11,16 @@ import Title from '@woocommerce/base-components/title';
|
|
11 |
import './style.scss';
|
12 |
|
13 |
const StepHeading = ( { title, stepHeadingContent } ) => (
|
14 |
-
<div className="wc-block-checkout-step__heading">
|
15 |
<Title
|
16 |
aria-hidden="true"
|
17 |
-
className="wc-block-checkout-step__title"
|
18 |
headingLevel="2"
|
19 |
>
|
20 |
{ title }
|
21 |
</Title>
|
22 |
{ !! stepHeadingContent && (
|
23 |
-
<span className="wc-block-checkout-step__heading-content">
|
24 |
{ stepHeadingContent }
|
25 |
</span>
|
26 |
) }
|
@@ -39,7 +39,10 @@ const FormStep = ( {
|
|
39 |
} ) => {
|
40 |
return (
|
41 |
<fieldset
|
42 |
-
className={ classnames(
|
|
|
|
|
|
|
43 |
id={ id }
|
44 |
disabled={ disabled }
|
45 |
>
|
@@ -48,13 +51,13 @@ const FormStep = ( {
|
|
48 |
title={ title }
|
49 |
stepHeadingContent={ stepHeadingContent() }
|
50 |
/>
|
51 |
-
<div className="wc-block-checkout-step__container">
|
52 |
{ !! description && (
|
53 |
-
<p className="wc-block-checkout-step__description">
|
54 |
{ description }
|
55 |
</p>
|
56 |
) }
|
57 |
-
<div className="wc-block-checkout-step__content">
|
58 |
{ children }
|
59 |
</div>
|
60 |
</div>
|
11 |
import './style.scss';
|
12 |
|
13 |
const StepHeading = ( { title, stepHeadingContent } ) => (
|
14 |
+
<div className="wc-block-components-checkout-step__heading">
|
15 |
<Title
|
16 |
aria-hidden="true"
|
17 |
+
className="wc-block-components-checkout-step__title"
|
18 |
headingLevel="2"
|
19 |
>
|
20 |
{ title }
|
21 |
</Title>
|
22 |
{ !! stepHeadingContent && (
|
23 |
+
<span className="wc-block-components-checkout-step__heading-content">
|
24 |
{ stepHeadingContent }
|
25 |
</span>
|
26 |
) }
|
39 |
} ) => {
|
40 |
return (
|
41 |
<fieldset
|
42 |
+
className={ classnames(
|
43 |
+
className,
|
44 |
+
'wc-block-components-checkout-step'
|
45 |
+
) }
|
46 |
id={ id }
|
47 |
disabled={ disabled }
|
48 |
>
|
51 |
title={ title }
|
52 |
stepHeadingContent={ stepHeadingContent() }
|
53 |
/>
|
54 |
+
<div className="wc-block-components-checkout-step__container">
|
55 |
{ !! description && (
|
56 |
+
<p className="wc-block-components-checkout-step__description">
|
57 |
{ description }
|
58 |
</p>
|
59 |
) }
|
60 |
+
<div className="wc-block-components-checkout-step__content">
|
61 |
{ children }
|
62 |
</div>
|
63 |
</div>
|
assets/js/base/components/cart-checkout/form-step/style.scss
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
.wc-block-checkout-form {
|
2 |
counter-reset: checkout-step;
|
3 |
}
|
4 |
|
5 |
-
.wc-block-checkout-form fieldset.wc-block-checkout-step {
|
6 |
position: relative;
|
7 |
border: none;
|
8 |
padding: 0 0 0 $gap-larger;
|
@@ -14,52 +14,53 @@
|
|
14 |
}
|
15 |
}
|
16 |
|
17 |
-
.wc-block-checkout-step__container {
|
18 |
position: relative;
|
19 |
}
|
20 |
|
21 |
-
.wc-block-checkout-step__content {
|
22 |
-
padding-bottom: $gap-
|
23 |
}
|
24 |
|
25 |
-
.wc-block-checkout-form fieldset.wc-block-checkout-step:disabled {
|
26 |
opacity: 0.6;
|
27 |
}
|
28 |
|
29 |
-
.wc-block-checkout-step__heading {
|
30 |
display: flex;
|
31 |
justify-content: space-between;
|
32 |
align-content: center;
|
33 |
flex-wrap: wrap;
|
34 |
-
margin
|
35 |
position: relative;
|
36 |
}
|
37 |
|
38 |
-
.wc-block-checkout-
|
39 |
-
|
|
|
|
|
|
|
40 |
margin: 0 $gap-small 0 0;
|
41 |
}
|
42 |
|
43 |
-
.wc-block-checkout-step__heading-content {
|
44 |
@include font-size(smaller);
|
45 |
-
color: $gray-80;
|
46 |
position: absolute;
|
47 |
right: 0;
|
48 |
|
49 |
a {
|
50 |
font-weight: bold;
|
51 |
-
color:
|
52 |
}
|
53 |
}
|
54 |
|
55 |
-
.wc-block-checkout-step__description {
|
56 |
@include font-size(small);
|
57 |
line-height: 1.25;
|
58 |
-
color: $gray-60;
|
59 |
margin-bottom: $gap;
|
60 |
}
|
61 |
|
62 |
-
.wc-block-checkout-step__title::before {
|
63 |
@include reset-box();
|
64 |
background: transparent;
|
65 |
counter-increment: checkout-step;
|
@@ -73,15 +74,16 @@
|
|
73 |
transform: translateX(-50%);
|
74 |
}
|
75 |
|
76 |
-
.wc-block-checkout-step__container::after {
|
77 |
content: "";
|
78 |
-
height:
|
79 |
border-left: 1px solid;
|
|
|
80 |
position: absolute;
|
81 |
left: -$gap-larger/2;
|
82 |
top: 0;
|
83 |
}
|
84 |
|
85 |
-
.wc-block-checkout-step:last-child .wc-block-checkout-step__container::after {
|
86 |
content: none;
|
87 |
}
|
1 |
+
.wc-block-components-checkout-form {
|
2 |
counter-reset: checkout-step;
|
3 |
}
|
4 |
|
5 |
+
.wc-block-components-checkout-form fieldset.wc-block-components-checkout-step {
|
6 |
position: relative;
|
7 |
border: none;
|
8 |
padding: 0 0 0 $gap-larger;
|
14 |
}
|
15 |
}
|
16 |
|
17 |
+
.wc-block-components-checkout-step__container {
|
18 |
position: relative;
|
19 |
}
|
20 |
|
21 |
+
.wc-block-components-checkout-step__content {
|
22 |
+
padding-bottom: em($gap-large);
|
23 |
}
|
24 |
|
25 |
+
.wc-block-components-checkout-form fieldset.wc-block-components-checkout-step:disabled {
|
26 |
opacity: 0.6;
|
27 |
}
|
28 |
|
29 |
+
.wc-block-components-checkout-step__heading {
|
30 |
display: flex;
|
31 |
justify-content: space-between;
|
32 |
align-content: center;
|
33 |
flex-wrap: wrap;
|
34 |
+
margin: em($gap-small) 0 em($gap);
|
35 |
position: relative;
|
36 |
}
|
37 |
|
38 |
+
.wc-block-components-checkout-step:first-child .wc-block-components-checkout-step__heading {
|
39 |
+
margin-top: 0;
|
40 |
+
}
|
41 |
+
|
42 |
+
.wc-block-components-checkout-step__title {
|
43 |
margin: 0 $gap-small 0 0;
|
44 |
}
|
45 |
|
46 |
+
.wc-block-components-checkout-step__heading-content {
|
47 |
@include font-size(smaller);
|
|
|
48 |
position: absolute;
|
49 |
right: 0;
|
50 |
|
51 |
a {
|
52 |
font-weight: bold;
|
53 |
+
color: inherit;
|
54 |
}
|
55 |
}
|
56 |
|
57 |
+
.wc-block-components-checkout-step__description {
|
58 |
@include font-size(small);
|
59 |
line-height: 1.25;
|
|
|
60 |
margin-bottom: $gap;
|
61 |
}
|
62 |
|
63 |
+
.wc-block-components-checkout-step__title::before {
|
64 |
@include reset-box();
|
65 |
background: transparent;
|
66 |
counter-increment: checkout-step;
|
74 |
transform: translateX(-50%);
|
75 |
}
|
76 |
|
77 |
+
.wc-block-components-checkout-step__container::after {
|
78 |
content: "";
|
79 |
+
height: 100%;
|
80 |
border-left: 1px solid;
|
81 |
+
opacity: 0.3;
|
82 |
position: absolute;
|
83 |
left: -$gap-larger/2;
|
84 |
top: 0;
|
85 |
}
|
86 |
|
87 |
+
.wc-block-components-checkout-step:last-child .wc-block-components-checkout-step__container::after {
|
88 |
content: none;
|
89 |
}
|
assets/js/base/components/cart-checkout/form/index.js
CHANGED
@@ -20,7 +20,10 @@ const CheckoutForm = ( {
|
|
20 |
};
|
21 |
return (
|
22 |
<form
|
23 |
-
className={ classnames(
|
|
|
|
|
|
|
24 |
onSubmit={ formOnSubmit }
|
25 |
>
|
26 |
{ children }
|
20 |
};
|
21 |
return (
|
22 |
<form
|
23 |
+
className={ classnames(
|
24 |
+
'wc-block-components-checkout-form',
|
25 |
+
className
|
26 |
+
) }
|
27 |
onSubmit={ formOnSubmit }
|
28 |
>
|
29 |
{ children }
|
assets/js/base/components/cart-checkout/form/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-checkout-form {
|
2 |
margin: 0;
|
3 |
max-width: 100%;
|
4 |
}
|
1 |
+
.wc-block-components-checkout-form {
|
2 |
margin: 0;
|
3 |
max-width: 100%;
|
4 |
}
|
assets/js/base/components/cart-checkout/order-summary/style.scss
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
.wc-block-components-order-summary {
|
2 |
-
|
|
|
|
|
|
|
3 |
}
|
4 |
|
5 |
.wc-block-components-order-summary__content {
|
@@ -8,18 +11,19 @@
|
|
8 |
}
|
9 |
|
10 |
.wc-block-components-order-summary-item {
|
|
|
11 |
display: table-row;
|
|
|
12 |
width: 100%;
|
13 |
|
14 |
-
> div {
|
15 |
-
border-bottom: 1px solid $core-grey-light-600;
|
16 |
-
}
|
17 |
-
|
18 |
&:last-child {
|
19 |
> div {
|
20 |
-
border-bottom: none;
|
21 |
padding-bottom: 0;
|
22 |
}
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
}
|
25 |
|
@@ -70,7 +74,7 @@
|
|
70 |
line-height: 1.375;
|
71 |
|
72 |
p,
|
73 |
-
.wc-block-product-metadata {
|
74 |
line-height: 1.375;
|
75 |
margin-top: #{ ( $gap-large - $gap ) / 2 };
|
76 |
}
|
1 |
.wc-block-components-order-summary {
|
2 |
+
.wc-blocks-components-panel__button {
|
3 |
+
margin-top: 0;
|
4 |
+
padding-top: 0;
|
5 |
+
}
|
6 |
}
|
7 |
|
8 |
.wc-block-components-order-summary__content {
|
11 |
}
|
12 |
|
13 |
.wc-block-components-order-summary-item {
|
14 |
+
@include with-translucent-border(0 0 1px);
|
15 |
display: table-row;
|
16 |
+
padding-bottom: 1px;
|
17 |
width: 100%;
|
18 |
|
|
|
|
|
|
|
|
|
19 |
&:last-child {
|
20 |
> div {
|
|
|
21 |
padding-bottom: 0;
|
22 |
}
|
23 |
+
|
24 |
+
&::after {
|
25 |
+
display: none;
|
26 |
+
}
|
27 |
}
|
28 |
}
|
29 |
|
74 |
line-height: 1.375;
|
75 |
|
76 |
p,
|
77 |
+
.wc-block-components-product-metadata {
|
78 |
line-height: 1.375;
|
79 |
margin-top: #{ ( $gap-large - $gap ) / 2 };
|
80 |
}
|
assets/js/base/components/cart-checkout/payment-method-icons/index.js
CHANGED
@@ -25,10 +25,15 @@ export const PaymentMethodIcons = ( { icons = [], align = 'center' } ) => {
|
|
25 |
return null;
|
26 |
}
|
27 |
|
28 |
-
const containerClass = classnames(
|
29 |
-
'wc-block-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
return (
|
34 |
<div className={ containerClass }>
|
25 |
return null;
|
26 |
}
|
27 |
|
28 |
+
const containerClass = classnames(
|
29 |
+
'wc-block-components-payment-method-icons',
|
30 |
+
{
|
31 |
+
'wc-block-components-payment-method-icons--align-left':
|
32 |
+
align === 'left',
|
33 |
+
'wc-block-components-payment-method-icons--align-right':
|
34 |
+
align === 'right',
|
35 |
+
}
|
36 |
+
);
|
37 |
|
38 |
return (
|
39 |
<div className={ containerClass }>
|
assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* @param {string} id Icon ID.
|
5 |
*/
|
6 |
const getIconClassName = ( id ) => {
|
7 |
-
return `wc-
|
8 |
};
|
9 |
|
10 |
/**
|
4 |
* @param {string} id Icon ID.
|
5 |
*/
|
6 |
const getIconClassName = ( id ) => {
|
7 |
+
return `wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${ id }`;
|
8 |
};
|
9 |
|
10 |
/**
|
assets/js/base/components/cart-checkout/payment-method-icons/style.scss
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
.wc-block-
|
2 |
display: block;
|
3 |
text-align: center;
|
4 |
margin: 0 0 #{$gap - 2px};
|
5 |
|
6 |
-
.wc-
|
7 |
display: inline-block;
|
8 |
margin: 0 4px 2px;
|
9 |
padding: 0;
|
@@ -15,7 +15,7 @@
|
|
15 |
&--align-left {
|
16 |
text-align: left;
|
17 |
|
18 |
-
.wc-
|
19 |
margin-left: 0;
|
20 |
margin-right: 8px;
|
21 |
}
|
@@ -24,7 +24,7 @@
|
|
24 |
&--align-right {
|
25 |
text-align: right;
|
26 |
|
27 |
-
.wc-
|
28 |
margin-right: 0;
|
29 |
margin-left: 8px;
|
30 |
}
|
@@ -37,8 +37,8 @@
|
|
37 |
|
38 |
.is-mobile,
|
39 |
.is-small {
|
40 |
-
.wc-block-
|
41 |
-
.wc-
|
42 |
height: 16px;
|
43 |
}
|
44 |
}
|
1 |
+
.wc-block-components-payment-method-icons {
|
2 |
display: block;
|
3 |
text-align: center;
|
4 |
margin: 0 0 #{$gap - 2px};
|
5 |
|
6 |
+
.wc-block-components-payment-method-icon {
|
7 |
display: inline-block;
|
8 |
margin: 0 4px 2px;
|
9 |
padding: 0;
|
15 |
&--align-left {
|
16 |
text-align: left;
|
17 |
|
18 |
+
.wc-block-components-payment-method-icon {
|
19 |
margin-left: 0;
|
20 |
margin-right: 8px;
|
21 |
}
|
24 |
&--align-right {
|
25 |
text-align: right;
|
26 |
|
27 |
+
.wc-block-components-payment-method-icon {
|
28 |
margin-right: 0;
|
29 |
margin-left: 8px;
|
30 |
}
|
37 |
|
38 |
.is-mobile,
|
39 |
.is-small {
|
40 |
+
.wc-block-components-payment-method-icons {
|
41 |
+
.wc-block-components-payment-method-icon {
|
42 |
height: 16px;
|
43 |
}
|
44 |
}
|
assets/js/base/components/cart-checkout/payment-method-label/index.js
CHANGED
@@ -29,8 +29,8 @@ export const PaymentMethodLabel = ( { icon = '', text = '' } ) => {
|
|
29 |
const hasIcon = !! icon;
|
30 |
const hasNamedIcon =
|
31 |
hasIcon && typeof icon === 'string' && namedIcons[ icon ];
|
32 |
-
const className = classnames( 'wc-block-
|
33 |
-
'wc-block-
|
34 |
} );
|
35 |
|
36 |
return (
|
29 |
const hasIcon = !! icon;
|
30 |
const hasNamedIcon =
|
31 |
hasIcon && typeof icon === 'string' && namedIcons[ icon ];
|
32 |
+
const className = classnames( 'wc-block-components-payment-method-label', {
|
33 |
+
'wc-block-components-payment-method-label--with-icon': hasIcon,
|
34 |
} );
|
35 |
|
36 |
return (
|
assets/js/base/components/cart-checkout/payment-method-label/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-
|
2 |
display: inline-block;
|
3 |
vertical-align: middle;
|
4 |
> img,
|
@@ -10,7 +10,7 @@
|
|
10 |
|
11 |
.is-mobile,
|
12 |
.is-small {
|
13 |
-
.wc-block-
|
14 |
> img,
|
15 |
> svg {
|
16 |
display: none;
|
1 |
+
.wc-block-components-payment-method-label--with-icon {
|
2 |
display: inline-block;
|
3 |
vertical-align: middle;
|
4 |
> img,
|
10 |
|
11 |
.is-mobile,
|
12 |
.is-small {
|
13 |
+
.wc-block-components-payment-method-label--with-icon {
|
14 |
> img,
|
15 |
> svg {
|
16 |
display: none;
|
assets/js/base/components/cart-checkout/product-image/index.js
CHANGED
@@ -10,10 +10,8 @@ import PropTypes from 'prop-types';
|
|
10 |
*/
|
11 |
const ProductImage = ( { image = {} } ) => {
|
12 |
const imageProps = {
|
13 |
-
src: image.
|
14 |
alt: decodeEntities( image.alt ) || '',
|
15 |
-
srcSet: image.srcset || '',
|
16 |
-
sizes: image.sizes || '',
|
17 |
};
|
18 |
|
19 |
return <img { ...imageProps } alt={ imageProps.alt } />;
|
@@ -22,9 +20,7 @@ const ProductImage = ( { image = {} } ) => {
|
|
22 |
ProductImage.propTypes = {
|
23 |
image: PropTypes.shape( {
|
24 |
alt: PropTypes.string,
|
25 |
-
|
26 |
-
srcsizes: PropTypes.string,
|
27 |
-
srcset: PropTypes.string,
|
28 |
} ),
|
29 |
};
|
30 |
|
10 |
*/
|
11 |
const ProductImage = ( { image = {} } ) => {
|
12 |
const imageProps = {
|
13 |
+
src: image.thumbnail || PLACEHOLDER_IMG_SRC,
|
14 |
alt: decodeEntities( image.alt ) || '',
|
|
|
|
|
15 |
};
|
16 |
|
17 |
return <img { ...imageProps } alt={ imageProps.alt } />;
|
20 |
ProductImage.propTypes = {
|
21 |
image: PropTypes.shape( {
|
22 |
alt: PropTypes.string,
|
23 |
+
thumbnail: PropTypes.string,
|
|
|
|
|
24 |
} ),
|
25 |
};
|
26 |
|
assets/js/base/components/cart-checkout/product-low-stock-badge/index.js
CHANGED
@@ -18,7 +18,7 @@ const ProductLowStockBadge = ( { lowStockRemaining } ) => {
|
|
18 |
}
|
19 |
|
20 |
return (
|
21 |
-
<div className="wc-block-low-stock-badge">
|
22 |
{ sprintf(
|
23 |
/* translators: %d stock amount (number of items in stock for product) */
|
24 |
__( '%d left in stock', 'woo-gutenberg-products-block' ),
|
18 |
}
|
19 |
|
20 |
return (
|
21 |
+
<div className="wc-block-components-product-low-stock-badge">
|
22 |
{ sprintf(
|
23 |
/* translators: %d stock amount (number of items in stock for product) */
|
24 |
__( '%d left in stock', 'woo-gutenberg-products-block' ),
|
assets/js/base/components/cart-checkout/product-low-stock-badge/style.scss
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
.wc-block-low-stock-badge {
|
2 |
@include font-size(smaller);
|
3 |
-
|
4 |
-
border
|
5 |
-
border: 1px solid $black;
|
6 |
display: inline-block;
|
7 |
-
|
8 |
-
padding: 0
|
9 |
text-transform: uppercase;
|
10 |
white-space: nowrap;
|
11 |
}
|
1 |
+
.wc-block-components-product-low-stock-badge {
|
2 |
@include font-size(smaller);
|
3 |
+
border-radius: 2px;
|
4 |
+
border: 1px solid;
|
|
|
5 |
display: inline-block;
|
6 |
+
font-weight: 600;
|
7 |
+
padding: 0 0.66em;
|
8 |
text-transform: uppercase;
|
9 |
white-space: nowrap;
|
10 |
}
|
assets/js/base/components/cart-checkout/product-metadata/index.js
CHANGED
@@ -16,12 +16,16 @@ const ProductMetadata = ( {
|
|
16 |
variation = [],
|
17 |
} ) => {
|
18 |
return (
|
19 |
-
<div className="wc-block-product-metadata">
|
20 |
<ProductSummary
|
|
|
21 |
shortDescription={ shortDescription }
|
22 |
fullDescription={ fullDescription }
|
23 |
/>
|
24 |
-
<ProductVariationData
|
|
|
|
|
|
|
25 |
</div>
|
26 |
);
|
27 |
};
|
16 |
variation = [],
|
17 |
} ) => {
|
18 |
return (
|
19 |
+
<div className="wc-block-components-product-metadata">
|
20 |
<ProductSummary
|
21 |
+
className="wc-block-components-product-metadata__description"
|
22 |
shortDescription={ shortDescription }
|
23 |
fullDescription={ fullDescription }
|
24 |
/>
|
25 |
+
<ProductVariationData
|
26 |
+
className="wc-block-components-product-metadata__variation-data"
|
27 |
+
variation={ variation }
|
28 |
+
/>
|
29 |
</div>
|
30 |
);
|
31 |
};
|
assets/js/base/components/cart-checkout/product-metadata/style.scss
CHANGED
@@ -1,9 +1,8 @@
|
|
1 |
-
.wc-block-product-metadata {
|
2 |
@include font-size(smaller);
|
3 |
-
color: $core-grey-dark-400;
|
4 |
|
5 |
-
p,
|
6 |
-
.wc-block-product-
|
7 |
margin: 0.25em 0 0 0;
|
8 |
}
|
9 |
}
|
1 |
+
.wc-block-components-product-metadata {
|
2 |
@include font-size(smaller);
|
|
|
3 |
|
4 |
+
.wc-block-components-product-metadata__description > p,
|
5 |
+
.wc-block-components-product-metadata__variation-data {
|
6 |
margin: 0.25em 0 0 0;
|
7 |
}
|
8 |
}
|
assets/js/base/components/cart-checkout/product-name/index.js
CHANGED
@@ -14,7 +14,7 @@ const ProductName = ( { name, permalink, disabled } ) => {
|
|
14 |
// we use tabIndex -1 to prevent the link from being focused, pointer-events
|
15 |
// disabled click events, so we get an almost disabled link.
|
16 |
<a
|
17 |
-
className="wc-block-product-name"
|
18 |
href={ permalink }
|
19 |
tabIndex={ disabled ? -1 : 0 }
|
20 |
>
|
14 |
// we use tabIndex -1 to prevent the link from being focused, pointer-events
|
15 |
// disabled click events, so we get an almost disabled link.
|
16 |
<a
|
17 |
+
className="wc-block-components-product-name"
|
18 |
href={ permalink }
|
19 |
tabIndex={ disabled ? -1 : 0 }
|
20 |
>
|
assets/js/base/components/cart-checkout/product-name/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-product-name {
|
2 |
@include font-size(regular);
|
3 |
@include wrap-break-word();
|
4 |
display: block;
|
1 |
+
.wc-block-components-product-name {
|
2 |
@include font-size(regular);
|
3 |
@include wrap-break-word();
|
4 |
display: block;
|
assets/js/base/components/cart-checkout/product-price/index.js
CHANGED
@@ -14,40 +14,60 @@ import './style.scss';
|
|
14 |
const ProductPrice = ( { className, currency, regularValue, value } ) => {
|
15 |
const isDiscounted =
|
16 |
Number.isFinite( regularValue ) && regularValue !== value;
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
) }
|
26 |
-
</span>
|
27 |
<FormattedMonetaryAmount
|
28 |
className={ classNames(
|
29 |
-
'wc-block-product-
|
30 |
className
|
31 |
) }
|
32 |
currency={ currency }
|
33 |
value={ regularValue }
|
34 |
/>
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
) }
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
<FormattedMonetaryAmount
|
44 |
-
className={ classNames(
|
45 |
-
'
|
46 |
-
|
|
|
|
|
|
|
|
|
47 |
currency={ currency }
|
48 |
value={ value }
|
49 |
/>
|
50 |
-
|
51 |
);
|
52 |
};
|
53 |
|
14 |
const ProductPrice = ( { className, currency, regularValue, value } ) => {
|
15 |
const isDiscounted =
|
16 |
Number.isFinite( regularValue ) && regularValue !== value;
|
17 |
+
|
18 |
+
if ( isDiscounted ) {
|
19 |
+
return (
|
20 |
+
<span className="price wc-block-components-product-price">
|
21 |
+
<span className="screen-reader-text">
|
22 |
+
{ __( 'Previous price:', 'woo-gutenberg-products-block' ) }
|
23 |
+
</span>
|
24 |
+
<del>
|
|
|
|
|
25 |
<FormattedMonetaryAmount
|
26 |
className={ classNames(
|
27 |
+
'wc-block-components-product-price__regular',
|
28 |
className
|
29 |
) }
|
30 |
currency={ currency }
|
31 |
value={ regularValue }
|
32 |
/>
|
33 |
+
</del>
|
34 |
+
<span className="screen-reader-text">
|
35 |
+
{ __(
|
36 |
+
'Discounted price:',
|
37 |
+
'woo-gutenberg-products-block'
|
38 |
+
) }
|
39 |
+
</span>
|
40 |
+
<ins>
|
41 |
+
<FormattedMonetaryAmount
|
42 |
+
className={ classNames(
|
43 |
+
'wc-block-components-product-price__value',
|
44 |
+
className,
|
45 |
+
{
|
46 |
+
'is-discounted': isDiscounted,
|
47 |
+
}
|
48 |
) }
|
49 |
+
currency={ currency }
|
50 |
+
value={ value }
|
51 |
+
/>
|
52 |
+
</ins>
|
53 |
+
</span>
|
54 |
+
);
|
55 |
+
}
|
56 |
+
|
57 |
+
return (
|
58 |
+
<span className="price wc-block-components-product-price">
|
59 |
<FormattedMonetaryAmount
|
60 |
+
className={ classNames(
|
61 |
+
'wc-block-components-product-price__value',
|
62 |
+
className,
|
63 |
+
{
|
64 |
+
'is-discounted': isDiscounted,
|
65 |
+
}
|
66 |
+
) }
|
67 |
currency={ currency }
|
68 |
value={ value }
|
69 |
/>
|
70 |
+
</span>
|
71 |
);
|
72 |
};
|
73 |
|
assets/js/base/components/cart-checkout/product-price/style.scss
CHANGED
@@ -1,12 +1,5 @@
|
|
1 |
-
.wc-block-product-
|
2 |
-
color: $black;
|
3 |
-
|
4 |
&.is-discounted {
|
5 |
margin-left: 0.5em;
|
6 |
}
|
7 |
}
|
8 |
-
|
9 |
-
.wc-block-product-price--regular {
|
10 |
-
color: $core-grey-dark-400;
|
11 |
-
text-decoration: line-through;
|
12 |
-
}
|
1 |
+
.wc-block-components-product-price__value {
|
|
|
|
|
2 |
&.is-discounted {
|
3 |
margin-left: 0.5em;
|
4 |
}
|
5 |
}
|
|
|
|
|
|
|
|
|
|
assets/js/base/components/cart-checkout/product-sale-badge/index.js
CHANGED
@@ -25,10 +25,10 @@ const ProductSaleBadge = ( { currency, saleAmount } ) => {
|
|
25 |
return null;
|
26 |
}
|
27 |
return (
|
28 |
-
<div className="wc-block-sale-badge">
|
29 |
{ __experimentalCreateInterpolateElement(
|
30 |
/* translators: <price/> will be replaced by the discount amount */
|
31 |
-
__( 'Save <price
|
32 |
{
|
33 |
price: (
|
34 |
<FormattedMonetaryAmount
|
25 |
return null;
|
26 |
}
|
27 |
return (
|
28 |
+
<div className="wc-block-components-sale-badge">
|
29 |
{ __experimentalCreateInterpolateElement(
|
30 |
/* translators: <price/> will be replaced by the discount amount */
|
31 |
+
__( 'Save <price/>', 'woo-gutenberg-products-block' ),
|
32 |
{
|
33 |
price: (
|
34 |
<FormattedMonetaryAmount
|
assets/js/base/components/cart-checkout/product-sale-badge/style.scss
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
-
.wc-block-sale-badge {
|
2 |
@include font-size(smaller);
|
3 |
-
background-color: $core-grey-dark-600;
|
4 |
border-radius: 2px;
|
5 |
-
|
6 |
display: inline-block;
|
7 |
font-weight: 600;
|
8 |
-
letter-spacing: 0.0833em; // 1px/12px
|
9 |
padding: 0 0.66em;
|
10 |
text-transform: uppercase;
|
11 |
white-space: nowrap;
|
1 |
+
.wc-block-components-sale-badge {
|
2 |
@include font-size(smaller);
|
|
|
3 |
border-radius: 2px;
|
4 |
+
border: 1px solid;
|
5 |
display: inline-block;
|
6 |
font-weight: 600;
|
|
|
7 |
padding: 0 0.66em;
|
8 |
text-transform: uppercase;
|
9 |
white-space: nowrap;
|
assets/js/base/components/cart-checkout/product-summary/index.js
CHANGED
@@ -8,7 +8,11 @@ import { getSetting } from '@woocommerce/settings';
|
|
8 |
/**
|
9 |
* Returns an element containing a summary of the product.
|
10 |
*/
|
11 |
-
const ProductSummary = ( {
|
|
|
|
|
|
|
|
|
12 |
const source = shortDescription ? shortDescription : fullDescription;
|
13 |
|
14 |
if ( ! source ) {
|
@@ -16,11 +20,17 @@ const ProductSummary = ( { shortDescription = '', fullDescription = '' } ) => {
|
|
16 |
}
|
17 |
|
18 |
return (
|
19 |
-
<Summary
|
|
|
|
|
|
|
|
|
|
|
20 |
);
|
21 |
};
|
22 |
|
23 |
ProductSummary.propTypes = {
|
|
|
24 |
shortDescription: PropTypes.string,
|
25 |
fullDescription: PropTypes.string,
|
26 |
};
|
8 |
/**
|
9 |
* Returns an element containing a summary of the product.
|
10 |
*/
|
11 |
+
const ProductSummary = ( {
|
12 |
+
className,
|
13 |
+
shortDescription = '',
|
14 |
+
fullDescription = '',
|
15 |
+
} ) => {
|
16 |
const source = shortDescription ? shortDescription : fullDescription;
|
17 |
|
18 |
if ( ! source ) {
|
20 |
}
|
21 |
|
22 |
return (
|
23 |
+
<Summary
|
24 |
+
className={ className }
|
25 |
+
source={ source }
|
26 |
+
maxLength={ 15 }
|
27 |
+
countType={ getSetting( 'wordCountType', 'words' ) }
|
28 |
+
/>
|
29 |
);
|
30 |
};
|
31 |
|
32 |
ProductSummary.propTypes = {
|
33 |
+
className: PropTypes.string,
|
34 |
shortDescription: PropTypes.string,
|
35 |
fullDescription: PropTypes.string,
|
36 |
};
|
assets/js/base/components/cart-checkout/product-variation-data/index.js
CHANGED
@@ -3,11 +3,12 @@
|
|
3 |
*/
|
4 |
import { decodeEntities } from '@wordpress/html-entities';
|
5 |
import PropTypes from 'prop-types';
|
|
|
6 |
|
7 |
/**
|
8 |
* Returns a formatted element containing variation details.
|
9 |
*/
|
10 |
-
const ProductVariationData = ( { variation = [] } ) => {
|
11 |
if ( ! variation ) {
|
12 |
return null;
|
13 |
}
|
@@ -25,7 +26,12 @@ const ProductVariationData = ( { variation = [] } ) => {
|
|
25 |
.join( ' / ' );
|
26 |
|
27 |
return (
|
28 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
29 |
{ variationsText }
|
30 |
</div>
|
31 |
);
|
3 |
*/
|
4 |
import { decodeEntities } from '@wordpress/html-entities';
|
5 |
import PropTypes from 'prop-types';
|
6 |
+
import classNames from 'classnames';
|
7 |
|
8 |
/**
|
9 |
* Returns a formatted element containing variation details.
|
10 |
*/
|
11 |
+
const ProductVariationData = ( { className, variation = [] } ) => {
|
12 |
if ( ! variation ) {
|
13 |
return null;
|
14 |
}
|
26 |
.join( ' / ' );
|
27 |
|
28 |
return (
|
29 |
+
<div
|
30 |
+
className={ classNames(
|
31 |
+
'wc-block-components-product-variation-data',
|
32 |
+
className
|
33 |
+
) }
|
34 |
+
>
|
35 |
{ variationsText }
|
36 |
</div>
|
37 |
);
|
assets/js/base/components/cart-checkout/return-to-cart-button/style.scss
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
.wc-block-components-checkout-return-to-cart-button {
|
2 |
box-shadow: none;
|
3 |
-
color:
|
4 |
padding-left: calc(24px + 0.25em);
|
5 |
position: relative;
|
6 |
text-decoration: none;
|
1 |
.wc-block-components-checkout-return-to-cart-button {
|
2 |
box-shadow: none;
|
3 |
+
color: inherit;
|
4 |
padding-left: calc(24px + 0.25em);
|
5 |
position: relative;
|
6 |
text-decoration: none;
|
assets/js/base/components/cart-checkout/shipping-calculator/address.js
CHANGED
@@ -53,7 +53,7 @@ const ShippingCalculatorAddress = ( {
|
|
53 |
} );
|
54 |
|
55 |
return (
|
56 |
-
<form className="wc-block-shipping-calculator-address">
|
57 |
<AddressForm
|
58 |
fields={ addressFields }
|
59 |
fieldConfig={ fieldConfig }
|
@@ -61,7 +61,7 @@ const ShippingCalculatorAddress = ( {
|
|
61 |
values={ address }
|
62 |
/>
|
63 |
<Button
|
64 |
-
className="wc-block-shipping-calculator-address__button"
|
65 |
disabled={ isShallowEqual( address, initialAddress ) }
|
66 |
onClick={ ( e ) => {
|
67 |
e.preventDefault();
|
53 |
} );
|
54 |
|
55 |
return (
|
56 |
+
<form className="wc-block-components-shipping-calculator-address">
|
57 |
<AddressForm
|
58 |
fields={ addressFields }
|
59 |
fieldConfig={ fieldConfig }
|
61 |
values={ address }
|
62 |
/>
|
63 |
<Button
|
64 |
+
className="wc-block-components-shipping-calculator-address__button"
|
65 |
disabled={ isShallowEqual( address, initialAddress ) }
|
66 |
onClick={ ( e ) => {
|
67 |
e.preventDefault();
|
assets/js/base/components/cart-checkout/shipping-calculator/index.js
CHANGED
@@ -16,7 +16,7 @@ const ShippingCalculator = ( {
|
|
16 |
} ) => {
|
17 |
const { shippingAddress, setShippingAddress } = useShippingDataContext();
|
18 |
return (
|
19 |
-
<div className="wc-block-
|
20 |
<ShippingCalculatorAddress
|
21 |
address={ shippingAddress }
|
22 |
addressFields={ addressFields }
|
16 |
} ) => {
|
17 |
const { shippingAddress, setShippingAddress } = useShippingDataContext();
|
18 |
return (
|
19 |
+
<div className="wc-block-components-shipping-calculator">
|
20 |
<ShippingCalculatorAddress
|
21 |
address={ shippingAddress }
|
22 |
addressFields={ addressFields }
|
assets/js/base/components/cart-checkout/shipping-calculator/style.scss
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
.wc-block-shipping-calculator-address {
|
2 |
margin-bottom: 0;
|
3 |
}
|
4 |
|
5 |
-
.wc-block-shipping-calculator-address__button {
|
6 |
width: 100%;
|
7 |
}
|
8 |
|
9 |
-
.wc-block-
|
10 |
padding: em($gap-smaller) 0 em($gap-small);
|
11 |
}
|
1 |
+
.wc-block-components-shipping-calculator-address {
|
2 |
margin-bottom: 0;
|
3 |
}
|
4 |
|
5 |
+
.wc-block-components-shipping-calculator-address__button {
|
6 |
width: 100%;
|
7 |
}
|
8 |
|
9 |
+
.wc-block-components-shipping-calculator {
|
10 |
padding: em($gap-smaller) 0 em($gap-small);
|
11 |
}
|
assets/js/base/components/cart-checkout/shipping-location/index.js
CHANGED
@@ -41,7 +41,7 @@ const ShippingLocation = ( { address } ) => {
|
|
41 |
|
42 |
return (
|
43 |
formattedLocation && (
|
44 |
-
<span className="wc-block-
|
45 |
{ sprintf(
|
46 |
/* Translators: %s location. */
|
47 |
__( 'Shipping to %s', 'woo-gutenberg-products-block' ),
|
41 |
|
42 |
return (
|
43 |
formattedLocation && (
|
44 |
+
<span className="wc-block-components-shipping-address">
|
45 |
{ sprintf(
|
46 |
/* Translators: %s location. */
|
47 |
__( 'Shipping to %s', 'woo-gutenberg-products-block' ),
|
assets/js/base/components/cart-checkout/shipping-rates-control/package-options.js
CHANGED
@@ -21,7 +21,7 @@ const PackageOptions = ( {
|
|
21 |
<Notice
|
22 |
isDismissible={ false }
|
23 |
className={ classnames(
|
24 |
-
'wc-block-shipping-rates-control__no-results-notice',
|
25 |
'woocommerce-message',
|
26 |
'woocommerce-info'
|
27 |
) }
|
21 |
<Notice
|
22 |
isDismissible={ false }
|
23 |
className={ classnames(
|
24 |
+
'wc-block-components-shipping-rates-control__no-results-notice',
|
25 |
'woocommerce-message',
|
26 |
'woocommerce-info'
|
27 |
) }
|
assets/js/base/components/cart-checkout/shipping-rates-control/package.js
CHANGED
@@ -30,21 +30,21 @@ const Package = ( {
|
|
30 |
<>
|
31 |
{ title && (
|
32 |
<Title
|
33 |
-
className="wc-block-shipping-rates-control__package-title"
|
34 |
headingLevel="3"
|
35 |
>
|
36 |
{ title }
|
37 |
</Title>
|
38 |
) }
|
39 |
{ showItems && (
|
40 |
-
<ul className="wc-block-shipping-rates-control__package-items">
|
41 |
{ Object.values( shippingRate.items ).map( ( v ) => {
|
42 |
const name = decodeEntities( v.name );
|
43 |
const quantity = v.quantity;
|
44 |
return (
|
45 |
<li
|
46 |
key={ name }
|
47 |
-
className="wc-block-shipping-rates-control__package-item"
|
48 |
>
|
49 |
<Label
|
50 |
label={ `${ name } ×${ quantity }` }
|
@@ -80,7 +80,8 @@ const Package = ( {
|
|
80 |
if ( collapsible ) {
|
81 |
return (
|
82 |
<Panel
|
83 |
-
className="wc-block-shipping-rates-control__package"
|
|
|
84 |
initialOpen={ true }
|
85 |
title={ header }
|
86 |
>
|
@@ -91,7 +92,7 @@ const Package = ( {
|
|
91 |
return (
|
92 |
<div
|
93 |
className={ classNames(
|
94 |
-
'wc-block-shipping-rates-control__package',
|
95 |
className
|
96 |
) }
|
97 |
>
|
30 |
<>
|
31 |
{ title && (
|
32 |
<Title
|
33 |
+
className="wc-block-components-shipping-rates-control__package-title"
|
34 |
headingLevel="3"
|
35 |
>
|
36 |
{ title }
|
37 |
</Title>
|
38 |
) }
|
39 |
{ showItems && (
|
40 |
+
<ul className="wc-block-components-shipping-rates-control__package-items">
|
41 |
{ Object.values( shippingRate.items ).map( ( v ) => {
|
42 |
const name = decodeEntities( v.name );
|
43 |
const quantity = v.quantity;
|
44 |
return (
|
45 |
<li
|
46 |
key={ name }
|
47 |
+
className="wc-block-components-shipping-rates-control__package-item"
|
48 |
>
|
49 |
<Label
|
50 |
label={ `${ name } ×${ quantity }` }
|
80 |
if ( collapsible ) {
|
81 |
return (
|
82 |
<Panel
|
83 |
+
className="wc-block-components-shipping-rates-control__package"
|
84 |
+
hasBorder={ true }
|
85 |
initialOpen={ true }
|
86 |
title={ header }
|
87 |
>
|
92 |
return (
|
93 |
<div
|
94 |
className={ classNames(
|
95 |
+
'wc-block-components-shipping-rates-control__package',
|
96 |
className
|
97 |
) }
|
98 |
>
|
assets/js/base/components/cart-checkout/shipping-rates-control/packages.js
CHANGED
@@ -22,7 +22,7 @@ const Packages = ( {
|
|
22 |
);
|
23 |
/* eslint-disable camelcase */
|
24 |
return (
|
25 |
-
<div className="wc-block-shipping-rates-control">
|
26 |
{ shippingRates.map( ( { package_id, ...shippingRate } ) => (
|
27 |
<Package
|
28 |
key={ package_id }
|
22 |
);
|
23 |
/* eslint-disable camelcase */
|
24 |
return (
|
25 |
+
<div className="wc-block-components-shipping-rates-control">
|
26 |
{ shippingRates.map( ( { package_id, ...shippingRate } ) => (
|
27 |
<Package
|
28 |
key={ package_id }
|
assets/js/base/components/cart-checkout/shipping-rates-control/style.scss
CHANGED
@@ -1,64 +1,35 @@
|
|
1 |
-
.wc-block-shipping-rates-control__package {
|
2 |
-
.wc-block-shipping-rates-control__package-title {
|
3 |
margin: 0;
|
4 |
}
|
5 |
}
|
6 |
|
7 |
-
.wc-block-shipping-rates-control__package-items {
|
8 |
@include font-size(small);
|
9 |
-
color: $core-grey-dark-400;
|
10 |
display: block;
|
11 |
list-style: none;
|
12 |
margin: 0;
|
13 |
padding: 0;
|
14 |
}
|
15 |
|
16 |
-
.wc-block-shipping-rates-control__package-item {
|
17 |
@include wrap-break-word();
|
18 |
display: inline-block;
|
19 |
margin: 0;
|
20 |
padding: 0;
|
21 |
}
|
22 |
|
23 |
-
.wc-block-shipping-rates-control__package-item:not(:last-child)::after {
|
24 |
content: ", ";
|
25 |
white-space: pre;
|
26 |
}
|
27 |
|
28 |
-
.wc-block-
|
29 |
-
.wc-block-cart__shipping-address button {
|
30 |
-
color: $core-grey-dark-400;
|
31 |
-
}
|
32 |
-
|
33 |
-
.components-notice.wc-block-shipping-rates-control__no-results-notice {
|
34 |
margin-bottom: 0;
|
35 |
}
|
36 |
|
37 |
-
|
38 |
-
.wc-
|
39 |
-
|
40 |
-
border-bottom: none;
|
41 |
-
|
42 |
-
&,
|
43 |
-
&.is-opened {
|
44 |
-
padding-bottom: 0;
|
45 |
-
}
|
46 |
-
|
47 |
-
.wc-block-shipping-rates-control__package-items {
|
48 |
-
margin: 0;
|
49 |
-
}
|
50 |
-
|
51 |
-
.wc-block-radio-control {
|
52 |
-
width: 100%;
|
53 |
-
}
|
54 |
-
|
55 |
-
.wc-block-radio-control__option {
|
56 |
-
margin-right: 0;
|
57 |
-
max-width: none;
|
58 |
-
|
59 |
-
&:first-child {
|
60 |
-
border-top: 1px solid $core-grey-light-600;
|
61 |
-
}
|
62 |
-
}
|
63 |
}
|
64 |
}
|
1 |
+
.wc-block-components-shipping-rates-control__package {
|
2 |
+
.wc-block-components-shipping-rates-control__package-title {
|
3 |
margin: 0;
|
4 |
}
|
5 |
}
|
6 |
|
7 |
+
.wc-block-components-shipping-rates-control__package-items {
|
8 |
@include font-size(small);
|
|
|
9 |
display: block;
|
10 |
list-style: none;
|
11 |
margin: 0;
|
12 |
padding: 0;
|
13 |
}
|
14 |
|
15 |
+
.wc-block-components-shipping-rates-control__package-item {
|
16 |
@include wrap-break-word();
|
17 |
display: inline-block;
|
18 |
margin: 0;
|
19 |
padding: 0;
|
20 |
}
|
21 |
|
22 |
+
.wc-block-components-shipping-rates-control__package-item:not(:last-child)::after {
|
23 |
content: ", ";
|
24 |
white-space: pre;
|
25 |
}
|
26 |
|
27 |
+
.components-notice.wc-block-components-shipping-rates-control__no-results-notice {
|
|
|
|
|
|
|
|
|
|
|
28 |
margin-bottom: 0;
|
29 |
}
|
30 |
|
31 |
+
.wc-block-components-shipping-rates-control {
|
32 |
+
.wc-blocks-components-panel__content {
|
33 |
+
padding-bottom: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
}
|
assets/js/base/components/cart-checkout/totals/totals-coupon-code-input/index.js
CHANGED
@@ -39,11 +39,12 @@ const TotalsCouponCodeInput = ( {
|
|
39 |
}
|
40 |
}, [ isLoading, couponValue, validationError ] );
|
41 |
|
42 |
-
const textInputId = `wc-block-
|
43 |
|
44 |
return (
|
45 |
<Panel
|
46 |
-
className="wc-block-coupon
|
|
|
47 |
initialOpen={ initialOpen }
|
48 |
title={
|
49 |
<Label
|
@@ -68,12 +69,12 @@ const TotalsCouponCodeInput = ( {
|
|
68 |
isLoading={ isLoading }
|
69 |
showSpinner={ false }
|
70 |
>
|
71 |
-
<div className="wc-block-
|
72 |
-
<form className="wc-block-
|
73 |
<ValidatedTextInput
|
74 |
id={ textInputId }
|
75 |
errorId="coupon"
|
76 |
-
className="wc-block-
|
77 |
label={ __(
|
78 |
'Enter code',
|
79 |
'woo-gutenberg-products-block'
|
@@ -90,7 +91,7 @@ const TotalsCouponCodeInput = ( {
|
|
90 |
showError={ false }
|
91 |
/>
|
92 |
<Button
|
93 |
-
className="wc-block-
|
94 |
disabled={ isLoading || ! couponValue }
|
95 |
showSpinner={ isLoading }
|
96 |
onClick={ ( e ) => {
|
39 |
}
|
40 |
}, [ isLoading, couponValue, validationError ] );
|
41 |
|
42 |
+
const textInputId = `wc-block-components-totals-coupon__input-${ instanceId }`;
|
43 |
|
44 |
return (
|
45 |
<Panel
|
46 |
+
className="wc-block-components-totals-coupon"
|
47 |
+
hasBorder={ true }
|
48 |
initialOpen={ initialOpen }
|
49 |
title={
|
50 |
<Label
|
69 |
isLoading={ isLoading }
|
70 |
showSpinner={ false }
|
71 |
>
|
72 |
+
<div className="wc-block-components-totals-coupon__content">
|
73 |
+
<form className="wc-block-components-totals-coupon__form">
|
74 |
<ValidatedTextInput
|
75 |
id={ textInputId }
|
76 |
errorId="coupon"
|
77 |
+
className="wc-block-components-totals-coupon__input"
|
78 |
label={ __(
|
79 |
'Enter code',
|
80 |
'woo-gutenberg-products-block'
|
91 |
showError={ false }
|
92 |
/>
|
93 |
<Button
|
94 |
+
className="wc-block-components-totals-coupon__button"
|
95 |
disabled={ isLoading || ! couponValue }
|
96 |
showSpinner={ isLoading }
|
97 |
onClick={ ( e ) => {
|
assets/js/base/components/cart-checkout/totals/totals-coupon-code-input/style.scss
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
.wc-block-
|
2 |
display: flex;
|
3 |
margin-bottom: 0;
|
4 |
width: 100%;
|
5 |
|
6 |
-
.wc-block-
|
7 |
margin-bottom: 0;
|
8 |
margin-top: 0;
|
9 |
flex-grow: 1;
|
10 |
}
|
11 |
|
12 |
-
.wc-block-
|
13 |
height: 48px;
|
14 |
flex-shrink: 0;
|
15 |
margin-left: $gap-smaller;
|
@@ -19,11 +19,11 @@
|
|
19 |
}
|
20 |
}
|
21 |
|
22 |
-
.wc-block-
|
23 |
flex-direction: column;
|
24 |
position: relative;
|
25 |
|
26 |
-
.wc-block-
|
27 |
margin-top: $gap-smaller;
|
28 |
position: relative;
|
29 |
width: 100%;
|
1 |
+
.wc-block-components-totals-coupon__form {
|
2 |
display: flex;
|
3 |
margin-bottom: 0;
|
4 |
width: 100%;
|
5 |
|
6 |
+
.wc-block-components-totals-coupon__input {
|
7 |
margin-bottom: 0;
|
8 |
margin-top: 0;
|
9 |
flex-grow: 1;
|
10 |
}
|
11 |
|
12 |
+
.wc-block-components-totals-coupon__button {
|
13 |
height: 48px;
|
14 |
flex-shrink: 0;
|
15 |
margin-left: $gap-smaller;
|
19 |
}
|
20 |
}
|
21 |
|
22 |
+
.wc-block-components-totals-coupon__content {
|
23 |
flex-direction: column;
|
24 |
position: relative;
|
25 |
|
26 |
+
.wc-block-components-validation-error {
|
27 |
margin-top: $gap-smaller;
|
28 |
position: relative;
|
29 |
width: 100%;
|
assets/js/base/components/cart-checkout/totals/totals-discount-item/index.js
CHANGED
@@ -11,6 +11,7 @@ import PropTypes from 'prop-types';
|
|
11 |
* Internal dependencies
|
12 |
*/
|
13 |
import TotalsItem from '../totals-item';
|
|
|
14 |
|
15 |
const TotalsDiscountItem = ( {
|
16 |
cartCoupons = [],
|
@@ -36,6 +37,7 @@ const TotalsDiscountItem = ( {
|
|
36 |
|
37 |
return (
|
38 |
<TotalsItem
|
|
|
39 |
currency={ currency }
|
40 |
description={
|
41 |
cartCoupons.length !== 0 && (
|
@@ -47,11 +49,11 @@ const TotalsDiscountItem = ( {
|
|
47 |
isLoading={ isRemovingCoupon }
|
48 |
showSpinner={ false }
|
49 |
>
|
50 |
-
<ul className="wc-block-
|
51 |
{ cartCoupons.map( ( cartCoupon ) => (
|
52 |
<Chip
|
53 |
key={ 'coupon-' + cartCoupon.code }
|
54 |
-
className="wc-block-
|
55 |
text={ cartCoupon.code }
|
56 |
screenReaderText={ sprintf(
|
57 |
/* Translators: %s Coupon code. */
|
11 |
* Internal dependencies
|
12 |
*/
|
13 |
import TotalsItem from '../totals-item';
|
14 |
+
import './style.scss';
|
15 |
|
16 |
const TotalsDiscountItem = ( {
|
17 |
cartCoupons = [],
|
37 |
|
38 |
return (
|
39 |
<TotalsItem
|
40 |
+
className="wc-block-components-totals-discount"
|
41 |
currency={ currency }
|
42 |
description={
|
43 |
cartCoupons.length !== 0 && (
|
49 |
isLoading={ isRemovingCoupon }
|
50 |
showSpinner={ false }
|
51 |
>
|
52 |
+
<ul className="wc-block-components-totals-discount__coupon-list">
|
53 |
{ cartCoupons.map( ( cartCoupon ) => (
|
54 |
<Chip
|
55 |
key={ 'coupon-' + cartCoupon.code }
|
56 |
+
className="wc-block-components-totals-discount__coupon-list-item"
|
57 |
text={ cartCoupon.code }
|
58 |
screenReaderText={ sprintf(
|
59 |
/* Translators: %s Coupon code. */
|
assets/js/base/components/cart-checkout/totals/totals-discount-item/style.scss
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wc-block-components-totals-discount__coupon-list {
|
2 |
+
list-style: none;
|
3 |
+
margin: 0;
|
4 |
+
padding: 0;
|
5 |
+
}
|
assets/js/base/components/cart-checkout/totals/totals-fees-item/index.js
CHANGED
@@ -27,6 +27,7 @@ const TotalsFeesItem = ( { currency, values } ) => {
|
|
27 |
|
28 |
return (
|
29 |
<TotalsItem
|
|
|
30 |
currency={ currency }
|
31 |
label={ __( 'Fees', 'woo-gutenberg-products-block' ) }
|
32 |
value={
|
27 |
|
28 |
return (
|
29 |
<TotalsItem
|
30 |
+
className="wc-block-components-totals-fees"
|
31 |
currency={ currency }
|
32 |
label={ __( 'Fees', 'woo-gutenberg-products-block' ) }
|
33 |
value={
|
assets/js/base/components/cart-checkout/totals/totals-footer-item/index.js
CHANGED
@@ -18,13 +18,13 @@ const TotalsFooterItem = ( { currency, values } ) => {
|
|
18 |
|
19 |
return (
|
20 |
<TotalsItem
|
21 |
-
className="wc-block-totals-footer-item"
|
22 |
currency={ currency }
|
23 |
label={ __( 'Total', 'woo-gutenberg-products-block' ) }
|
24 |
value={ parseInt( totalPrice, 10 ) }
|
25 |
description={
|
26 |
DISPLAY_CART_PRICES_INCLUDING_TAX && (
|
27 |
-
<p className="wc-block-totals-footer-item-tax">
|
28 |
{ __experimentalCreateInterpolateElement(
|
29 |
__(
|
30 |
'Including <TaxAmount/> in taxes',
|
@@ -33,7 +33,7 @@ const TotalsFooterItem = ( { currency, values } ) => {
|
|
33 |
{
|
34 |
TaxAmount: (
|
35 |
<FormattedMonetaryAmount
|
36 |
-
className="wc-block-totals-footer-item-tax-value"
|
37 |
currency={ currency }
|
38 |
displayType="text"
|
39 |
value={ parseInt( totalTax, 10 ) }
|
18 |
|
19 |
return (
|
20 |
<TotalsItem
|
21 |
+
className="wc-block-components-totals-footer-item"
|
22 |
currency={ currency }
|
23 |
label={ __( 'Total', 'woo-gutenberg-products-block' ) }
|
24 |
value={ parseInt( totalPrice, 10 ) }
|
25 |
description={
|
26 |
DISPLAY_CART_PRICES_INCLUDING_TAX && (
|
27 |
+
<p className="wc-block-components-totals-footer-item-tax">
|
28 |
{ __experimentalCreateInterpolateElement(
|
29 |
__(
|
30 |
'Including <TaxAmount/> in taxes',
|
33 |
{
|
34 |
TaxAmount: (
|
35 |
<FormattedMonetaryAmount
|
36 |
+
className="wc-block-components-totals-footer-item-tax-value"
|
37 |
currency={ currency }
|
38 |
displayType="text"
|
39 |
value={ parseInt( totalTax, 10 ) }
|
assets/js/base/components/cart-checkout/totals/totals-footer-item/style.scss
CHANGED
@@ -1,15 +1,14 @@
|
|
1 |
-
.wc-block-totals-footer-item {
|
2 |
-
.wc-block-totals-
|
3 |
-
.wc-block-totals-
|
4 |
@include font-size(large);
|
5 |
-
color: #000;
|
6 |
}
|
7 |
|
8 |
-
.wc-block-totals-
|
9 |
font-weight: normal;
|
10 |
}
|
11 |
|
12 |
-
.wc-block-totals-footer-item-tax {
|
13 |
margin-bottom: 0;
|
14 |
}
|
15 |
}
|
1 |
+
.wc-block-components-totals-footer-item {
|
2 |
+
.wc-block-components-totals-item__value,
|
3 |
+
.wc-block-components-totals-item__label {
|
4 |
@include font-size(large);
|
|
|
5 |
}
|
6 |
|
7 |
+
.wc-block-components-totals-item__label {
|
8 |
font-weight: normal;
|
9 |
}
|
10 |
|
11 |
+
.wc-block-components-totals-footer-item-tax {
|
12 |
margin-bottom: 0;
|
13 |
}
|
14 |
}
|
assets/js/base/components/cart-checkout/totals/totals-item/index.js
CHANGED
@@ -14,22 +14,27 @@ import './style.scss';
|
|
14 |
const TotalsItem = ( { className, currency, label, value, description } ) => {
|
15 |
return (
|
16 |
<div
|
17 |
-
className={ classnames(
|
|
|
|
|
|
|
18 |
>
|
19 |
-
<span className="wc-block-totals-
|
|
|
|
|
20 |
{ isValidElement( value ) ? (
|
21 |
-
<div className="wc-block-totals-
|
22 |
{ value }
|
23 |
</div>
|
24 |
) : (
|
25 |
<FormattedMonetaryAmount
|
26 |
-
className="wc-block-totals-
|
27 |
currency={ currency }
|
28 |
displayType="text"
|
29 |
value={ value }
|
30 |
/>
|
31 |
) }
|
32 |
-
<div className="wc-block-totals-
|
33 |
{ description }
|
34 |
</div>
|
35 |
</div>
|
14 |
const TotalsItem = ( { className, currency, label, value, description } ) => {
|
15 |
return (
|
16 |
<div
|
17 |
+
className={ classnames(
|
18 |
+
'wc-block-components-totals-item',
|
19 |
+
className
|
20 |
+
) }
|
21 |
>
|
22 |
+
<span className="wc-block-components-totals-item__label">
|
23 |
+
{ label }
|
24 |
+
</span>
|
25 |
{ isValidElement( value ) ? (
|
26 |
+
<div className="wc-block-components-totals-item__value">
|
27 |
{ value }
|
28 |
</div>
|
29 |
) : (
|
30 |
<FormattedMonetaryAmount
|
31 |
+
className="wc-block-components-totals-item__value"
|
32 |
currency={ currency }
|
33 |
displayType="text"
|
34 |
value={ value }
|
35 |
/>
|
36 |
) }
|
37 |
+
<div className="wc-block-components-totals-item__description">
|
38 |
{ description }
|
39 |
</div>
|
40 |
</div>
|
assets/js/base/components/cart-checkout/totals/totals-item/style.scss
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
.wc-block-totals-
|
2 |
display: flex;
|
3 |
flex-wrap: wrap;
|
4 |
padding: em($gap-small) 0;
|
5 |
width: 100%;
|
6 |
}
|
7 |
|
8 |
-
.wc-block-totals-
|
9 |
flex-grow: 1;
|
10 |
font-weight: bold;
|
11 |
}
|
12 |
|
13 |
-
.wc-block-totals-
|
14 |
white-space: nowrap;
|
15 |
}
|
16 |
|
17 |
-
.wc-block-totals-
|
18 |
@include font-size(small);
|
19 |
width: 100%;
|
20 |
}
|
1 |
+
.wc-block-components-totals-item {
|
2 |
display: flex;
|
3 |
flex-wrap: wrap;
|
4 |
padding: em($gap-small) 0;
|
5 |
width: 100%;
|
6 |
}
|
7 |
|
8 |
+
.wc-block-components-totals-item__label {
|
9 |
flex-grow: 1;
|
10 |
font-weight: bold;
|
11 |
}
|
12 |
|
13 |
+
.wc-block-components-totals-item__value {
|
14 |
white-space: nowrap;
|
15 |
}
|
16 |
|
17 |
+
.wc-block-components-totals-item__description {
|
18 |
@include font-size(small);
|
19 |
width: 100%;
|
20 |
}
|
assets/js/base/components/cart-checkout/totals/totals-shipping-item/index.js
CHANGED
@@ -50,12 +50,12 @@ const TotalsShippingItem = ( {
|
|
50 |
return (
|
51 |
<>
|
52 |
<TotalsItem
|
53 |
-
className="wc-block-
|
54 |
label={ __( 'Shipping', 'woo-gutenberg-products-block' ) }
|
55 |
value={
|
56 |
showCalculator ? (
|
57 |
<button
|
58 |
-
className="wc-block-
|
59 |
onClick={ () => {
|
60 |
setIsShippingCalculatorOpen(
|
61 |
! isShippingCalculatorOpen
|
@@ -89,7 +89,7 @@ const TotalsShippingItem = ( {
|
|
89 |
}
|
90 |
|
91 |
return (
|
92 |
-
<div className="wc-block-
|
93 |
<TotalsItem
|
94 |
label={ __( 'Shipping', 'woo-gutenberg-products-block' ) }
|
95 |
value={ totalShippingValue ? totalShippingValue : '' }
|
@@ -98,12 +98,13 @@ const TotalsShippingItem = ( {
|
|
98 |
<ShippingLocation address={ shippingAddress } />{ ' ' }
|
99 |
{ showCalculator && (
|
100 |
<button
|
101 |
-
className="wc-block-
|
102 |
onClick={ () => {
|
103 |
setIsShippingCalculatorOpen(
|
104 |
! isShippingCalculatorOpen
|
105 |
);
|
106 |
} }
|
|
|
107 |
>
|
108 |
{ __(
|
109 |
'(change address)',
|
50 |
return (
|
51 |
<>
|
52 |
<TotalsItem
|
53 |
+
className="wc-block-components-totals-shipping"
|
54 |
label={ __( 'Shipping', 'woo-gutenberg-products-block' ) }
|
55 |
value={
|
56 |
showCalculator ? (
|
57 |
<button
|
58 |
+
className="wc-block-components-totals-shipping__change-address-button"
|
59 |
onClick={ () => {
|
60 |
setIsShippingCalculatorOpen(
|
61 |
! isShippingCalculatorOpen
|
89 |
}
|
90 |
|
91 |
return (
|
92 |
+
<div className="wc-block-components-totals-shipping">
|
93 |
<TotalsItem
|
94 |
label={ __( 'Shipping', 'woo-gutenberg-products-block' ) }
|
95 |
value={ totalShippingValue ? totalShippingValue : '' }
|
98 |
<ShippingLocation address={ shippingAddress } />{ ' ' }
|
99 |
{ showCalculator && (
|
100 |
<button
|
101 |
+
className="wc-block-components-totals-shipping__change-address-button"
|
102 |
onClick={ () => {
|
103 |
setIsShippingCalculatorOpen(
|
104 |
! isShippingCalculatorOpen
|
105 |
);
|
106 |
} }
|
107 |
+
aria-expanded={ isShippingCalculatorOpen }
|
108 |
>
|
109 |
{ __(
|
110 |
'(change address)',
|
assets/js/base/components/cart-checkout/totals/totals-shipping-item/shipping-rate-selector.js
CHANGED
@@ -6,23 +6,31 @@ import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-mone
|
|
6 |
import { decodeEntities } from '@wordpress/html-entities';
|
7 |
import { getCurrencyFromPriceResponse } from '@woocommerce/base-utils';
|
8 |
import { ShippingRatesControl } from '@woocommerce/base-components/cart-checkout';
|
|
|
9 |
|
10 |
-
const renderShippingRatesControlOption = ( option ) =>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
const ShippingRateSelector = ( {
|
28 |
hasRates,
|
@@ -30,7 +38,7 @@ const ShippingRateSelector = ( {
|
|
30 |
shippingRatesLoading,
|
31 |
} ) => {
|
32 |
return (
|
33 |
-
<fieldset className="wc-block-
|
34 |
<legend className="screen-reader-text">
|
35 |
{ hasRates
|
36 |
? __( 'Shipping options', 'woo-gutenberg-products-block' )
|
@@ -40,7 +48,7 @@ const ShippingRateSelector = ( {
|
|
40 |
) }
|
41 |
</legend>
|
42 |
<ShippingRatesControl
|
43 |
-
className="wc-block-
|
44 |
collapsibleWhenMultiple={ true }
|
45 |
noResultsMessage={ __(
|
46 |
'No shipping options were found.',
|
6 |
import { decodeEntities } from '@wordpress/html-entities';
|
7 |
import { getCurrencyFromPriceResponse } from '@woocommerce/base-utils';
|
8 |
import { ShippingRatesControl } from '@woocommerce/base-components/cart-checkout';
|
9 |
+
import { DISPLAY_CART_PRICES_INCLUDING_TAX } from '@woocommerce/block-settings';
|
10 |
|
11 |
+
const renderShippingRatesControlOption = ( option ) => {
|
12 |
+
const priceWithTaxes = DISPLAY_CART_PRICES_INCLUDING_TAX
|
13 |
+
? parseInt( option.price, 10 ) + parseInt( option.taxes, 10 )
|
14 |
+
: parseInt( option.price, 10 );
|
15 |
+
return {
|
16 |
+
label: decodeEntities( option.name ),
|
17 |
+
value: option.rate_id,
|
18 |
+
description: (
|
19 |
+
<>
|
20 |
+
{ Number.isFinite( priceWithTaxes ) && (
|
21 |
+
<FormattedMonetaryAmount
|
22 |
+
currency={ getCurrencyFromPriceResponse( option ) }
|
23 |
+
value={ priceWithTaxes }
|
24 |
+
/>
|
25 |
+
) }
|
26 |
+
{ Number.isFinite( priceWithTaxes ) && option.delivery_time
|
27 |
+
? ' — '
|
28 |
+
: null }
|
29 |
+
{ decodeEntities( option.delivery_time ) }
|
30 |
+
</>
|
31 |
+
),
|
32 |
+
};
|
33 |
+
};
|
34 |
|
35 |
const ShippingRateSelector = ( {
|
36 |
hasRates,
|
38 |
shippingRatesLoading,
|
39 |
} ) => {
|
40 |
return (
|
41 |
+
<fieldset className="wc-block-components-totals-shipping__fieldset">
|
42 |
<legend className="screen-reader-text">
|
43 |
{ hasRates
|
44 |
? __( 'Shipping options', 'woo-gutenberg-products-block' )
|
48 |
) }
|
49 |
</legend>
|
50 |
<ShippingRatesControl
|
51 |
+
className="wc-block-components-totals-shipping__options"
|
52 |
collapsibleWhenMultiple={ true }
|
53 |
noResultsMessage={ __(
|
54 |
'No shipping options were found.',
|
assets/js/base/components/cart-checkout/totals/totals-shipping-item/style.scss
CHANGED
@@ -1,29 +1,34 @@
|
|
1 |
-
.wc-block-
|
2 |
// Added extra label for specificity.
|
3 |
-
fieldset.wc-block-
|
4 |
background-color: transparent;
|
5 |
margin: 0;
|
6 |
padding: 0;
|
7 |
border: 0;
|
8 |
}
|
9 |
|
10 |
-
.wc-block-
|
11 |
-
.wc-block-radio-control__label,
|
12 |
-
.wc-block-radio-control__description,
|
13 |
-
.wc-block-radio-control__secondary-label,
|
14 |
-
.wc-block-radio-control__secondary-description {
|
15 |
flex-basis: 100%;
|
16 |
text-align: left;
|
17 |
}
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
}
|
24 |
}
|
25 |
|
26 |
-
.wc-block-shipping-
|
|
|
|
|
|
|
|
|
27 |
@include link-button();
|
28 |
|
29 |
&:hover,
|
@@ -32,4 +37,8 @@
|
|
32 |
opacity: 0.8;
|
33 |
}
|
34 |
}
|
|
|
|
|
|
|
|
|
35 |
}
|
1 |
+
.wc-block-components-totals-shipping {
|
2 |
// Added extra label for specificity.
|
3 |
+
fieldset.wc-block-components-totals-shipping__fieldset {
|
4 |
background-color: transparent;
|
5 |
margin: 0;
|
6 |
padding: 0;
|
7 |
border: 0;
|
8 |
}
|
9 |
|
10 |
+
.wc-block-components-totals-shipping__options {
|
11 |
+
.wc-block-components-radio-control__label,
|
12 |
+
.wc-block-components-radio-control__description,
|
13 |
+
.wc-block-components-radio-control__secondary-label,
|
14 |
+
.wc-block-components-radio-control__secondary-description {
|
15 |
flex-basis: 100%;
|
16 |
text-align: left;
|
17 |
}
|
18 |
+
}
|
19 |
|
20 |
+
.wc-block-components-radio-control__option,
|
21 |
+
.wc-block-components-radio-control__option-layout {
|
22 |
+
&:last-child::after {
|
23 |
+
display: none;
|
24 |
}
|
25 |
}
|
26 |
|
27 |
+
.wc-block-components-shipping-rates-control__no-results-notice {
|
28 |
+
margin-bottom: em($gap-small);
|
29 |
+
}
|
30 |
+
|
31 |
+
.wc-block-components-totals-shipping__change-address-button {
|
32 |
@include link-button();
|
33 |
|
34 |
&:hover,
|
37 |
opacity: 0.8;
|
38 |
}
|
39 |
}
|
40 |
+
|
41 |
+
.wc-blocks-components-panel:last-child::after {
|
42 |
+
border-bottom-width: 0;
|
43 |
+
}
|
44 |
}
|
assets/js/base/components/cart-checkout/totals/totals-taxes-item/index.js
CHANGED
@@ -12,6 +12,7 @@ import {
|
|
12 |
* Internal dependencies
|
13 |
*/
|
14 |
import TotalsItem from '../totals-item';
|
|
|
15 |
|
16 |
const TotalsTaxesItem = ( { currency, values } ) => {
|
17 |
const { total_tax: totalTax, tax_lines: taxLines } = values;
|
@@ -23,6 +24,7 @@ const TotalsTaxesItem = ( { currency, values } ) => {
|
|
23 |
if ( ! DISPLAY_ITEMIZED_TAXES ) {
|
24 |
return (
|
25 |
<TotalsItem
|
|
|
26 |
currency={ currency }
|
27 |
label={ __( 'Taxes', 'woo-gutenberg-products-block' ) }
|
28 |
value={ parseInt( totalTax, 10 ) }
|
@@ -35,6 +37,7 @@ const TotalsTaxesItem = ( { currency, values } ) => {
|
|
35 |
{ taxLines.map( ( { name, price }, i ) => (
|
36 |
<TotalsItem
|
37 |
key={ `tax-line-${ i }` }
|
|
|
38 |
currency={ currency }
|
39 |
label={ name }
|
40 |
value={ parseInt( price, 10 ) }
|
12 |
* Internal dependencies
|
13 |
*/
|
14 |
import TotalsItem from '../totals-item';
|
15 |
+
import './style.scss';
|
16 |
|
17 |
const TotalsTaxesItem = ( { currency, values } ) => {
|
18 |
const { total_tax: totalTax, tax_lines: taxLines } = values;
|
24 |
if ( ! DISPLAY_ITEMIZED_TAXES ) {
|
25 |
return (
|
26 |
<TotalsItem
|
27 |
+
className="wc-block-components-totals-taxes"
|
28 |
currency={ currency }
|
29 |
label={ __( 'Taxes', 'woo-gutenberg-products-block' ) }
|
30 |
value={ parseInt( totalTax, 10 ) }
|
37 |
{ taxLines.map( ( { name, price }, i ) => (
|
38 |
<TotalsItem
|
39 |
key={ `tax-line-${ i }` }
|
40 |
+
className="wc-block-components-totals-taxes"
|
41 |
currency={ currency }
|
42 |
label={ name }
|
43 |
value={ parseInt( price, 10 ) }
|
assets/js/base/components/cart-checkout/totals/totals-taxes-item/style.scss
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.wc-block-components-totals-taxes {
|
2 |
+
@include with-translucent-border(1px 0 0);
|
3 |
+
}
|
assets/js/base/components/checkbox-control/index.js
CHANGED
@@ -25,17 +25,22 @@ const CheckboxControl = ( {
|
|
25 |
|
26 |
return (
|
27 |
<label
|
28 |
-
className={ classNames(
|
|
|
|
|
|
|
29 |
htmlFor={ checkboxId }
|
30 |
>
|
31 |
<input
|
32 |
id={ checkboxId }
|
33 |
-
className="wc-block-checkbox__input"
|
34 |
type="checkbox"
|
35 |
onChange={ ( event ) => onChange( event.target.checked ) }
|
36 |
{ ...rest }
|
37 |
/>
|
38 |
-
<span className="wc-block-checkbox__label">
|
|
|
|
|
39 |
</label>
|
40 |
);
|
41 |
};
|
25 |
|
26 |
return (
|
27 |
<label
|
28 |
+
className={ classNames(
|
29 |
+
'wc-block-components-checkbox',
|
30 |
+
className
|
31 |
+
) }
|
32 |
htmlFor={ checkboxId }
|
33 |
>
|
34 |
<input
|
35 |
id={ checkboxId }
|
36 |
+
className="wc-block-components-checkbox__input"
|
37 |
type="checkbox"
|
38 |
onChange={ ( event ) => onChange( event.target.checked ) }
|
39 |
{ ...rest }
|
40 |
/>
|
41 |
+
<span className="wc-block-components-checkbox__label">
|
42 |
+
{ label }
|
43 |
+
</span>
|
44 |
</label>
|
45 |
);
|
46 |
};
|
assets/js/base/components/checkbox-control/style.scss
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
.wc-block-checkbox {
|
2 |
@include reset-typography();
|
3 |
display: block;
|
4 |
position: relative;
|
5 |
|
6 |
-
.wc-block-checkbox__input[type="checkbox"] {
|
7 |
appearance: none;
|
8 |
border: 1px solid currentColor;
|
9 |
height: 1rem;
|
@@ -34,7 +34,7 @@
|
|
34 |
}
|
35 |
}
|
36 |
|
37 |
-
.wc-block-checkbox__input[type="checkbox"] + .wc-block-checkbox__label {
|
38 |
padding-left: $gap-smaller;
|
39 |
vertical-align: middle;
|
40 |
}
|
1 |
+
.wc-block-components-checkbox {
|
2 |
@include reset-typography();
|
3 |
display: block;
|
4 |
position: relative;
|
5 |
|
6 |
+
.wc-block-components-checkbox__input[type="checkbox"] {
|
7 |
appearance: none;
|
8 |
border: 1px solid currentColor;
|
9 |
height: 1rem;
|
34 |
}
|
35 |
}
|
36 |
|
37 |
+
.wc-block-components-checkbox__input[type="checkbox"] + .wc-block-components-checkbox__label {
|
38 |
padding-left: $gap-smaller;
|
39 |
vertical-align: middle;
|
40 |
}
|
assets/js/base/components/checkbox-list/index.js
CHANGED
@@ -142,6 +142,7 @@ const CheckboxList = ( {
|
|
142 |
|
143 |
const classes = classNames(
|
144 |
'wc-block-checkbox-list',
|
|
|
145 |
{
|
146 |
'is-loading': isLoading,
|
147 |
},
|
142 |
|
143 |
const classes = classNames(
|
144 |
'wc-block-checkbox-list',
|
145 |
+
'wc-block-components-checkbox-list',
|
146 |
{
|
147 |
'is-loading': isLoading,
|
148 |
},
|
assets/js/base/components/checkbox-list/style.scss
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
.editor-styles-wrapper .wc-block-checkbox-list,
|
2 |
-
.wc-block-checkbox-list {
|
3 |
margin: 0;
|
4 |
padding: 0;
|
5 |
list-style: none outside;
|
1 |
+
.editor-styles-wrapper .wc-block-components-checkbox-list,
|
2 |
+
.wc-block-components-checkbox-list {
|
3 |
margin: 0;
|
4 |
padding: 0;
|
5 |
list-style: none outside;
|
assets/js/base/components/country-input/country-input.js
CHANGED
@@ -32,7 +32,12 @@ const CountryInput = ( {
|
|
32 |
} ) );
|
33 |
|
34 |
return (
|
35 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
36 |
<ValidatedSelect
|
37 |
id={ id }
|
38 |
label={ label }
|
32 |
} ) );
|
33 |
|
34 |
return (
|
35 |
+
<div
|
36 |
+
className={ classnames(
|
37 |
+
className,
|
38 |
+
'wc-block-components-country-input'
|
39 |
+
) }
|
40 |
+
>
|
41 |
<ValidatedSelect
|
42 |
id={ id }
|
43 |
label={ label }
|
assets/js/base/components/dropdown-selector/index.js
CHANGED
@@ -33,10 +33,15 @@ const DropdownSelector = ( {
|
|
33 |
} ) => {
|
34 |
const inputRef = useRef( null );
|
35 |
|
36 |
-
const classes = classNames(
|
37 |
-
|
38 |
-
'
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
/**
|
42 |
* State reducer for the downshift component.
|
33 |
} ) => {
|
34 |
const inputRef = useRef( null );
|
35 |
|
36 |
+
const classes = classNames(
|
37 |
+
className,
|
38 |
+
'wc-block-dropdown-selector',
|
39 |
+
'wc-block-components-dropdown-selector',
|
40 |
+
{
|
41 |
+
'is-disabled': isDisabled,
|
42 |
+
'is-loading': isLoading,
|
43 |
+
}
|
44 |
+
);
|
45 |
|
46 |
/**
|
47 |
* State reducer for the downshift component.
|
assets/js/base/components/dropdown-selector/input-wrapper.js
CHANGED
@@ -2,7 +2,7 @@ const DropdownSelectorInputWrapper = ( { children, onClick } ) => {
|
|
2 |
return (
|
3 |
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
|
4 |
<div
|
5 |
-
className="wc-block-dropdown-selector__input-wrapper"
|
6 |
onClick={ onClick }
|
7 |
>
|
8 |
{ children }
|
2 |
return (
|
3 |
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
|
4 |
<div
|
5 |
+
className="wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper"
|
6 |
onClick={ onClick }
|
7 |
>
|
8 |
{ children }
|
assets/js/base/components/dropdown-selector/input.js
CHANGED
@@ -13,7 +13,8 @@ const DropdownSelectorInput = ( {
|
|
13 |
<input
|
14 |
{ ...getInputProps( {
|
15 |
ref: inputRef,
|
16 |
-
className:
|
|
|
17 |
disabled: isDisabled,
|
18 |
onFocus,
|
19 |
onKeyDown( e ) {
|
13 |
<input
|
14 |
{ ...getInputProps( {
|
15 |
ref: inputRef,
|
16 |
+
className:
|
17 |
+
'wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input',
|
18 |
disabled: isDisabled,
|
19 |
onFocus,
|
20 |
onKeyDown( e ) {
|
assets/js/base/components/dropdown-selector/menu.js
CHANGED
@@ -14,7 +14,8 @@ const DropdownSelectorMenu = ( {
|
|
14 |
return (
|
15 |
<ul
|
16 |
{ ...getMenuProps( {
|
17 |
-
className:
|
|
|
18 |
} ) }
|
19 |
>
|
20 |
{ options.map( ( option, index ) => {
|
@@ -26,6 +27,7 @@ const DropdownSelectorMenu = ( {
|
|
26 |
key: option.value,
|
27 |
className: classNames(
|
28 |
'wc-block-dropdown-selector__list-item',
|
|
|
29 |
{
|
30 |
'is-selected': selected,
|
31 |
'is-highlighted':
|
14 |
return (
|
15 |
<ul
|
16 |
{ ...getMenuProps( {
|
17 |
+
className:
|
18 |
+
'wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list',
|
19 |
} ) }
|
20 |
>
|
21 |
{ options.map( ( option, index ) => {
|
27 |
key: option.value,
|
28 |
className: classNames(
|
29 |
'wc-block-dropdown-selector__list-item',
|
30 |
+
'wc-block-components-dropdown-selector__list-item',
|
31 |
{
|
32 |
'is-selected': selected,
|
33 |
'is-highlighted':
|
assets/js/base/components/dropdown-selector/selected-chip.js
CHANGED
@@ -6,7 +6,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
6 |
const DropdownSelectorSelectedChip = ( { onRemoveItem, option } ) => {
|
7 |
return (
|
8 |
<button
|
9 |
-
className="wc-block-dropdown-selector__selected-chip"
|
10 |
onClick={ () => {
|
11 |
onRemoveItem( option.value );
|
12 |
} }
|
@@ -20,10 +20,10 @@ const DropdownSelectorSelectedChip = ( { onRemoveItem, option } ) => {
|
|
20 |
option.name
|
21 |
) }
|
22 |
>
|
23 |
-
<span className="wc-block-dropdown-selector__selected-chip__label">
|
24 |
{ option.label }
|
25 |
</span>
|
26 |
-
<span className="wc-block-dropdown-selector__selected-chip__remove">
|
27 |
𝘅
|
28 |
</span>
|
29 |
</button>
|
6 |
const DropdownSelectorSelectedChip = ( { onRemoveItem, option } ) => {
|
7 |
return (
|
8 |
<button
|
9 |
+
className="wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip"
|
10 |
onClick={ () => {
|
11 |
onRemoveItem( option.value );
|
12 |
} }
|
20 |
option.name
|
21 |
) }
|
22 |
>
|
23 |
+
<span className="wc-block-dropdown-selector__selected-chip__label wc-block-components-dropdown-selector__selected-chip__label">
|
24 |
{ option.label }
|
25 |
</span>
|
26 |
+
<span className="wc-block-dropdown-selector__selected-chip__remove wc-block-components-dropdown-selector__selected-chip__remove">
|
27 |
𝘅
|
28 |
</span>
|
29 |
</button>
|
assets/js/base/components/dropdown-selector/selected-value.js
CHANGED
@@ -12,10 +12,10 @@ const DropdownSelectorSelectedValue = ( { onClick, onRemoveItem, option } ) => {
|
|
12 |
}, [ labelRef ] );
|
13 |
|
14 |
return (
|
15 |
-
<div className="wc-block-dropdown-selector__selected-value">
|
16 |
<button
|
17 |
ref={ labelRef }
|
18 |
-
className="wc-block-dropdown-selector__selected-value__label"
|
19 |
onClick={ ( e ) => {
|
20 |
e.stopPropagation();
|
21 |
onClick( option.value );
|
@@ -32,7 +32,7 @@ const DropdownSelectorSelectedValue = ( { onClick, onRemoveItem, option } ) => {
|
|
32 |
{ option.label }
|
33 |
</button>
|
34 |
<button
|
35 |
-
className="wc-block-dropdown-selector__selected-value__remove"
|
36 |
onClick={ () => {
|
37 |
onRemoveItem( option.value );
|
38 |
} }
|
12 |
}, [ labelRef ] );
|
13 |
|
14 |
return (
|
15 |
+
<div className="wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value">
|
16 |
<button
|
17 |
ref={ labelRef }
|
18 |
+
className="wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label"
|
19 |
onClick={ ( e ) => {
|
20 |
e.stopPropagation();
|
21 |
onClick( option.value );
|
32 |
{ option.label }
|
33 |
</button>
|
34 |
<button
|
35 |
+
className="wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove"
|
36 |
onClick={ () => {
|
37 |
onRemoveItem( option.value );
|
38 |
} }
|
assets/js/base/components/dropdown-selector/style.scss
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
.wc-block-dropdown-selector {
|
2 |
max-width: 300px;
|
3 |
position: relative;
|
4 |
width: 100%;
|
5 |
}
|
6 |
|
7 |
-
.wc-block-dropdown-selector__input-wrapper {
|
8 |
align-items: center;
|
9 |
border: 1px solid #9f9f9f;
|
10 |
border-radius: 4px;
|
@@ -18,14 +18,14 @@
|
|
18 |
}
|
19 |
}
|
20 |
|
21 |
-
.wc-block-dropdown-selector__placeholder {
|
22 |
@include font-size(small);
|
23 |
height: 1.8em;
|
24 |
margin: 0 $gap-smallest;
|
25 |
white-space: nowrap;
|
26 |
}
|
27 |
|
28 |
-
.wc-block-dropdown-selector__input {
|
29 |
@include font-size(small);
|
30 |
height: 1.8em;
|
31 |
min-width: 0;
|
@@ -62,8 +62,8 @@
|
|
62 |
}
|
63 |
|
64 |
// Visually hide the input
|
65 |
-
.is-single .wc-block-dropdown-selector__input:first-child,
|
66 |
-
.is-multiple .wc-block-dropdown-selector__input {
|
67 |
background: transparent;
|
68 |
border: 0;
|
69 |
|
@@ -74,11 +74,11 @@
|
|
74 |
}
|
75 |
}
|
76 |
|
77 |
-
.wc-block-dropdown-selector {
|
78 |
// Reset <button> styles
|
79 |
-
.wc-block-dropdown-selector__selected-chip,
|
80 |
-
.wc-block-dropdown-selector__selected-value__label,
|
81 |
-
.wc-block-dropdown-selector__selected-value__remove {
|
82 |
background-color: transparent;
|
83 |
border: 0;
|
84 |
color: inherit;
|
@@ -94,7 +94,7 @@
|
|
94 |
}
|
95 |
}
|
96 |
|
97 |
-
.wc-block-dropdown-selector__selected-value {
|
98 |
align-items: center;
|
99 |
color: $core-grey-dark-600;
|
100 |
display: inline-flex;
|
@@ -103,7 +103,7 @@
|
|
103 |
width: 100%;
|
104 |
}
|
105 |
|
106 |
-
.wc-block-dropdown-selector__selected-chip {
|
107 |
align-items: center;
|
108 |
background-color: $core-grey-light-600;
|
109 |
border: 1px solid #9f9f9f;
|
@@ -124,16 +124,16 @@
|
|
124 |
}
|
125 |
}
|
126 |
|
127 |
-
.wc-block-dropdown-selector__selected-value__label,
|
128 |
-
.wc-block-dropdown-selector__selected-chip__label {
|
129 |
@include font-size(small);
|
130 |
flex-grow: 1;
|
131 |
padding: 0;
|
132 |
text-align: left;
|
133 |
}
|
134 |
|
135 |
-
.wc-block-dropdown-selector__selected-value__remove,
|
136 |
-
.wc-block-dropdown-selector__selected-chip__remove {
|
137 |
background-color: transparent;
|
138 |
border: 0;
|
139 |
display: inline-block;
|
@@ -142,7 +142,7 @@
|
|
142 |
}
|
143 |
}
|
144 |
|
145 |
-
.wc-block-dropdown-selector__list {
|
146 |
background-color: #fff;
|
147 |
margin: -1px 0 0;
|
148 |
padding: 0;
|
@@ -159,7 +159,7 @@
|
|
159 |
}
|
160 |
}
|
161 |
|
162 |
-
.wc-block-dropdown-selector__list-item {
|
163 |
@include font-size(small);
|
164 |
color: $core-grey-dark-600;
|
165 |
cursor: default;
|
1 |
+
.wc-block-components-dropdown-selector {
|
2 |
max-width: 300px;
|
3 |
position: relative;
|
4 |
width: 100%;
|
5 |
}
|
6 |
|
7 |
+
.wc-block-components-dropdown-selector__input-wrapper {
|
8 |
align-items: center;
|
9 |
border: 1px solid #9f9f9f;
|
10 |
border-radius: 4px;
|
18 |
}
|
19 |
}
|
20 |
|
21 |
+
.wc-block-components-dropdown-selector__placeholder {
|
22 |
@include font-size(small);
|
23 |
height: 1.8em;
|
24 |
margin: 0 $gap-smallest;
|
25 |
white-space: nowrap;
|
26 |
}
|
27 |
|
28 |
+
.wc-block-components-dropdown-selector__input {
|
29 |
@include font-size(small);
|
30 |
height: 1.8em;
|
31 |
min-width: 0;
|
62 |
}
|
63 |
|
64 |
// Visually hide the input
|
65 |
+
.is-single .wc-block-components-dropdown-selector__input:first-child,
|
66 |
+
.is-multiple .wc-block-components-dropdown-selector__input {
|
67 |
background: transparent;
|
68 |
border: 0;
|
69 |
|
74 |
}
|
75 |
}
|
76 |
|
77 |
+
.wc-block-components-dropdown-selector {
|
78 |
// Reset <button> styles
|
79 |
+
.wc-block-components-dropdown-selector__selected-chip,
|
80 |
+
.wc-block-components-dropdown-selector__selected-value__label,
|
81 |
+
.wc-block-components-dropdown-selector__selected-value__remove {
|
82 |
background-color: transparent;
|
83 |
border: 0;
|
84 |
color: inherit;
|
94 |
}
|
95 |
}
|
96 |
|
97 |
+
.wc-block-components-dropdown-selector__selected-value {
|
98 |
align-items: center;
|
99 |
color: $core-grey-dark-600;
|
100 |
display: inline-flex;
|
103 |
width: 100%;
|
104 |
}
|
105 |
|
106 |
+
.wc-block-components-dropdown-selector__selected-chip {
|
107 |
align-items: center;
|
108 |
background-color: $core-grey-light-600;
|
109 |
border: 1px solid #9f9f9f;
|
124 |
}
|
125 |
}
|
126 |
|
127 |
+
.wc-block-components-dropdown-selector__selected-value__label,
|
128 |
+
.wc-block-components-dropdown-selector__selected-chip__label {
|
129 |
@include font-size(small);
|
130 |
flex-grow: 1;
|
131 |
padding: 0;
|
132 |
text-align: left;
|
133 |
}
|
134 |
|
135 |
+
.wc-block-components-dropdown-selector__selected-value__remove,
|
136 |
+
.wc-block-components-dropdown-selector__selected-chip__remove {
|
137 |
background-color: transparent;
|
138 |
border: 0;
|
139 |
display: inline-block;
|
142 |
}
|
143 |
}
|
144 |
|
145 |
+
.wc-block-components-dropdown-selector__list {
|
146 |
background-color: #fff;
|
147 |
margin: -1px 0 0;
|
148 |
padding: 0;
|
159 |
}
|
160 |
}
|
161 |
|
162 |
+
.wc-block-components-dropdown-selector__list-item {
|
163 |
@include font-size(small);
|
164 |
color: $core-grey-dark-600;
|
165 |
cursor: default;
|
assets/js/base/components/filter-submit-button/index.js
CHANGED
@@ -24,6 +24,7 @@ const FilterSubmitButton = ( {
|
|
24 |
type="submit"
|
25 |
className={ classNames(
|
26 |
'wc-block-filter-submit-button',
|
|
|
27 |
className
|
28 |
) }
|
29 |
disabled={ disabled }
|
24 |
type="submit"
|
25 |
className={ classNames(
|
26 |
'wc-block-filter-submit-button',
|
27 |
+
'wc-block-components-filter-submit-button',
|
28 |
className
|
29 |
) }
|
30 |
disabled={ disabled }
|
assets/js/base/components/filter-submit-button/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-filter-submit-button {
|
2 |
display: block;
|
3 |
margin-left: auto;
|
4 |
white-space: nowrap;
|
1 |
+
.wc-block-components-filter-submit-button {
|
2 |
display: block;
|
3 |
margin-left: auto;
|
4 |
white-space: nowrap;
|
assets/js/base/components/formatted-monetary-amount/index.js
CHANGED
@@ -51,7 +51,11 @@ const FormattedMonetaryAmount = ( {
|
|
51 |
return null;
|
52 |
}
|
53 |
|
54 |
-
const classes = classNames(
|
|
|
|
|
|
|
|
|
55 |
const numberFormatProps = {
|
56 |
displayType: 'text',
|
57 |
...props,
|
51 |
return null;
|
52 |
}
|
53 |
|
54 |
+
const classes = classNames(
|
55 |
+
'wc-block-formatted-money-amount',
|
56 |
+
'wc-block-components-formatted-money-amount',
|
57 |
+
className
|
58 |
+
);
|
59 |
const numberFormatProps = {
|
60 |
displayType: 'text',
|
61 |
...props,
|
assets/js/base/components/formatted-monetary-amount/style.scss
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
.wc-block-formatted-money-amount {
|
2 |
white-space: nowrap;
|
3 |
}
|
1 |
+
.wc-block-components-formatted-money-amount {
|
2 |
white-space: nowrap;
|
3 |
}
|
assets/js/base/components/load-more-button/index.js
CHANGED
@@ -12,7 +12,7 @@ import './style.scss';
|
|
12 |
|
13 |
export const LoadMoreButton = ( { onClick, label, screenReaderLabel } ) => {
|
14 |
return (
|
15 |
-
<div className="wp-block-button wc-block-load-more">
|
16 |
<button className="wp-block-button__link" onClick={ onClick }>
|
17 |
<Label
|
18 |
label={ label }
|
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 }>
|
17 |
<Label
|
18 |
label={ label }
|
assets/js/base/components/load-more-button/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-load-more {
|
2 |
text-align: center;
|
3 |
width: 100%;
|
4 |
}
|
1 |
+
.wc-block-components-load-more {
|
2 |
text-align: center;
|
3 |
width: 100%;
|
4 |
}
|
assets/js/base/components/loading-mask/index.js
CHANGED
@@ -24,10 +24,15 @@ const LoadingMask = ( {
|
|
24 |
}
|
25 |
|
26 |
return (
|
27 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
28 |
{ showSpinner && <Spinner /> }
|
29 |
<div
|
30 |
-
className="wc-
|
31 |
aria-hidden={ true }
|
32 |
>
|
33 |
{ children }
|
24 |
}
|
25 |
|
26 |
return (
|
27 |
+
<div
|
28 |
+
className={ classNames(
|
29 |
+
className,
|
30 |
+
'wc-block-components-loading-mask'
|
31 |
+
) }
|
32 |
+
>
|
33 |
{ showSpinner && <Spinner /> }
|
34 |
<div
|
35 |
+
className="wc-block-components-loading-mask__children"
|
36 |
aria-hidden={ true }
|
37 |
>
|
38 |
{ children }
|
assets/js/base/components/loading-mask/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-loading-mask {
|
2 |
position: relative;
|
3 |
min-height: 18px + $gap;
|
4 |
|
@@ -11,6 +11,6 @@
|
|
11 |
}
|
12 |
}
|
13 |
|
14 |
-
.wc-
|
15 |
opacity: 0.5;
|
16 |
}
|
1 |
+
.wc-block-components-loading-mask {
|
2 |
position: relative;
|
3 |
min-height: 18px + $gap;
|
4 |
|
11 |
}
|
12 |
}
|
13 |
|
14 |
+
.wc-block-components-loading-mask__children {
|
15 |
opacity: 0.5;
|
16 |
}
|
assets/js/base/components/pagination/index.js
CHANGED
@@ -49,7 +49,7 @@ const Pagination = ( {
|
|
49 |
}
|
50 |
|
51 |
return (
|
52 |
-
<div className="wc-block-pagination">
|
53 |
<Label
|
54 |
screenReaderLabel={ __(
|
55 |
'Navigate to another page',
|
@@ -58,7 +58,7 @@ const Pagination = ( {
|
|
58 |
/>
|
59 |
{ displayNextAndPreviousArrows && (
|
60 |
<button
|
61 |
-
className="wc-block-pagination-page"
|
62 |
onClick={ () => onPageChange( currentPage - 1 ) }
|
63 |
title={ __(
|
64 |
'Previous page',
|
@@ -77,9 +77,16 @@ const Pagination = ( {
|
|
77 |
) }
|
78 |
{ showFirstPage && (
|
79 |
<button
|
80 |
-
className={ classNames(
|
81 |
-
'wc-block-pagination-page
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
onClick={ () => onPageChange( 1 ) }
|
84 |
disabled={ currentPage === 1 }
|
85 |
>
|
@@ -95,7 +102,7 @@ const Pagination = ( {
|
|
95 |
) }
|
96 |
{ showFirstPageEllipsis && (
|
97 |
<span
|
98 |
-
className="wc-block-pagination-ellipsis"
|
99 |
aria-hidden="true"
|
100 |
>
|
101 |
{ __( '…', 'woo-gutenberg-products-block' ) }
|
@@ -105,10 +112,16 @@ const Pagination = ( {
|
|
105 |
return (
|
106 |
<button
|
107 |
key={ page }
|
108 |
-
className={ classNames(
|
109 |
-
'wc-block-pagination-page
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
onClick={
|
113 |
currentPage === page
|
114 |
? null
|
@@ -129,7 +142,7 @@ const Pagination = ( {
|
|
129 |
} ) }
|
130 |
{ showLastPageEllipsis && (
|
131 |
<span
|
132 |
-
className="wc-block-pagination-ellipsis"
|
133 |
aria-hidden="true"
|
134 |
>
|
135 |
{ __( '…', 'woo-gutenberg-products-block' ) }
|
@@ -137,10 +150,16 @@ const Pagination = ( {
|
|
137 |
) }
|
138 |
{ showLastPage && (
|
139 |
<button
|
140 |
-
className={ classNames(
|
141 |
-
'wc-block-pagination-page
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
onClick={ () => onPageChange( totalPages ) }
|
145 |
disabled={ currentPage === totalPages }
|
146 |
>
|
@@ -156,7 +175,7 @@ const Pagination = ( {
|
|
156 |
) }
|
157 |
{ displayNextAndPreviousArrows && (
|
158 |
<button
|
159 |
-
className="wc-block-pagination-page"
|
160 |
onClick={ () => onPageChange( currentPage + 1 ) }
|
161 |
title={ __( 'Next page', 'woo-gutenberg-products-block' ) }
|
162 |
disabled={ currentPage >= totalPages }
|
49 |
}
|
50 |
|
51 |
return (
|
52 |
+
<div className="wc-block-pagination wc-block-components-pagination">
|
53 |
<Label
|
54 |
screenReaderLabel={ __(
|
55 |
'Navigate to another page',
|
58 |
/>
|
59 |
{ displayNextAndPreviousArrows && (
|
60 |
<button
|
61 |
+
className="wc-block-pagination-page wc-block-components-pagination__page"
|
62 |
onClick={ () => onPageChange( currentPage - 1 ) }
|
63 |
title={ __(
|
64 |
'Previous page',
|
77 |
) }
|
78 |
{ showFirstPage && (
|
79 |
<button
|
80 |
+
className={ classNames(
|
81 |
+
'wc-block-pagination-page',
|
82 |
+
'wc-block-components-pagination__page',
|
83 |
+
{
|
84 |
+
'wc-block-pagination-page--active':
|
85 |
+
currentPage === 1,
|
86 |
+
'wc-block-components-pagination__page--active':
|
87 |
+
currentPage === 1,
|
88 |
+
}
|
89 |
+
) }
|
90 |
onClick={ () => onPageChange( 1 ) }
|
91 |
disabled={ currentPage === 1 }
|
92 |
>
|
102 |
) }
|
103 |
{ showFirstPageEllipsis && (
|
104 |
<span
|
105 |
+
className="wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis"
|
106 |
aria-hidden="true"
|
107 |
>
|
108 |
{ __( '…', 'woo-gutenberg-products-block' ) }
|
112 |
return (
|
113 |
<button
|
114 |
key={ page }
|
115 |
+
className={ classNames(
|
116 |
+
'wc-block-pagination-page',
|
117 |
+
'wc-block-components-pagination__page',
|
118 |
+
{
|
119 |
+
'wc-block-pagination-page--active':
|
120 |
+
currentPage === page,
|
121 |
+
'wc-block-components-pagination__page--active':
|
122 |
+
currentPage === page,
|
123 |
+
}
|
124 |
+
) }
|
125 |
onClick={
|
126 |
currentPage === page
|
127 |
? null
|
142 |
} ) }
|
143 |
{ showLastPageEllipsis && (
|
144 |
<span
|
145 |
+
className="wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis"
|
146 |
aria-hidden="true"
|
147 |
>
|
148 |
{ __( '…', 'woo-gutenberg-products-block' ) }
|
150 |
) }
|
151 |
{ showLastPage && (
|
152 |
<button
|
153 |
+
className={ classNames(
|
154 |
+
'wc-block-pagination-page',
|
155 |
+
'wc-block-components-pagination__page',
|
156 |
+
{
|
157 |
+
'wc-block-pagination-page--active':
|
158 |
+
currentPage === totalPages,
|
159 |
+
'wc-block-components-pagination__page--active':
|
160 |
+
currentPage === totalPages,
|
161 |
+
}
|
162 |
+
) }
|
163 |
onClick={ () => onPageChange( totalPages ) }
|
164 |
disabled={ currentPage === totalPages }
|
165 |
>
|
175 |
) }
|
176 |
{ displayNextAndPreviousArrows && (
|
177 |
<button
|
178 |
+
className="wc-block-pagination-page wc-block-components-pagination__page"
|
179 |
onClick={ () => onPageChange( currentPage + 1 ) }
|
180 |
title={ __( 'Next page', 'woo-gutenberg-products-block' ) }
|
181 |
disabled={ currentPage >= totalPages }
|
assets/js/base/components/pagination/style.scss
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
-
.wc-block-pagination {
|
2 |
margin: 0 auto $gap;
|
3 |
}
|
4 |
|
5 |
-
.wc-block-
|
6 |
-
.wc-block-
|
7 |
@include font-size(regular);
|
8 |
color: #333;
|
9 |
display: inline-block;
|
10 |
font-weight: normal;
|
11 |
}
|
12 |
|
13 |
-
.wc-block-
|
14 |
border-color: transparent;
|
15 |
padding: 0.3em 0.6em;
|
16 |
min-width: 2.2em;
|
@@ -29,7 +29,7 @@
|
|
29 |
}
|
30 |
}
|
31 |
|
32 |
-
.wc-block-
|
33 |
padding: 0.3em;
|
34 |
|
35 |
@include breakpoint( "<782px" ) {
|
@@ -37,7 +37,7 @@
|
|
37 |
}
|
38 |
}
|
39 |
|
40 |
-
.wc-block-
|
41 |
color: #333;
|
42 |
font-weight: bold;
|
43 |
opacity: 1 !important;
|
1 |
+
.wc-block-components-pagination {
|
2 |
margin: 0 auto $gap;
|
3 |
}
|
4 |
|
5 |
+
.wc-block-components-pagination__page,
|
6 |
+
.wc-block-components-pagination__ellipsis {
|
7 |
@include font-size(regular);
|
8 |
color: #333;
|
9 |
display: inline-block;
|
10 |
font-weight: normal;
|
11 |
}
|
12 |
|
13 |
+
.wc-block-components-pagination__page {
|
14 |
border-color: transparent;
|
15 |
padding: 0.3em 0.6em;
|
16 |
min-width: 2.2em;
|
29 |
}
|
30 |
}
|
31 |
|
32 |
+
.wc-block-components-pagination__ellipsis {
|
33 |
padding: 0.3em;
|
34 |
|
35 |
@include breakpoint( "<782px" ) {
|
37 |
}
|
38 |
}
|
39 |
|
40 |
+
.wc-block-components-pagination__page--active[disabled] {
|
41 |
color: #333;
|
42 |
font-weight: bold;
|
43 |
opacity: 1 !important;
|
assets/js/base/components/panel/index.js
CHANGED
@@ -15,6 +15,7 @@ const Panel = ( {
|
|
15 |
children,
|
16 |
className,
|
17 |
initialOpen = false,
|
|
|
18 |
title,
|
19 |
titleTag: TitleTag = 'div',
|
20 |
} ) => {
|
@@ -22,7 +23,9 @@ const Panel = ( {
|
|
22 |
|
23 |
return (
|
24 |
<div
|
25 |
-
className={ classNames( className, 'wc-blocks-components-panel'
|
|
|
|
|
26 |
>
|
27 |
<TitleTag>
|
28 |
<button
|
@@ -50,6 +53,7 @@ const Panel = ( {
|
|
50 |
|
51 |
Panel.propTypes = {
|
52 |
className: PropTypes.string,
|
|
|
53 |
initialOpen: PropTypes.bool,
|
54 |
title: PropTypes.element,
|
55 |
titleTag: PropTypes.string,
|
15 |
children,
|
16 |
className,
|
17 |
initialOpen = false,
|
18 |
+
hasBorder = false,
|
19 |
title,
|
20 |
titleTag: TitleTag = 'div',
|
21 |
} ) => {
|
23 |
|
24 |
return (
|
25 |
<div
|
26 |
+
className={ classNames( className, 'wc-blocks-components-panel', {
|
27 |
+
'has-border': hasBorder,
|
28 |
+
} ) }
|
29 |
>
|
30 |
<TitleTag>
|
31 |
<button
|
53 |
|
54 |
Panel.propTypes = {
|
55 |
className: PropTypes.string,
|
56 |
+
hasBorder: PropTypes.bool,
|
57 |
initialOpen: PropTypes.bool,
|
58 |
title: PropTypes.element,
|
59 |
titleTag: PropTypes.string,
|
assets/js/base/components/panel/style.scss
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
.wc-blocks-components-panel__button {
|
2 |
&,
|
3 |
&:hover,
|
@@ -20,6 +28,7 @@
|
|
20 |
}
|
21 |
|
22 |
> .wc-blocks-components-panel__button-icon {
|
|
|
23 |
position: absolute;
|
24 |
right: 0;
|
25 |
top: 50%;
|
@@ -30,6 +39,7 @@
|
|
30 |
|
31 |
.wc-blocks-components-panel__content {
|
32 |
padding-bottom: em($gap);
|
|
|
33 |
}
|
34 |
|
35 |
.theme-twentytwenty .wc-blocks-components-panel__button {
|
1 |
+
.wc-blocks-components-panel.has-border {
|
2 |
+
@include with-translucent-border( 1px 0 );
|
3 |
+
|
4 |
+
+ .wc-blocks-components-panel.has-border::after {
|
5 |
+
border-top-width: 0;
|
6 |
+
}
|
7 |
+
}
|
8 |
+
|
9 |
.wc-blocks-components-panel__button {
|
10 |
&,
|
11 |
&:hover,
|
28 |
}
|
29 |
|
30 |
> .wc-blocks-components-panel__button-icon {
|
31 |
+
fill: currentColor;
|
32 |
position: absolute;
|
33 |
right: 0;
|
34 |
top: 50%;
|
39 |
|
40 |
.wc-blocks-components-panel__content {
|
41 |
padding-bottom: em($gap);
|
42 |
+
overflow: auto;
|
43 |
}
|
44 |
|
45 |
.theme-twentytwenty .wc-blocks-components-panel__button {
|
assets/js/base/components/payment-methods/express-checkout.js
CHANGED
@@ -16,12 +16,17 @@ const ExpressCheckoutContainer = ( { children } ) => {
|
|
16 |
return (
|
17 |
<>
|
18 |
<div className="wc-block-components-express-checkout">
|
19 |
-
<
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
<div className="wc-block-components-express-checkout__content">
|
26 |
<StoreNoticesProvider context="wc/express-payment-area">
|
27 |
{ children }
|
16 |
return (
|
17 |
<>
|
18 |
<div className="wc-block-components-express-checkout">
|
19 |
+
<div className="wc-block-components-express-checkout__title-container">
|
20 |
+
<Title
|
21 |
+
className="wc-block-components-express-checkout__title"
|
22 |
+
headingLevel="2"
|
23 |
+
>
|
24 |
+
{ __(
|
25 |
+
'Express checkout',
|
26 |
+
'woo-gutenberg-products-block'
|
27 |
+
) }
|
28 |
+
</Title>
|
29 |
+
</div>
|
30 |
<div className="wc-block-components-express-checkout__content">
|
31 |
<StoreNoticesProvider context="wc/express-payment-area">
|
32 |
{ children }
|
assets/js/base/components/payment-methods/payment-methods.js
CHANGED
@@ -98,7 +98,7 @@ const PaymentMethods = () => {
|
|
98 |
} ) }
|
99 |
{ customerId > 0 && supports.savePaymentInfo && (
|
100 |
<CheckboxControl
|
101 |
-
className="wc-block-
|
102 |
label={ __(
|
103 |
'Save payment information to my account for future purchases.',
|
104 |
'woo-gutenberg-products-block'
|
98 |
} ) }
|
99 |
{ customerId > 0 && supports.savePaymentInfo && (
|
100 |
<CheckboxControl
|
101 |
+
className="wc-block-components-payment-methods__save-card-info"
|
102 |
label={ __(
|
103 |
'Save payment information to my account for future purchases.',
|
104 |
'woo-gutenberg-products-block'
|
assets/js/base/components/payment-methods/style.scss
CHANGED
@@ -1,25 +1,64 @@
|
|
|
|
|
|
|
|
1 |
.wc-block-components-express-checkout {
|
2 |
margin: auto;
|
3 |
-
border: 2px solid $black;
|
4 |
-
border-radius: 5px;
|
5 |
-
padding: 8px;
|
6 |
position: relative;
|
7 |
|
8 |
-
.wc-block-components-express-checkout__title {
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
14 |
vertical-align: middle;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
transform: translateY(-50%);
|
16 |
-
position: absolute;
|
17 |
-
top: 0;
|
18 |
-
margin-top: -2px; // Same as container border width.
|
19 |
}
|
20 |
|
21 |
.wc-block-components-express-checkout__content {
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
.wc-block-components-express-checkout-payment-event-buttons {
|
@@ -29,10 +68,11 @@
|
|
29 |
flex-wrap: wrap;
|
30 |
width: 100%;
|
31 |
padding: 0;
|
32 |
-
margin: 0
|
33 |
overflow: hidden;
|
34 |
> li {
|
35 |
display: inline-block;
|
|
|
36 |
width: 50%;
|
37 |
> img {
|
38 |
width: 100%;
|
@@ -125,7 +165,7 @@
|
|
125 |
transform: translateY(#{$gap-smallest}) scale(0.75);
|
126 |
}
|
127 |
}
|
128 |
-
& + .wc-block-
|
129 |
position: static;
|
130 |
margin-top: -$gap-large;
|
131 |
}
|
@@ -157,7 +197,7 @@
|
|
157 |
.is-large {
|
158 |
.wc-card-expiry-element,
|
159 |
.wc-card-cvc-element {
|
160 |
-
.wc-block-
|
161 |
line-height: 16px;
|
162 |
padding-top: 4px;
|
163 |
}
|
@@ -168,7 +208,7 @@
|
|
168 |
.is-small {
|
169 |
.wc-card-expiry-element,
|
170 |
.wc-card-cvc-element {
|
171 |
-
.wc-block-
|
172 |
min-height: 28px;
|
173 |
}
|
174 |
}
|
@@ -214,11 +254,16 @@
|
|
214 |
}
|
215 |
}
|
216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
// For Twenty Twenty we need to increase specificity of the title.
|
218 |
.theme-twentytwenty {
|
219 |
.wc-block-components-express-checkout .wc-block-components-express-checkout__title {
|
220 |
padding-left: $gap-small;
|
221 |
padding-right: $gap-small;
|
222 |
-
margin-left: $gap-small;
|
223 |
}
|
224 |
}
|
1 |
+
$border-width: 1px;
|
2 |
+
$border-radius: 5px;
|
3 |
+
|
4 |
.wc-block-components-express-checkout {
|
5 |
margin: auto;
|
|
|
|
|
|
|
6 |
position: relative;
|
7 |
|
8 |
+
.wc-block-components-express-checkout__title-container {
|
9 |
+
display: flex;
|
10 |
+
flex-direction: row;
|
11 |
+
left: 0;
|
12 |
+
position: absolute;
|
13 |
+
right: 0;
|
14 |
+
top: -$border-radius;
|
15 |
vertical-align: middle;
|
16 |
+
|
17 |
+
// Pseudo-elements used to show the border before and after the title.
|
18 |
+
&::before {
|
19 |
+
border-left: $border-width solid currentColor;
|
20 |
+
border-top: $border-width solid currentColor;
|
21 |
+
border-radius: $border-radius 0 0 0;
|
22 |
+
content: "";
|
23 |
+
display: block;
|
24 |
+
height: $border-radius - $border-width;
|
25 |
+
margin-right: $gap-small;
|
26 |
+
opacity: 0.3;
|
27 |
+
pointer-events: none;
|
28 |
+
width: #{$gap-larger - $gap-small - $border-width * 2};
|
29 |
+
}
|
30 |
+
|
31 |
+
&::after {
|
32 |
+
border-right: $border-width solid currentColor;
|
33 |
+
border-top: $border-width solid currentColor;
|
34 |
+
border-radius: 0 $border-radius 0 0;
|
35 |
+
content: "";
|
36 |
+
display: block;
|
37 |
+
height: $border-radius - $border-width;
|
38 |
+
margin-left: $gap-small;
|
39 |
+
opacity: 0.3;
|
40 |
+
pointer-events: none;
|
41 |
+
flex-grow: 1;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
.wc-block-components-express-checkout__title {
|
46 |
+
flex-grow: 0;
|
47 |
transform: translateY(-50%);
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
.wc-block-components-express-checkout__content {
|
51 |
+
@include with-translucent-border(0 $border-width $border-width);
|
52 |
+
margin-top: calc(0.75em + #{$border-radius});
|
53 |
+
padding: em($gap-large) #{$gap-larger - $border-width} em($gap) #{$gap-larger - $border-width};
|
54 |
+
|
55 |
+
&::after {
|
56 |
+
border-radius: 0 0 $border-radius $border-radius;
|
57 |
+
}
|
58 |
+
|
59 |
+
> p {
|
60 |
+
margin-bottom: em($gap);
|
61 |
+
}
|
62 |
}
|
63 |
|
64 |
.wc-block-components-express-checkout-payment-event-buttons {
|
68 |
flex-wrap: wrap;
|
69 |
width: 100%;
|
70 |
padding: 0;
|
71 |
+
margin: 0;
|
72 |
overflow: hidden;
|
73 |
> li {
|
74 |
display: inline-block;
|
75 |
+
margin: 0;
|
76 |
width: 50%;
|
77 |
> img {
|
78 |
width: 100%;
|
165 |
transform: translateY(#{$gap-smallest}) scale(0.75);
|
166 |
}
|
167 |
}
|
168 |
+
& + .wc-block-components-validation-error {
|
169 |
position: static;
|
170 |
margin-top: -$gap-large;
|
171 |
}
|
197 |
.is-large {
|
198 |
.wc-card-expiry-element,
|
199 |
.wc-card-cvc-element {
|
200 |
+
.wc-block-components-validation-error > p {
|
201 |
line-height: 16px;
|
202 |
padding-top: 4px;
|
203 |
}
|
208 |
.is-small {
|
209 |
.wc-card-expiry-element,
|
210 |
.wc-card-cvc-element {
|
211 |
+
.wc-block-components-validation-error > p {
|
212 |
min-height: 28px;
|
213 |
}
|
214 |
}
|
254 |
}
|
255 |
}
|
256 |
|
257 |
+
.theme-twentynineteen {
|
258 |
+
.wc-block-components-express-checkout__title::before {
|
259 |
+
display: none;
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
// For Twenty Twenty we need to increase specificity of the title.
|
264 |
.theme-twentytwenty {
|
265 |
.wc-block-components-express-checkout .wc-block-components-express-checkout__title {
|
266 |
padding-left: $gap-small;
|
267 |
padding-right: $gap-small;
|
|
|
268 |
}
|
269 |
}
|
assets/js/base/components/price-slider/index.js
CHANGED
@@ -222,8 +222,12 @@ const PriceSlider = ( {
|
|
222 |
|
223 |
const classes = classnames(
|
224 |
'wc-block-price-filter',
|
|
|
225 |
showInputFields && 'wc-block-price-filter--has-input-fields',
|
|
|
226 |
showFilterButton && 'wc-block-price-filter--has-filter-button',
|
|
|
|
|
227 |
isLoading && 'is-loading',
|
228 |
! hasValidConstraints && 'is-disabled'
|
229 |
);
|
@@ -236,19 +240,19 @@ const PriceSlider = ( {
|
|
236 |
return (
|
237 |
<div className={ classes }>
|
238 |
<div
|
239 |
-
className="wc-block-price-filter__range-input-wrapper"
|
240 |
onMouseMove={ findClosestRange }
|
241 |
onFocus={ findClosestRange }
|
242 |
>
|
243 |
{ hasValidConstraints && (
|
244 |
<div aria-hidden={ showInputFields }>
|
245 |
<div
|
246 |
-
className="wc-block-price-filter__range-input-progress"
|
247 |
style={ progressStyles }
|
248 |
/>
|
249 |
<input
|
250 |
type="range"
|
251 |
-
className="wc-block-price-filter__range-input wc-block-price-filter__range-input--min"
|
252 |
aria-label={ __(
|
253 |
'Filter products by minimum price',
|
254 |
'woo-gutenberg-products-block'
|
@@ -268,7 +272,7 @@ const PriceSlider = ( {
|
|
268 |
/>
|
269 |
<input
|
270 |
type="range"
|
271 |
-
className="wc-block-price-filter__range-input wc-block-price-filter__range-input--max"
|
272 |
aria-label={ __(
|
273 |
'Filter products by maximum price',
|
274 |
'woo-gutenberg-products-block'
|
@@ -289,13 +293,13 @@ const PriceSlider = ( {
|
|
289 |
</div>
|
290 |
) }
|
291 |
</div>
|
292 |
-
<div className="wc-block-price-filter__controls">
|
293 |
{ showInputFields && (
|
294 |
<Fragment>
|
295 |
<FormattedMonetaryAmount
|
296 |
currency={ currency }
|
297 |
displayType="input"
|
298 |
-
className="wc-block-price-filter__amount wc-block-price-filter__amount--min wc-block-form-text-input"
|
299 |
aria-label={ __(
|
300 |
'Filter products by minimum price',
|
301 |
'woo-gutenberg-products-block'
|
@@ -313,7 +317,7 @@ const PriceSlider = ( {
|
|
313 |
<FormattedMonetaryAmount
|
314 |
currency={ currency }
|
315 |
displayType="input"
|
316 |
-
className="wc-block-price-filter__amount wc-block-price-filter__amount--max wc-block-form-text-input"
|
317 |
aria-label={ __(
|
318 |
'Filter products by maximum price',
|
319 |
'woo-gutenberg-products-block'
|
@@ -334,7 +338,7 @@ const PriceSlider = ( {
|
|
334 |
! isLoading &&
|
335 |
Number.isFinite( minPrice ) &&
|
336 |
Number.isFinite( maxPrice ) && (
|
337 |
-
<div className="wc-block-price-filter__range-text">
|
338 |
{ __( 'Price', 'woo-gutenberg-products-block' ) }
|
339 |
:
|
340 |
<FormattedMonetaryAmount
|
@@ -352,7 +356,7 @@ const PriceSlider = ( {
|
|
352 |
) }
|
353 |
{ showFilterButton && (
|
354 |
<FilterSubmitButton
|
355 |
-
className="wc-block-price-filter__button"
|
356 |
disabled={ isLoading || ! hasValidConstraints }
|
357 |
onClick={ onSubmit }
|
358 |
screenReaderLabel={ __(
|
222 |
|
223 |
const classes = classnames(
|
224 |
'wc-block-price-filter',
|
225 |
+
'wc-block-components-price-slider',
|
226 |
showInputFields && 'wc-block-price-filter--has-input-fields',
|
227 |
+
showInputFields && 'wc-block-components-price-slider--has-input-fields',
|
228 |
showFilterButton && 'wc-block-price-filter--has-filter-button',
|
229 |
+
showFilterButton &&
|
230 |
+
'wc-block-components-price-slider--has-filter-button',
|
231 |
isLoading && 'is-loading',
|
232 |
! hasValidConstraints && 'is-disabled'
|
233 |
);
|
240 |
return (
|
241 |
<div className={ classes }>
|
242 |
<div
|
243 |
+
className="wc-block-price-filter__range-input-wrapper wc-block-components-price-slider__range-input-wrapper"
|
244 |
onMouseMove={ findClosestRange }
|
245 |
onFocus={ findClosestRange }
|
246 |
>
|
247 |
{ hasValidConstraints && (
|
248 |
<div aria-hidden={ showInputFields }>
|
249 |
<div
|
250 |
+
className="wc-block-price-filter__range-input-progress wc-block-components-price-slider__range-input-progress"
|
251 |
style={ progressStyles }
|
252 |
/>
|
253 |
<input
|
254 |
type="range"
|
255 |
+
className="wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min"
|
256 |
aria-label={ __(
|
257 |
'Filter products by minimum price',
|
258 |
'woo-gutenberg-products-block'
|
272 |
/>
|
273 |
<input
|
274 |
type="range"
|
275 |
+
className="wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max"
|
276 |
aria-label={ __(
|
277 |
'Filter products by maximum price',
|
278 |
'woo-gutenberg-products-block'
|
293 |
</div>
|
294 |
) }
|
295 |
</div>
|
296 |
+
<div className="wc-block-price-filter__controls wc-block-components-price-slider__controls">
|
297 |
{ showInputFields && (
|
298 |
<Fragment>
|
299 |
<FormattedMonetaryAmount
|
300 |
currency={ currency }
|
301 |
displayType="input"
|
302 |
+
className="wc-block-price-filter__amount wc-block-price-filter__amount--min wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--min"
|
303 |
aria-label={ __(
|
304 |
'Filter products by minimum price',
|
305 |
'woo-gutenberg-products-block'
|
317 |
<FormattedMonetaryAmount
|
318 |
currency={ currency }
|
319 |
displayType="input"
|
320 |
+
className="wc-block-price-filter__amount wc-block-price-filter__amount--max wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--max"
|
321 |
aria-label={ __(
|
322 |
'Filter products by maximum price',
|
323 |
'woo-gutenberg-products-block'
|
338 |
! isLoading &&
|
339 |
Number.isFinite( minPrice ) &&
|
340 |
Number.isFinite( maxPrice ) && (
|
341 |
+
<div className="wc-block-price-filter__range-text wc-block-components-price-slider__range-text">
|
342 |
{ __( 'Price', 'woo-gutenberg-products-block' ) }
|
343 |
:
|
344 |
<FormattedMonetaryAmount
|
356 |
) }
|
357 |
{ showFilterButton && (
|
358 |
<FilterSubmitButton
|
359 |
+
className="wc-block-price-filter__button wc-block-components-price-slider__button"
|
360 |
disabled={ isLoading || ! hasValidConstraints }
|
361 |
onClick={ onSubmit }
|
362 |
screenReaderLabel={ __(
|
assets/js/base/components/price-slider/style.scss
CHANGED
@@ -46,10 +46,10 @@
|
|
46 |
appearance: none;
|
47 |
}
|
48 |
|
49 |
-
.wc-block-price-
|
50 |
margin-bottom: $gap-large;
|
51 |
|
52 |
-
.wc-block-price-
|
53 |
@include reset;
|
54 |
height: 9px;
|
55 |
clear: both;
|
@@ -58,7 +58,7 @@
|
|
58 |
background: #e1e1e1;
|
59 |
margin: 15px 0;
|
60 |
|
61 |
-
.wc-block-price-
|
62 |
height: 9px;
|
63 |
width: 100%;
|
64 |
position: absolute;
|
@@ -71,35 +71,35 @@
|
|
71 |
}
|
72 |
}
|
73 |
|
74 |
-
.wc-block-price-
|
75 |
display: flex;
|
76 |
|
77 |
-
.wc-block-price-
|
78 |
margin: 0;
|
79 |
border-radius: 4px;
|
80 |
width: auto;
|
81 |
max-width: 100px;
|
82 |
min-width: 0;
|
83 |
|
84 |
-
&.wc-block-price-
|
85 |
margin-right: 10px;
|
86 |
}
|
87 |
-
&.wc-block-price-
|
88 |
margin-left: auto;
|
89 |
}
|
90 |
}
|
91 |
}
|
92 |
-
&.wc-block-price-
|
93 |
-
.wc-block-price-
|
94 |
justify-content: flex-end;
|
95 |
|
96 |
-
.wc-block-price-
|
97 |
margin-left: 0;
|
98 |
margin-right: 10px;
|
99 |
}
|
100 |
}
|
101 |
}
|
102 |
-
.wc-block-price-
|
103 |
@include reset;
|
104 |
width: 100%;
|
105 |
height: 0;
|
@@ -148,7 +148,7 @@
|
|
148 |
}
|
149 |
}
|
150 |
|
151 |
-
&.wc-block-price-
|
152 |
z-index: 21;
|
153 |
|
154 |
&::-webkit-slider-thumb {
|
@@ -164,7 +164,7 @@
|
|
164 |
}
|
165 |
}
|
166 |
|
167 |
-
&.wc-block-price-
|
168 |
z-index: 20;
|
169 |
|
170 |
&::-webkit-slider-thumb {
|
@@ -183,25 +183,25 @@
|
|
183 |
|
184 |
&.is-loading,
|
185 |
&.is-disabled {
|
186 |
-
.wc-block-price-
|
187 |
-
.wc-block-price-
|
188 |
-
.wc-block-price-
|
189 |
@include placeholder();
|
190 |
box-shadow: none;
|
191 |
}
|
192 |
}
|
193 |
|
194 |
&.is-disabled:not(.is-loading) {
|
195 |
-
.wc-block-price-
|
196 |
-
.wc-block-price-
|
197 |
-
.wc-block-price-
|
198 |
animation: none;
|
199 |
}
|
200 |
}
|
201 |
}
|
202 |
|
203 |
.rtl {
|
204 |
-
.wc-block-price-
|
205 |
--track-background: linear-gradient(to left, transparent var(--low), var(--range-color) 0, var(--range-color) var(--high), transparent 0) no-repeat 0 100% / 100% 100%;
|
206 |
--range-color: #a8739d;
|
207 |
background: var(--track-background);
|
@@ -209,20 +209,20 @@
|
|
209 |
}
|
210 |
|
211 |
@mixin ie {
|
212 |
-
.wc-block-price-
|
213 |
-
.wc-block-price-
|
214 |
background: transparent;
|
215 |
box-shadow: none;
|
216 |
height: 24px;
|
217 |
|
218 |
-
.wc-block-price-
|
219 |
background: #a8739d;
|
220 |
box-shadow: 0 0 0 1px inset #95588a;
|
221 |
width: 100%;
|
222 |
top: 7px;
|
223 |
}
|
224 |
}
|
225 |
-
.wc-block-price-
|
226 |
height: 24px;
|
227 |
pointer-events: auto;
|
228 |
position: absolute;
|
@@ -255,7 +255,7 @@
|
|
255 |
pointer-events: auto;
|
256 |
}
|
257 |
}
|
258 |
-
.wc-block-price-
|
259 |
&::-ms-fill-upper {
|
260 |
background: #e1e1e1;
|
261 |
box-shadow: 0 0 0 1px inset #b8b8b8;
|
@@ -267,14 +267,14 @@
|
|
267 |
|
268 |
&.is-loading,
|
269 |
&.is-disabled {
|
270 |
-
.wc-block-price-
|
271 |
@include placeholder();
|
272 |
box-shadow: none;
|
273 |
}
|
274 |
}
|
275 |
|
276 |
&.is-disabled:not(.is-loading) {
|
277 |
-
.wc-block-price-
|
278 |
animation: none;
|
279 |
}
|
280 |
}
|
46 |
appearance: none;
|
47 |
}
|
48 |
|
49 |
+
.wc-block-components-price-slider {
|
50 |
margin-bottom: $gap-large;
|
51 |
|
52 |
+
.wc-block-components-price-slider__range-input-wrapper {
|
53 |
@include reset;
|
54 |
height: 9px;
|
55 |
clear: both;
|
58 |
background: #e1e1e1;
|
59 |
margin: 15px 0;
|
60 |
|
61 |
+
.wc-block-components-price-slider__range-input-progress {
|
62 |
height: 9px;
|
63 |
width: 100%;
|
64 |
position: absolute;
|
71 |
}
|
72 |
}
|
73 |
|
74 |
+
.wc-block-components-price-slider__controls {
|
75 |
display: flex;
|
76 |
|
77 |
+
.wc-block-components-price-slider__amount {
|
78 |
margin: 0;
|
79 |
border-radius: 4px;
|
80 |
width: auto;
|
81 |
max-width: 100px;
|
82 |
min-width: 0;
|
83 |
|
84 |
+
&.wc-block-components-price-slider__amount--min {
|
85 |
margin-right: 10px;
|
86 |
}
|
87 |
+
&.wc-block-components-price-slider__amount--max {
|
88 |
margin-left: auto;
|
89 |
}
|
90 |
}
|
91 |
}
|
92 |
+
&.wc-block-components-price-slider--has-filter-button {
|
93 |
+
.wc-block-components-price-slider__controls {
|
94 |
justify-content: flex-end;
|
95 |
|
96 |
+
.wc-block-components-price-slider__amount.wc-block-components-price-slider__amount--max {
|
97 |
margin-left: 0;
|
98 |
margin-right: 10px;
|
99 |
}
|
100 |
}
|
101 |
}
|
102 |
+
.wc-block-components-price-slider__range-input {
|
103 |
@include reset;
|
104 |
width: 100%;
|
105 |
height: 0;
|
148 |
}
|
149 |
}
|
150 |
|
151 |
+
&.wc-block-components-price-slider__range-input--min {
|
152 |
z-index: 21;
|
153 |
|
154 |
&::-webkit-slider-thumb {
|
164 |
}
|
165 |
}
|
166 |
|
167 |
+
&.wc-block-components-price-slider__range-input--max {
|
168 |
z-index: 20;
|
169 |
|
170 |
&::-webkit-slider-thumb {
|
183 |
|
184 |
&.is-loading,
|
185 |
&.is-disabled {
|
186 |
+
.wc-block-components-price-slider__range-input-wrapper,
|
187 |
+
.wc-block-components-price-slider__amount,
|
188 |
+
.wc-block-components-price-slider__button {
|
189 |
@include placeholder();
|
190 |
box-shadow: none;
|
191 |
}
|
192 |
}
|
193 |
|
194 |
&.is-disabled:not(.is-loading) {
|
195 |
+
.wc-block-components-price-slider__range-input-wrapper,
|
196 |
+
.wc-block-components-price-slider__amount,
|
197 |
+
.wc-block-components-price-slider__button {
|
198 |
animation: none;
|
199 |
}
|
200 |
}
|
201 |
}
|
202 |
|
203 |
.rtl {
|
204 |
+
.wc-block-components-price-slider .wc-block-components-price-slider__range-input-wrapper .wc-block-components-price-slider__range-input-progress {
|
205 |
--track-background: linear-gradient(to left, transparent var(--low), var(--range-color) 0, var(--range-color) var(--high), transparent 0) no-repeat 0 100% / 100% 100%;
|
206 |
--range-color: #a8739d;
|
207 |
background: var(--track-background);
|
209 |
}
|
210 |
|
211 |
@mixin ie {
|
212 |
+
.wc-block-components-price-slider {
|
213 |
+
.wc-block-components-price-slider__range-input-wrapper {
|
214 |
background: transparent;
|
215 |
box-shadow: none;
|
216 |
height: 24px;
|
217 |
|
218 |
+
.wc-block-components-price-slider__range-input-progress {
|
219 |
background: #a8739d;
|
220 |
box-shadow: 0 0 0 1px inset #95588a;
|
221 |
width: 100%;
|
222 |
top: 7px;
|
223 |
}
|
224 |
}
|
225 |
+
.wc-block-components-price-slider__range-input {
|
226 |
height: 24px;
|
227 |
pointer-events: auto;
|
228 |
position: absolute;
|
255 |
pointer-events: auto;
|
256 |
}
|
257 |
}
|
258 |
+
.wc-block-components-price-slider__range-input--max {
|
259 |
&::-ms-fill-upper {
|
260 |
background: #e1e1e1;
|
261 |
box-shadow: 0 0 0 1px inset #b8b8b8;
|
267 |
|
268 |
&.is-loading,
|
269 |
&.is-disabled {
|
270 |
+
.wc-block-components-price-slider__range-input-wrapper {
|
271 |
@include placeholder();
|
272 |
box-shadow: none;
|
273 |
}
|
274 |
}
|
275 |
|
276 |
&.is-disabled:not(.is-loading) {
|
277 |
+
.wc-block-components-price-slider__range-input-wrapper {
|
278 |
animation: none;
|
279 |
}
|
280 |
}
|
assets/js/base/components/product-sort-select/index.js
CHANGED
@@ -13,7 +13,7 @@ import './style.scss';
|
|
13 |
const ProductSortSelect = ( { defaultValue, onChange, readOnly, value } ) => {
|
14 |
return (
|
15 |
<SortSelect
|
16 |
-
className="wc-block-product-sort-select"
|
17 |
defaultValue={ defaultValue }
|
18 |
name="orderby"
|
19 |
onChange={ onChange }
|
13 |
const ProductSortSelect = ( { defaultValue, onChange, readOnly, value } ) => {
|
14 |
return (
|
15 |
<SortSelect
|
16 |
+
className="wc-block-product-sort-select wc-block-components-product-sort-select"
|
17 |
defaultValue={ defaultValue }
|
18 |
name="orderby"
|
19 |
onChange={ onChange }
|
assets/js/base/components/product-sort-select/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-product-sort-select {
|
2 |
margin-bottom: $gap-large;
|
3 |
text-align: left;
|
4 |
}
|
1 |
+
.wc-block-components-product-sort-select {
|
2 |
margin-bottom: $gap-large;
|
3 |
text-align: left;
|
4 |
}
|
assets/js/base/components/quantity-selector/index.js
CHANGED
@@ -22,7 +22,10 @@ const QuantitySelector = ( {
|
|
22 |
itemName = '',
|
23 |
disabled,
|
24 |
} ) => {
|
25 |
-
const classes = classNames(
|
|
|
|
|
|
|
26 |
|
27 |
const hasMaximum = typeof maximum !== 'undefined';
|
28 |
const canDecrease = quantity > minimum;
|
@@ -60,7 +63,7 @@ const QuantitySelector = ( {
|
|
60 |
return (
|
61 |
<div className={ classes }>
|
62 |
<input
|
63 |
-
className="wc-block-quantity-selector__input"
|
64 |
disabled={ disabled }
|
65 |
type="number"
|
66 |
step="1"
|
@@ -94,7 +97,7 @@ const QuantitySelector = ( {
|
|
94 |
'Reduce quantity',
|
95 |
'woo-gutenberg-products-block'
|
96 |
) }
|
97 |
-
className="wc-block-quantity-selector__button wc-block-quantity-selector__button--minus"
|
98 |
disabled={ disabled || ! canDecrease }
|
99 |
onClick={ () => {
|
100 |
const newQuantity = quantity - 1;
|
@@ -119,7 +122,7 @@ const QuantitySelector = ( {
|
|
119 |
'woo-gutenberg-products-block'
|
120 |
) }
|
121 |
disabled={ disabled || ! canIncrease }
|
122 |
-
className="wc-block-quantity-selector__button wc-block-quantity-selector__button--plus"
|
123 |
onClick={ () => {
|
124 |
const newQuantity = quantity + 1;
|
125 |
onChange( newQuantity );
|
22 |
itemName = '',
|
23 |
disabled,
|
24 |
} ) => {
|
25 |
+
const classes = classNames(
|
26 |
+
'wc-block-components-quantity-selector',
|
27 |
+
className
|
28 |
+
);
|
29 |
|
30 |
const hasMaximum = typeof maximum !== 'undefined';
|
31 |
const canDecrease = quantity > minimum;
|
63 |
return (
|
64 |
<div className={ classes }>
|
65 |
<input
|
66 |
+
className="wc-block-components-quantity-selector__input"
|
67 |
disabled={ disabled }
|
68 |
type="number"
|
69 |
step="1"
|
97 |
'Reduce quantity',
|
98 |
'woo-gutenberg-products-block'
|
99 |
) }
|
100 |
+
className="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
|
101 |
disabled={ disabled || ! canDecrease }
|
102 |
onClick={ () => {
|
103 |
const newQuantity = quantity - 1;
|
122 |
'woo-gutenberg-products-block'
|
123 |
) }
|
124 |
disabled={ disabled || ! canIncrease }
|
125 |
+
className="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
|
126 |
onClick={ () => {
|
127 |
const newQuantity = quantity + 1;
|
128 |
onChange( newQuantity );
|
assets/js/base/components/quantity-selector/style.scss
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
}
|
11 |
}
|
12 |
|
13 |
-
.wc-block-quantity-selector {
|
14 |
display: flex;
|
15 |
min-width: 100px;
|
16 |
border: 1px solid $core-grey-light-600;
|
@@ -18,7 +18,7 @@
|
|
18 |
border-radius: 4px;
|
19 |
|
20 |
// Extra label for specificity needed in the editor.
|
21 |
-
input.wc-block-quantity-selector__input {
|
22 |
@include font-size(regular);
|
23 |
order: 2;
|
24 |
min-width: 40px;
|
@@ -47,7 +47,7 @@
|
|
47 |
-webkit-appearance: none;
|
48 |
margin: 0;
|
49 |
}
|
50 |
-
.wc-block-quantity-selector__button {
|
51 |
@include reset-button;
|
52 |
@include font-size(regular);
|
53 |
min-width: 30px;
|
@@ -67,10 +67,10 @@
|
|
67 |
@include reset-button;
|
68 |
}
|
69 |
}
|
70 |
-
.wc-block-quantity-selector__button--minus {
|
71 |
order: 1;
|
72 |
}
|
73 |
-
.wc-block-quantity-selector__button--plus {
|
74 |
order: 3;
|
75 |
}
|
76 |
}
|
10 |
}
|
11 |
}
|
12 |
|
13 |
+
.wc-block-components-quantity-selector {
|
14 |
display: flex;
|
15 |
min-width: 100px;
|
16 |
border: 1px solid $core-grey-light-600;
|
18 |
border-radius: 4px;
|
19 |
|
20 |
// Extra label for specificity needed in the editor.
|
21 |
+
input.wc-block-components-quantity-selector__input {
|
22 |
@include font-size(regular);
|
23 |
order: 2;
|
24 |
min-width: 40px;
|
47 |
-webkit-appearance: none;
|
48 |
margin: 0;
|
49 |
}
|
50 |
+
.wc-block-components-quantity-selector__button {
|
51 |
@include reset-button;
|
52 |
@include font-size(regular);
|
53 |
min-width: 30px;
|
67 |
@include reset-button;
|
68 |
}
|
69 |
}
|
70 |
+
.wc-block-components-quantity-selector__button--minus {
|
71 |
order: 1;
|
72 |
}
|
73 |
+
.wc-block-components-quantity-selector__button--plus {
|
74 |
order: 3;
|
75 |
}
|
76 |
}
|
assets/js/base/components/radio-control/_mixin.scss
CHANGED
@@ -1,65 +1,64 @@
|
|
1 |
@mixin radio-control-styles {
|
2 |
-
.wc-block-radio-control__option {
|
3 |
@include reset-typography();
|
4 |
-
border
|
5 |
display: block;
|
6 |
padding: $gap-small $gap-small 0 #{$gap-larger * 2};
|
7 |
-
position: relative;
|
8 |
}
|
9 |
|
10 |
-
.wc-block-radio-control__option-layout {
|
|
|
11 |
display: table;
|
12 |
width: 100%;
|
13 |
-
border-bottom: 1px solid $core-grey-light-600;
|
14 |
padding-bottom: $gap-small;
|
15 |
}
|
16 |
|
17 |
-
.wc-block-radio-control__option .wc-block-radio-control__option-layout {
|
18 |
-
|
|
|
|
|
19 |
}
|
20 |
|
21 |
-
.wc-block-radio-control__input {
|
22 |
left: $gap-large;
|
23 |
position: absolute;
|
24 |
top: $gap-small;
|
25 |
}
|
26 |
|
27 |
-
.wc-block-radio-control__label-group,
|
28 |
-
.wc-block-radio-control__description-group {
|
29 |
display: table-row;
|
30 |
|
31 |
> span {
|
32 |
display: table-cell;
|
33 |
}
|
34 |
|
35 |
-
.wc-block-radio-control__secondary-label,
|
36 |
-
.wc-block-radio-control__secondary-description {
|
37 |
text-align: right;
|
38 |
min-width: 50%;
|
39 |
}
|
40 |
}
|
41 |
|
42 |
-
.wc-block-radio-control__label,
|
43 |
-
.wc-block-radio-control__secondary-label {
|
44 |
line-height: 20px;
|
45 |
// Currently, max() CSS function calls need to be wrapped with unquote.
|
46 |
// See: https://github.com/sass/sass/issues/2378#issuecomment-367490840
|
47 |
line-height: unquote("max(1rem, 20px)");
|
48 |
-
color: $core-grey-dark-600;
|
49 |
}
|
50 |
|
51 |
-
.wc-block-radio-control__description,
|
52 |
-
.wc-block-radio-control__secondary-description {
|
53 |
@include font-size(small);
|
54 |
line-height: 20px;
|
55 |
-
color: $core-grey-dark-400;
|
56 |
}
|
57 |
}
|
58 |
|
59 |
@mixin radio-control-input-styles {
|
60 |
// Extra class for specificity.
|
61 |
-
.wc-block-radio-control {
|
62 |
-
.wc-block-radio-control__input {
|
63 |
appearance: none;
|
64 |
background: #fff;
|
65 |
border: 2px solid currentColor;
|
@@ -88,7 +87,7 @@
|
|
88 |
}
|
89 |
|
90 |
@include breakpoint( ">782px" ) {
|
91 |
-
.wc-block-radio-control__input {
|
92 |
height: 1rem;
|
93 |
margin-top: 2px;
|
94 |
min-height: 16px;
|
1 |
@mixin radio-control-styles {
|
2 |
+
.wc-block-components-radio-control__option {
|
3 |
@include reset-typography();
|
4 |
+
@include with-translucent-border(0 0 1px);
|
5 |
display: block;
|
6 |
padding: $gap-small $gap-small 0 #{$gap-larger * 2};
|
|
|
7 |
}
|
8 |
|
9 |
+
.wc-block-components-radio-control__option-layout {
|
10 |
+
@include with-translucent-border(0 0 1px);
|
11 |
display: table;
|
12 |
width: 100%;
|
|
|
13 |
padding-bottom: $gap-small;
|
14 |
}
|
15 |
|
16 |
+
.wc-block-components-radio-control__option .wc-block-components-radio-control__option-layout {
|
17 |
+
&::after {
|
18 |
+
display: none;
|
19 |
+
}
|
20 |
}
|
21 |
|
22 |
+
.wc-block-components-radio-control__input {
|
23 |
left: $gap-large;
|
24 |
position: absolute;
|
25 |
top: $gap-small;
|
26 |
}
|
27 |
|
28 |
+
.wc-block-components-radio-control__label-group,
|
29 |
+
.wc-block-components-radio-control__description-group {
|
30 |
display: table-row;
|
31 |
|
32 |
> span {
|
33 |
display: table-cell;
|
34 |
}
|
35 |
|
36 |
+
.wc-block-components-radio-control__secondary-label,
|
37 |
+
.wc-block-components-radio-control__secondary-description {
|
38 |
text-align: right;
|
39 |
min-width: 50%;
|
40 |
}
|
41 |
}
|
42 |
|
43 |
+
.wc-block-components-radio-control__label,
|
44 |
+
.wc-block-components-radio-control__secondary-label {
|
45 |
line-height: 20px;
|
46 |
// Currently, max() CSS function calls need to be wrapped with unquote.
|
47 |
// See: https://github.com/sass/sass/issues/2378#issuecomment-367490840
|
48 |
line-height: unquote("max(1rem, 20px)");
|
|
|
49 |
}
|
50 |
|
51 |
+
.wc-block-components-radio-control__description,
|
52 |
+
.wc-block-components-radio-control__secondary-description {
|
53 |
@include font-size(small);
|
54 |
line-height: 20px;
|
|
|
55 |
}
|
56 |
}
|
57 |
|
58 |
@mixin radio-control-input-styles {
|
59 |
// Extra class for specificity.
|
60 |
+
.wc-block-components-radio-control {
|
61 |
+
.wc-block-components-radio-control__input {
|
62 |
appearance: none;
|
63 |
background: #fff;
|
64 |
border: 2px solid currentColor;
|
87 |
}
|
88 |
|
89 |
@include breakpoint( ">782px" ) {
|
90 |
+
.wc-block-components-radio-control__input {
|
91 |
height: 1rem;
|
92 |
margin-top: 2px;
|
93 |
min-height: 16px;
|
assets/js/base/components/radio-control/index.js
CHANGED
@@ -24,7 +24,10 @@ const RadioControl = ( {
|
|
24 |
return (
|
25 |
options.length && (
|
26 |
<div
|
27 |
-
className={ classnames(
|
|
|
|
|
|
|
28 |
>
|
29 |
{ options.map( ( option ) => (
|
30 |
<RadioControlOption
|
24 |
return (
|
25 |
options.length && (
|
26 |
<div
|
27 |
+
className={ classnames(
|
28 |
+
'wc-block-components-radio-control',
|
29 |
+
className
|
30 |
+
) }
|
31 |
>
|
32 |
{ options.map( ( option ) => (
|
33 |
<RadioControlOption
|
assets/js/base/components/radio-control/option-layout.js
CHANGED
@@ -6,12 +6,12 @@ const OptionLayout = ( {
|
|
6 |
id,
|
7 |
} ) => {
|
8 |
return (
|
9 |
-
<div className="wc-block-radio-control__option-layout">
|
10 |
-
<div className="wc-block-radio-control__label-group">
|
11 |
{ label && (
|
12 |
<span
|
13 |
id={ id ? `${ id }__label` : null }
|
14 |
-
className="wc-block-radio-control__label"
|
15 |
>
|
16 |
{ label }
|
17 |
</span>
|
@@ -19,17 +19,17 @@ const OptionLayout = ( {
|
|
19 |
{ secondaryLabel && (
|
20 |
<span
|
21 |
id={ id ? `${ id }__secondary-label` : null }
|
22 |
-
className="wc-block-radio-control__secondary-label"
|
23 |
>
|
24 |
{ secondaryLabel }
|
25 |
</span>
|
26 |
) }
|
27 |
</div>
|
28 |
-
<div className="wc-block-radio-control__description-group">
|
29 |
{ description && (
|
30 |
<span
|
31 |
id={ id ? `${ id }__description` : null }
|
32 |
-
className="wc-block-radio-control__description"
|
33 |
>
|
34 |
{ description }
|
35 |
</span>
|
@@ -37,7 +37,7 @@ const OptionLayout = ( {
|
|
37 |
{ secondaryDescription && (
|
38 |
<span
|
39 |
id={ id ? `${ id }__secondary-description` : null }
|
40 |
-
className="wc-block-radio-control__secondary-description"
|
41 |
>
|
42 |
{ secondaryDescription }
|
43 |
</span>
|
6 |
id,
|
7 |
} ) => {
|
8 |
return (
|
9 |
+
<div className="wc-block-components-radio-control__option-layout">
|
10 |
+
<div className="wc-block-components-radio-control__label-group">
|
11 |
{ label && (
|
12 |
<span
|
13 |
id={ id ? `${ id }__label` : null }
|
14 |
+
className="wc-block-components-radio-control__label"
|
15 |
>
|
16 |
{ label }
|
17 |
</span>
|
19 |
{ secondaryLabel && (
|
20 |
<span
|
21 |
id={ id ? `${ id }__secondary-label` : null }
|
22 |
+
className="wc-block-components-radio-control__secondary-label"
|
23 |
>
|
24 |
{ secondaryLabel }
|
25 |
</span>
|
26 |
) }
|
27 |
</div>
|
28 |
+
<div className="wc-block-components-radio-control__description-group">
|
29 |
{ description && (
|
30 |
<span
|
31 |
id={ id ? `${ id }__description` : null }
|
32 |
+
className="wc-block-components-radio-control__description"
|
33 |
>
|
34 |
{ description }
|
35 |
</span>
|
37 |
{ secondaryDescription && (
|
38 |
<span
|
39 |
id={ id ? `${ id }__secondary-description` : null }
|
40 |
+
className="wc-block-components-radio-control__secondary-description"
|
41 |
>
|
42 |
{ secondaryDescription }
|
43 |
</span>
|
assets/js/base/components/radio-control/option.js
CHANGED
@@ -20,12 +20,12 @@ const Option = ( { checked, name, onChange, option } ) => {
|
|
20 |
|
21 |
return (
|
22 |
<label
|
23 |
-
className="wc-block-radio-control__option"
|
24 |
htmlFor={ `${ name }-${ value }` }
|
25 |
>
|
26 |
<input
|
27 |
id={ `${ name }-${ value }` }
|
28 |
-
className="wc-block-radio-control__input"
|
29 |
type="radio"
|
30 |
name={ name }
|
31 |
value={ value }
|
20 |
|
21 |
return (
|
22 |
<label
|
23 |
+
className="wc-block-components-radio-control__option"
|
24 |
htmlFor={ `${ name }-${ value }` }
|
25 |
>
|
26 |
<input
|
27 |
id={ `${ name }-${ value }` }
|
28 |
+
className="wc-block-components-radio-control__input"
|
29 |
type="radio"
|
30 |
name={ name }
|
31 |
value={ value }
|
assets/js/base/components/reviews/review-list-item/index.js
CHANGED
@@ -15,7 +15,7 @@ function getReviewImage( review, imageType, isLoading ) {
|
|
15 |
if ( isLoading || ! review ) {
|
16 |
return (
|
17 |
<div
|
18 |
-
className="wc-block-review-list-item__image"
|
19 |
width="48"
|
20 |
height="48"
|
21 |
/>
|
@@ -23,15 +23,12 @@ function getReviewImage( review, imageType, isLoading ) {
|
|
23 |
}
|
24 |
|
25 |
return (
|
26 |
-
<div className="wc-block-review-list-item__image">
|
27 |
{ imageType === 'product' ? (
|
28 |
<img
|
29 |
aria-hidden="true"
|
30 |
alt={ review.product_image?.alt || '' }
|
31 |
-
src={ review.product_image?.
|
32 |
-
className="wc-block-review-list-item__image"
|
33 |
-
width="48"
|
34 |
-
height="48"
|
35 |
/>
|
36 |
) : (
|
37 |
<img
|
@@ -39,14 +36,11 @@ function getReviewImage( review, imageType, isLoading ) {
|
|
39 |
alt=""
|
40 |
src={ review.reviewer_avatar_urls[ '48' ] || '' }
|
41 |
srcSet={ review.reviewer_avatar_urls[ '96' ] + ' 2x' }
|
42 |
-
className="wc-block-review-list-item__image"
|
43 |
-
width="48"
|
44 |
-
height="48"
|
45 |
/>
|
46 |
) }
|
47 |
{ review.verified && (
|
48 |
<div
|
49 |
-
className="wc-block-review-list-item__verified"
|
50 |
title={ __(
|
51 |
'Verified buyer',
|
52 |
'woo-gutenberg-products-block'
|
@@ -71,7 +65,7 @@ function getReviewContent( review ) {
|
|
71 |
'Hide full review',
|
72 |
'woo-gutenberg-products-block'
|
73 |
) }
|
74 |
-
className="wc-block-review-list-item__text"
|
75 |
>
|
76 |
<div
|
77 |
dangerouslySetInnerHTML={ {
|
@@ -87,7 +81,7 @@ function getReviewContent( review ) {
|
|
87 |
|
88 |
function getReviewProductName( review ) {
|
89 |
return (
|
90 |
-
<div className="wc-block-review-list-item__product">
|
91 |
<a
|
92 |
href={ review.product_permalink }
|
93 |
dangerouslySetInnerHTML={ {
|
@@ -104,7 +98,9 @@ function getReviewProductName( review ) {
|
|
104 |
function getReviewerName( review ) {
|
105 |
const { reviewer = '' } = review;
|
106 |
return (
|
107 |
-
<div className="wc-block-review-list-item__author">
|
|
|
|
|
108 |
);
|
109 |
}
|
110 |
|
@@ -115,7 +111,7 @@ function getReviewDate( review ) {
|
|
115 |
} = review;
|
116 |
return (
|
117 |
<time
|
118 |
-
className="wc-block-review-list-item__published-date"
|
119 |
dateTime={ dateCreated }
|
120 |
>
|
121 |
{ formattedDateCreated }
|
@@ -129,9 +125,9 @@ function getReviewRating( review ) {
|
|
129 |
width: ( rating / 5 ) * 100 + '%' /* stylelint-disable-line */,
|
130 |
};
|
131 |
return (
|
132 |
-
<div className="wc-block-review-list-item__rating">
|
133 |
<div
|
134 |
-
className="wc-block-review-list-item__rating__stars"
|
135 |
role="img"
|
136 |
>
|
137 |
<span style={ starStyle }>
|
@@ -164,9 +160,13 @@ const ReviewListItem = ( { attributes, review = {} } ) => {
|
|
164 |
|
165 |
return (
|
166 |
<li
|
167 |
-
className={ classNames(
|
168 |
-
'
|
169 |
-
|
|
|
|
|
|
|
|
|
170 |
aria-hidden={ isLoading }
|
171 |
>
|
172 |
{ ( showProductName ||
|
@@ -174,14 +174,14 @@ const ReviewListItem = ( { attributes, review = {} } ) => {
|
|
174 |
showReviewerName ||
|
175 |
showReviewImage ||
|
176 |
showReviewRating ) && (
|
177 |
-
<div className="wc-block-review-list-item__info">
|
178 |
{ showReviewImage &&
|
179 |
getReviewImage( review, imageType, isLoading ) }
|
180 |
{ ( showProductName ||
|
181 |
showReviewerName ||
|
182 |
showReviewRating ||
|
183 |
showReviewDate ) && (
|
184 |
-
<div className="wc-block-review-list-item__meta">
|
185 |
{ showReviewRating && getReviewRating( review ) }
|
186 |
{ showProductName &&
|
187 |
getReviewProductName( review ) }
|
15 |
if ( isLoading || ! review ) {
|
16 |
return (
|
17 |
<div
|
18 |
+
className="wc-block-review-list-item__image wc-block-components-review-list-item__image"
|
19 |
width="48"
|
20 |
height="48"
|
21 |
/>
|
23 |
}
|
24 |
|
25 |
return (
|
26 |
+
<div className="wc-block-review-list-item__image wc-block-components-review-list-item__image">
|
27 |
{ imageType === 'product' ? (
|
28 |
<img
|
29 |
aria-hidden="true"
|
30 |
alt={ review.product_image?.alt || '' }
|
31 |
+
src={ review.product_image?.thumbnail || '' }
|
|
|
|
|
|
|
32 |
/>
|
33 |
) : (
|
34 |
<img
|
36 |
alt=""
|
37 |
src={ review.reviewer_avatar_urls[ '48' ] || '' }
|
38 |
srcSet={ review.reviewer_avatar_urls[ '96' ] + ' 2x' }
|
|
|
|
|
|
|
39 |
/>
|
40 |
) }
|
41 |
{ review.verified && (
|
42 |
<div
|
43 |
+
className="wc-block-review-list-item__verified wc-block-components-review-list-item__verified"
|
44 |
title={ __(
|
45 |
'Verified buyer',
|
46 |
'woo-gutenberg-products-block'
|
65 |
'Hide full review',
|
66 |
'woo-gutenberg-products-block'
|
67 |
) }
|
68 |
+
className="wc-block-review-list-item__text wc-block-components-review-list-item__text"
|
69 |
>
|
70 |
<div
|
71 |
dangerouslySetInnerHTML={ {
|
81 |
|
82 |
function getReviewProductName( review ) {
|
83 |
return (
|
84 |
+
<div className="wc-block-review-list-item__product wc-block-components-review-list-item__product">
|
85 |
<a
|
86 |
href={ review.product_permalink }
|
87 |
dangerouslySetInnerHTML={ {
|
98 |
function getReviewerName( review ) {
|
99 |
const { reviewer = '' } = review;
|
100 |
return (
|
101 |
+
<div className="wc-block-review-list-item__author wc-block-components-review-list-item__author">
|
102 |
+
{ reviewer }
|
103 |
+
</div>
|
104 |
);
|
105 |
}
|
106 |
|
111 |
} = review;
|
112 |
return (
|
113 |
<time
|
114 |
+
className="wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date"
|
115 |
dateTime={ dateCreated }
|
116 |
>
|
117 |
{ formattedDateCreated }
|
125 |
width: ( rating / 5 ) * 100 + '%' /* stylelint-disable-line */,
|
126 |
};
|
127 |
return (
|
128 |
+
<div className="wc-block-review-list-item__rating wc-block-components-review-list-item__rating">
|
129 |
<div
|
130 |
+
className="wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars"
|
131 |
role="img"
|
132 |
>
|
133 |
<span style={ starStyle }>
|
160 |
|
161 |
return (
|
162 |
<li
|
163 |
+
className={ classNames(
|
164 |
+
'wc-block-review-list-item__item',
|
165 |
+
'wc-block-components-review-list-item__item',
|
166 |
+
{
|
167 |
+
'is-loading': isLoading,
|
168 |
+
}
|
169 |
+
) }
|
170 |
aria-hidden={ isLoading }
|
171 |
>
|
172 |
{ ( showProductName ||
|
174 |
showReviewerName ||
|
175 |
showReviewImage ||
|
176 |
showReviewRating ) && (
|
177 |
+
<div className="wc-block-review-list-item__info wc-block-components-review-list-item__info">
|
178 |
{ showReviewImage &&
|
179 |
getReviewImage( review, imageType, isLoading ) }
|
180 |
{ ( showProductName ||
|
181 |
showReviewerName ||
|
182 |
showReviewRating ||
|
183 |
showReviewDate ) && (
|
184 |
+
<div className="wc-block-review-list-item__meta wc-block-components-review-list-item__meta">
|
185 |
{ showReviewRating && getReviewRating( review ) }
|
186 |
{ showProductName &&
|
187 |
getReviewProductName( review ) }
|
assets/js/base/components/reviews/review-list-item/style.scss
CHANGED
@@ -1,82 +1,91 @@
|
|
1 |
.is-loading {
|
2 |
-
.wc-block-review-list-item__text {
|
3 |
@include placeholder();
|
|
|
4 |
display: block;
|
5 |
width: 60%;
|
6 |
}
|
7 |
|
8 |
-
.wc-block-review-list-item__info {
|
9 |
-
.wc-block-review-list-item__image {
|
10 |
@include placeholder();
|
|
|
11 |
}
|
12 |
|
13 |
-
.wc-block-review-list-item__meta {
|
14 |
-
.wc-block-review-list-item__author {
|
15 |
@include placeholder();
|
16 |
@include font-size(regular);
|
|
|
17 |
width: 80px;
|
18 |
}
|
19 |
|
20 |
-
.wc-block-review-list-item__product {
|
21 |
display: none;
|
22 |
}
|
23 |
|
24 |
-
.wc-block-review-list-item__rating {
|
25 |
-
.wc-block-review-list-item__rating__stars > span {
|
26 |
display: none;
|
27 |
}
|
28 |
}
|
29 |
}
|
30 |
|
31 |
-
.wc-block-review-list-item__published-date {
|
32 |
@include placeholder();
|
|
|
33 |
height: 1em;
|
34 |
width: 120px;
|
35 |
}
|
36 |
}
|
37 |
}
|
38 |
|
39 |
-
.editor-styles-wrapper .wc-block-review-list-item__item,
|
40 |
-
.wc-block-review-list-item__item {
|
41 |
margin: 0 0 $gap-large * 2;
|
42 |
list-style: none;
|
43 |
}
|
44 |
|
45 |
-
.wc-block-review-list-item__info {
|
46 |
display: grid;
|
47 |
grid-template-columns: 1fr;
|
48 |
margin-bottom: $gap-large;
|
49 |
}
|
50 |
|
51 |
-
.wc-block-review-list-item__meta {
|
52 |
grid-column: 1;
|
53 |
grid-row: 1;
|
54 |
}
|
55 |
|
56 |
.has-image {
|
57 |
-
.wc-block-review-list-item__info {
|
58 |
grid-template-columns: #{48px + $gap} 1fr;
|
59 |
}
|
60 |
-
.wc-block-review-list-item__meta {
|
61 |
grid-column: 2;
|
62 |
}
|
63 |
}
|
64 |
|
65 |
-
.wc-block-review-list-item__image {
|
|
|
|
|
66 |
height: 48px;
|
67 |
grid-column: 1;
|
68 |
grid-row: 1 / 3;
|
69 |
-
|
70 |
position: relative;
|
|
|
71 |
|
72 |
-
img {
|
73 |
-
width: 100%;
|
74 |
-
height: 100%;
|
75 |
display: block;
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
}
|
78 |
|
79 |
-
.wc-block-review-list-item__verified {
|
80 |
width: 21px;
|
81 |
height: 21px;
|
82 |
text-indent: 21px;
|
@@ -96,7 +105,7 @@
|
|
96 |
}
|
97 |
}
|
98 |
|
99 |
-
.wc-block-review-list-item__meta {
|
100 |
display: flex;
|
101 |
align-items: center;
|
102 |
flex-flow: row wrap;
|
@@ -109,32 +118,32 @@
|
|
109 |
}
|
110 |
}
|
111 |
|
112 |
-
.wc-block-review-list-item__product {
|
113 |
display: block;
|
114 |
font-weight: bold;
|
115 |
order: 1;
|
116 |
margin-right: $gap/2;
|
117 |
}
|
118 |
|
119 |
-
.wc-block-review-list-item__author {
|
120 |
display: block;
|
121 |
font-weight: bold;
|
122 |
order: 1;
|
123 |
margin-right: $gap/2;
|
124 |
}
|
125 |
|
126 |
-
.wc-block-review-list-item__product + .wc-block-review-list-item__author {
|
127 |
font-weight: normal;
|
128 |
color: #808080;
|
129 |
order: 4;
|
130 |
}
|
131 |
|
132 |
-
.wc-block-review-list-item__published-date {
|
133 |
color: #808080;
|
134 |
order: 5;
|
135 |
}
|
136 |
|
137 |
-
.wc-block-review-list-item__author + .wc-block-review-list-item__published-date {
|
138 |
&::before {
|
139 |
content: "";
|
140 |
display: inline-block;
|
@@ -145,17 +154,17 @@
|
|
145 |
}
|
146 |
}
|
147 |
|
148 |
-
.wc-block-review-list-item__author:first-child + .wc-block-review-list-item__published-date,
|
149 |
-
.wc-block-review-list-item__rating + .wc-block-review-list-item__author + .wc-block-review-list-item__published-date {
|
150 |
&::before {
|
151 |
display: none;
|
152 |
}
|
153 |
}
|
154 |
|
155 |
-
.wc-block-review-list-item__rating {
|
156 |
order: 2;
|
157 |
|
158 |
-
> .wc-block-review-list-item__rating__stars {
|
159 |
@include font-size(regular);
|
160 |
display: inline-block;
|
161 |
top: 0;
|
@@ -169,7 +178,7 @@
|
|
169 |
vertical-align: top;
|
170 |
}
|
171 |
|
172 |
-
> .wc-block-review-list-item__rating__stars::before {
|
173 |
content: "\53\53\53\53\53";
|
174 |
opacity: 0.25;
|
175 |
float: left;
|
@@ -178,7 +187,7 @@
|
|
178 |
position: absolute;
|
179 |
}
|
180 |
|
181 |
-
> .wc-block-review-list-item__rating__stars span {
|
182 |
overflow: hidden;
|
183 |
float: left;
|
184 |
top: 0;
|
@@ -187,7 +196,7 @@
|
|
187 |
padding-top: 1.5em;
|
188 |
}
|
189 |
|
190 |
-
> .wc-block-review-list-item__rating__stars span::before {
|
191 |
content: "\53\53\53\53\53";
|
192 |
top: 0;
|
193 |
position: absolute;
|
1 |
.is-loading {
|
2 |
+
.wc-block-components-review-list-item__text {
|
3 |
@include placeholder();
|
4 |
+
@include force-content();
|
5 |
display: block;
|
6 |
width: 60%;
|
7 |
}
|
8 |
|
9 |
+
.wc-block-components-review-list-item__info {
|
10 |
+
.wc-block-components-review-list-item__image {
|
11 |
@include placeholder();
|
12 |
+
@include force-content();
|
13 |
}
|
14 |
|
15 |
+
.wc-block-components-review-list-item__meta {
|
16 |
+
.wc-block-components-review-list-item__author {
|
17 |
@include placeholder();
|
18 |
@include font-size(regular);
|
19 |
+
@include force-content();
|
20 |
width: 80px;
|
21 |
}
|
22 |
|
23 |
+
.wc-block-components-review-list-item__product {
|
24 |
display: none;
|
25 |
}
|
26 |
|
27 |
+
.wc-block-components-review-list-item__rating {
|
28 |
+
.wc-block-components-review-list-item__rating__stars > span {
|
29 |
display: none;
|
30 |
}
|
31 |
}
|
32 |
}
|
33 |
|
34 |
+
.wc-block-components-review-list-item__published-date {
|
35 |
@include placeholder();
|
36 |
+
@include force-content();
|
37 |
height: 1em;
|
38 |
width: 120px;
|
39 |
}
|
40 |
}
|
41 |
}
|
42 |
|
43 |
+
.editor-styles-wrapper .wc-block-components-review-list-item__item,
|
44 |
+
.wc-block-components-review-list-item__item {
|
45 |
margin: 0 0 $gap-large * 2;
|
46 |
list-style: none;
|
47 |
}
|
48 |
|
49 |
+
.wc-block-components-review-list-item__info {
|
50 |
display: grid;
|
51 |
grid-template-columns: 1fr;
|
52 |
margin-bottom: $gap-large;
|
53 |
}
|
54 |
|
55 |
+
.wc-block-components-review-list-item__meta {
|
56 |
grid-column: 1;
|
57 |
grid-row: 1;
|
58 |
}
|
59 |
|
60 |
.has-image {
|
61 |
+
.wc-block-components-review-list-item__info {
|
62 |
grid-template-columns: #{48px + $gap} 1fr;
|
63 |
}
|
64 |
+
.wc-block-components-review-list-item__meta {
|
65 |
grid-column: 2;
|
66 |
}
|
67 |
}
|
68 |
|
69 |
+
.wc-block-components-review-list-item__image {
|
70 |
+
align-items: center;
|
71 |
+
display: flex;
|
72 |
height: 48px;
|
73 |
grid-column: 1;
|
74 |
grid-row: 1 / 3;
|
75 |
+
justify-content: center;
|
76 |
position: relative;
|
77 |
+
width: 48px;
|
78 |
|
79 |
+
> img {
|
|
|
|
|
80 |
display: block;
|
81 |
+
height: auto;
|
82 |
+
max-height: 100%;
|
83 |
+
max-width: 100%;
|
84 |
+
width: auto;
|
85 |
}
|
86 |
}
|
87 |
|
88 |
+
.wc-block-components-review-list-item__verified {
|
89 |
width: 21px;
|
90 |
height: 21px;
|
91 |
text-indent: 21px;
|
105 |
}
|
106 |
}
|
107 |
|
108 |
+
.wc-block-components-review-list-item__meta {
|
109 |
display: flex;
|
110 |
align-items: center;
|
111 |
flex-flow: row wrap;
|
118 |
}
|
119 |
}
|
120 |
|
121 |
+
.wc-block-components-review-list-item__product {
|
122 |
display: block;
|
123 |
font-weight: bold;
|
124 |
order: 1;
|
125 |
margin-right: $gap/2;
|
126 |
}
|
127 |
|
128 |
+
.wc-block-components-review-list-item__author {
|
129 |
display: block;
|
130 |
font-weight: bold;
|
131 |
order: 1;
|
132 |
margin-right: $gap/2;
|
133 |
}
|
134 |
|
135 |
+
.wc-block-components-review-list-item__product + .wc-block-components-review-list-item__author {
|
136 |
font-weight: normal;
|
137 |
color: #808080;
|
138 |
order: 4;
|
139 |
}
|
140 |
|
141 |
+
.wc-block-components-review-list-item__published-date {
|
142 |
color: #808080;
|
143 |
order: 5;
|
144 |
}
|
145 |
|
146 |
+
.wc-block-components-review-list-item__author + .wc-block-components-review-list-item__published-date {
|
147 |
&::before {
|
148 |
content: "";
|
149 |
display: inline-block;
|
154 |
}
|
155 |
}
|
156 |
|
157 |
+
.wc-block-components-review-list-item__author:first-child + .wc-block-components-review-list-item__published-date,
|
158 |
+
.wc-block-components-review-list-item__rating + .wc-block-components-review-list-item__author + .wc-block-components-review-list-item__published-date {
|
159 |
&::before {
|
160 |
display: none;
|
161 |
}
|
162 |
}
|
163 |
|
164 |
+
.wc-block-components-review-list-item__rating {
|
165 |
order: 2;
|
166 |
|
167 |
+
> .wc-block-components-review-list-item__rating__stars {
|
168 |
@include font-size(regular);
|
169 |
display: inline-block;
|
170 |
top: 0;
|
178 |
vertical-align: top;
|
179 |
}
|
180 |
|
181 |
+
> .wc-block-components-review-list-item__rating__stars::before {
|
182 |
content: "\53\53\53\53\53";
|
183 |
opacity: 0.25;
|
184 |
float: left;
|
187 |
position: absolute;
|
188 |
}
|
189 |
|
190 |
+
> .wc-block-components-review-list-item__rating__stars span {
|
191 |
overflow: hidden;
|
192 |
float: left;
|
193 |
top: 0;
|
196 |
padding-top: 1.5em;
|
197 |
}
|
198 |
|
199 |
+
> .wc-block-components-review-list-item__rating__stars span::before {
|
200 |
content: "\53\53\53\53\53";
|
201 |
top: 0;
|
202 |
position: absolute;
|
assets/js/base/components/reviews/review-list/index.js
CHANGED
@@ -26,7 +26,7 @@ const ReviewList = ( { attributes, reviews } ) => {
|
|
26 |
};
|
27 |
|
28 |
return (
|
29 |
-
<ul className="wc-block-review-list">
|
30 |
{ reviews.length === 0 ? (
|
31 |
<ReviewListItem attributes={ attrs } />
|
32 |
) : (
|
26 |
};
|
27 |
|
28 |
return (
|
29 |
+
<ul className="wc-block-review-list wc-block-components-review-list">
|
30 |
{ reviews.length === 0 ? (
|
31 |
<ReviewListItem attributes={ attrs } />
|
32 |
) : (
|
assets/js/base/components/reviews/review-list/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-review-list,
|
2 |
-
.editor-styles .wc-block-review-list {
|
3 |
margin: 0;
|
4 |
}
|
1 |
+
.wc-block-components-review-list,
|
2 |
+
.editor-styles .wc-block-components-review-list {
|
3 |
margin: 0;
|
4 |
}
|
assets/js/base/components/reviews/review-sort-select/index.js
CHANGED
@@ -13,7 +13,7 @@ import './style.scss';
|
|
13 |
const ReviewSortSelect = ( { defaultValue, onChange, readOnly, value } ) => {
|
14 |
return (
|
15 |
<SortSelect
|
16 |
-
className="wc-block-review-sort-select"
|
17 |
defaultValue={ defaultValue }
|
18 |
label={ __( 'Order by', 'woo-gutenberg-products-block' ) }
|
19 |
onChange={ onChange }
|
13 |
const ReviewSortSelect = ( { defaultValue, onChange, readOnly, value } ) => {
|
14 |
return (
|
15 |
<SortSelect
|
16 |
+
className="wc-block-review-sort-select wc-block-components-review-sort-select"
|
17 |
defaultValue={ defaultValue }
|
18 |
label={ __( 'Order by', 'woo-gutenberg-products-block' ) }
|
19 |
onChange={ onChange }
|
assets/js/base/components/reviews/review-sort-select/style.scss
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
.wc-block-review-sort-select {
|
2 |
text-align: right;
|
3 |
}
|
1 |
+
.wc-block-components-review-sort-select {
|
2 |
text-align: right;
|
3 |
}
|
assets/js/base/components/select/index.js
CHANGED
@@ -22,7 +22,7 @@ const Select = ( {
|
|
22 |
return (
|
23 |
<div
|
24 |
id={ id }
|
25 |
-
className={ classnames( 'wc-block-select', className, {
|
26 |
'is-active': value,
|
27 |
} ) }
|
28 |
>
|
22 |
return (
|
23 |
<div
|
24 |
id={ id }
|
25 |
+
className={ classnames( 'wc-block-components-select', className, {
|
26 |
'is-active': value,
|
27 |
} ) }
|
28 |
>
|
assets/js/base/components/select/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-select {
|
2 |
height: 3em;
|
3 |
position: relative;
|
4 |
margin-bottom: em($gap-large);
|
1 |
+
.wc-block-components-select {
|
2 |
height: 3em;
|
3 |
position: relative;
|
4 |
margin-bottom: em($gap-large);
|
assets/js/base/components/sidebar-layout/main.js
CHANGED
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
6 |
|
7 |
const Main = ( { children, className } ) => {
|
8 |
return (
|
9 |
-
<div className={ classNames( 'wc-block-main', className ) }>
|
10 |
{ children }
|
11 |
</div>
|
12 |
);
|
6 |
|
7 |
const Main = ( { children, className } ) => {
|
8 |
return (
|
9 |
+
<div className={ classNames( 'wc-block-components-main', className ) }>
|
10 |
{ children }
|
11 |
</div>
|
12 |
);
|
assets/js/base/components/sidebar-layout/sidebar-layout.js
CHANGED
@@ -13,7 +13,10 @@ import './style.scss';
|
|
13 |
const SidebarLayout = ( { children, className } ) => {
|
14 |
return (
|
15 |
<ContainerWidthContextProvider
|
16 |
-
className={ classNames(
|
|
|
|
|
|
|
17 |
>
|
18 |
{ children }
|
19 |
</ContainerWidthContextProvider>
|
13 |
const SidebarLayout = ( { children, className } ) => {
|
14 |
return (
|
15 |
<ContainerWidthContextProvider
|
16 |
+
className={ classNames(
|
17 |
+
'wc-block-components-sidebar-layout',
|
18 |
+
className
|
19 |
+
) }
|
20 |
>
|
21 |
{ children }
|
22 |
</ContainerWidthContextProvider>
|
assets/js/base/components/sidebar-layout/sidebar.js
CHANGED
@@ -6,7 +6,9 @@ import PropTypes from 'prop-types';
|
|
6 |
|
7 |
const Sidebar = ( { children, className } ) => {
|
8 |
return (
|
9 |
-
<div
|
|
|
|
|
10 |
{ children }
|
11 |
</div>
|
12 |
);
|
6 |
|
7 |
const Sidebar = ( { children, className } ) => {
|
8 |
return (
|
9 |
+
<div
|
10 |
+
className={ classNames( 'wc-block-components-sidebar', className ) }
|
11 |
+
>
|
12 |
{ children }
|
13 |
</div>
|
14 |
);
|
assets/js/base/components/sidebar-layout/style.scss
CHANGED
@@ -1,29 +1,22 @@
|
|
1 |
-
.wc-block-sidebar-layout {
|
2 |
display: flex;
|
3 |
flex-wrap: wrap;
|
4 |
margin: 0 auto $gap;
|
5 |
position: relative;
|
6 |
|
7 |
-
.wc-block-main {
|
8 |
margin: 0;
|
9 |
padding-right: percentage($gap-largest / 1060px); // ~1060px is the default width of the content area in Storefront.
|
10 |
width: 65%;
|
11 |
}
|
12 |
}
|
13 |
|
14 |
-
.wc-block-sidebar {
|
15 |
margin: 0;
|
16 |
padding-left: percentage($gap-large / 1060px);
|
17 |
width: 35%;
|
18 |
|
19 |
.wc-blocks-components-panel {
|
20 |
-
border-top: 1px solid $core-grey-light-600;
|
21 |
-
border-bottom: 1px solid $core-grey-light-600;
|
22 |
-
|
23 |
-
+ .wc-blocks-components-panel {
|
24 |
-
border-top: none;
|
25 |
-
}
|
26 |
-
|
27 |
> h2 {
|
28 |
@include font-size(large);
|
29 |
@include reset-box();
|
@@ -34,15 +27,15 @@
|
|
34 |
.is-medium,
|
35 |
.is-small,
|
36 |
.is-mobile {
|
37 |
-
&.wc-block-sidebar-layout {
|
38 |
flex-direction: column;
|
39 |
margin: 0 auto $gap;
|
40 |
|
41 |
-
.wc-block-main {
|
42 |
padding: 0;
|
43 |
width: 100%;
|
44 |
}
|
45 |
-
.wc-block-sidebar {
|
46 |
padding: 0;
|
47 |
width: 100%;
|
48 |
}
|
@@ -50,8 +43,8 @@
|
|
50 |
}
|
51 |
|
52 |
.is-large {
|
53 |
-
.wc-block-sidebar {
|
54 |
-
.wc-block-totals-
|
55 |
.wc-blocks-components-panel {
|
56 |
padding-left: $gap;
|
57 |
padding-right: $gap;
|
@@ -61,7 +54,7 @@
|
|
61 |
|
62 |
// For Twenty Twenty we need to increase specificity a bit more.
|
63 |
.theme-twentytwenty {
|
64 |
-
.wc-block-sidebar .wc-blocks-components-panel > h2 {
|
65 |
@include font-size(large);
|
66 |
@include reset-box();
|
67 |
}
|
1 |
+
.wc-block-components-sidebar-layout {
|
2 |
display: flex;
|
3 |
flex-wrap: wrap;
|
4 |
margin: 0 auto $gap;
|
5 |
position: relative;
|
6 |
|
7 |
+
.wc-block-components-main {
|
8 |
margin: 0;
|
9 |
padding-right: percentage($gap-largest / 1060px); // ~1060px is the default width of the content area in Storefront.
|
10 |
width: 65%;
|
11 |
}
|
12 |
}
|
13 |
|
14 |
+
.wc-block-components-sidebar {
|
15 |
margin: 0;
|
16 |
padding-left: percentage($gap-large / 1060px);
|
17 |
width: 35%;
|
18 |
|
19 |
.wc-blocks-components-panel {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
> h2 {
|
21 |
@include font-size(large);
|
22 |
@include reset-box();
|
27 |
.is-medium,
|
28 |
.is-small,
|
29 |
.is-mobile {
|
30 |
+
&.wc-block-components-sidebar-layout {
|
31 |
flex-direction: column;
|
32 |
margin: 0 auto $gap;
|
33 |
|
34 |
+
.wc-block-components-main {
|
35 |
padding: 0;
|
36 |
width: 100%;
|
37 |
}
|
38 |
+
.wc-block-components-sidebar {
|
39 |
padding: 0;
|
40 |
width: 100%;
|
41 |
}
|
43 |
}
|
44 |
|
45 |
.is-large {
|
46 |
+
.wc-block-components-sidebar {
|
47 |
+
.wc-block-components-totals-item,
|
48 |
.wc-blocks-components-panel {
|
49 |
padding-left: $gap;
|
50 |
padding-right: $gap;
|
54 |
|
55 |
// For Twenty Twenty we need to increase specificity a bit more.
|
56 |
.theme-twentytwenty {
|
57 |
+
.wc-block-components-sidebar .wc-blocks-components-panel > h2 {
|
58 |
@include font-size(large);
|
59 |
@include reset-box();
|
60 |
}
|
assets/js/base/components/sort-select/index.js
CHANGED
@@ -26,22 +26,29 @@ const SortSelect = ( {
|
|
26 |
readOnly,
|
27 |
value,
|
28 |
} ) => {
|
29 |
-
const selectId = `wc-block-sort-select__select-${ instanceId }`;
|
30 |
|
31 |
return (
|
32 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
<Label
|
34 |
label={ label }
|
35 |
screenReaderLabel={ screenReaderLabel }
|
36 |
wrapperElement="label"
|
37 |
wrapperProps={ {
|
38 |
-
className:
|
|
|
39 |
htmlFor: selectId,
|
40 |
} }
|
41 |
/>
|
42 |
<select // eslint-disable-line jsx-a11y/no-onchange
|
43 |
id={ selectId }
|
44 |
-
className="wc-block-sort-select__select"
|
45 |
defaultValue={ defaultValue }
|
46 |
onChange={ onChange }
|
47 |
readOnly={ readOnly }
|
26 |
readOnly,
|
27 |
value,
|
28 |
} ) => {
|
29 |
+
const selectId = `wc-block-components-sort-select__select-${ instanceId }`;
|
30 |
|
31 |
return (
|
32 |
+
<div
|
33 |
+
className={ classNames(
|
34 |
+
'wc-block-sort-select',
|
35 |
+
'wc-block-components-sort-select',
|
36 |
+
className
|
37 |
+
) }
|
38 |
+
>
|
39 |
<Label
|
40 |
label={ label }
|
41 |
screenReaderLabel={ screenReaderLabel }
|
42 |
wrapperElement="label"
|
43 |
wrapperProps={ {
|
44 |
+
className:
|
45 |
+
'wc-block-sort-select__label wc-block-components-sort-select__label',
|
46 |
htmlFor: selectId,
|
47 |
} }
|
48 |
/>
|
49 |
<select // eslint-disable-line jsx-a11y/no-onchange
|
50 |
id={ selectId }
|
51 |
+
className="wc-block-sort-select__select wc-block-components-sort-select__select"
|
52 |
defaultValue={ defaultValue }
|
53 |
onChange={ onChange }
|
54 |
readOnly={ readOnly }
|
assets/js/base/components/sort-select/style.scss
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
.wc-block-sort-select {
|
2 |
margin-bottom: $gap-small;
|
3 |
}
|
4 |
|
5 |
-
.wc-block-sort-select__label {
|
6 |
margin-right: $gap-small;
|
7 |
display: inline-block;
|
8 |
font-weight: normal;
|
9 |
}
|
10 |
|
11 |
-
.wc-block-sort-select__select {
|
12 |
width: max-content;
|
13 |
}
|
1 |
+
.wc-block-components-sort-select {
|
2 |
margin-bottom: $gap-small;
|
3 |
}
|
4 |
|
5 |
+
.wc-block-components-sort-select__label {
|
6 |
margin-right: $gap-small;
|
7 |
display: inline-block;
|
8 |
font-weight: normal;
|
9 |
}
|
10 |
|
11 |
+
.wc-block-components-sort-select__select {
|
12 |
width: max-content;
|
13 |
}
|
assets/js/base/components/store-notices-container/snackbar-notices.js
CHANGED
@@ -18,7 +18,7 @@ const NoticesContainer = () => {
|
|
18 |
return (
|
19 |
<SnackbarList
|
20 |
notices={ snackbarNotices }
|
21 |
-
className={ 'wc-block-notices__snackbar' }
|
22 |
onRemove={ removeNotice }
|
23 |
/>
|
24 |
);
|
18 |
return (
|
19 |
<SnackbarList
|
20 |
notices={ snackbarNotices }
|
21 |
+
className={ 'wc-block-components-notices__snackbar' }
|
22 |
onRemove={ removeNotice }
|
23 |
/>
|
24 |
);
|
assets/js/base/components/store-notices-container/style.scss
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
}
|
26 |
}
|
27 |
|
28 |
-
.wc-block-notices__snackbar {
|
29 |
position: fixed;
|
30 |
bottom: 20px;
|
31 |
left: 16px;
|
25 |
}
|
26 |
}
|
27 |
|
28 |
+
.wc-block-components-notices__snackbar {
|
29 |
position: fixed;
|
30 |
bottom: 20px;
|
31 |
left: 16px;
|
assets/js/base/components/tabs/style.scss
CHANGED
@@ -9,20 +9,19 @@
|
|
9 |
flex: auto;
|
10 |
background: transparent;
|
11 |
padding: $gap-small $gap;
|
12 |
-
color:
|
13 |
outline-offset: -1px;
|
14 |
text-align: center;
|
15 |
transition: box-shadow 0.1s linear;
|
16 |
-
box-shadow: inset 0 -
|
17 |
&.is-active {
|
18 |
-
box-shadow: inset 0 -3px
|
19 |
font-weight: 600;
|
20 |
position: relative;
|
21 |
}
|
22 |
&:focus {
|
23 |
-
color: $black;
|
24 |
outline-offset: -1px;
|
25 |
-
outline: 1px dotted
|
26 |
}
|
27 |
.wc-block-components-tabs__item-content {
|
28 |
@include font-size(regular);
|
@@ -38,10 +37,10 @@
|
|
38 |
margin: 0.2em 0 -0.2em;
|
39 |
}
|
40 |
|
41 |
-
.wc-block-
|
42 |
margin: 0.2em 0 -0.2em;
|
43 |
|
44 |
-
.wc-
|
45 |
height: 1.2em;
|
46 |
vertical-align: middle;
|
47 |
}
|
9 |
flex: auto;
|
10 |
background: transparent;
|
11 |
padding: $gap-small $gap;
|
12 |
+
color: inherit;
|
13 |
outline-offset: -1px;
|
14 |
text-align: center;
|
15 |
transition: box-shadow 0.1s linear;
|
16 |
+
box-shadow: inset 0 -1px currentColor;
|
17 |
&.is-active {
|
18 |
+
box-shadow: inset 0 -3px currentColor;
|
19 |
font-weight: 600;
|
20 |
position: relative;
|
21 |
}
|
22 |
&:focus {
|
|
|
23 |
outline-offset: -1px;
|
24 |
+
outline: 1px dotted currentColor;
|
25 |
}
|
26 |
.wc-block-components-tabs__item-content {
|
27 |
@include font-size(regular);
|
37 |
margin: 0.2em 0 -0.2em;
|
38 |
}
|
39 |
|
40 |
+
.wc-block-components-payment-method-icons {
|
41 |
margin: 0.2em 0 -0.2em;
|
42 |
|
43 |
+
.wc-block-components-payment-method-icon {
|
44 |
height: 1.2em;
|
45 |
vertical-align: middle;
|
46 |
}
|
assets/js/base/components/text-input/index.js
CHANGED
@@ -37,9 +37,13 @@ const TextInput = forwardRef(
|
|
37 |
|
38 |
return (
|
39 |
<div
|
40 |
-
className={ classnames(
|
41 |
-
'
|
42 |
-
|
|
|
|
|
|
|
|
|
43 |
>
|
44 |
<input
|
45 |
type={ type }
|
@@ -76,7 +80,7 @@ const TextInput = forwardRef(
|
|
76 |
{ !! help && (
|
77 |
<p
|
78 |
id={ id + '__help' }
|
79 |
-
className="wc-block-text-input__help"
|
80 |
>
|
81 |
{ help }
|
82 |
</p>
|
37 |
|
38 |
return (
|
39 |
<div
|
40 |
+
className={ classnames(
|
41 |
+
'wc-block-components-text-input',
|
42 |
+
className,
|
43 |
+
{
|
44 |
+
'is-active': isActive || value,
|
45 |
+
}
|
46 |
+
) }
|
47 |
>
|
48 |
<input
|
49 |
type={ type }
|
80 |
{ !! help && (
|
81 |
<p
|
82 |
id={ id + '__help' }
|
83 |
+
className="wc-block-components-text-input__help"
|
84 |
>
|
85 |
{ help }
|
86 |
</p>
|
assets/js/base/components/text-input/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-text-input {
|
2 |
position: relative;
|
3 |
margin-bottom: em($gap-large);
|
4 |
white-space: nowrap;
|
1 |
+
.wc-block-components-text-input {
|
2 |
position: relative;
|
3 |
margin-bottom: em($gap-large);
|
4 |
white-space: nowrap;
|
assets/js/base/components/title/index.js
CHANGED
@@ -14,7 +14,7 @@ import './style.scss';
|
|
14 |
*/
|
15 |
const Title = ( { children, className, headingLevel, ...props } ) => {
|
16 |
const buttonClassName = classNames(
|
17 |
-
'wc-block-
|
18 |
className
|
19 |
);
|
20 |
const TagName = `h${ headingLevel }`;
|
14 |
*/
|
15 |
const Title = ( { children, className, headingLevel, ...props } ) => {
|
16 |
const buttonClassName = classNames(
|
17 |
+
'wc-block-components-title',
|
18 |
className
|
19 |
);
|
20 |
const TagName = `h${ headingLevel }`;
|
assets/js/base/components/title/style.scss
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
// Extra class for specificity to overwrite editor styles.
|
2 |
-
.wc-block-
|
3 |
@include reset-box();
|
4 |
@include font-size(large);
|
5 |
}
|
6 |
|
7 |
// For Twenty Twenty we need to increase specificity a bit more.
|
8 |
.theme-twentytwenty {
|
9 |
-
.wc-block-
|
10 |
@include reset-box();
|
11 |
@include font-size(large);
|
12 |
}
|
1 |
// Extra class for specificity to overwrite editor styles.
|
2 |
+
.wc-block-components-title.wc-block-components-title {
|
3 |
@include reset-box();
|
4 |
@include font-size(large);
|
5 |
}
|
6 |
|
7 |
// For Twenty Twenty we need to increase specificity a bit more.
|
8 |
.theme-twentytwenty {
|
9 |
+
.wc-block-components-title.wc-block-components-title {
|
10 |
@include reset-box();
|
11 |
@include font-size(large);
|
12 |
}
|
assets/js/base/components/validation/style.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.wc-block-
|
2 |
@include font-size(smaller);
|
3 |
color: $error-red;
|
4 |
max-width: 100%;
|
@@ -16,6 +16,6 @@
|
|
16 |
}
|
17 |
}
|
18 |
|
19 |
-
.wc-block-select + .wc-block-
|
20 |
margin-bottom: $gap-large;
|
21 |
}
|
1 |
+
.wc-block-components-validation-error {
|
2 |
@include font-size(smaller);
|
3 |
color: $error-red;
|
4 |
max-width: 100%;
|
16 |
}
|
17 |
}
|
18 |
|
19 |
+
.wc-block-components-select + .wc-block-components-validation-error {
|
20 |
margin-bottom: $gap-large;
|
21 |
}
|
assets/js/base/components/validation/validation-input-error.js
CHANGED
@@ -25,7 +25,7 @@ export const ValidationInputError = ( {
|
|
25 |
}
|
26 |
|
27 |
return (
|
28 |
-
<div className="wc-block-
|
29 |
<p id={ getValidationErrorId( elementId ) }>{ errorMessage }</p>
|
30 |
</div>
|
31 |
);
|
25 |
}
|
26 |
|
27 |
return (
|
28 |
+
<div className="wc-block-components-validation-error" role="alert">
|
29 |
<p id={ getValidationErrorId( elementId ) }>{ errorMessage }</p>
|
30 |
</div>
|
31 |
);
|
assets/js/base/context/add-to-cart-form-context.js
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import {
|
5 |
+
createContext,
|
6 |
+
useContext,
|
7 |
+
useState,
|
8 |
+
useCallback,
|
9 |
+
} from '@wordpress/element';
|
10 |
+
import {
|
11 |
+
useStoreAddToCart,
|
12 |
+
useTriggerFragmentRefresh,
|
13 |
+
} from '@woocommerce/base-hooks';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @typedef {import('@woocommerce/type-defs/contexts').AddToCartFormContext} AddToCartFormContext
|
17 |
+
*/
|
18 |
+
|
19 |
+
const AddToCartFormContext = createContext( {
|
20 |
+
product: {},
|
21 |
+
productId: 0,
|
22 |
+
variationId: 0,
|
23 |
+
variationData: {},
|
24 |
+
cartItemData: {},
|
25 |
+
quantity: 1,
|
26 |
+
minQuantity: 1,
|
27 |
+
maxQuantity: 99,
|
28 |
+
quantityInCart: 0,
|
29 |
+
setQuantity: ( quantity ) => void { quantity },
|
30 |
+
setVariationId: ( variationId ) => void { variationId },
|
31 |
+
setVariationData: ( variationData ) => void { variationData },
|
32 |
+
setCartItemData: ( cartItemData ) => void { cartItemData },
|
33 |
+
showFormElements: false,
|
34 |
+
formInitialized: false,
|
35 |
+
formDisabled: true,
|
36 |
+
formSubmitting: false,
|
37 |
+
onChange: () => void null,
|
38 |
+
onSubmit: () => void null,
|
39 |
+
onSuccess: () => void null,
|
40 |
+
onFail: () => void null,
|
41 |
+
} );
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @return {AddToCartFormContext} Returns the add to cart form context value.
|
45 |
+
*/
|
46 |
+
export const useAddToCartFormContext = () => {
|
47 |
+
return useContext( AddToCartFormContext );
|
48 |
+
};
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Provides an interface for blocks to control the add to cart form for a product.
|
52 |
+
*
|
53 |
+
* @param {Object} props Incoming props for the provider.
|
54 |
+
* @param {*} props.children The children being wrapped.
|
55 |
+
* @param {Object} [props.product] The product for which the form belongs to.
|
56 |
+
* @param {boolean} [props.showFormElements] Should form elements be shown.
|
57 |
+
*/
|
58 |
+
export const AddToCartFormContextProvider = ( {
|
59 |
+
children,
|
60 |
+
product,
|
61 |
+
showFormElements,
|
62 |
+
} ) => {
|
63 |
+
const productId = product.id || 0;
|
64 |
+
const [ variationId, setVariationId ] = useState( 0 );
|
65 |
+
const [ variationData, setVariationData ] = useState( {} );
|
66 |
+
const [ cartItemData, setCartItemData ] = useState( {} );
|
67 |
+
const [ quantity, setQuantity ] = useState( 1 );
|
68 |
+
const {
|
69 |
+
addToCart: storeAddToCart,
|
70 |
+
addingToCart: formSubmitting,
|
71 |
+
cartQuantity: quantityInCart,
|
72 |
+
cartIsLoading,
|
73 |
+
} = useStoreAddToCart( productId );
|
74 |
+
|
75 |
+
// This will ensure any add to cart events update legacy fragments using jQuery.
|
76 |
+
useTriggerFragmentRefresh( quantityInCart );
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @todo Introduce Validation Emitter for the Add to Cart Form
|
80 |
+
*
|
81 |
+
* The add to cart form may have several inner form elements which need to run validation and
|
82 |
+
* change whether or not the form can be submitted. They may also need to show errors and
|
83 |
+
* validation notices.
|
84 |
+
*/
|
85 |
+
const formInitialized = ! cartIsLoading && productId > 0;
|
86 |
+
const formDisabled =
|
87 |
+
formSubmitting ||
|
88 |
+
! formInitialized ||
|
89 |
+
! productIsPurchasable( product );
|
90 |
+
|
91 |
+
// Events.
|
92 |
+
const onSubmit = useCallback( () => {
|
93 |
+
/**
|
94 |
+
* @todo Surface add to cart errors in the single product block.
|
95 |
+
*
|
96 |
+
* If the addToCart function within useStoreAddToCart fails, a notice should be shown on the product page.
|
97 |
+
*/
|
98 |
+
storeAddToCart( quantity );
|
99 |
+
}, [ storeAddToCart, quantity ] );
|
100 |
+
|
101 |
+
/**
|
102 |
+
* @todo Add Event Callbacks to the Add to Cart Form.
|
103 |
+
*
|
104 |
+
* - onChange should trigger when a form element changes, so for example, a variation picker could indicate that it's ready.
|
105 |
+
* - onSuccess should trigger after a successful add to cart. This could be used to reset form elements, do a redirect, or show something to the user.
|
106 |
+
* - onFail should trigger when adding to cart fails. Form elements might show extra notices or reset. A fallback might be to redirect to the core product page in case of incompatibilities.
|
107 |
+
*/
|
108 |
+
const onChange = useCallback( () => {}, [] );
|
109 |
+
const onSuccess = useCallback( () => {}, [] );
|
110 |
+
const onFail = useCallback( () => {}, [] );
|
111 |
+
|
112 |
+
/**
|
113 |
+
* @type {AddToCartFormContext}
|
114 |
+
*/
|
115 |
+
const contextValue = {
|
116 |
+
product,
|
117 |
+
productId,
|
118 |
+
variationId,
|
119 |
+
variationData,
|
120 |
+
cartItemData,
|
121 |
+
quantity,
|
122 |
+
minQuantity: 1,
|
123 |
+
maxQuantity: product.quantity_limit || 99,
|
124 |
+
quantityInCart,
|
125 |
+
setQuantity,
|
126 |
+
setVariationId,
|
127 |
+
setVariationData,
|
128 |
+
setCartItemData,
|
129 |
+
showFormElements,
|
130 |
+
formInitialized,
|
131 |
+
formDisabled,
|
132 |
+
formSubmitting,
|
133 |
+
onChange,
|
134 |
+
onSubmit,
|
135 |
+
onSuccess,
|
136 |
+
onFail,
|
137 |
+
};
|
138 |
+
|
139 |
+
return (
|
140 |
+
<AddToCartFormContext.Provider value={ contextValue }>
|
141 |
+
{ children }
|
142 |
+
</AddToCartFormContext.Provider>
|
143 |
+
);
|
144 |
+
};
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Check a product object to see if it can be purchased.
|
148 |
+
*
|
149 |
+
* @param {Object} product Product object.
|
150 |
+
*/
|
151 |
+
const productIsPurchasable = ( product ) => {
|
152 |
+
const { is_purchasable: isPurchasable = false } = product;
|
153 |
+
|
154 |
+
return isPurchasable;
|
155 |
+
};
|
assets/js/base/context/index.js
CHANGED
@@ -3,3 +3,4 @@ export * from './container-width-context';
|
|
3 |
export * from './query-state-context';
|
4 |
export * from './store-notices-context';
|
5 |
export * from './editor';
|
|
3 |
export * from './query-state-context';
|
4 |
export * from './store-notices-context';
|
5 |
export * from './editor';
|
6 |
+
export * from './add-to-cart-form-context';
|
assets/js/base/hooks/cart/test/use-store-cart.js
CHANGED
@@ -75,6 +75,7 @@ describe( 'useStoreCart', () => {
|
|
75 |
const mockStoreCartData = {
|
76 |
cartCoupons: [],
|
77 |
cartItems: mockCartItems,
|
|
|
78 |
cartItemsCount: 1,
|
79 |
cartItemsWeight: 10,
|
80 |
cartNeedsPayment: true,
|
75 |
const mockStoreCartData = {
|
76 |
cartCoupons: [],
|
77 |
cartItems: mockCartItems,
|
78 |
+
cartItemErrors: [],
|
79 |
cartItemsCount: 1,
|
80 |
cartItemsWeight: 10,
|
81 |
cartNeedsPayment: true,
|
assets/js/base/hooks/cart/use-store-cart-coupons.js
CHANGED
@@ -18,7 +18,7 @@ import { useStoreNotices } from '../use-store-notices';
|
|
18 |
/**
|
19 |
* This is a custom hook for loading the Store API /cart/coupons endpoint and an
|
20 |
* action for adding a coupon _to_ the cart.
|
21 |
-
* See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/
|
22 |
*
|
23 |
* @return {StoreCartCoupon} An object exposing data and actions from/for the
|
24 |
* store api /cart/coupons endpoint.
|
18 |
/**
|
19 |
* This is a custom hook for loading the Store API /cart/coupons endpoint and an
|
20 |
* action for adding a coupon _to_ the cart.
|
21 |
+
* See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/main/src/RestApi/StoreApi
|
22 |
*
|
23 |
* @return {StoreCartCoupon} An object exposing data and actions from/for the
|
24 |
* store api /cart/coupons endpoint.
|
assets/js/base/hooks/cart/use-store-cart-item-quantity.js
CHANGED
@@ -23,7 +23,7 @@ import { useStoreCart } from './use-store-cart';
|
|
23 |
* This is a custom hook for loading the Store API /cart/ endpoint and
|
24 |
* actions for removing or changing item quantity.
|
25 |
*
|
26 |
-
* @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/
|
27 |
*
|
28 |
* @param {CartItem} cartItem The cartItem to get quantity info from and
|
29 |
* will have quantity updated on.
|
23 |
* This is a custom hook for loading the Store API /cart/ endpoint and
|
24 |
* actions for removing or changing item quantity.
|
25 |
*
|
26 |
+
* @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/main/src/RestApi/StoreApi
|
27 |
*
|
28 |
* @param {CartItem} cartItem The cartItem to get quantity info from and
|
29 |
* will have quantity updated on.
|
assets/js/base/hooks/cart/use-store-cart.js
CHANGED
@@ -113,17 +113,17 @@ export const useStoreCart = ( options = { shouldSelect: true } ) => {
|
|
113 |
|
114 |
return {
|
115 |
cartCoupons: cartData.coupons,
|
116 |
-
cartItems: cartData.items,
|
117 |
cartItemsCount: cartData.itemsCount,
|
118 |
cartItemsWeight: cartData.itemsWeight,
|
119 |
cartNeedsPayment: cartData.needsPayment,
|
120 |
cartNeedsShipping: cartData.needsShipping,
|
121 |
-
cartItemErrors: cartData.errors,
|
122 |
cartTotals,
|
123 |
cartIsLoading,
|
124 |
cartErrors,
|
125 |
shippingAddress,
|
126 |
-
shippingRates: cartData.shippingRates,
|
127 |
shippingRatesLoading,
|
128 |
hasShippingAddress: !! shippingAddress.country,
|
129 |
receiveCart,
|
113 |
|
114 |
return {
|
115 |
cartCoupons: cartData.coupons,
|
116 |
+
cartItems: cartData.items || [],
|
117 |
cartItemsCount: cartData.itemsCount,
|
118 |
cartItemsWeight: cartData.itemsWeight,
|
119 |
cartNeedsPayment: cartData.needsPayment,
|
120 |
cartNeedsShipping: cartData.needsShipping,
|
121 |
+
cartItemErrors: cartData.errors || [],
|
122 |
cartTotals,
|
123 |
cartIsLoading,
|
124 |
cartErrors,
|
125 |
shippingAddress,
|
126 |
+
shippingRates: cartData.shippingRates || [],
|
127 |
shippingRatesLoading,
|
128 |
hasShippingAddress: !! shippingAddress.country,
|
129 |
receiveCart,
|
assets/js/base/hooks/index.js
CHANGED
@@ -13,3 +13,4 @@ export * from './use-store-add-to-cart';
|
|
13 |
export * from './use-store-notices';
|
14 |
export * from './use-query-state';
|
15 |
export * from './use-throw-error';
|
|
13 |
export * from './use-store-notices';
|
14 |
export * from './use-query-state';
|
15 |
export * from './use-throw-error';
|
16 |
+
export * from './use-trigger-fragment-refresh';
|
assets/js/base/hooks/shipping/use-select-shipping-rate.js
CHANGED
@@ -8,7 +8,7 @@ import { useThrowError } from '@woocommerce/base-hooks';
|
|
8 |
|
9 |
/**
|
10 |
* This is a custom hook for loading the selected shipping rate from the cart store and actions for selecting a rate.
|
11 |
-
See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/
|
12 |
*
|
13 |
* @param {Array} shippingRates an array of packages with shipping rates.
|
14 |
* @return {Object} This hook will return an object with two properties:
|
8 |
|
9 |
/**
|
10 |
* This is a custom hook for loading the selected shipping rate from the cart store and actions for selecting a rate.
|
11 |
+
See also: https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/main/src/RestApi/StoreApi
|
12 |
*
|
13 |
* @param {Array} shippingRates an array of packages with shipping rates.
|
14 |
* @return {Object} This hook will return an object with two properties:
|
assets/js/base/hooks/use-store-add-to-cart.js
CHANGED
@@ -49,9 +49,9 @@ export const useStoreAddToCart = ( productId ) => {
|
|
49 |
getQuantityFromCartItems( cartItems, productId )
|
50 |
);
|
51 |
|
52 |
-
const addToCart = () => {
|
53 |
setAddingToCart( true );
|
54 |
-
addItemToCart( productId )
|
55 |
.then( ( result ) => {
|
56 |
if ( result === true ) {
|
57 |
removeNotice( 'add-to-cart' );
|
@@ -78,7 +78,9 @@ export const useStoreAddToCart = ( productId ) => {
|
|
78 |
}, [ cartItems, productId ] );
|
79 |
|
80 |
return {
|
81 |
-
cartQuantity: currentCartItemQuantity.current
|
|
|
|
|
82 |
addingToCart,
|
83 |
cartIsLoading,
|
84 |
addToCart,
|
49 |
getQuantityFromCartItems( cartItems, productId )
|
50 |
);
|
51 |
|
52 |
+
const addToCart = ( quantity = 1 ) => {
|
53 |
setAddingToCart( true );
|
54 |
+
addItemToCart( productId, quantity )
|
55 |
.then( ( result ) => {
|
56 |
if ( result === true ) {
|
57 |
removeNotice( 'add-to-cart' );
|
78 |
}, [ cartItems, productId ] );
|
79 |
|
80 |
return {
|
81 |
+
cartQuantity: Number.isFinite( currentCartItemQuantity.current )
|
82 |
+
? currentCartItemQuantity.current
|
83 |
+
: 0,
|
84 |
addingToCart,
|
85 |
cartIsLoading,
|
86 |
addToCart,
|
assets/js/base/hooks/use-trigger-fragment-refresh.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { useRef, useEffect } from '@wordpress/element';
|
5 |
+
import { triggerFragmentRefresh } from '@woocommerce/base-utils';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Helper that implements triggerFragmentRefresh.
|
9 |
+
*
|
10 |
+
* @param {number} quantityInCart Quantity of the item in the cart.
|
11 |
+
*/
|
12 |
+
export const useTriggerFragmentRefresh = ( quantityInCart ) => {
|
13 |
+
const firstMount = useRef( true );
|
14 |
+
|
15 |
+
useEffect( () => {
|
16 |
+
if ( firstMount.current ) {
|
17 |
+
firstMount.current = false;
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
triggerFragmentRefresh();
|
21 |
+
}, [ quantityInCart ] );
|
22 |
+
};
|
assets/js/base/utils/get-valid-block-attributes.js
CHANGED
@@ -12,7 +12,9 @@ export const getValidBlockAttributes = ( blockAttributes, rawAttributes ) => {
|
|
12 |
if ( typeof rawAttributes[ key ] !== 'undefined' ) {
|
13 |
switch ( blockAttributes[ key ].type ) {
|
14 |
case 'boolean':
|
15 |
-
attributes[ key ] =
|
|
|
|
|
16 |
break;
|
17 |
case 'number':
|
18 |
attributes[ key ] = parseInt( rawAttributes[ key ], 10 );
|
12 |
if ( typeof rawAttributes[ key ] !== 'undefined' ) {
|
13 |
switch ( blockAttributes[ key ].type ) {
|
14 |
case 'boolean':
|
15 |
+
attributes[ key ] =
|
16 |
+
rawAttributes[ key ] !== 'false' &&
|
17 |
+
rawAttributes[ key ] !== false;
|
18 |
break;
|
19 |
case 'number':
|
20 |
attributes[ key ] = parseInt( rawAttributes[ key ], 10 );
|
assets/js/blocks-registry/block-components/get-registered-block-components.js
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import deprecated from '@wordpress/deprecated';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import { registeredBlockComponents } from './registered-block-components-init';
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Get all Registered Block Components.
|
13 |
+
*
|
14 |
+
* WooCommerce Blocks allows React Components to be used on the frontend of the store in place of
|
15 |
+
* Blocks instead of just serving static content.
|
16 |
+
*
|
17 |
+
* This gets all registered Block Components so we know which Blocks map to which React Components.
|
18 |
+
*
|
19 |
+
* @export
|
20 |
+
* @param {string} context Current context (a named parent Block). If Block Components were only
|
21 |
+
* registered under a certain context, those Components will be returned,
|
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( context ) {
|
26 |
+
const parentInnerBlocks =
|
27 |
+
typeof registeredBlockComponents[ context ] === 'object' &&
|
28 |
+
Object.keys( registeredBlockComponents[ context ] ).length > 0
|
29 |
+
? registeredBlockComponents[ context ]
|
30 |
+
: {};
|
31 |
+
|
32 |
+
return {
|
33 |
+
...parentInnerBlocks,
|
34 |
+
...registeredBlockComponents.any,
|
35 |
+
};
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Alias of getRegisteredBlockComponents kept for backwards compatibility.
|
40 |
+
*
|
41 |
+
* @export
|
42 |
+
* @param {string} main Name of the parent block to retrieve children of.
|
43 |
+
* @return {Object} List of registered inner blocks.
|
44 |
+
*/
|
45 |
+
export function getRegisteredInnerBlocks( main ) {
|
46 |
+
deprecated( 'getRegisteredInnerBlocks', {
|
47 |
+
version: '2.8.0',
|
48 |
+
alternative: 'getRegisteredBlockComponents',
|
49 |
+
plugin: 'WooCommerce Blocks',
|
50 |
+
} );
|
51 |
+
return getRegisteredBlockComponents( main );
|
52 |
+
}
|
assets/js/blocks-registry/block-components/index.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
export * from './get-registered-block-components';
|
2 |
+
export * from './register-block-component';
|
assets/js/blocks-registry/block-components/register-block-component.js
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import deprecated from '@wordpress/deprecated';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Internal dependencies
|
8 |
+
*/
|
9 |
+
import { registeredBlockComponents } from './registered-block-components-init';
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Register a Block Component.
|
13 |
+
*
|
14 |
+
* WooCommerce Blocks allows React Components to be used on the frontend of the store in place of
|
15 |
+
* Blocks instead of just serving static content.
|
16 |
+
*
|
17 |
+
* Registering a Block Component allows you to define which React Component should be used in place
|
18 |
+
* of a registered Block. The Component, when rendered, will be passed all Block Attributes.
|
19 |
+
*
|
20 |
+
* @export
|
21 |
+
* @param {Object} options Options to use when registering the block.
|
22 |
+
* @param {Function} options.component React component that will be rendered.
|
23 |
+
* @param {string} options.blockName Name of the block that this component belongs to.
|
24 |
+
* @param {string} [options.context] To make this component available only under a certain context
|
25 |
+
* (named parent Block) define it here. If left blank, the
|
26 |
+
* Component will be available for all contexts.
|
27 |
+
*/
|
28 |
+
export function registerBlockComponent( options ) {
|
29 |
+
if ( ! options.context ) {
|
30 |
+
options.context = 'any';
|
31 |
+
}
|
32 |
+
assertOption( options, 'context', 'string' );
|
33 |
+
assertOption( options, 'blockName', 'string' );
|
34 |
+
assertOption( options, 'component', 'function' );
|
35 |
+
|
36 |
+
const { context, blockName, component } = options;
|
37 |
+
|
38 |
+
if ( ! registeredBlockComponents[ context ] ) {
|
39 |
+
registeredBlockComponents[ context ] = {};
|
40 |
+
}
|
41 |
+
|
42 |
+
registeredBlockComponents[ context ][ blockName ] = component;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Asserts that an option is of the given type. Otherwise, throws an error.
|
47 |
+
*
|
48 |
+
* @throws Will throw an error if the type of the option doesn't match the expected type.
|
49 |
+
* @param {Object} options Object containing the option to validate.
|
50 |
+
* @param {string} optionName Name of the option to validate.
|
51 |
+
* @param {string} expectedType Type expected for the option.
|
52 |
+
*/
|
53 |
+
const assertOption = ( options, optionName, expectedType ) => {
|
54 |
+
if ( typeof options[ optionName ] !== expectedType ) {
|
55 |
+
throw new Error(
|
56 |
+
`Incorrect value for the ${ optionName } argument when registering an inner block. It must be a ${ expectedType }.`
|
57 |
+
);
|
58 |
+
}
|
59 |
+
};
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Alias of registerBlockComponent kept for backwards compatibility.
|
63 |
+
*
|
64 |
+
* @export
|
65 |
+
* @param {Object} options Options to use when registering the block.
|
66 |
+
* @param {string} options.main Name of the parent block.
|
67 |
+
* @param {string} options.blockName Name of the child block being registered.
|
68 |
+
* @param {Function} options.component React component used to render the child block.
|
69 |
+
*/
|
70 |
+
export function registerInnerBlock( options ) {
|
71 |
+
deprecated( 'registerInnerBlock', {
|
72 |
+
version: '2.8.0',
|
73 |
+
alternative: 'registerBlockComponent',
|
74 |
+
plugin: 'WooCommerce Blocks',
|
75 |
+
hint: '"main" has been replaced with "context" and is now optional.',
|
76 |
+
} );
|
77 |
+
assertOption( options, 'main', 'string' );
|
78 |
+
registerBlockComponent( {
|
79 |
+
...options,
|
80 |
+
context: options.main,
|
81 |
+
} );
|
82 |
+
}
|
assets/js/blocks-registry/block-components/registered-block-components-init.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
const registeredBlockComponents = {};
|
2 |
+
|
3 |
+
export { registeredBlockComponents };
|
assets/js/blocks-registry/block-components/test/index.js
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Internal dependencies
|
3 |
+
*/
|
4 |
+
import {
|
5 |
+
getRegisteredBlockComponents,
|
6 |
+
registerBlockComponent,
|
7 |
+
registerInnerBlock,
|
8 |
+
getRegisteredInnerBlocks,
|
9 |
+
} from '../index';
|
10 |
+
|
11 |
+
describe( 'blocks registry', () => {
|
12 |
+
const context = '@woocommerce/all-products';
|
13 |
+
const blockName = '@woocommerce-extension/price-level';
|
14 |
+
const component = () => {};
|
15 |
+
|
16 |
+
describe( 'registerBlockComponent', () => {
|
17 |
+
const invokeTest = ( args ) => () => {
|
18 |
+
return registerBlockComponent( args );
|
19 |
+
};
|
20 |
+
it( 'throws an error when registered block is missing `blockName`', () => {
|
21 |
+
expect( invokeTest( { context, blockName: null } ) ).toThrowError(
|
22 |
+
/blockName/
|
23 |
+
);
|
24 |
+
} );
|
25 |
+
it( 'throws an error when registered block is missing `component`', () => {
|
26 |
+
expect(
|
27 |
+
invokeTest( { context, blockName, component: null } )
|
28 |
+
).toThrowError( /component/ );
|
29 |
+
} );
|
30 |
+
} );
|
31 |
+
|
32 |
+
describe( 'getRegisteredBlockComponents', () => {
|
33 |
+
it( 'gets an empty object when context has no inner blocks', () => {
|
34 |
+
expect(
|
35 |
+
getRegisteredBlockComponents( '@woocommerce/all-products' )
|
36 |
+
).toEqual( {} );
|
37 |
+
} );
|
38 |
+
it( 'gets a block that was successfully registered', () => {
|
39 |
+
registerBlockComponent( { context, blockName, component } );
|
40 |
+
expect(
|
41 |
+
getRegisteredBlockComponents( '@woocommerce/all-products' )
|
42 |
+
).toEqual( { [ blockName ]: component } );
|
43 |
+
} );
|
44 |
+
} );
|
45 |
+
|
46 |
+
describe( 'registerInnerBlock (deprecated)', () => {
|
47 |
+
const invokeTest = ( args ) => () => {
|
48 |
+
registerInnerBlock( args );
|
49 |
+
};
|
50 |
+
|
51 |
+
it( 'throws an error when registered block is missing `main`', () => {
|
52 |
+
const options = { main: null };
|
53 |
+
expect( invokeTest( options ) ).toThrowError( /main/ );
|
54 |
+
expect( console ).toHaveWarned();
|
55 |
+
} );
|
56 |
+
it( 'throws an error when registered block is missing `blockName`', () => {
|
57 |
+
const options = { main: context, blockName: null };
|
58 |
+
expect( invokeTest( options ) ).toThrowError( /blockName/ );
|
59 |
+
} );
|
60 |
+
it( 'throws an error when registered block is missing `component`', () => {
|
61 |
+
const options = { main: context, blockName, component: null };
|
62 |
+
expect( invokeTest( options ) ).toThrowError( /component/ );
|
63 |
+
} );
|
64 |
+
} );
|
65 |
+
|
66 |
+
describe( 'getRegisteredInnerBlocks (deprecated)', () => {
|
67 |
+
it( 'gets an empty object when parent has no inner blocks', () => {
|
68 |
+
expect(
|
69 |
+
getRegisteredInnerBlocks( '@woocommerce/test-parent' )
|
70 |
+
).toEqual( {} );
|
71 |
+
expect( console ).toHaveWarned();
|
72 |
+
} );
|
73 |
+
it( 'gets a block that was successfully registered', () => {
|
74 |
+
registerBlockComponent( { context, blockName, component } );
|
75 |
+
expect(
|
76 |
+
getRegisteredInnerBlocks( '@woocommerce/all-products' )
|
77 |
+
).toEqual( {
|
78 |
+
[ blockName ]: component,
|
79 |
+
} );
|
80 |
+
} );
|
81 |
+
} );
|
82 |
+
} );
|
assets/js/blocks-registry/get-registered-inner-blocks.js
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Internal dependencies
|
3 |
-
*/
|
4 |
-
import { registeredBlocks } from './registered-blocks-init';
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Retrieves the inner blocks registered as a child of a specific one.
|
8 |
-
*
|
9 |
-
* @export
|
10 |
-
* @param {string} main Name of the parent block to retrieve children of.
|
11 |
-
*
|
12 |
-
* @return {Object} List of registered inner blocks.
|
13 |
-
*/
|
14 |
-
export function getRegisteredInnerBlocks( main ) {
|
15 |
-
return typeof registeredBlocks[ main ] === 'object' &&
|
16 |
-
Object.keys( registeredBlocks[ main ] ).length > 0
|
17 |
-
? registeredBlocks[ main ]
|
18 |
-
: {};
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks-registry/index.js
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
-
export { getRegisteredInnerBlocks } from './get-registered-inner-blocks';
|
2 |
-
export { registerInnerBlock } from './register-inner-block';
|
3 |
export * from './payment-methods';
|
|
|
|
|
|
1 |
export * from './payment-methods';
|
2 |
+
export * from './block-components';
|
assets/js/blocks-registry/register-inner-block.js
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Internal dependencies
|
3 |
-
*/
|
4 |
-
import { registeredBlocks } from './registered-blocks-init';
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Asserts that an option is of the given type. Otherwise, throws an error.
|
8 |
-
*
|
9 |
-
* @throws Will throw an error if the type of the option doesn't match the expected type.
|
10 |
-
* @param {Object} options Object containing the option to validate.
|
11 |
-
* @param {string} optionName Name of the option to validate.
|
12 |
-
* @param {string} expectedType Type expected for the option.
|
13 |
-
*/
|
14 |
-
const assertOption = ( options, optionName, expectedType ) => {
|
15 |
-
if ( typeof options[ optionName ] !== expectedType ) {
|
16 |
-
throw new Error(
|
17 |
-
`Incorrect value for the ${ optionName } argument when registering an inner block. It must be a ${ expectedType }.`
|
18 |
-
);
|
19 |
-
}
|
20 |
-
};
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Registers an inner block that can be added as a child of another block.
|
24 |
-
*
|
25 |
-
* @export
|
26 |
-
* @param {Object} options Options to use when registering the block.
|
27 |
-
* @param {string} options.main Name of the parent block.
|
28 |
-
* @param {string} options.blockName Name of the child block being registered.
|
29 |
-
* @param {Function} options.component React component used to render the child block.
|
30 |
-
*/
|
31 |
-
export function registerInnerBlock( options ) {
|
32 |
-
assertOption( options, 'main', 'string' );
|
33 |
-
assertOption( options, 'blockName', 'string' );
|
34 |
-
assertOption( options, 'component', 'function' );
|
35 |
-
|
36 |
-
const { main, blockName, component } = options;
|
37 |
-
|
38 |
-
if ( ! registeredBlocks[ main ] ) {
|
39 |
-
registeredBlocks[ main ] = {};
|
40 |
-
}
|
41 |
-
|
42 |
-
registeredBlocks[ main ][ blockName ] = component;
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks-registry/registered-blocks-init.js
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
const registeredBlocks = {};
|
2 |
-
|
3 |
-
export { registeredBlocks };
|
|
|
|
|
|
assets/js/blocks-registry/test/index.js
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Internal dependencies
|
3 |
-
*/
|
4 |
-
import { getRegisteredInnerBlocks, registerInnerBlock } from '../index';
|
5 |
-
|
6 |
-
describe( 'blocks registry', () => {
|
7 |
-
const main = '@woocommerce/all-products';
|
8 |
-
const blockName = '@woocommerce-extension/price-level';
|
9 |
-
const component = () => {};
|
10 |
-
|
11 |
-
describe( 'registerInnerBlock', () => {
|
12 |
-
const invokeTest = ( args ) => () => {
|
13 |
-
return registerInnerBlock( args );
|
14 |
-
};
|
15 |
-
it( 'throws an error when registered block is missing `main`', () => {
|
16 |
-
expect( invokeTest( { main: null } ) ).toThrowError( /main/ );
|
17 |
-
} );
|
18 |
-
it( 'throws an error when registered block is missing `blockName`', () => {
|
19 |
-
expect( invokeTest( { main, blockName: null } ) ).toThrowError(
|
20 |
-
/blockName/
|
21 |
-
);
|
22 |
-
} );
|
23 |
-
it( 'throws an error when registered block is missing `component`', () => {
|
24 |
-
expect(
|
25 |
-
invokeTest( { main, blockName, component: null } )
|
26 |
-
).toThrowError( /component/ );
|
27 |
-
} );
|
28 |
-
} );
|
29 |
-
|
30 |
-
describe( 'getRegisteredInnerBlocks', () => {
|
31 |
-
it( 'gets an empty object when parent has no inner blocks', () => {
|
32 |
-
expect(
|
33 |
-
getRegisteredInnerBlocks( '@woocommerce/all-products' )
|
34 |
-
).toEqual( {} );
|
35 |
-
} );
|
36 |
-
it( 'gets a block that was successfully registered', () => {
|
37 |
-
registerInnerBlock( { main, blockName, component } );
|
38 |
-
expect(
|
39 |
-
getRegisteredInnerBlocks( '@woocommerce/all-products' )
|
40 |
-
).toEqual( { [ blockName ]: component } );
|
41 |
-
} );
|
42 |
-
} );
|
43 |
-
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.js
CHANGED
@@ -35,8 +35,11 @@ const getAmountFromRawPrice = ( priceObject, currency ) => {
|
|
35 |
|
36 |
/**
|
37 |
* Cart line item table row component.
|
|
|
|
|
|
|
38 |
*/
|
39 |
-
const CartLineItemRow = ( { lineItem } ) => {
|
40 |
const {
|
41 |
name = '',
|
42 |
short_description: shortDescription = '',
|
35 |
|
36 |
/**
|
37 |
* Cart line item table row component.
|
38 |
+
*
|
39 |
+
* @param {Object} props
|
40 |
+
* @param {CartItem|Object} props.lineItem
|
41 |
*/
|
42 |
+
const CartLineItemRow = ( { lineItem = {} } ) => {
|
43 |
const {
|
44 |
name = '',
|
45 |
short_description: shortDescription = '',
|
assets/js/blocks/cart-checkout/cart/full-cart/product-image.js
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import { decodeEntities } from '@wordpress/html-entities';
|
5 |
-
import { PLACEHOLDER_IMG_SRC } from '@woocommerce/block-settings';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Formats and returns an image element.
|
9 |
-
*/
|
10 |
-
const ProductImage = ( { image = {} } ) => {
|
11 |
-
const imageProps = {
|
12 |
-
src: image.src || PLACEHOLDER_IMG_SRC,
|
13 |
-
alt: decodeEntities( image.alt ) || '',
|
14 |
-
srcSet: image.srcset || '',
|
15 |
-
sizes: image.sizes || '',
|
16 |
-
};
|
17 |
-
|
18 |
-
return <img { ...imageProps } alt={ imageProps.alt } />;
|
19 |
-
};
|
20 |
-
|
21 |
-
export default ProductImage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/cart-checkout/cart/full-cart/product-low-stock-badge.js
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import { __, sprintf } from '@wordpress/i18n';
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Returns a low stock badge for a line item.
|
8 |
-
*/
|
9 |
-
const ProductLowStockBadge = ( { lowStockRemaining } ) => {
|
10 |
-
if ( ! lowStockRemaining ) {
|
11 |
-
return null;
|
12 |
-
}
|
13 |
-
|
14 |
-
return (
|
15 |
-
<div className="wc-block-cart-item__low-stock-badge">
|
16 |
-
{ sprintf(
|
17 |
-
/* translators: %s stock amount (number of items in stock for product) */
|
18 |
-
__( '%s left in stock', 'woo-gutenberg-products-block' ),
|
19 |
-
lowStockRemaining
|
20 |
-
) }
|
21 |
-
</div>
|
22 |
-
);
|
23 |
-
};
|
24 |
-
|
25 |
-
export default ProductLowStockBadge;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/cart-checkout/cart/full-cart/product-variation-data.js
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* External dependencies
|
3 |
-
*/
|
4 |
-
import { decodeEntities } from '@wordpress/html-entities';
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Returns a formatted element containing variation details.
|
8 |
-
*/
|
9 |
-
const ProductVariationData = ( { variation } ) => {
|
10 |
-
const variationsText = variation
|
11 |
-
.map( ( v ) => {
|
12 |
-
if ( v.attribute ) {
|
13 |
-
return `${ decodeEntities( v.attribute ) }: ${ decodeEntities(
|
14 |
-
v.value
|
15 |
-
) }`;
|
16 |
-
}
|
17 |
-
// Support for product attributes with no name/key
|
18 |
-
return `${ decodeEntities( v.value ) }`;
|
19 |
-
} )
|
20 |
-
.join( ' / ' );
|
21 |
-
|
22 |
-
return (
|
23 |
-
<div className="wc-block-cart-item__product-attributes">
|
24 |
-
{ variationsText }
|
25 |
-
</div>
|
26 |
-
);
|
27 |
-
};
|
28 |
-
|
29 |
-
export default ProductVariationData;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/cart-checkout/cart/full-cart/style.scss
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
.wc-block-cart {
|
2 |
-
|
3 |
-
|
4 |
-
.wc-block-cart__shipping-calculator {
|
5 |
white-space: nowrap;
|
6 |
}
|
7 |
|
8 |
-
.wc-block-product-name {
|
9 |
color: inherit;
|
10 |
}
|
11 |
}
|
@@ -24,23 +22,7 @@ table.wc-block-cart-items td {
|
|
24 |
table.wc-block-cart-items {
|
25 |
table-layout: fixed;
|
26 |
width: 100%;
|
27 |
-
border-bottom: 1px solid $core-grey-light-600;
|
28 |
|
29 |
-
th {
|
30 |
-
padding: 0.25rem $gap 0.25rem 0;
|
31 |
-
white-space: nowrap;
|
32 |
-
border-collapse: collapse;
|
33 |
-
}
|
34 |
-
td {
|
35 |
-
border-top: 1px solid $core-grey-light-600;
|
36 |
-
padding: $gap $gap $gap 0;
|
37 |
-
vertical-align: top;
|
38 |
-
border-collapse: collapse;
|
39 |
-
}
|
40 |
-
th:last-child,
|
41 |
-
td:last-child {
|
42 |
-
padding-right: 0;
|
43 |
-
}
|
44 |
.wc-block-cart-items__header {
|
45 |
@include font-size(smaller);
|
46 |
text-transform: uppercase;
|
@@ -70,14 +52,12 @@ table.wc-block-cart-items {
|
|
70 |
@include link-button;
|
71 |
@include font-size(smaller);
|
72 |
|
73 |
-
color: $core-grey-dark-400;
|
74 |
text-transform: none;
|
75 |
white-space: nowrap;
|
76 |
}
|
77 |
.wc-block-cart-item__remove-icon {
|
78 |
@include link-button;
|
79 |
|
80 |
-
color: $core-grey-dark-400;
|
81 |
fill: currentColor;
|
82 |
position: absolute;
|
83 |
top: $gap;
|
@@ -90,8 +70,8 @@ table.wc-block-cart-items {
|
|
90 |
text-align: right;
|
91 |
line-height: 1.25;
|
92 |
|
93 |
-
.wc-block-product-
|
94 |
-
.wc-block-product-
|
95 |
display: block;
|
96 |
}
|
97 |
}
|
@@ -121,7 +101,7 @@ table.wc-block-cart-items {
|
|
121 |
.wc-block-cart-item__price,
|
122 |
.wc-block-cart-item__product-metadata,
|
123 |
.wc-block-cart-item__image > *,
|
124 |
-
.wc-block-quantity-selector {
|
125 |
@include placeholder();
|
126 |
}
|
127 |
.wc-block-cart-item__product-name {
|
@@ -159,10 +139,10 @@ table.wc-block-cart-items {
|
|
159 |
min-height: 460px;
|
160 |
}
|
161 |
}
|
162 |
-
.wc-block-sidebar-layout.wc-block-cart--skeleton {
|
163 |
display: none;
|
164 |
}
|
165 |
-
.is-loading + .wc-block-sidebar-layout.wc-block-cart--skeleton {
|
166 |
display: flex;
|
167 |
}
|
168 |
|
@@ -170,7 +150,7 @@ table.wc-block-cart-items {
|
|
170 |
.is-small,
|
171 |
.is-mobile {
|
172 |
&.wc-block-cart {
|
173 |
-
.wc-block-sidebar {
|
174 |
.wc-block-cart__totals-title {
|
175 |
display: none;
|
176 |
}
|
@@ -179,7 +159,6 @@ table.wc-block-cart-items {
|
|
179 |
table.wc-block-cart-items {
|
180 |
td {
|
181 |
padding: 0;
|
182 |
-
border: 0;
|
183 |
}
|
184 |
.wc-block-cart-items__header {
|
185 |
display: none;
|
@@ -188,11 +167,10 @@ table.wc-block-cart-items {
|
|
188 |
display: none;
|
189 |
}
|
190 |
.wc-block-cart-items__row {
|
|
|
191 |
display: grid;
|
192 |
grid-template-columns: 80px 132px;
|
193 |
-
border-top: 1px solid $core-grey-light-600;
|
194 |
padding: $gap 0;
|
195 |
-
position: relative;
|
196 |
|
197 |
.wc-block-cart-item__image {
|
198 |
grid-column-start: 1;
|
@@ -225,11 +203,11 @@ table.wc-block-cart-items {
|
|
225 |
grid-row-start: 2;
|
226 |
align-self: center;
|
227 |
|
228 |
-
.wc-block-formatted-money-amount {
|
229 |
display: inline-block;
|
230 |
}
|
231 |
|
232 |
-
.wc-block-sale-badge {
|
233 |
display: none;
|
234 |
}
|
235 |
}
|
@@ -255,27 +233,38 @@ table.wc-block-cart-items {
|
|
255 |
}
|
256 |
|
257 |
.is-large.wc-block-cart {
|
258 |
-
.wc-block-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
padding-left: $gap-large;
|
260 |
}
|
261 |
|
262 |
-
.wc-block-radio-control__input {
|
263 |
left: 0;
|
264 |
}
|
265 |
|
266 |
-
.wc-block-sidebar {
|
267 |
> .wc-block-cart__totals-title,
|
268 |
-
.wc-block-
|
269 |
-
.wc-block-shipping-rates-control__package:not(.wc-blocks-components-panel),
|
270 |
> .wc-block-cart__submit-container {
|
271 |
padding-left: $gap;
|
272 |
padding-right: $gap;
|
273 |
}
|
274 |
}
|
275 |
}
|
276 |
-
|
277 |
-
.wc-block-cart-coupon-list {
|
278 |
-
list-style: none;
|
279 |
-
margin: 0;
|
280 |
-
padding: 0;
|
281 |
-
}
|
1 |
.wc-block-cart {
|
2 |
+
.wc-block-components-shipping-calculator {
|
|
|
|
|
3 |
white-space: nowrap;
|
4 |
}
|
5 |
|
6 |
+
.wc-block-components-product-name {
|
7 |
color: inherit;
|
8 |
}
|
9 |
}
|
22 |
table.wc-block-cart-items {
|
23 |
table-layout: fixed;
|
24 |
width: 100%;
|
|
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
.wc-block-cart-items__header {
|
27 |
@include font-size(smaller);
|
28 |
text-transform: uppercase;
|
52 |
@include link-button;
|
53 |
@include font-size(smaller);
|
54 |
|
|
|
55 |
text-transform: none;
|
56 |
white-space: nowrap;
|
57 |
}
|
58 |
.wc-block-cart-item__remove-icon {
|
59 |
@include link-button;
|
60 |
|
|
|
61 |
fill: currentColor;
|
62 |
position: absolute;
|
63 |
top: $gap;
|
70 |
text-align: right;
|
71 |
line-height: 1.25;
|
72 |
|
73 |
+
.wc-block-components-product-price__regular,
|
74 |
+
.wc-block-components-product-price__value {
|
75 |
display: block;
|
76 |
}
|
77 |
}
|
101 |
.wc-block-cart-item__price,
|
102 |
.wc-block-cart-item__product-metadata,
|
103 |
.wc-block-cart-item__image > *,
|
104 |
+
.wc-block-components-quantity-selector {
|
105 |
@include placeholder();
|
106 |
}
|
107 |
.wc-block-cart-item__product-name {
|
139 |
min-height: 460px;
|
140 |
}
|
141 |
}
|
142 |
+
.wc-block-components-sidebar-layout.wc-block-cart--skeleton {
|
143 |
display: none;
|
144 |
}
|
145 |
+
.is-loading + .wc-block-components-sidebar-layout.wc-block-cart--skeleton {
|
146 |
display: flex;
|
147 |
}
|
148 |
|
150 |
.is-small,
|
151 |
.is-mobile {
|
152 |
&.wc-block-cart {
|
153 |
+
.wc-block-components-sidebar {
|
154 |
.wc-block-cart__totals-title {
|
155 |
display: none;
|
156 |
}
|
159 |
table.wc-block-cart-items {
|
160 |
td {
|
161 |
padding: 0;
|
|
|
162 |
}
|
163 |
.wc-block-cart-items__header {
|
164 |
display: none;
|
167 |
display: none;
|
168 |
}
|
169 |
.wc-block-cart-items__row {
|
170 |
+
@include with-translucent-border(0 0 1px);
|
171 |
display: grid;
|
172 |
grid-template-columns: 80px 132px;
|
|
|
173 |
padding: $gap 0;
|
|
|
174 |
|
175 |
.wc-block-cart-item__image {
|
176 |
grid-column-start: 1;
|
203 |
grid-row-start: 2;
|
204 |
align-self: center;
|
205 |
|
206 |
+
.wc-block-components-formatted-money-amount {
|
207 |
display: inline-block;
|
208 |
}
|
209 |
|
210 |
+
.wc-block-components-sale-badge {
|
211 |
display: none;
|
212 |
}
|
213 |
}
|
233 |
}
|
234 |
|
235 |
.is-large.wc-block-cart {
|
236 |
+
.wc-block-cart-items {
|
237 |
+
@include with-translucent-border(0 0 1px);
|
238 |
+
|
239 |
+
th {
|
240 |
+
padding: 0.25rem $gap 0.25rem 0;
|
241 |
+
white-space: nowrap;
|
242 |
+
}
|
243 |
+
td {
|
244 |
+
@include with-translucent-border(1px 0 0);
|
245 |
+
padding: $gap $gap $gap 0;
|
246 |
+
vertical-align: top;
|
247 |
+
}
|
248 |
+
th:last-child,
|
249 |
+
td:last-child {
|
250 |
+
padding-right: 0;
|
251 |
+
}
|
252 |
+
}
|
253 |
+
.wc-block-components-radio-control__option {
|
254 |
padding-left: $gap-large;
|
255 |
}
|
256 |
|
257 |
+
.wc-block-components-radio-control__input {
|
258 |
left: 0;
|
259 |
}
|
260 |
|
261 |
+
.wc-block-components-sidebar {
|
262 |
> .wc-block-cart__totals-title,
|
263 |
+
.wc-block-components-shipping-calculator,
|
264 |
+
.wc-block-components-shipping-rates-control__package:not(.wc-blocks-components-panel),
|
265 |
> .wc-block-cart__submit-container {
|
266 |
padding-left: $gap;
|
267 |
padding-right: $gap;
|
268 |
}
|
269 |
}
|
270 |
}
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/cart-checkout/cart/test/block.js
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* External dependencies
|
3 |
+
*/
|
4 |
+
import { render, screen, waitFor } from '@testing-library/react';
|
5 |
+
import { previewCart } from '@woocommerce/resource-previews';
|
6 |
+
import { dispatch } from '@wordpress/data';
|
7 |
+
import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
|
8 |
+
/**
|
9 |
+
* Internal dependencies
|
10 |
+
*/
|
11 |
+
import CartBlock from '../block';
|
12 |
+
import { defaultCartState } from '../../../../data/default-states';
|
13 |
+
|
14 |
+
describe( 'Testing cart', () => {
|
15 |
+
beforeEach( async () => {
|
16 |
+
fetchMock.mockResponseOnce( ( req ) => {
|
17 |
+
if ( req.url.match( /wc\/store\/cart/ ) ) {
|
18 |
+
return Promise.resolve( JSON.stringify( previewCart ) );
|
19 |
+
}
|
20 |
+
} );
|
21 |
+
// need to clear the store resolution state between tests.
|
22 |
+
await dispatch( storeKey ).invalidateResolutionForStore();
|
23 |
+
await dispatch( storeKey ).receiveCart( defaultCartState );
|
24 |
+
} );
|
25 |
+
it( 'renders cart if there are items in the cart', async () => {
|
26 |
+
render(
|
27 |
+
<CartBlock
|
28 |
+
emptyCart={ null }
|
29 |
+
attributes={ {
|
30 |
+
isShippingCalculatorEnabled: false,
|
31 |
+
isShippingCostHidden: true,
|
32 |
+
} }
|
33 |
+
/>
|
34 |
+
);
|
35 |
+
await waitFor( () => {
|
36 |
+
expect(
|
37 |
+
screen.getByText( /Proceed to Checkout/ )
|
38 |
+
).toBeInTheDocument();
|
39 |
+
} );
|
40 |
+
} );
|
41 |
+
it( 'renders empty cart if there are no items in the cart', async () => {
|
42 |
+
fetchMock.mockResponseOnce( ( req ) => {
|
43 |
+
if ( req.url.match( /wc\/store\/cart/ ) ) {
|
44 |
+
return Promise.resolve( JSON.stringify( defaultCartState ) );
|
45 |
+
}
|
46 |
+
} );
|
47 |
+
render(
|
48 |
+
<CartBlock
|
49 |
+
emptyCart={ '<div>Empty Cart</div>' }
|
50 |
+
attributes={ {
|
51 |
+
isShippingCalculatorEnabled: false,
|
52 |
+
isShippingCostHidden: true,
|
53 |
+
} }
|
54 |
+
/>
|
55 |
+
);
|
56 |
+
expect( await screen.findByText( /Empty Cart/ ) ).toBeInTheDocument();
|
57 |
+
} );
|
58 |
+
} );
|
assets/js/blocks/cart-checkout/checkout/block.js
CHANGED
@@ -49,6 +49,7 @@ import withScrollToTop from '@woocommerce/base-hocs/with-scroll-to-top';
|
|
49 |
import {
|
50 |
CHECKOUT_SHOW_LOGIN_REMINDER,
|
51 |
CHECKOUT_ALLOWS_GUEST,
|
|
|
52 |
} from '@woocommerce/block-settings';
|
53 |
|
54 |
/**
|
@@ -78,18 +79,23 @@ const Block = ( props ) => {
|
|
78 |
*
|
79 |
* @param {Object} option Shipping Rate.
|
80 |
*/
|
81 |
-
const renderShippingRatesControlOption = ( option ) =>
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
}
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
/**
|
95 |
* Main Checkout Component.
|
49 |
import {
|
50 |
CHECKOUT_SHOW_LOGIN_REMINDER,
|
51 |
CHECKOUT_ALLOWS_GUEST,
|
52 |
+
DISPLAY_CART_PRICES_INCLUDING_TAX,
|
53 |
} from '@woocommerce/block-settings';
|
54 |
|
55 |
/**
|
79 |
*
|
80 |
* @param {Object} option Shipping Rate.
|
81 |
*/
|
82 |
+
const renderShippingRatesControlOption = ( option ) => {
|
83 |
+
const priceWithTaxes = DISPLAY_CART_PRICES_INCLUDING_TAX
|
84 |
+
? parseInt( option.price, 10 ) + parseInt( option.taxes, 10 )
|
85 |
+
: parseInt( option.price, 10 );
|
86 |
+
return {
|
87 |
+
label: decodeEntities( option.name ),
|
88 |
+
value: option.rate_id,
|
89 |
+
description: decodeEntities( option.description ),
|
90 |
+
secondaryLabel: (
|
91 |
+
<FormattedMonetaryAmount
|
92 |
+
currency={ getCurrencyFromPriceResponse( option ) }
|
93 |
+
value={ priceWithTaxes }
|
94 |
+
/>
|
95 |
+
),
|
96 |
+
secondaryDescription: decodeEntities( option.delivery_time ),
|
97 |
+
};
|
98 |
+
};
|
99 |
|
100 |
/**
|
101 |
* Main Checkout Component.
|
assets/js/blocks/cart-checkout/checkout/editor.scss
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
.editor-styles-wrapper {
|
2 |
-
.wp-block h4.wc-block-checkout-step__title {
|
3 |
@include font-size(regular);
|
4 |
line-height: 24px;
|
5 |
margin: 0 $gap-small 0 0;
|
1 |
.editor-styles-wrapper {
|
2 |
+
.wp-block h4.wc-block-components-checkout-step__title {
|
3 |
@include font-size(regular);
|
4 |
line-height: 24px;
|
5 |
margin: 0 $gap-small 0 0;
|
assets/js/blocks/cart-checkout/checkout/style.scss
CHANGED
@@ -8,20 +8,15 @@
|
|
8 |
}
|
9 |
|
10 |
.wc-block-checkout__shipping-option {
|
11 |
-
.wc-block-shipping-rates-control__package:not(:first-of-type) {
|
12 |
margin-top: $gap-larger;
|
13 |
}
|
14 |
}
|
15 |
|
16 |
-
.wc-block-checkout__main {
|
17 |
-
fieldset.wc-block-checkout-step:first-child {
|
18 |
-
margin-top: $gap-small;
|
19 |
-
}
|
20 |
-
}
|
21 |
-
|
22 |
.wc-block-checkout__sidebar {
|
23 |
-
.wc-block-product-name {
|
24 |
color: inherit;
|
|
|
25 |
flex-grow: 1;
|
26 |
// Required by IE11.
|
27 |
flex-basis: 0;
|
@@ -45,7 +40,8 @@
|
|
45 |
&::after {
|
46 |
content: " ";
|
47 |
flex: 1;
|
48 |
-
border-bottom: 1px solid
|
|
|
49 |
}
|
50 |
}
|
51 |
|
@@ -84,13 +80,13 @@
|
|
84 |
.wc-block-components-express-checkout {
|
85 |
min-height: 150px;
|
86 |
}
|
87 |
-
.wc-block-components-express-checkout-continue-rule span {
|
88 |
@include placeholder();
|
89 |
@include force-content();
|
90 |
width: 150px;
|
91 |
}
|
92 |
-
.wc-block-checkout-form {
|
93 |
-
.wc-block-checkout-step__title {
|
94 |
@include placeholder();
|
95 |
@include force-content();
|
96 |
display: block;
|
@@ -105,17 +101,17 @@
|
|
105 |
width: 1.5em;
|
106 |
}
|
107 |
}
|
108 |
-
.wc-block-checkout-step__container::after {
|
109 |
@include placeholder();
|
110 |
}
|
111 |
-
.wc-block-checkout-step__content > span {
|
112 |
@include placeholder();
|
113 |
@include force-content();
|
114 |
display: block;
|
115 |
min-height: 100px;
|
116 |
}
|
117 |
-
.wc-block-checkout-step::before,
|
118 |
-
.wc-block-checkout-step::after {
|
119 |
@include placeholder();
|
120 |
}
|
121 |
}
|
@@ -125,10 +121,10 @@
|
|
125 |
min-height: 460px;
|
126 |
}
|
127 |
}
|
128 |
-
.wc-block-sidebar-layout.wc-block-checkout--skeleton {
|
129 |
display: none;
|
130 |
}
|
131 |
-
.is-loading + .wc-block-sidebar-layout.wc-block-checkout--skeleton {
|
132 |
display: flex;
|
133 |
}
|
134 |
|
@@ -188,7 +184,7 @@
|
|
188 |
.is-large {
|
189 |
.wc-block-checkout__billing-fields,
|
190 |
.wc-block-checkout__shipping-fields {
|
191 |
-
.wc-block-address-form {
|
192 |
margin-left: #{-$gap-small / 2};
|
193 |
margin-right: #{-$gap-small / 2};
|
194 |
|
@@ -198,16 +194,16 @@
|
|
198 |
display: block;
|
199 |
}
|
200 |
|
201 |
-
.wc-block-text-input,
|
202 |
-
.wc-block-country-input,
|
203 |
-
.wc-block-select {
|
204 |
float: left;
|
205 |
margin-left: #{$gap-small / 2};
|
206 |
margin-right: #{$gap-small / 2};
|
207 |
position: relative;
|
208 |
width: calc(50% - #{$gap-small});
|
209 |
|
210 |
-
.wc-block-select {
|
211 |
float: none;
|
212 |
width: 100%;
|
213 |
margin-left: 0;
|
@@ -215,13 +211,13 @@
|
|
215 |
}
|
216 |
}
|
217 |
|
218 |
-
.wc-block-address-form__company,
|
219 |
-
.wc-block-address-form__address_1,
|
220 |
-
.wc-block-address-form__address_2 {
|
221 |
width: calc(100% - #{$gap-small});
|
222 |
}
|
223 |
|
224 |
-
.wc-block-checkbox {
|
225 |
clear: both;
|
226 |
}
|
227 |
}
|
@@ -234,7 +230,7 @@
|
|
234 |
}
|
235 |
|
236 |
.wc-block-checkout__shipping-option {
|
237 |
-
.wc-block-radio-control__input {
|
238 |
margin-left: -8px;
|
239 |
}
|
240 |
}
|
8 |
}
|
9 |
|
10 |
.wc-block-checkout__shipping-option {
|
11 |
+
.wc-block-components-shipping-rates-control__package:not(:first-of-type) {
|
12 |
margin-top: $gap-larger;
|
13 |
}
|
14 |
}
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
.wc-block-checkout__sidebar {
|
17 |
+
.wc-block-components-product-name {
|
18 |
color: inherit;
|
19 |
+
padding-right: $gap-small;
|
20 |
flex-grow: 1;
|
21 |
// Required by IE11.
|
22 |
flex-basis: 0;
|
40 |
&::after {
|
41 |
content: " ";
|
42 |
flex: 1;
|
43 |
+
border-bottom: 1px solid;
|
44 |
+
opacity: 0.3;
|
45 |
}
|
46 |
}
|
47 |
|
80 |
.wc-block-components-express-checkout {
|
81 |
min-height: 150px;
|
82 |
}
|
83 |
+
.wc-block-components-express-checkout-continue-rule > span {
|
84 |
@include placeholder();
|
85 |
@include force-content();
|
86 |
width: 150px;
|
87 |
}
|
88 |
+
.wc-block-components-checkout-form {
|
89 |
+
.wc-block-components-checkout-step__title {
|
90 |
@include placeholder();
|
91 |
@include force-content();
|
92 |
display: block;
|
101 |
width: 1.5em;
|
102 |
}
|
103 |
}
|
104 |
+
.wc-block-components-checkout-step__container::after {
|
105 |
@include placeholder();
|
106 |
}
|
107 |
+
.wc-block-components-checkout-step__content > span {
|
108 |
@include placeholder();
|
109 |
@include force-content();
|
110 |
display: block;
|
111 |
min-height: 100px;
|
112 |
}
|
113 |
+
.wc-block-components-checkout-step::before,
|
114 |
+
.wc-block-components-checkout-step::after {
|
115 |
@include placeholder();
|
116 |
}
|
117 |
}
|
121 |
min-height: 460px;
|
122 |
}
|
123 |
}
|
124 |
+
.wc-block-components-sidebar-layout.wc-block-checkout--skeleton {
|
125 |
display: none;
|
126 |
}
|
127 |
+
.is-loading + .wc-block-components-sidebar-layout.wc-block-checkout--skeleton {
|
128 |
display: flex;
|
129 |
}
|
130 |
|
184 |
.is-large {
|
185 |
.wc-block-checkout__billing-fields,
|
186 |
.wc-block-checkout__shipping-fields {
|
187 |
+
.wc-block-components-address-form {
|
188 |
margin-left: #{-$gap-small / 2};
|
189 |
margin-right: #{-$gap-small / 2};
|
190 |
|
194 |
display: block;
|
195 |
}
|
196 |
|
197 |
+
.wc-block-components-text-input,
|
198 |
+
.wc-block-components-country-input,
|
199 |
+
.wc-block-components-select {
|
200 |
float: left;
|
201 |
margin-left: #{$gap-small / 2};
|
202 |
margin-right: #{$gap-small / 2};
|
203 |
position: relative;
|
204 |
width: calc(50% - #{$gap-small});
|
205 |
|
206 |
+
.wc-block-components-select {
|
207 |
float: none;
|
208 |
width: 100%;
|
209 |
margin-left: 0;
|
211 |
}
|
212 |
}
|
213 |
|
214 |
+
.wc-block-components-address-form__company,
|
215 |
+
.wc-block-components-address-form__address_1,
|
216 |
+
.wc-block-components-address-form__address_2 {
|
217 |
width: calc(100% - #{$gap-small});
|
218 |
}
|
219 |
|
220 |
+
.wc-block-components-checkbox {
|
221 |
clear: both;
|
222 |
}
|
223 |
}
|
230 |
}
|
231 |
|
232 |
.wc-block-checkout__shipping-option {
|
233 |
+
.wc-block-components-radio-control__input {
|
234 |
margin-left: -8px;
|
235 |
}
|
236 |
}
|
assets/js/blocks/product-categories/index.js
CHANGED
@@ -35,6 +35,13 @@ registerBlockType( 'woocommerce/product-categories', {
|
|
35 |
},
|
36 |
},
|
37 |
attributes: {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
/**
|
39 |
* Whether to show the product count in each category.
|
40 |
*/
|
35 |
},
|
36 |
},
|
37 |
attributes: {
|
38 |
+
/**
|
39 |
+
* Alignment of the block.
|
40 |
+
*/
|
41 |
+
align: {
|
42 |
+
type: 'string',
|
43 |
+
},
|
44 |
+
|
45 |
/**
|
46 |
* Whether to show the product count in each category.
|
47 |
*/
|
assets/js/blocks/single-product/constants.js
CHANGED
@@ -35,8 +35,14 @@ export const DEFAULT_INNER_BLOCKS = [
|
|
35 |
[ 'woocommerce/product-rating' ],
|
36 |
[ 'woocommerce/product-price' ],
|
37 |
[ 'woocommerce/product-summary' ],
|
38 |
-
[ 'woocommerce/product-
|
|
|
|
|
|
|
|
|
39 |
[ 'woocommerce/product-sku' ],
|
|
|
|
|
40 |
],
|
41 |
],
|
42 |
],
|
35 |
[ 'woocommerce/product-rating' ],
|
36 |
[ 'woocommerce/product-price' ],
|
37 |
[ 'woocommerce/product-summary' ],
|
38 |
+
[ 'woocommerce/product-stock-indicator' ],
|
39 |
+
[
|
40 |
+
'woocommerce/product-add-to-cart',
|
41 |
+
{ showFormElements: true },
|
42 |
+
],
|
43 |
[ 'woocommerce/product-sku' ],
|
44 |
+
[ 'woocommerce/product-category-list' ],
|
45 |
+
[ 'woocommerce/product-tag-list' ],
|
46 |
],
|
47 |
],
|
48 |
],
|
assets/js/components/block-title/editor.scss
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
// Ensure textarea bg color is transparent for block titles.
|
2 |
// Some themes (e.g. Twenty Twenty) set a non-white background for the editor, and Gutenberg sets white background for text inputs, creating this issue.
|
3 |
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/1204
|
4 |
-
.wc-block-components-title {
|
5 |
background-color: transparent;
|
6 |
}
|
1 |
// Ensure textarea bg color is transparent for block titles.
|
2 |
// Some themes (e.g. Twenty Twenty) set a non-white background for the editor, and Gutenberg sets white background for text inputs, creating this issue.
|
3 |
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/1204
|
4 |
+
.wc-block-editor-components-title {
|
5 |
background-color: transparent;
|
6 |
}
|
assets/js/components/block-title/index.js
CHANGED
@@ -16,7 +16,7 @@ const BlockTitle = ( { className, headingLevel, onChange, heading } ) => {
|
|
16 |
<TagName>
|
17 |
<PlainText
|
18 |
className={ classnames(
|
19 |
-
'wc-block-components-title',
|
20 |
className
|
21 |
) }
|
22 |
value={ heading }
|
16 |
<TagName>
|
17 |
<PlainText
|
18 |
className={ classnames(
|
19 |
+
'wc-block-editor-components-title',
|
20 |
className
|
21 |
) }
|
22 |
value={ heading }
|
assets/js/components/edit-product-link/index.js
CHANGED
@@ -5,11 +5,22 @@ 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 |
|
9 |
/**
|
10 |
* Component to render an edit product link in the sidebar.
|
|
|
|
|
11 |
*/
|
12 |
-
const EditProductLink = (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
return (
|
14 |
<InspectorControls>
|
15 |
<div className="wc-block-single-product__edit-card">
|
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';
|
9 |
|
10 |
/**
|
11 |
* Component to render an edit product link in the sidebar.
|
12 |
+
*
|
13 |
+
* @param {Object} props Component props.
|
14 |
*/
|
15 |
+
const EditProductLink = ( props ) => {
|
16 |
+
const productDataContext = useProductDataContext();
|
17 |
+
const product = productDataContext.product || {};
|
18 |
+
const productId = product.id || props.productId || 0;
|
19 |
+
|
20 |
+
if ( ! productId ) {
|
21 |
+
return null;
|
22 |
+
}
|
23 |
+
|
24 |
return (
|
25 |
<InspectorControls>
|
26 |
<div className="wc-block-single-product__edit-card">
|
assets/js/data/cart/reducers.js
CHANGED
@@ -7,6 +7,7 @@ import { camelCase, mapKeys } from 'lodash';
|
|
7 |
* Internal dependencies
|
8 |
*/
|
9 |
import { ACTION_TYPES as types } from './action-types';
|
|
|
10 |
|
11 |
/**
|
12 |
* Sub-reducer for cart items array.
|
@@ -36,54 +37,7 @@ const cartItemsReducer = ( state = [], action ) => {
|
|
36 |
*
|
37 |
* @return {Object} New or existing state.
|
38 |
*/
|
39 |
-
const reducer = (
|
40 |
-
state = {
|
41 |
-
cartItemsPendingQuantity: [],
|
42 |
-
cartItemsPendingDelete: [],
|
43 |
-
cartData: {
|
44 |
-
coupons: [],
|
45 |
-
shippingRates: [],
|
46 |
-
shippingAddress: {
|
47 |
-
first_name: '',
|
48 |
-
last_name: '',
|
49 |
-
company: '',
|
50 |
-
address_1: '',
|
51 |
-
address_2: '',
|
52 |
-
city: '',
|
53 |
-
state: '',
|
54 |
-
postcode: '',
|
55 |
-
country: '',
|
56 |
-
},
|
57 |
-
items: [],
|
58 |
-
itemsCount: 0,
|
59 |
-
itemsWeight: 0,
|
60 |
-
needsShipping: true,
|
61 |
-
totals: {
|
62 |
-
currency_code: '',
|
63 |
-
currency_symbol: '',
|
64 |
-
currency_minor_unit: 2,
|
65 |
-
currency_decimal_separator: '.',
|
66 |
-
currency_thousand_separator: ',',
|
67 |
-
currency_prefix: '',
|
68 |
-
currency_suffix: '',
|
69 |
-
total_items: '0',
|
70 |
-
total_items_tax: '0',
|
71 |
-
total_fees: '0',
|
72 |
-
total_fees_tax: '0',
|
73 |
-
total_discount: '0',
|
74 |
-
total_discount_tax: '0',
|
75 |
-
total_shipping: '0',
|
76 |
-
total_shipping_tax: '0',
|
77 |
-
total_price: '0',
|
78 |
-
total_tax: '0',
|
79 |
-
tax_lines: [],
|
80 |
-
},
|
81 |
-
},
|
82 |
-
metaData: {},
|
83 |
-
errors: [],
|
84 |
-
},
|
85 |
-
action
|
86 |
-
) => {
|
87 |
switch ( action.type ) {
|
88 |
case types.RECEIVE_ERROR:
|
89 |
state = {
|
7 |
* Internal dependencies
|
8 |
*/
|
9 |
import { ACTION_TYPES as types } from './action-types';
|
10 |
+
import { defaultCartState } from '../default-states';
|
11 |
|
12 |
/**
|
13 |
* Sub-reducer for cart items array.
|
37 |
*
|
38 |
* @return {Object} New or existing state.
|
39 |
*/
|
40 |
+
const reducer = ( state = defaultCartState, action ) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
switch ( action.type ) {
|
42 |
case types.RECEIVE_ERROR:
|
43 |
state = {
|
assets/js/data/default-states.js
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export const defaultCartState = {
|
2 |
+
cartItemsPendingQuantity: [],
|
3 |
+
cartItemsPendingDelete: [],
|
4 |
+
cartData: {
|
5 |
+
coupons: [],
|
6 |
+
shippingRates: [],
|
7 |
+
shippingAddress: {
|
8 |
+
first_name: '',
|
9 |
+
last_name: '',
|
10 |
+
company: '',
|
11 |
+
address_1: '',
|
12 |
+
address_2: '',
|
13 |
+
city: '',
|
14 |
+
state: '',
|
15 |
+
postcode: '',
|
16 |
+
country: '',
|
17 |
+
},
|
18 |
+
items: [],
|
19 |
+
itemsCount: 0,
|
20 |
+
itemsWeight: 0,
|
21 |
+
needsShipping: true,
|
22 |
+
totals: {
|
23 |
+
currency_code: '',
|
24 |
+
currency_symbol: '',
|
25 |
+
currency_minor_unit: 2,
|
26 |
+
currency_decimal_separator: '.',
|
27 |
+
currency_thousand_separator: ',',
|
28 |
+
currency_prefix: '',
|
29 |
+
currency_suffix: '',
|
30 |
+
total_items: '0',
|
31 |
+
total_items_tax: '0',
|
32 |
+
total_fees: '0',
|
33 |
+
total_fees_tax: '0',
|
34 |
+
total_discount: '0',
|
35 |
+
total_discount_tax: '0',
|
36 |
+
total_shipping: '0',
|
37 |
+
total_shipping_tax: '0',
|
38 |
+
total_price: '0',
|
39 |
+
total_tax: '0',
|
40 |
+
tax_lines: [],
|
41 |
+
},
|
42 |
+
},
|
43 |
+
metaData: {},
|
44 |
+
errors: [],
|
45 |
+
};
|
assets/js/hocs/test/with-product-variations.js
CHANGED
@@ -19,10 +19,13 @@ jest.mock( '../../base/utils/errors', () => ( {
|
|
19 |
} ) );
|
20 |
|
21 |
const mockProducts = [
|
22 |
-
{ id: 1, name: 'Hoodie', variations: [ 3, 4 ] },
|
23 |
{ id: 2, name: 'Backpack' },
|
24 |
];
|
25 |
-
const mockVariations = [
|
|
|
|
|
|
|
26 |
const TestComponent = withProductVariations( ( props ) => {
|
27 |
return (
|
28 |
<div
|
19 |
} ) );
|
20 |
|
21 |
const mockProducts = [
|
22 |
+
{ id: 1, name: 'Hoodie', variations: [ { id: 3 }, { id: 4 } ] },
|
23 |
{ id: 2, name: 'Backpack' },
|
24 |
];
|
25 |
+
const mockVariations = [
|
26 |
+
{ id: 3, name: 'Blue' },
|
27 |
+
{ id: 4, name: 'Red' },
|
28 |
+
];
|
29 |
const TestComponent = withProductVariations( ( props ) => {
|
30 |
return (
|
31 |
<div
|
assets/js/hocs/with-attributes.js
CHANGED
@@ -88,7 +88,7 @@ const withAttributes = ( OriginalComponent ) => {
|
|
88 |
newTerms = newTerms.map( ( term ) => ( {
|
89 |
...term,
|
90 |
parent: expandedAttribute,
|
91 |
-
attr_slug: attributeData.
|
92 |
} ) );
|
93 |
|
94 |
setTermsList( {
|
88 |
newTerms = newTerms.map( ( term ) => ( {
|
89 |
...term,
|
90 |
parent: expandedAttribute,
|
91 |
+
attr_slug: attributeData.taxonomy,
|
92 |
} ) );
|
93 |
|
94 |
setTermsList( {
|
assets/js/hocs/with-product-variations.js
CHANGED
@@ -121,7 +121,8 @@ const withProductVariations = createHigherOrderComponent(
|
|
121 |
const { products } = this.props;
|
122 |
const parentProduct = products.filter(
|
123 |
( p ) =>
|
124 |
-
p.variations &&
|
|
|
125 |
);
|
126 |
return parentProduct[ 0 ].id;
|
127 |
}
|
121 |
const { products } = this.props;
|
122 |
const parentProduct = products.filter(
|
123 |
( p ) =>
|
124 |
+
p.variations &&
|
125 |
+
p.variations.find( ( { id } ) => id === variationId )
|
126 |
);
|
127 |
return parentProduct[ 0 ].id;
|
128 |
}
|
assets/js/icons/index.js
CHANGED
@@ -5,6 +5,7 @@ export { default as arrowDownAlt2 } from './library/arrow-down-alt2';
|
|
5 |
export { default as bank } from './library/bank';
|
6 |
export { default as barcode } from './library/barcode';
|
7 |
export { default as bill } from './library/bill';
|
|
|
8 |
export { default as card } from './library/card';
|
9 |
export { default as cart } from './library/cart';
|
10 |
export { default as checkPayment } from './library/check-payment';
|
5 |
export { default as bank } from './library/bank';
|
6 |
export { default as barcode } from './library/barcode';
|
7 |
export { default as bill } from './library/bill';
|
8 |
+
export { default as box } from './library/box';
|
9 |
export { default as card } from './library/card';
|
10 |
export { default as cart } from './library/cart';
|
11 |
export { default as checkPayment } from './library/check-payment';
|
assets/js/icons/library/barcode.js
CHANGED
@@ -5,10 +5,7 @@ import { SVG } from 'wordpress-components';
|
|
5 |
|
6 |
const barcode = (
|
7 |
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
8 |
-
<path
|
9 |
-
fill="#626262"
|
10 |
-
d="M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"
|
11 |
-
/>
|
12 |
</SVG>
|
13 |
);
|
14 |
|
5 |
|
6 |
const barcode = (
|
7 |
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
8 |
+
<path d="M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z" />
|
|
|
|
|
|
|
9 |
</SVG>
|
10 |
);
|
11 |
|
assets/js/icons/library/box.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/previews/cart.js
CHANGED
@@ -15,7 +15,7 @@ import { previewShippingRates } from './shipping-rates';
|
|
15 |
|
16 |
// Sample data for cart block.
|
17 |
// This closely resembles the data returned from the Store API /cart endpoint.
|
18 |
-
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/
|
19 |
export const previewCart = {
|
20 |
coupons: [],
|
21 |
shipping_rates: SHIPPING_METHODS_EXIST ? previewShippingRates : [],
|
15 |
|
16 |
// Sample data for cart block.
|
17 |
// This closely resembles the data returned from the Store API /cart endpoint.
|
18 |
+
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/main/src/RestApi/StoreApi#cart-api
|
19 |
export const previewCart = {
|
20 |
coupons: [],
|
21 |
shipping_rates: SHIPPING_METHODS_EXIST ? previewShippingRates : [],
|
assets/js/type-defs/contexts.js
CHANGED
@@ -252,10 +252,35 @@
|
|
252 |
/**
|
253 |
* @typedef {Object} EditorDataContext
|
254 |
*
|
255 |
-
* @property {
|
256 |
-
* @property {number}
|
257 |
-
* @property {Object}
|
258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
*/
|
260 |
|
261 |
/**
|
252 |
/**
|
253 |
* @typedef {Object} EditorDataContext
|
254 |
*
|
255 |
+
* @property {number} isEditor Indicates whether in the editor context.
|
256 |
+
* @property {number} currentPostId The post ID being edited.
|
257 |
+
* @property {Object} previewData Object containing preview data for the editor.
|
258 |
+
*/
|
259 |
+
|
260 |
+
/**
|
261 |
+
* @typedef {Object} AddToCartFormContext
|
262 |
+
*
|
263 |
+
* @property {Object} product The product object.
|
264 |
+
* @property {number} productId The product ID being added to the cart.
|
265 |
+
* @property {number} variationId The variation ID being added to the cart, or 0.
|
266 |
+
* @property {Object} variationData Object containing variation attribute/value data.
|
267 |
+
* @property {Object} cartItemData Object containing custom cart item data.
|
268 |
+
* @property {number} quantity Stores the quantity being added to the cart.
|
269 |
+
* @property {number} minQuantity Min quantity that can be added to the cart.
|
270 |
+
* @property {number} maxQuantity Max quantity than can be added to the cart.
|
271 |
+
* @property {number} quantityInCart Stores how many of a product are already in the cart.
|
272 |
+
* @property {function(number):void} setQuantity Sets the quantity being added to the cart.
|
273 |
+
* @property {function(number):void} setVariationId Sets the variation ID being added to the cart.
|
274 |
+
* @property {function(Object):void} setVariationData Sets variation data attribute=>value pairs.
|
275 |
+
* @property {function(Object):void} setCartItemData Sets cart item data attribute=>value pairs.
|
276 |
+
* @property {boolean} showFormElements True if showing a full add to cart form.
|
277 |
+
* @property {boolean} formInitialized True once the cart form is ready.
|
278 |
+
* @property {boolean} formDisabled True if the cart form cannot yet be submitted.
|
279 |
+
* @property {boolean} formSubmitting True when the cart form is busy adding to the cart.
|
280 |
+
* @property {function():void} onChange Triggered when a form element changes.
|
281 |
+
* @property {function():void} onSubmit Submits the form.
|
282 |
+
* @property {function():void} onSuccess Triggered when the add to cart request is successful.
|
283 |
+
* @property {function():void} onFail Triggered when the add to cart request fails.
|
284 |
*/
|
285 |
|
286 |
/**
|
build/active-filters-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => 'dd622d4a58cdc807a4e8d4d7eacccf71');
|
build/active-filters-frontend.js
CHANGED
@@ -1,6 +1,6 @@
|
|
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=255)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t,r){var n=r(70),o=r(71),c=r(52),i=r(72);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()}},106:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(15),o=r(12),c=r(0),i=r(85),u=r(38),a=function(e){var t=e.namespace,r=e.resourceName,a=e.resourceValues,s=void 0===a?[]:a,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,b=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var g=Object(c.useRef)({results:[],isLoading:!0}),d=Object(u.a)(f),m=Object(u.a)(s),O=Object(i.a)(),y=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,d,m],i=o.getCollectionError.apply(o,c);return i&&O(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,m,d,b]);return null!==y&&(g.current=y),g.current}},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},r.apply(this,arguments)}e.exports=r},118:function(e,t,r){"use strict";r.d(t,"c",(function(){return b})),r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return d}));var n=r(6),o=r.n(n),c=r(20),i=r.n(c),u=r(2);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l,f,p={code:u.CURRENCY.code,symbol:u.CURRENCY.symbol,thousandSeparator:u.CURRENCY.thousandSeparator,decimalSeparator:u.CURRENCY.decimalSeparator,minorUnit:u.CURRENCY.precision,prefix:(l=u.CURRENCY.symbol,f=u.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[f]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(u.CURRENCY.symbol,u.CURRENCY.symbolPosition)},b=function(e){if(!e||"object"!==i()(e))return p;var t=e.currency_code,r=e.currency_symbol,n=e.currency_thousand_separator,o=e.currency_decimal_separator,c=e.currency_minor_unit,u=e.currency_prefix,a=e.currency_suffix;return{code:t||"USD",symbol:r||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof o?o:".",minorUnit:Number.isFinite(c)?c:2,prefix:"string"==typeof u?u:"$",suffix:"string"==typeof a?a:""}},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},p),e)},d=function(e,t){if(""===e||void 0===e)return"";var r=parseInt(e,10);if(!Number.isFinite(r))return"";var n=g(t),o=r/Math.pow(10,n.minorUnit),c=n.prefix+o+n.suffix,i=document.createElement("textarea");return i.innerHTML=c,i.value}},119:function(e,t,r){"use strict";var n=r(0),o=r(2),c=r(15),i=r(12);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(Object(o.getSetting)("restApiRoutes")),Object(i.useSelect)((function(e,t){if(r.current){var n=e(c.SCHEMA_STORE_KEY),o=n.isResolving,i=n.hasFinishedResolution,u=t.dispatch(c.SCHEMA_STORE_KEY),a=u.receiveRoutes,s=u.startResolution,l=u.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];o("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),a(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},12:function(e,t){!function(){e.exports=this.wp.data}()},129:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return i}));var n=r(8),o=n.c.reduce((function(e,t){var r,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;return n.id&&e.push(n),e}),[]),c=function(e){if(e)return o.find((function(t){return t.id===e}))},i=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},130:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(7),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),i=c.length?c[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(o)){var u=i.slug.filter((function(e){return e!==o})),a=e.filter((function(e){return e.attribute!==r.taxonomy}));u.length>0&&(i.slug=u.sort(),a.push(i)),t(Object(n.sortBy)(a,"attribute"))}},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},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",i=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(i):(i.push({attribute:r.taxonomy,operator:c,slug:Object(n.map)(o,"slug").sort()}),t(Object(n.sortBy)(i,"attribute")))}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},16:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},19:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},198:function(e,t){},2:function(e,t){!function(){e.exports=this.wc.wcSettings}()},20:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},21:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},255:function(e,t,r){"use strict";r.r(t);var n=r(119),o=r(98),c=r(10),i=r.n(c),u=r(1),a=r(93),s=r(0),l=r(4),f=r.n(l),p=(r(5),r(28)),b=(r(198),r(129)),g=r(118),d=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(u.sprintf)(Object(u.__)("Between %s and %s","woo-gutenberg-products-block"),Object(g.a)(e),Object(g.a)(t)):Number.isFinite(e)?Object(u.sprintf)(Object(u.__)("From %s","woo-gutenberg-products-block"),Object(g.a)(e)):Object(u.sprintf)(Object(u.__)("Up to %s","woo-gutenberg-products-block"),Object(g.a)(t))},m=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,i=e.showLabel,a=void 0===i||i;return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},a&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),React.createElement("span",{className:"wc-block-active-filters__list-item-name"},n?React.createElement(s.Fragment,null,n," ",r):r,React.createElement("button",{onClick:c},Object(u.sprintf)(Object(u.__)("Remove %s filter","woo-gutenberg-products-block"),r))))},O=r(106),y=r(16),v=r(130),h=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,s=void 0===c?"in":c,l=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=l.results,p=l.isLoading,b=Object(a.b)("attributes",[]),g=i()(b,2),d=g[0],h=g[1];if(p)return null;var j=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},j,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===s&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(u.__)("and","woo-gutenberg-products-block"))),m({type:j,name:Object(y.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(v.a)(d,h,r,e)},showLabel:!1})}))))},j=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(a.b)("attributes",[]),c=i()(o,2),l=c[0],g=c[1],O=Object(a.b)("min_price"),y=i()(O,2),v=y[0],j=y[1],_=Object(a.b)("max_price"),S=i()(_,2),E=S[0],w=S[1],R=Object(s.useMemo)((function(){return Number.isFinite(v)||Number.isFinite(E)?m({type:Object(u.__)("Price","woo-gutenberg-products-block"),name:d(v,E),removeCallback:function(){j(void 0),w(void 0)}}):null}),[v,E,d]),x=Object(s.useMemo)((function(){return l.map((function(e){var t=Object(b.b)(e.attribute);return React.createElement(h,{attributeObject:t,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l]);if(!(l.length>0||Number.isFinite(v)||Number.isFinite(E)||n))return null;var k="h".concat(t.headingLevel),P=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(s.Fragment,null,!n&&t.heading&&React.createElement(k,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(s.Fragment,null,m({type:Object(u.__)("Size","woo-gutenberg-products-block"),name:Object(u.__)("Small","woo-gutenberg-products-block")}),m({type:Object(u.__)("Color","woo-gutenberg-products-block"),name:Object(u.__)("Blue","woo-gutenberg-products-block")})):React.createElement(s.Fragment,null,R,x)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){j(void 0),w(void 0),g([])}},React.createElement(p.a,{label:Object(u.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(u.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(j),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},28:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=(r(5),r(3)),i=r(4),u=r.n(i);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,a=null!=r,l=null!=n;return!a&&l?(t=o||"span",i=s(s({},i),{},{className:u()(i.className,"screen-reader-text")}),React.createElement(t,i,n)):(t=o||c.Fragment,a&&l&&r!==n?React.createElement(t,i,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,i,r))};l.defaultProps={wrapperProps:{}},t.a=l},3:function(e,t){!function(){e.exports=this.React}()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},33:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},34:function(e,t,r){var n=r(58);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},35:function(e,t,r){var n=r(20),o=r(19);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t}},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(37),c=r.n(o),i=function(e){var t=Object(n.useRef)();return c()(e,t.current)||(t.current=e),t.current}},39:function(e,t){!function(){e.exports=this.wp.blocks}()},4:function(e,t,r){var n;
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!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)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"===c)for(var u in n)r.call(n,u)&&n[u]&&e.push(u)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},43:function(e,t,r){"use strict";var n=r(32),o=r.n(n),c=r(33),i=r.n(c),u=r(19),a=r.n(u),s=r(34),l=r.n(s),f=r(35),p=r.n(f),b=r(21),g=r.n(b),d=r(6),m=r.n(d),O=(r(5),r(3)),y=r(1),v=r(8),h=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.A,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(y.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,i=void 0===c?Object(y.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,u=e.errorMessage,a=e.errorMessagePrefix,s=void 0===a?Object(y.__)("Error:","woo-gutenberg-products-block"):a;return React.createElement("div",{className:"wc-block-error"},r&&React.createElement("img",{className:"wc-block-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content"},o&&React.createElement("p",{className:"wc-block-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text"},i),u&&React.createElement("p",{className:"wc-block-error__message"},s?s+" ":"",u)))};r(61);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=g()(e);if(t){var o=g()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return p()(this,r)}}var _=function(e){l()(r,e);var t=j(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),i=0;i<n;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),m()(a()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=this.state,u=i.errorMessage;return i.hasError?React.createElement(h,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(O.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(O.Component);_.defaultProps={showErrorMessage:!0};t.a=_},44:function(e,t){!function(){e.exports=this.ReactDOM}()},5:function(e,t,r){e.exports=r(59)()},52:function(e,t,r){var n=r(53);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},53:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},55:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},58:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},59:function(e,t,r){"use strict";var n=r(60);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,i){if(i!==n){var u=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 u.name="Invariant Violation",u}}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}},6: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}},60:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},61:function(e,t){},7:function(e,t){!function(){e.exports=this.lodash}()},70:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},71:function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw c}}return r}}},72:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},8:function(e,t,r){"use strict";r.d(t,"i",(function(){return o})),r.d(t,"s",(function(){return c})),r.d(t,"w",(function(){return i})),r.d(t,"p",(function(){return u})),r.d(t,"l",(function(){return a})),r.d(t,"o",(function(){return s})),r.d(t,"h",(function(){return l})),r.d(t,"x",(function(){return f})),r.d(t,"k",(function(){return p})),r.d(t,"j",(function(){return b})),r.d(t,"c",(function(){return g})),r.d(t,"m",(function(){return d})),r.d(t,"n",(function(){return m})),r.d(t,"A",(function(){return O})),r.d(t,"t",(function(){return y})),r.d(t,"a",(function(){return v})),r.d(t,"u",(function(){return h})),r.d(t,"b",(function(){return j})),r.d(t,"f",(function(){return _})),r.d(t,"v",(function(){return w})),r.d(t,"g",(function(){return R})),r.d(t,"r",(function(){return x})),r.d(t,"q",(function(){return k})),r.d(t,"z",(function(){return P})),r.d(t,"y",(function(){return C})),r.d(t,"d",(function(){return T})),r.d(t,"e",(function(){return N}));var n=r(2),o=Object(n.getSetting)("currentUserIsAdmin",!1),c=Object(n.getSetting)("reviewRatingsEnabled",!0),i=Object(n.getSetting)("showAvatars",!0),u=(Object(n.getSetting)("max_columns",6),Object(n.getSetting)("min_columns",1),Object(n.getSetting)("default_columns",3),Object(n.getSetting)("max_rows",6),Object(n.getSetting)("min_rows",1),Object(n.getSetting)("default_rows",3),Object(n.getSetting)("min_height",500),Object(n.getSetting)("default_height",500),Object(n.getSetting)("placeholderImgSrc","")),a=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),s=Object(n.getSetting)("limitTags"),l=(Object(n.getSetting)("hasProducts",!0),Object(n.getSetting)("hasTags",!0),Object(n.getSetting)("homeUrl",""),Object(n.getSetting)("couponsEnabled",!0)),f=(Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0)),p=Object(n.getSetting)("displayItemizedTaxes",!1),b=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),g=(Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[])),d=Object(n.getSetting)("isShippingCalculatorEnabled",!0),m=Object(n.getSetting)("isShippingCostHidden",!1),O=(Object(n.getSetting)("woocommerceBlocksPhase",1),Object(n.getSetting)("wcBlocksAssetUrl","")),y=Object(n.getSetting)("shippingCountries",{}),v=Object(n.getSetting)("allowedCountries",{}),h=Object(n.getSetting)("shippingStates",{}),j=Object(n.getSetting)("allowedStates",{}),_=(Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("checkoutShowLoginReminder",!0)),S={id:0,title:"",permalink:""},E=Object(n.getSetting)("storePages",{shop:S,cart:S,checkout:S,privacy:S,terms:S}),w=E.shop.permalink,R=(E.checkout.id,E.checkout.permalink),x=E.privacy.permalink,k=E.privacy.title,P=E.terms.permalink,C=E.terms.title,T=(E.cart.id,E.cart.permalink),N=Object(n.getSetting)("checkoutAllowsGuest",!1);Object(n.getSetting)("checkoutAllowsSignup",!1),r(39)},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(10),o=r.n(n),c=r(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},93:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b}));var n=r(10),o=r.n(n),c=r(15),i=r(12),u=r(0),a=r(55),s=r(7),l=r(38),f=function(e){var t=Object(a.a)();e=e||t;var r=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(u.useCallback)((function(t){n(e,t)}),[e])]},p=function(e,t,r){var n=Object(a.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(u.useCallback)((function(t){s(r,e,t)}),[r,e])]},b=function(e,t){var r=Object(a.a)(),n=f(t=t||r),c=o()(n,2),i=c[0],p=c[1],b=Object(l.a)(e),g=Object(u.useRef)(!1);return Object(u.useEffect)((function(){p(Object(s.assign)({},i,b)),g.current=!0}),[b]),g.current?[i,p]:[e,p]}},98:function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(11),o=r.n(n),c=r(6),i=r.n(c),u=r(44),a=r(43);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=function(e){var t=e.Block,r=e.selector,n=e.getProps,c=void 0===n?function(){}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i,f=document.querySelectorAll(r);f.length&&Array.prototype.forEach.call(f,(function(e,r){var n=c(e,r),i=s(e,r),f=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(u.render)(React.createElement(a.a,i,React.createElement(t,o()({},n,{attributes:f}))),e)}))}}});
|
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=265)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},102:function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(11),o=r.n(n),c=r(6),i=r.n(c),u=r(45),a=r(44);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=function(e){var t=e.Block,r=e.selector,n=e.getProps,c=void 0===n?function(){}:n,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i,f=document.querySelectorAll(r);f.length&&Array.prototype.forEach.call(f,(function(e,r){var n=c(e,r),i=s(e,r),f=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(u.render)(React.createElement(a.a,i,React.createElement(t,o()({},n,{attributes:f}))),e)}))}},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(16),o=r(13),c=r(0),i=r(86),u=r(39),a=function(e){var t=e.namespace,r=e.resourceName,a=e.resourceValues,s=void 0===a?[]:a,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,b=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var g=Object(c.useRef)({results:[],isLoading:!0}),d=Object(u.a)(f),m=Object(u.a)(s),O=Object(i.a)(),y=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,d,m],i=o.getCollectionError.apply(o,c);return i&&O(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,m,d,b]);return null!==y&&(g.current=y),g.current}},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},r.apply(this,arguments)}e.exports=r},119:function(e,t,r){"use strict";r.d(t,"c",(function(){return b})),r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return d}));var n=r(6),o=r.n(n),c=r(22),i=r.n(c),u=r(2);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l,f,p={code:u.CURRENCY.code,symbol:u.CURRENCY.symbol,thousandSeparator:u.CURRENCY.thousandSeparator,decimalSeparator:u.CURRENCY.decimalSeparator,minorUnit:u.CURRENCY.precision,prefix:(l=u.CURRENCY.symbol,f=u.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[f]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(u.CURRENCY.symbol,u.CURRENCY.symbolPosition)},b=function(e){if(!e||"object"!==i()(e))return p;var t=e.currency_code,r=e.currency_symbol,n=e.currency_thousand_separator,o=e.currency_decimal_separator,c=e.currency_minor_unit,u=e.currency_prefix,a=e.currency_suffix;return{code:t||"USD",symbol:r||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof o?o:".",minorUnit:Number.isFinite(c)?c:2,prefix:"string"==typeof u?u:"$",suffix:"string"==typeof a?a:""}},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},p),e)},d=function(e,t){if(""===e||void 0===e)return"";var r=parseInt(e,10);if(!Number.isFinite(r))return"";var n=g(t),o=r/Math.pow(10,n.minorUnit),c=n.prefix+o+n.suffix,i=document.createElement("textarea");return i.innerHTML=c,i.value}},120:function(e,t,r){"use strict";var n=r(0),o=r(2),c=r(16),i=r(13);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(Object(o.getSetting)("restApiRoutes")),Object(i.useSelect)((function(e,t){if(r.current){var n=e(c.SCHEMA_STORE_KEY),o=n.isResolving,i=n.hasFinishedResolution,u=t.dispatch(c.SCHEMA_STORE_KEY),a=u.receiveRoutes,s=u.startResolution,l=u.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];o("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),a(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},13:function(e,t){!function(){e.exports=this.wp.data}()},130:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return i}));var n=r(9),o=n.c.reduce((function(e,t){var r,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;return n.id&&e.push(n),e}),[]),c=function(e){if(e)return o.find((function(t){return t.id===e}))},i=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},131:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(7),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),i=c.length?c[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(o)){var u=i.slug.filter((function(e){return e!==o})),a=e.filter((function(e){return e.attribute!==r.taxonomy}));u.length>0&&(i.slug=u.sort(),a.push(i)),t(Object(n.sortBy)(a,"attribute"))}},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},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",i=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(i):(i.push({attribute:r.taxonomy,operator:c,slug:Object(n.map)(o,"slug").sort()}),t(Object(n.sortBy)(i,"attribute")))}},15:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},16:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},19:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},2:function(e,t){!function(){e.exports=this.wc.wcSettings}()},208:function(e,t){},22:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},24:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},265:function(e,t,r){"use strict";r.r(t);var n=r(120),o=r(102),c=r(8),i=r.n(c),u=r(1),a=r(97),s=r(0),l=r(4),f=r.n(l),p=(r(5),r(28)),b=(r(208),r(130)),g=r(119),d=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(u.sprintf)(Object(u.__)("Between %s and %s","woo-gutenberg-products-block"),Object(g.a)(e),Object(g.a)(t)):Number.isFinite(e)?Object(u.sprintf)(Object(u.__)("From %s","woo-gutenberg-products-block"),Object(g.a)(e)):Object(u.sprintf)(Object(u.__)("Up to %s","woo-gutenberg-products-block"),Object(g.a)(t))},m=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,i=e.showLabel,a=void 0===i||i;return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},a&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),React.createElement("span",{className:"wc-block-active-filters__list-item-name"},n?React.createElement(s.Fragment,null,n," ",r):r,React.createElement("button",{onClick:c},Object(u.sprintf)(Object(u.__)("Remove %s filter","woo-gutenberg-products-block"),r))))},O=r(107),y=r(15),v=r(131),h=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,s=void 0===c?"in":c,l=Object(O.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=l.results,p=l.isLoading,b=Object(a.b)("attributes",[]),g=i()(b,2),d=g[0],h=g[1];if(p)return null;var j=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},j,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===s&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(u.__)("and","woo-gutenberg-products-block"))),m({type:j,name:Object(y.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(v.a)(d,h,r,e)},showLabel:!1})}))))},j=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(a.b)("attributes",[]),c=i()(o,2),l=c[0],g=c[1],O=Object(a.b)("min_price"),y=i()(O,2),v=y[0],j=y[1],_=Object(a.b)("max_price"),w=i()(_,2),S=w[0],E=w[1],R=Object(s.useMemo)((function(){return Number.isFinite(v)||Number.isFinite(S)?m({type:Object(u.__)("Price","woo-gutenberg-products-block"),name:d(v,S),removeCallback:function(){j(void 0),E(void 0)}}):null}),[v,S,d]),x=Object(s.useMemo)((function(){return l.map((function(e){var t=Object(b.b)(e.attribute);return React.createElement(h,{attributeObject:t,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l]);if(!(l.length>0||Number.isFinite(v)||Number.isFinite(S)||n))return null;var k="h".concat(t.headingLevel),P=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(s.Fragment,null,!n&&t.heading&&React.createElement(k,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(s.Fragment,null,m({type:Object(u.__)("Size","woo-gutenberg-products-block"),name:Object(u.__)("Small","woo-gutenberg-products-block")}),m({type:Object(u.__)("Color","woo-gutenberg-products-block"),name:Object(u.__)("Blue","woo-gutenberg-products-block")})):React.createElement(s.Fragment,null,R,x)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){j(void 0),E(void 0),g([])}},React.createElement(p.a,{label:Object(u.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(u.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(j),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},28:function(e,t,r){"use strict";var n=r(6),o=r.n(n),c=(r(5),r(3)),i=r(4),u=r.n(i);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,a=null!=r,l=null!=n;return!a&&l?(t=o||"span",i=s(s({},i),{},{className:u()(i.className,"screen-reader-text")}),React.createElement(t,i,n)):(t=o||c.Fragment,a&&l&&r!==n?React.createElement(t,i,React.createElement("span",{"aria-hidden":"true"},r),React.createElement("span",{className:"screen-reader-text"},n)):React.createElement(t,i,r))};l.defaultProps={wrapperProps:{}},t.a=l},3:function(e,t){!function(){e.exports=this.React}()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},33:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},34:function(e,t,r){var n=r(60);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},35:function(e,t,r){var n=r(22),o=r(19);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t}},38:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),o=r(38),c=r.n(o),i=function(e){var t=Object(n.useRef)();return c()(e,t.current)||(t.current=e),t.current}},4:function(e,t,r){var n;
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!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)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"===c)for(var u in n)r.call(n,u)&&n[u]&&e.push(u)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},41:function(e,t){!function(){e.exports=this.wp.blocks}()},44:function(e,t,r){"use strict";var n=r(32),o=r.n(n),c=r(33),i=r.n(c),u=r(19),a=r.n(u),s=r(34),l=r.n(s),f=r(35),p=r.n(f),b=r(24),g=r.n(b),d=r(6),m=r.n(d),O=(r(5),r(3)),y=r(1),v=r(9),h=function(e){var t=e.imageUrl,r=void 0===t?"".concat(v.A,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(y.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,i=void 0===c?Object(y.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,u=e.errorMessage,a=e.errorMessagePrefix,s=void 0===a?Object(y.__)("Error:","woo-gutenberg-products-block"):a;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),u&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",u)))};r(63);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=g()(e);if(t){var o=g()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return p()(this,r)}}var _=function(e){l()(r,e);var t=j(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),i=0;i<n;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),m()(a()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=this.state,u=i.errorMessage;return i.hasError?React.createElement(h,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(O.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(O.Component);_.defaultProps={showErrorMessage:!0};t.a=_},45:function(e,t){!function(){e.exports=this.ReactDOM}()},5:function(e,t,r){e.exports=r(61)()},54:function(e,t,r){var n=r(55);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},55:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},6: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}},60:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},61:function(e,t,r){"use strict";var n=r(62);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,i){if(i!==n){var u=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 u.name="Invariant Violation",u}}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}},62:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},63:function(e,t){},7:function(e,t){!function(){e.exports=this.lodash}()},73:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},74:function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw c}}return r}}},75:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},8:function(e,t,r){var n=r(73),o=r(74),c=r(54),i=r(75);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()}},86:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8),o=r.n(n),c=r(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},9:function(e,t,r){"use strict";r.d(t,"i",(function(){return o})),r.d(t,"s",(function(){return c})),r.d(t,"w",(function(){return i})),r.d(t,"p",(function(){return u})),r.d(t,"l",(function(){return a})),r.d(t,"o",(function(){return s})),r.d(t,"h",(function(){return l})),r.d(t,"x",(function(){return f})),r.d(t,"k",(function(){return p})),r.d(t,"j",(function(){return b})),r.d(t,"c",(function(){return g})),r.d(t,"m",(function(){return d})),r.d(t,"n",(function(){return m})),r.d(t,"A",(function(){return O})),r.d(t,"t",(function(){return y})),r.d(t,"a",(function(){return v})),r.d(t,"u",(function(){return h})),r.d(t,"b",(function(){return j})),r.d(t,"f",(function(){return _})),r.d(t,"v",(function(){return E})),r.d(t,"g",(function(){return R})),r.d(t,"r",(function(){return x})),r.d(t,"q",(function(){return k})),r.d(t,"z",(function(){return P})),r.d(t,"y",(function(){return C})),r.d(t,"d",(function(){return T})),r.d(t,"e",(function(){return N}));var n=r(2),o=Object(n.getSetting)("currentUserIsAdmin",!1),c=Object(n.getSetting)("reviewRatingsEnabled",!0),i=Object(n.getSetting)("showAvatars",!0),u=(Object(n.getSetting)("max_columns",6),Object(n.getSetting)("min_columns",1),Object(n.getSetting)("default_columns",3),Object(n.getSetting)("max_rows",6),Object(n.getSetting)("min_rows",1),Object(n.getSetting)("default_rows",3),Object(n.getSetting)("min_height",500),Object(n.getSetting)("default_height",500),Object(n.getSetting)("placeholderImgSrc","")),a=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),s=Object(n.getSetting)("limitTags"),l=(Object(n.getSetting)("hasProducts",!0),Object(n.getSetting)("hasTags",!0),Object(n.getSetting)("homeUrl",""),Object(n.getSetting)("couponsEnabled",!0)),f=(Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0)),p=Object(n.getSetting)("displayItemizedTaxes",!1),b=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),g=(Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[])),d=Object(n.getSetting)("isShippingCalculatorEnabled",!0),m=Object(n.getSetting)("isShippingCostHidden",!1),O=(Object(n.getSetting)("woocommerceBlocksPhase",1),Object(n.getSetting)("wcBlocksAssetUrl","")),y=Object(n.getSetting)("shippingCountries",{}),v=Object(n.getSetting)("allowedCountries",{}),h=Object(n.getSetting)("shippingStates",{}),j=Object(n.getSetting)("allowedStates",{}),_=(Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("checkoutShowLoginReminder",!0)),w={id:0,title:"",permalink:""},S=Object(n.getSetting)("storePages",{shop:w,cart:w,checkout:w,privacy:w,terms:w}),E=S.shop.permalink,R=(S.checkout.id,S.checkout.permalink),x=S.privacy.permalink,k=S.privacy.title,P=S.terms.permalink,C=S.terms.title,T=(S.cart.id,S.cart.permalink),N=Object(n.getSetting)("checkoutAllowsGuest",!1);Object(n.getSetting)("checkoutAllowsSignup",!1),r(41)},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b}));var n=r(8),o=r.n(n),c=r(16),i=r(13),u=r(0),a=r(58),s=r(7),l=r(39),f=function(e){var t=Object(a.a)();e=e||t;var r=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(u.useCallback)((function(t){n(e,t)}),[e])]},p=function(e,t,r){var n=Object(a.a)();r=r||n;var o=Object(i.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(u.useCallback)((function(t){s(r,e,t)}),[r,e])]},b=function(e,t){var r=Object(a.a)(),n=f(t=t||r),c=o()(n,2),i=c[0],p=c[1],b=Object(l.a)(e),g=Object(u.useRef)(!1);return Object(u.useEffect)((function(){p(Object(s.assign)({},i,b)),g.current=!0}),[b]),g.current?[i,p]:[e,p]}}});
|
build/active-filters.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', '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'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', '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'), 'version' => '3c5929be37666a27ead6d584b4935b72');
|
build/active-filters.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,o,u=t[0],a=t[1],l=t[2],b=0,f=[];b<u.length;b++)o=u[b],Object.prototype.hasOwnProperty.call(c,o)&&c[o]&&f.push(c[o][0]),c[o]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,u=1;u<n.length;u++){var a=n[u];0!==c[a]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},c={4:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,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="";var u=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],a=u.push.bind(u);u.push=t,u=u.slice();for(var l=0;l<u.length;l++)t(u[l]);var s=a;return i.push([844,2,0,1]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},14:function(e,t){!function(){e.exports=this.wp.blocks}()},145:function(e,t,n){"use strict";var r=n(20),c=n.n(r),i=n(26),o=n.n(i),u=n(21),a=n.n(u),l=n(22),s=n.n(l),b=n(12),f=n.n(b),p=n(0),d=n(6),g=n(1),O=n(4);function m(e){var t=e.level,n={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 n.hasOwnProperty(t)?Object(p.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(O.Path,{d:n[t]})):null}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var c=f()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return s()(this,n)}}var h=function(e){a()(n,e);var t=v(n);function n(){return c()(this,n),t.apply(this,arguments)}return o()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(m,{level:e}),title:Object(g.sprintf)(Object(g.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,i=t.maxLevel,o=t.selectedLevel,u=t.onChange;return Object(p.createElement)(O.Toolbar,{isCollapsed:r,icon:Object(p.createElement)(m,{level:o}),controls:Object(d.range)(c,i).map((function(t){return e.createLevelControl(t,o,u)}))})}}]),n}(p.Component);t.a=h},148:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(11),c=n.n(r),i=n(0),o=function(){var e=Object(i.useState)(),t=c()(e,2)[1];return function(e){return t((function(){throw e}))}}},165:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p}));var r=n(11),c=n.n(r),i=n(39),o=n(35),u=n(0),a=n(96),l=n(6),s=n(57),b=function(e){var t=Object(a.a)();e=e||t;var n=Object(o.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(u.useCallback)((function(t){r(e,t)}),[e])]},f=function(e,t,n){var r=Object(a.a)();n=n||r;var c=Object(o.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(u.useCallback)((function(t){l(n,e,t)}),[n,e])]},p=function(e,t){var n=Object(a.a)(),r=b(t=t||n),i=c()(r,2),o=i[0],f=i[1],p=Object(s.a)(e),d=Object(u.useRef)(!1);return Object(u.useEffect)((function(){f(Object(l.assign)({},o,p)),d.current=!0}),[p]),d.current?[o,f]:[e,f]}},176:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(24)),i=n(7),o=n.n(i);n(247);t.a=function(e){var t=e.className,n=e.headingLevel,i=e.onChange,u=e.heading,a="h".concat(n);return Object(r.createElement)(a,null,Object(r.createElement)(c.PlainText,{className:o()("wc-block-components-title",t),value:u,onChange:i}))}},187:function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return g}));var r=n(8),c=n.n(r),i=n(54),o=n.n(i),u=n(3);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s,b,f={code:u.CURRENCY.code,symbol:u.CURRENCY.symbol,thousandSeparator:u.CURRENCY.thousandSeparator,decimalSeparator:u.CURRENCY.decimalSeparator,minorUnit:u.CURRENCY.precision,prefix:(s=u.CURRENCY.symbol,b=u.CURRENCY.symbolPosition,{left:s,left_space:" "+s,right:"",right_space:""}[b]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(u.CURRENCY.symbol,u.CURRENCY.symbolPosition)},p=function(e){if(!e||"object"!==o()(e))return f;var t=e.currency_code,n=e.currency_symbol,r=e.currency_thousand_separator,c=e.currency_decimal_separator,i=e.currency_minor_unit,u=e.currency_prefix,a=e.currency_suffix;return{code:t||"USD",symbol:n||"$",thousandSeparator:"string"==typeof r?r:",",decimalSeparator:"string"==typeof c?c:".",minorUnit:Number.isFinite(i)?i:2,prefix:"string"==typeof u?u:"$",suffix:"string"==typeof a?a:""}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l(l({},f),e)},g=function(e,t){if(""===e||void 0===e)return"";var n=parseInt(e,10);if(!Number.isFinite(n))return"";var r=d(t),c=n/Math.pow(10,r.minorUnit),i=r.prefix+c+r.suffix,o=document.createElement("textarea");return o.innerHTML=i,o.value}},197:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(39),c=n(35),i=n(0),o=n(148),u=n(57),a=function(e){var t=e.namespace,n=e.resourceName,a=e.resourceValues,l=void 0===a?[]:a,s=e.query,b=void 0===s?{}:s,f=e.shouldSelect,p=void 0===f||f;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(i.useRef)({results:[],isLoading:!0}),g=Object(u.a)(b),O=Object(u.a)(l),m=Object(o.a)(),v=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),i=[t,n,g,O],o=c.getCollectionError.apply(c,i);return o&&m(o),{results:c.getCollection.apply(c,i),isLoading:!c.hasFinishedResolution("getCollection",i)}}),[t,n,O,g,p]);return null!==v&&(d.current=v),d.current}},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},247:function(e,t,n){},25:function(e,t){!function(){e.exports=this.wp.compose}()},252:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(5),c=r.c.reduce((function(e,t){var n,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;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return c.find((function(t){return t.id===e}))},o=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},253:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return i}));var r=n(6),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=e.filter((function(e){return e.attribute===n.taxonomy})),o=i.length?i[0]:null;if(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(c)){var u=o.slug.filter((function(e){return e!==c})),a=e.filter((function(e){return e.attribute!==n.taxonomy}));u.length>0&&(o.slug=u.sort(),a.push(o)),t(Object(r.sortBy)(a,"attribute"))}},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",o=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(o):(o.push({attribute:n.taxonomy,operator:i,slug:Object(r.map)(c,"slug").sort()}),t(Object(r.sortBy)(o,"attribute")))}},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},33:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},35:function(e,t){!function(){e.exports=this.wp.data}()},39:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},4:function(e,t){!function(){e.exports=this.wp.components}()},44:function(e,t,n){"use strict";var r=n(8),c=n.n(r),i=n(0),o=(n(2),n(9)),u=n(7),a=n.n(u);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,u=e.wrapperProps,l=null!=n,b=null!=r;return!l&&b?(t=c||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),Object(i.createElement)(t,u,r)):(t=c||o.Fragment,l&&b&&n!==r?Object(i.createElement)(t,u,Object(i.createElement)("span",{"aria-hidden":"true"},n),Object(i.createElement)("span",{className:"screen-reader-text"},r)):Object(i.createElement)(t,u,n))};b.defaultProps={wrapperProps:{}},t.a=b},48:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},5:function(e,t,n){"use strict";n.d(t,"k",(function(){return c})),n.d(t,"G",(function(){return i})),n.d(t,"M",(function(){return o})),n.d(t,"x",(function(){return u})),n.d(t,"z",(function(){return a})),n.d(t,"l",(function(){return l})),n.d(t,"y",(function(){return s})),n.d(t,"B",(function(){return b})),n.d(t,"n",(function(){return f})),n.d(t,"A",(function(){return p})),n.d(t,"m",(function(){return d})),n.d(t,"C",(function(){return g})),n.d(t,"t",(function(){return O})),n.d(t,"w",(function(){return m})),n.d(t,"q",(function(){return v})),n.d(t,"r",(function(){return h})),n.d(t,"s",(function(){return j})),n.d(t,"j",(function(){return y})),n.d(t,"I",(function(){return w})),n.d(t,"N",(function(){return _})),n.d(t,"p",(function(){return E})),n.d(t,"o",(function(){return S})),n.d(t,"F",(function(){return k})),n.d(t,"c",(function(){return C})),n.d(t,"u",(function(){return x})),n.d(t,"v",(function(){return P})),n.d(t,"Q",(function(){return N})),n.d(t,"H",(function(){return L})),n.d(t,"a",(function(){return H})),n.d(t,"K",(function(){return T})),n.d(t,"b",(function(){return V})),n.d(t,"J",(function(){return z})),n.d(t,"h",(function(){return D})),n.d(t,"L",(function(){return U})),n.d(t,"g",(function(){return B})),n.d(t,"i",(function(){return A})),n.d(t,"E",(function(){return Y})),n.d(t,"D",(function(){return I})),n.d(t,"P",(function(){return Q})),n.d(t,"O",(function(){return K})),n.d(t,"d",(function(){return G})),n.d(t,"e",(function(){return W})),n.d(t,"f",(function(){return q})),n.d(t,"R",(function(){return $})),n.d(t,"S",(function(){return X}));var r=n(3),c=Object(r.getSetting)("currentUserIsAdmin",!1),i=Object(r.getSetting)("reviewRatingsEnabled",!0),o=Object(r.getSetting)("showAvatars",!0),u=Object(r.getSetting)("max_columns",6),a=Object(r.getSetting)("min_columns",1),l=Object(r.getSetting)("default_columns",3),s=Object(r.getSetting)("max_rows",6),b=Object(r.getSetting)("min_rows",1),f=Object(r.getSetting)("default_rows",3),p=Object(r.getSetting)("min_height",500),d=Object(r.getSetting)("default_height",500),g=Object(r.getSetting)("placeholderImgSrc",""),O=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),m=Object(r.getSetting)("limitTags"),v=Object(r.getSetting)("hasProducts",!0),h=Object(r.getSetting)("hasTags",!0),j=Object(r.getSetting)("homeUrl",""),y=Object(r.getSetting)("couponsEnabled",!0),w=Object(r.getSetting)("shippingEnabled",!0),_=Object(r.getSetting)("taxesEnabled",!0),E=Object(r.getSetting)("displayItemizedTaxes",!1),S=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),k=Object(r.getSetting)("productCount",0),C=Object(r.getSetting)("attributes",[]),x=Object(r.getSetting)("isShippingCalculatorEnabled",!0),P=Object(r.getSetting)("isShippingCostHidden",!1),R=Object(r.getSetting)("woocommerceBlocksPhase",1),N=Object(r.getSetting)("wcBlocksAssetUrl",""),L=Object(r.getSetting)("shippingCountries",{}),H=Object(r.getSetting)("allowedCountries",{}),T=Object(r.getSetting)("shippingStates",{}),V=Object(r.getSetting)("allowedStates",{}),z=Object(r.getSetting)("shippingMethodsExist",!1),D=Object(r.getSetting)("checkoutShowLoginReminder",!0),F={id:0,title:"",permalink:""},M=Object(r.getSetting)("storePages",{shop:F,cart:F,checkout:F,privacy:F,terms:F}),U=M.shop.permalink,B=M.checkout.id,A=M.checkout.permalink,Y=M.privacy.permalink,I=M.privacy.title,Q=M.terms.permalink,K=M.terms.title,G=M.cart.id,W=M.cart.permalink,q=Object(r.getSetting)("checkoutAllowsGuest",!1),J=(Object(r.getSetting)("checkoutAllowsSignup",!1),n(14)),$=function(e,t){if(R>2)return Object(J.registerBlockType)(e,t)},X=function(e,t){if(R>1)return Object(J.registerBlockType)(e,t)}},57:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=n(48),i=n.n(c),o=function(e){var t=Object(r.useRef)();return i()(e,t.current)||(t.current=e),t.current}},58:function(e,t,n){"use strict";var r=n(8),c=n.n(r),i=n(23),o=n.n(i),u=n(9);n(2);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,i=o()(e,["srcElement","size"]);return Object(u.isValidElement)(t)&&Object(u.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},i))}},6:function(e,t){!function(){e.exports=this.lodash}()},70:function(e,t,n){"use strict";var r=n(10),c=n.n(r),i=n(20),o=n.n(i),u=n(26),a=n.n(u),l=n(19),s=n.n(l),b=n(21),f=n.n(b),p=n(22),d=n.n(p),g=n(12),O=n.n(g),m=n(0),v=n(6),h=n(7),j=n.n(h),y=n(4),w=n(25);n(168);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O()(e);if(t){var c=O()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return d()(this,n)}}var E=function(e){f()(n,e);var t=_(n);function n(){var e;return o()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return a()(n,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,i=n.checked,o=n.instanceId,u=n.className,a=n.help,l=n.options,s=n.value,b="inspector-toggle-button-control-".concat(o);return a&&(e=Object(v.isFunction)(a)?a(i):a),Object(m.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",u)},Object(m.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(m.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,n){var i={};return s===e.value?(i.isPrimary=!0,i["aria-pressed"]=!0):(i.isDefault=!0,i["aria-pressed"]=!1),Object(m.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},i),e.label)}))))}}]),n}(m.Component);t.a=Object(w.withInstanceId)(E)},844:function(e,t,n){"use strict";n.r(t);var r=n(10),c=n.n(r),i=n(0),o=n(1),u=n(14),a=n(58),l=n(63),s=Object(i.createElement)(l.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.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=n(7),f=n.n(b),p=n(24),d=n(4),g=n(145),O=n(176),m=n(11),v=n.n(m),h=n(165),j=(n(2),n(44)),y=(n(795),n(252)),w=n(187),_=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(o.sprintf)(Object(o.__)("Between %s and %s","woo-gutenberg-products-block"),Object(w.a)(e),Object(w.a)(t)):Number.isFinite(e)?Object(o.sprintf)(Object(o.__)("From %s","woo-gutenberg-products-block"),Object(w.a)(e)):Object(o.sprintf)(Object(o.__)("Up to %s","woo-gutenberg-products-block"),Object(w.a)(t))},E=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,u=void 0===c?function(){}:c,a=e.showLabel,l=void 0===a||a;return Object(i.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},l&&Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-name"},r?Object(i.createElement)(i.Fragment,null,r," ",n):n,Object(i.createElement)("button",{onClick:u},Object(o.sprintf)(Object(o.__)("Remove %s filter","woo-gutenberg-products-block"),n))))},S=n(197),k=n(33),C=n(253),x=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,u=e.operator,a=void 0===u?"in":u,l=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),s=l.results,b=l.isLoading,f=Object(h.b)("attributes",[]),p=v()(f,2),d=p[0],g=p[1];if(b)return null;var O=n.label;return Object(i.createElement)("li",null,Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-type"},O,":"),Object(i.createElement)("ul",null,c.map((function(e,t){var r=s.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===a&&(c=Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(o.__)("and","woo-gutenberg-products-block"))),E({type:O,name:Object(k.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(C.a)(d,g,n,e)},showLabel:!1})}))))},P=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(h.b)("attributes",[]),u=v()(c,2),a=u[0],l=u[1],s=Object(h.b)("min_price"),b=v()(s,2),p=b[0],d=b[1],g=Object(h.b)("max_price"),O=v()(g,2),m=O[0],w=O[1],S=Object(i.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(m)?E({type:Object(o.__)("Price","woo-gutenberg-products-block"),name:_(p,m),removeCallback:function(){d(void 0),w(void 0)}}):null}),[p,m,_]),k=Object(i.useMemo)((function(){return a.map((function(e){var t=Object(y.b)(e.attribute);return Object(i.createElement)(x,{attributeObject:t,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[a]);if(!(a.length>0||Number.isFinite(p)||Number.isFinite(m)||r))return null;var C="h".concat(t.headingLevel),P=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(i.createElement)(i.Fragment,null,!r&&t.heading&&Object(i.createElement)(C,null,t.heading),Object(i.createElement)("div",{className:"wc-block-active-filters"},Object(i.createElement)("ul",{className:P},r?Object(i.createElement)(i.Fragment,null,E({type:Object(o.__)("Size","woo-gutenberg-products-block"),name:Object(o.__)("Small","woo-gutenberg-products-block")}),E({type:Object(o.__)("Color","woo-gutenberg-products-block"),name:Object(o.__)("Blue","woo-gutenberg-products-block")})):Object(i.createElement)(i.Fragment,null,S,k)),Object(i.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),w(void 0),l([])}},Object(i.createElement)(j.a,{label:Object(o.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Clear All Filters","woo-gutenberg-products-block")}))))},R=n(70),N=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,u=t.heading,a=t.headingLevel;return Object(i.createElement)("div",{className:r},Object(i.createElement)(p.InspectorControls,{key:"inspector"},Object(i.createElement)(d.PanelBody,{title:Object(o.__)("Block Settings","woo-gutenberg-products-block")},Object(i.createElement)(R.a,{label:Object(o.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(o.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(o.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(i.createElement)("p",null,Object(o.__)("Heading Level","woo-gutenberg-products-block")),Object(i.createElement)(g.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:a,onChange:function(e){return n({headingLevel:e})}}))),Object(i.createElement)(O.a,{headingLevel:a,heading:u,onChange:function(e){return n({heading:e})}}),Object(i.createElement)(d.Disabled,null,Object(i.createElement)(P,{attributes:t,isEditor:!0})))}));Object(u.registerBlockType)("woocommerce/active-filters",{title:Object(o.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(a.a,{srcElement:s}),foreground:"#96588a"},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},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:N,save:function(e){var t=e.attributes,n=t.className,r={"data-display-style":t.displayStyle,"data-heading":t.heading,"data-heading-level":t.headingLevel};return Object(i.createElement)("div",c()({className:f()("is-loading",n)},r),Object(i.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},9:function(e,t){!function(){e.exports=this.React}()},96:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(c)};c.Provider}});
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,o,u=t[0],a=t[1],l=t[2],b=0,f=[];b<u.length;b++)o=u[b],Object.prototype.hasOwnProperty.call(c,o)&&c[o]&&f.push(c[o][0]),c[o]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);for(s&&s(t);f.length;)f.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,u=1;u<n.length;u++){var a=n[u];0!==c[a]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},c={4:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,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="";var u=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],a=u.push.bind(u);u.push=t,u=u.slice();for(var l=0;l<u.length;l++)t(u[l]);var s=a;return i.push([864,2,0,1]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},14:function(e,t){!function(){e.exports=this.wp.blocks}()},147:function(e,t,n){"use strict";var r=n(23),c=n.n(r),i=n(26),o=n.n(i),u=n(24),a=n.n(u),l=n(25),s=n.n(l),b=n(12),f=n.n(b),p=n(0),d=n(6),g=n(1),O=n(4);function m(e){var t=e.level,n={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 n.hasOwnProperty(t)?Object(p.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(O.Path,{d:n[t]})):null}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var c=f()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return s()(this,n)}}var h=function(e){a()(n,e);var t=v(n);function n(){return c()(this,n),t.apply(this,arguments)}return o()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(m,{level:e}),title:Object(g.sprintf)(Object(g.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,i=t.maxLevel,o=t.selectedLevel,u=t.onChange;return Object(p.createElement)(O.Toolbar,{isCollapsed:r,icon:Object(p.createElement)(m,{level:o}),controls:Object(d.range)(c,i).map((function(t){return e.createLevelControl(t,o,u)}))})}}]),n}(p.Component);t.a=h},150:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(11),c=n.n(r),i=n(0),o=function(){var e=Object(i.useState)(),t=c()(e,2)[1];return function(e){return t((function(){throw e}))}}},166:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p}));var r=n(11),c=n.n(r),i=n(41),o=n(36),u=n(0),a=n(97),l=n(6),s=n(58),b=function(e){var t=Object(a.a)();e=e||t;var n=Object(o.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(u.useCallback)((function(t){r(e,t)}),[e])]},f=function(e,t,n){var r=Object(a.a)();n=n||r;var c=Object(o.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(o.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(u.useCallback)((function(t){l(n,e,t)}),[n,e])]},p=function(e,t){var n=Object(a.a)(),r=b(t=t||n),i=c()(r,2),o=i[0],f=i[1],p=Object(s.a)(e),d=Object(u.useRef)(!1);return Object(u.useEffect)((function(){f(Object(l.assign)({},o,p)),d.current=!0}),[p]),d.current?[o,f]:[e,f]}},177:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(22)),i=n(7),o=n.n(i);n(253);t.a=function(e){var t=e.className,n=e.headingLevel,i=e.onChange,u=e.heading,a="h".concat(n);return Object(r.createElement)(a,null,Object(r.createElement)(c.PlainText,{className:o()("wc-block-editor-components-title",t),value:u,onChange:i}))}},189:function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return g}));var r=n(8),c=n.n(r),i=n(55),o=n.n(i),u=n(3);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s,b,f={code:u.CURRENCY.code,symbol:u.CURRENCY.symbol,thousandSeparator:u.CURRENCY.thousandSeparator,decimalSeparator:u.CURRENCY.decimalSeparator,minorUnit:u.CURRENCY.precision,prefix:(s=u.CURRENCY.symbol,b=u.CURRENCY.symbolPosition,{left:s,left_space:" "+s,right:"",right_space:""}[b]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(u.CURRENCY.symbol,u.CURRENCY.symbolPosition)},p=function(e){if(!e||"object"!==o()(e))return f;var t=e.currency_code,n=e.currency_symbol,r=e.currency_thousand_separator,c=e.currency_decimal_separator,i=e.currency_minor_unit,u=e.currency_prefix,a=e.currency_suffix;return{code:t||"USD",symbol:n||"$",thousandSeparator:"string"==typeof r?r:",",decimalSeparator:"string"==typeof c?c:".",minorUnit:Number.isFinite(i)?i:2,prefix:"string"==typeof u?u:"$",suffix:"string"==typeof a?a:""}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l(l({},f),e)},g=function(e,t){if(""===e||void 0===e)return"";var n=parseInt(e,10);if(!Number.isFinite(n))return"";var r=d(t),c=n/Math.pow(10,r.minorUnit),i=r.prefix+c+r.suffix,o=document.createElement("textarea");return o.innerHTML=i,o.value}},204:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(41),c=n(36),i=n(0),o=n(150),u=n(58),a=function(e){var t=e.namespace,n=e.resourceName,a=e.resourceValues,l=void 0===a?[]:a,s=e.query,b=void 0===s?{}:s,f=e.shouldSelect,p=void 0===f||f;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(i.useRef)({results:[],isLoading:!0}),g=Object(u.a)(b),O=Object(u.a)(l),m=Object(o.a)(),v=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),i=[t,n,g,O],o=c.getCollectionError.apply(c,i);return o&&m(o),{results:c.getCollection.apply(c,i),isLoading:!c.hasFinishedResolution("getCollection",i)}}),[t,n,O,g,p]);return null!==v&&(d.current=v),d.current}},21:function(e,t){!function(){e.exports=this.wp.compose}()},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},253:function(e,t,n){},257:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(5),c=r.c.reduce((function(e,t){var n,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;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return c.find((function(t){return t.id===e}))},o=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},258:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return i}));var r=n(6),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=e.filter((function(e){return e.attribute===n.taxonomy})),o=i.length?i[0]:null;if(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(c)){var u=o.slug.filter((function(e){return e!==c})),a=e.filter((function(e){return e.attribute!==n.taxonomy}));u.length>0&&(o.slug=u.sort(),a.push(o)),t(Object(r.sortBy)(a,"attribute"))}},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",o=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(o):(o.push({attribute:n.taxonomy,operator:i,slug:Object(r.map)(c,"slug").sort()}),t(Object(r.sortBy)(o,"attribute")))}},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},30:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},36:function(e,t){!function(){e.exports=this.wp.data}()},4:function(e,t){!function(){e.exports=this.wp.components}()},41:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},44:function(e,t,n){"use strict";var r=n(8),c=n.n(r),i=n(0),o=(n(2),n(9)),u=n(7),a=n.n(u);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,u=e.wrapperProps,l=null!=n,b=null!=r;return!l&&b?(t=c||"span",u=s(s({},u),{},{className:a()(u.className,"screen-reader-text")}),Object(i.createElement)(t,u,r)):(t=c||o.Fragment,l&&b&&n!==r?Object(i.createElement)(t,u,Object(i.createElement)("span",{"aria-hidden":"true"},n),Object(i.createElement)("span",{className:"screen-reader-text"},r)):Object(i.createElement)(t,u,n))};b.defaultProps={wrapperProps:{}},t.a=b},48:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},5:function(e,t,n){"use strict";n.d(t,"k",(function(){return c})),n.d(t,"G",(function(){return i})),n.d(t,"M",(function(){return o})),n.d(t,"x",(function(){return u})),n.d(t,"z",(function(){return a})),n.d(t,"l",(function(){return l})),n.d(t,"y",(function(){return s})),n.d(t,"B",(function(){return b})),n.d(t,"n",(function(){return f})),n.d(t,"A",(function(){return p})),n.d(t,"m",(function(){return d})),n.d(t,"C",(function(){return g})),n.d(t,"t",(function(){return O})),n.d(t,"w",(function(){return m})),n.d(t,"q",(function(){return v})),n.d(t,"r",(function(){return h})),n.d(t,"s",(function(){return j})),n.d(t,"j",(function(){return y})),n.d(t,"I",(function(){return w})),n.d(t,"N",(function(){return _})),n.d(t,"p",(function(){return E})),n.d(t,"o",(function(){return S})),n.d(t,"F",(function(){return k})),n.d(t,"c",(function(){return C})),n.d(t,"u",(function(){return x})),n.d(t,"v",(function(){return P})),n.d(t,"Q",(function(){return N})),n.d(t,"H",(function(){return L})),n.d(t,"a",(function(){return H})),n.d(t,"K",(function(){return T})),n.d(t,"b",(function(){return V})),n.d(t,"J",(function(){return z})),n.d(t,"h",(function(){return D})),n.d(t,"L",(function(){return U})),n.d(t,"g",(function(){return B})),n.d(t,"i",(function(){return A})),n.d(t,"E",(function(){return Y})),n.d(t,"D",(function(){return I})),n.d(t,"P",(function(){return Q})),n.d(t,"O",(function(){return K})),n.d(t,"d",(function(){return G})),n.d(t,"e",(function(){return W})),n.d(t,"f",(function(){return q})),n.d(t,"R",(function(){return $})),n.d(t,"S",(function(){return X}));var r=n(3),c=Object(r.getSetting)("currentUserIsAdmin",!1),i=Object(r.getSetting)("reviewRatingsEnabled",!0),o=Object(r.getSetting)("showAvatars",!0),u=Object(r.getSetting)("max_columns",6),a=Object(r.getSetting)("min_columns",1),l=Object(r.getSetting)("default_columns",3),s=Object(r.getSetting)("max_rows",6),b=Object(r.getSetting)("min_rows",1),f=Object(r.getSetting)("default_rows",3),p=Object(r.getSetting)("min_height",500),d=Object(r.getSetting)("default_height",500),g=Object(r.getSetting)("placeholderImgSrc",""),O=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),m=Object(r.getSetting)("limitTags"),v=Object(r.getSetting)("hasProducts",!0),h=Object(r.getSetting)("hasTags",!0),j=Object(r.getSetting)("homeUrl",""),y=Object(r.getSetting)("couponsEnabled",!0),w=Object(r.getSetting)("shippingEnabled",!0),_=Object(r.getSetting)("taxesEnabled",!0),E=Object(r.getSetting)("displayItemizedTaxes",!1),S=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),k=Object(r.getSetting)("productCount",0),C=Object(r.getSetting)("attributes",[]),x=Object(r.getSetting)("isShippingCalculatorEnabled",!0),P=Object(r.getSetting)("isShippingCostHidden",!1),R=Object(r.getSetting)("woocommerceBlocksPhase",1),N=Object(r.getSetting)("wcBlocksAssetUrl",""),L=Object(r.getSetting)("shippingCountries",{}),H=Object(r.getSetting)("allowedCountries",{}),T=Object(r.getSetting)("shippingStates",{}),V=Object(r.getSetting)("allowedStates",{}),z=Object(r.getSetting)("shippingMethodsExist",!1),D=Object(r.getSetting)("checkoutShowLoginReminder",!0),F={id:0,title:"",permalink:""},M=Object(r.getSetting)("storePages",{shop:F,cart:F,checkout:F,privacy:F,terms:F}),U=M.shop.permalink,B=M.checkout.id,A=M.checkout.permalink,Y=M.privacy.permalink,I=M.privacy.title,Q=M.terms.permalink,K=M.terms.title,G=M.cart.id,W=M.cart.permalink,q=Object(r.getSetting)("checkoutAllowsGuest",!1),J=(Object(r.getSetting)("checkoutAllowsSignup",!1),n(14)),$=function(e,t){if(R>2)return Object(J.registerBlockType)(e,t)},X=function(e,t){if(R>1)return Object(J.registerBlockType)(e,t)}},58:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=n(48),i=n.n(c),o=function(e){var t=Object(r.useRef)();return i()(e,t.current)||(t.current=e),t.current}},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,n){"use strict";var r=n(8),c=n.n(r),i=n(15),o=n.n(i),u=n(9);n(2);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,i=o()(e,["srcElement","size"]);return Object(u.isValidElement)(t)&&Object(u.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},i))}},71:function(e,t,n){"use strict";var r=n(10),c=n.n(r),i=n(23),o=n.n(i),u=n(26),a=n.n(u),l=n(20),s=n.n(l),b=n(24),f=n.n(b),p=n(25),d=n.n(p),g=n(12),O=n.n(g),m=n(0),v=n(6),h=n(7),j=n.n(h),y=n(4),w=n(21);n(169);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O()(e);if(t){var c=O()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return d()(this,n)}}var E=function(e){f()(n,e);var t=_(n);function n(){var e;return o()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return a()(n,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,i=n.checked,o=n.instanceId,u=n.className,a=n.help,l=n.options,s=n.value,b="inspector-toggle-button-control-".concat(o);return a&&(e=Object(v.isFunction)(a)?a(i):a),Object(m.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",u)},Object(m.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(m.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,n){var i={};return s===e.value?(i.isPrimary=!0,i["aria-pressed"]=!0):(i.isDefault=!0,i["aria-pressed"]=!1),Object(m.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},i),e.label)}))))}}]),n}(m.Component);t.a=Object(w.withInstanceId)(E)},864:function(e,t,n){"use strict";n.r(t);var r=n(10),c=n.n(r),i=n(0),o=n(1),u=n(14),a=n(60),l=n(59),s=Object(i.createElement)(l.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(i.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=n(7),f=n.n(b),p=n(22),d=n(4),g=n(147),O=n(177),m=n(11),v=n.n(m),h=n(166),j=(n(2),n(44)),y=(n(814),n(257)),w=n(189),_=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(o.sprintf)(Object(o.__)("Between %s and %s","woo-gutenberg-products-block"),Object(w.a)(e),Object(w.a)(t)):Number.isFinite(e)?Object(o.sprintf)(Object(o.__)("From %s","woo-gutenberg-products-block"),Object(w.a)(e)):Object(o.sprintf)(Object(o.__)("Up to %s","woo-gutenberg-products-block"),Object(w.a)(t))},E=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,u=void 0===c?function(){}:c,a=e.showLabel,l=void 0===a||a;return Object(i.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},l&&Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-name"},r?Object(i.createElement)(i.Fragment,null,r," ",n):n,Object(i.createElement)("button",{onClick:u},Object(o.sprintf)(Object(o.__)("Remove %s filter","woo-gutenberg-products-block"),n))))},S=n(204),k=n(30),C=n(258),x=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,u=e.operator,a=void 0===u?"in":u,l=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),s=l.results,b=l.isLoading,f=Object(h.b)("attributes",[]),p=v()(f,2),d=p[0],g=p[1];if(b)return null;var O=n.label;return Object(i.createElement)("li",null,Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-type"},O,":"),Object(i.createElement)("ul",null,c.map((function(e,t){var r=s.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===a&&(c=Object(i.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(o.__)("and","woo-gutenberg-products-block"))),E({type:O,name:Object(k.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(C.a)(d,g,n,e)},showLabel:!1})}))))},P=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(h.b)("attributes",[]),u=v()(c,2),a=u[0],l=u[1],s=Object(h.b)("min_price"),b=v()(s,2),p=b[0],d=b[1],g=Object(h.b)("max_price"),O=v()(g,2),m=O[0],w=O[1],S=Object(i.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(m)?E({type:Object(o.__)("Price","woo-gutenberg-products-block"),name:_(p,m),removeCallback:function(){d(void 0),w(void 0)}}):null}),[p,m,_]),k=Object(i.useMemo)((function(){return a.map((function(e){var t=Object(y.b)(e.attribute);return Object(i.createElement)(x,{attributeObject:t,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[a]);if(!(a.length>0||Number.isFinite(p)||Number.isFinite(m)||r))return null;var C="h".concat(t.headingLevel),P=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(i.createElement)(i.Fragment,null,!r&&t.heading&&Object(i.createElement)(C,null,t.heading),Object(i.createElement)("div",{className:"wc-block-active-filters"},Object(i.createElement)("ul",{className:P},r?Object(i.createElement)(i.Fragment,null,E({type:Object(o.__)("Size","woo-gutenberg-products-block"),name:Object(o.__)("Small","woo-gutenberg-products-block")}),E({type:Object(o.__)("Color","woo-gutenberg-products-block"),name:Object(o.__)("Blue","woo-gutenberg-products-block")})):Object(i.createElement)(i.Fragment,null,S,k)),Object(i.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),w(void 0),l([])}},Object(i.createElement)(j.a,{label:Object(o.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Clear All Filters","woo-gutenberg-products-block")}))))},R=n(71),N=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,u=t.heading,a=t.headingLevel;return Object(i.createElement)("div",{className:r},Object(i.createElement)(p.InspectorControls,{key:"inspector"},Object(i.createElement)(d.PanelBody,{title:Object(o.__)("Block Settings","woo-gutenberg-products-block")},Object(i.createElement)(R.a,{label:Object(o.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(o.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(o.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(i.createElement)("p",null,Object(o.__)("Heading Level","woo-gutenberg-products-block")),Object(i.createElement)(g.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:a,onChange:function(e){return n({headingLevel:e})}}))),Object(i.createElement)(O.a,{headingLevel:a,heading:u,onChange:function(e){return n({heading:e})}}),Object(i.createElement)(d.Disabled,null,Object(i.createElement)(P,{attributes:t,isEditor:!0})))}));Object(u.registerBlockType)("woocommerce/active-filters",{title:Object(o.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(a.a,{srcElement:s}),foreground:"#96588a"},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},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:N,save:function(e){var t=e.attributes,n=t.className,r={"data-display-style":t.displayStyle,"data-heading":t.heading,"data-heading-level":t.headingLevel};return Object(i.createElement)("div",c()({className:f()("is-loading",n)},r),Object(i.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},9:function(e,t){!function(){e.exports=this.React}()},97:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(c)};c.Provider}});
|
build/all-products-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wc-shared-context', 'wp-a11y', 'wp-autop', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wc-shared-context', 'wp-a11y', 'wp-autop', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-wordcount'), 'version' => '25a6eb7568d3c336a6b17693819c3553');
|
build/all-products-frontend.js
CHANGED
@@ -1,6 +1,6 @@
|
|
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=
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===a)for(var c in r)n.call(r,c)&&r[c]&&e.push(c)}}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,n){e.exports=n(59)()},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}},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){"use strict";n.d(t,"i",(function(){return o})),n.d(t,"s",(function(){return a})),n.d(t,"w",(function(){return i})),n.d(t,"p",(function(){return c})),n.d(t,"l",(function(){return u})),n.d(t,"o",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"x",(function(){return f})),n.d(t,"k",(function(){return p})),n.d(t,"j",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"m",(function(){return h})),n.d(t,"n",(function(){return g})),n.d(t,"A",(function(){return b})),n.d(t,"t",(function(){return v})),n.d(t,"a",(function(){return y})),n.d(t,"u",(function(){return O})),n.d(t,"b",(function(){return j})),n.d(t,"f",(function(){return w})),n.d(t,"v",(function(){return S})),n.d(t,"g",(function(){return _})),n.d(t,"r",(function(){return x})),n.d(t,"q",(function(){return R})),n.d(t,"z",(function(){return P})),n.d(t,"y",(function(){return C})),n.d(t,"d",(function(){return N})),n.d(t,"e",(function(){return T}));var r=n(2),o=Object(r.getSetting)("currentUserIsAdmin",!1),a=Object(r.getSetting)("reviewRatingsEnabled",!0),i=Object(r.getSetting)("showAvatars",!0),c=(Object(r.getSetting)("max_columns",6),Object(r.getSetting)("min_columns",1),Object(r.getSetting)("default_columns",3),Object(r.getSetting)("max_rows",6),Object(r.getSetting)("min_rows",1),Object(r.getSetting)("default_rows",3),Object(r.getSetting)("min_height",500),Object(r.getSetting)("default_height",500),Object(r.getSetting)("placeholderImgSrc","")),u=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),s=Object(r.getSetting)("limitTags"),l=(Object(r.getSetting)("hasProducts",!0),Object(r.getSetting)("hasTags",!0),Object(r.getSetting)("homeUrl",""),Object(r.getSetting)("couponsEnabled",!0)),f=(Object(r.getSetting)("shippingEnabled",!0),Object(r.getSetting)("taxesEnabled",!0)),p=Object(r.getSetting)("displayItemizedTaxes",!1),d=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),m=(Object(r.getSetting)("productCount",0),Object(r.getSetting)("attributes",[])),h=Object(r.getSetting)("isShippingCalculatorEnabled",!0),g=Object(r.getSetting)("isShippingCostHidden",!1),b=(Object(r.getSetting)("woocommerceBlocksPhase",1),Object(r.getSetting)("wcBlocksAssetUrl","")),v=Object(r.getSetting)("shippingCountries",{}),y=Object(r.getSetting)("allowedCountries",{}),O=Object(r.getSetting)("shippingStates",{}),j=Object(r.getSetting)("allowedStates",{}),w=(Object(r.getSetting)("shippingMethodsExist",!1),Object(r.getSetting)("checkoutShowLoginReminder",!0)),E={id:0,title:"",permalink:""},k=Object(r.getSetting)("storePages",{shop:E,cart:E,checkout:E,privacy:E,terms:E}),S=k.shop.permalink,_=(k.checkout.id,k.checkout.permalink),x=k.privacy.permalink,R=k.privacy.title,P=k.terms.permalink,C=k.terms.title,N=(k.cart.id,k.cart.permalink),T=Object(r.getSetting)("checkoutAllowsGuest",!1);Object(r.getSetting)("checkoutAllowsSignup",!1),n(39)},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){var r=n(70),o=n(71),a=n(52),i=n(72);e.exports=function(e,t){return r(e)||o(e,t)||a(e,t)||i()}},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},n.apply(this,arguments)}e.exports=n},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){var r=n(73);e.exports=function(e,t){if(null==e)return{};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},,function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},,,function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(45);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){Object(r.a)(e,t,n[t])}))}return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(51);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";var r=n(6),o=n.n(r),a=(n(5),n(3)),i=n(4),c=n.n(i);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,i=e.wrapperProps,u=null!=n,l=null!=r;return!u&&l?(t=o||"span",i=s(s({},i),{},{className:c()(i.className,"screen-reader-text")}),React.createElement(t,i,r)):(t=o||a.Fragment,u&&l&&n!==r?React.createElement(t,i,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,i,n))};l.defaultProps={wrapperProps:{}},t.a=l},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(30);function o(e,t){if(null==e)return{};var n,o,a=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(11),o=n.n(r),a=n(6),i=n.n(a),c=n(14),u=n.n(c),s=n(3),l=n.n(s);function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(){return(p=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)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(){}function b(){}b.resetWarningCache=g;var v=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){e.exports=function(){function e(e,t,n,r,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=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 i.name="Invariant Violation",i}}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:b,resetWarningCache:g};return n.PropTypes=n,n}()}));function y(){}function O(e){return!!(e||"").match(/\d/)}function j(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function w(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split("."),a=o[0],i=o[1]||"";return{beforeDecimal:a,afterDecimal:i,hasNagation:n,addNegation:r}}function E(e,t,n){for(var r="",o=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||o;return r}function k(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function S(e,t,n){return Math.min(Math.max(e,t),n)}function _(e){return Math.max(e.selectionStart,e.selectionEnd)}var x={thousandSeparator:v.oneOfType([v.string,v.oneOf([!0])]),decimalSeparator:v.string,allowedDecimalSeparators:v.arrayOf(v.string),thousandsGroupStyle:v.oneOf(["thousand","lakh","wan"]),decimalScale:v.number,fixedDecimalScale:v.bool,displayType:v.oneOf(["input","text"]),prefix:v.string,suffix:v.string,format:v.oneOfType([v.string,v.func]),removeFormatting:v.func,mask:v.oneOfType([v.string,v.arrayOf(v.string)]),value:v.oneOfType([v.number,v.string]),defaultValue:v.oneOfType([v.number,v.string]),isNumericString:v.bool,customInput:v.elementType,allowNegative:v.bool,allowEmptyFormatting:v.bool,allowLeadingZeros:v.bool,onValueChange:v.func,onKeyDown:v.func,onMouseUp:v.func,onChange:v.func,onFocus:v.func,onBlur:v.func,type:v.oneOf(["text","tel","password"]),isAllowed:v.func,renderText:v.func,getInputRef:v.oneOfType([v.func,v.shape({current:v.any})])},R={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:y,onChange:y,onKeyDown:y,onMouseUp:y,onFocus:y,onBlur:y,isAllowed:function(){return!0}},P=function(e){function t(e){var n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,n=!(o=d(t).call(this,e))||"object"!=typeof o&&"function"!=typeof o?h(r):o;var a=e.defaultValue;n.validateProps();var i=n.formatValueProp(a);return n.state={value:i,numAsString:n.removeFormatting(i)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(h(n)),n.onKeyDown=n.onKeyDown.bind(h(n)),n.onMouseUp=n.onMouseUp.bind(h(n)),n.onFocus=n.onFocus.bind(h(n)),n.onBlur=n.onBlur.bind(h(n)),n}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,a=n.numAsString,i=void 0===a?"":a;if(e!==t){this.validateProps();var c=this.formatNumString(i),u=void 0===t.value?c:this.formatValueProp(),s=this.removeFormatting(u),l=parseFloat(s),f=parseFloat(i);(isNaN(l)&&isNaN(f)||l===f)&&c===o&&(null!==r||u===o)||this.updateValue({formattedValue:u,numAsString:s,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),a="-"===e[0];a&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var i=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==i&&(e="".concat(e.substring(0,i),".").concat(e.substring(i+1,e.length).replace(new RegExp(j(r),"g"),""))),a&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,a=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!a||0===o||t||r?"":"|"+j(a)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n Mask ".concat(e," should not contain numeric character;\n "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){k(e,t),setTimeout((function(){e.value===n&&k(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,a=r.suffix,i=r.format;if(""===e)return 0;if(t=S(t,0,e.length),!i){var c="-"===e[0];return S(t,o.length+(c?1:0),e.length-a.length)}if("function"==typeof i)return t;if("#"===i[t]&&O(e[t]))return t;if("#"===i[t-1]&&O(e[t-1]))return t;var u=i.indexOf("#");t=S(t,u,i.lastIndexOf("#")+1);for(var s=i.substring(t,i.length).indexOf("#"),l=t,f=t+(-1===s?0:s);l>u&&("#"!==i[l]||!O(e[l]));)l-=1;return!O(e[f])||"left"===n&&t!==u||t-l<f-t?O(e[l])?l+1:l:f}},{key:"getCaretPosition",value:function(e,t,n){var r,o,a=this.props.format,i=this.state.value,c=this.getNumberRegex(!0),u=(e.match(c)||[]).join(""),s=(t.match(c)||[]).join("");for(r=0,o=0;o<n;o++){var l=e[o]||"",f=t[r]||"";if((l.match(c)||l===f)&&("0"!==l||!f.match(c)||"0"===f||u.length===s.length)){for(;l!==t[r]&&r<t.length;)r++;r++}}return"string"!=typeof a||i||(r=t.length),r=this.correctCaretPosition(t,r)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,n=t.format,r=t.prefix,o=t.suffix;if(!n&&e){var a="-"===e[0];a&&(e=e.substring(1,e.length));var i=(e=r&&0===e.indexOf(r)?e.substring(r.length,e.length):e).lastIndexOf(o);e=o&&-1!==i&&i===e.length-o.length?e.substring(0,i):e,a&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),n=0,r="",o=0,a=t.length;o<=a;o++){var i=t[o]||"",c=o===a?e.length:e.indexOf(i,n);if(-1===c){r=e;break}r+=e.substring(n,c),n=c+i.length}return(r.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,n=t.format,r=t.removeFormatting;return e?(n?e="string"==typeof n?this.removePatternFormatting(e):"function"==typeof r?r(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,n=0,r=t.split(""),o=0,a=t.length;o<a;o++)"#"===t[o]&&(r[o]=e[n]||this.getMaskAtIndex(n),n+=1);return r.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix,a=t.suffix,i=t.allowNegative,c=t.thousandsGroupStyle,u=this.getSeparators(),s=u.thousandSeparator,l=u.decimalSeparator,f=-1!==e.indexOf(".")||n&&r,p=w(e,i),d=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=E(m,n,r)),s&&(d=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(d,s,c)),o&&(d=o+d),a&&(m+=a),h&&(d="-"+d),e=d+(f&&l||"")+m}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return o=""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,a=t.allowEmptyFormatting,i=this.props,c=i.value,u=void 0===c?e:c,s=i.isNumericString,l=!u&&0!==u;return l&&a&&(u=""),l&&!a?"":("number"==typeof u&&(u=u.toString(),s=!0),"Infinity"===u&&s&&(u=""),s&&!n&&"number"==typeof r&&(u=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=w(e),a=o.beforeDecimal,i=o.afterDecimal,c=o.hasNagation,u=parseFloat("0.".concat(i||"0")).toFixed(t).split("."),s=a.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0]),l=E(u[1]||"",Math.min(t,i.length),n),f=r?".":"";return"".concat(c?"-":"").concat(s).concat(f).concat(l)}(u,r,o)),s?this.formatNumString(u):this.formatInput(u))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),o&&!a&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,a=n.suffix,i=n.decimalScale,c=n.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e<o.length||e>=t.length-a.length||i&&c&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;r<t;r++)if(this.isCharacterAFormat(r,n))return!0;return!1}},{key:"correctInputValue",value:function(e,t,n){var r=this.props,o=r.format,a=r.allowNegative,i=r.prefix,c=r.suffix,u=r.decimalScale,s=this.getSeparators(),l=s.allowedDecimalSeparators,f=s.decimalSeparator,p=this.state.numAsString||"",d=this.selectionBeforeInput,m=d.selectionStart,h=d.selectionEnd,g=function(e,t){for(var n=0,r=0,o=e.length,a=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[a-1-r]&&a-r>n&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),b=g.start,v=g.end;if(!o&&b===v&&-1!==l.indexOf(n[m])){var y=0===u?"":f;return n.substr(0,m)+y+n.substr(m+1,n.length)}var O=o?0:i.length,j=t.length-(o?0:c.length);if(n.length>t.length||!n.length||b===v||0===m&&h===t.length||m===O&&h===j)return n;if(this.checkIfFormatGotDeleted(b,v,t)&&(n=t),!o){var E=this.removeFormatting(n),k=w(E,a),S=k.beforeDecimal,_=k.afterDecimal,x=k.addNegation,R=e<n.indexOf(f)+1;if(E.length<p.length&&R&&""===S&&!parseFloat(_))return x?"-":""}return n}},{key:"updateValue",value:function(e){var t=e.formattedValue,n=e.input,r=e.setCaretPosition,o=void 0===r||r,a=e.numAsString,i=e.caretPos,c=this.props.onValueChange,u=this.state.value;if(n)if(o){if(!i){var s=e.inputValue||n.value,l=_(n);n.value=t,i=this.getCaretPosition(s,t,l)}this.setPatchedCaretPosition(n,i,t)}else n.value=t;void 0===a&&(a=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:a}),c(this.getValueObject(t,a)))}},{key:"onChange",value:function(e){var t=e.target,n=t.value,r=this.state,o=this.props,a=o.isAllowed,i=r.value||"",c=_(t);n=this.correctInputValue(c,i,n);var u=this.formatInput(n)||"",s=this.removeFormatting(u);a(this.getValueObject(u,s))||(u=i),this.updateValue({formattedValue:u,numAsString:s,inputValue:n,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,a=t.allowLeadingZeros,i=n.numAsString,c=n.value;if(this.focusedElm=null,this.focusTimeout&&clearTimeout(this.focusTimeout),!r){isNaN(parseFloat(i))&&(i=""),a||(i=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(i));var u=this.formatNumString(i);if(u!==c)return this.updateValue({formattedValue:u,numAsString:i,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,a=n.selectionEnd,i=n.value,c=void 0===i?"":i,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,f=u.prefix,p=u.suffix,d=u.format,m=u.onKeyDown,h=void 0!==s&&l,g=this.getNumberRegex(!1,h),b=new RegExp("-"),v="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:a},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===a){var y=t,O=v?d.indexOf("#"):f.length,j=v?d.lastIndexOf("#")+1:c.length-p.length;if("ArrowLeft"===r||"ArrowRight"===r){var w="ArrowLeft"===r?"left":"right";y=this.correctCaretPosition(c,t,w)}else if("Delete"!==r||g.test(c[t])||b.test(c[t])){if("Backspace"===r&&!g.test(c[t]))if(o<=O+1&&"-"===c[0]&&void 0===d){var E=c.substring(1);this.updateValue({formattedValue:E,caretPos:y,input:n})}else if(!b.test(c[t])){for(;!g.test(c[y-1])&&y>O;)y--;y=this.correctCaretPosition(c,y,"left")}}else for(;!g.test(c[y])&&y<j;)y++;(y!==t||t<O||t>j)&&(e.preventDefault(),this.setPatchedCaretPosition(n,y,c)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,y,c),m(e)}else m(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,a=void 0===o?"":o;if(n===r){var i=this.correctCaretPosition(a,n);i!==n&&this.setPatchedCaretPosition(t,i,a)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,a=n.value,i=void 0===a?"":a,c=t.correctCaretPosition(i,r);c===r||0===r&&o===i.length||t.setPatchedCaretPosition(n,c,i),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,o=r.type,a=r.displayType,i=r.customInput,c=r.renderText,u=r.getInputRef,s=this.state.value,f=(e=this.props,t=x,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),d=p({inputMode:"numeric"},f,{type:o,value:s,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===a)return c?c(s)||null:l.a.createElement("span",p({},f,{ref:u}),s);if(i){var m=i;return l.a.createElement(m,p({},d,{ref:u}))}return l.a.createElement("input",p({},d,{ref:u}))}}])&&f(n.prototype,r),o&&f(n,o),t}(l.a.Component);P.propTypes=x,P.defaultProps=R;var C=P,N=n(4),T=n.n(N);n(90);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,r=e.currency,a=e.onValueChange,i=u()(e,["className","value","currency","onValueChange"]);if("-"===n)return null;var c=n/Math.pow(10,r.minorUnit);if(!Number.isFinite(c))return null;var s=T()("wc-block-formatted-money-amount",t),l=I(I(I({displayType:"text"},i),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(r)),{},{value:void 0,currency:void 0,onValueChange:void 0}),f=a?function(e){var t=e.value*Math.pow(10,r.minorUnit);a(t)}:function(){};return React.createElement(C,o()({className:s},l,{value:c,onValueChange:f}))}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(58);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(20),o=n(19);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(46);var o=n(51);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(37),a=n.n(o),i=function(e){var t=Object(r.useRef)();return a()(e,t.current)||(t.current=e),t.current}},function(e,t){!function(){e.exports=this.wp.blocks}()},,,function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t,n){"use strict";var r=n(32),o=n.n(r),a=n(33),i=n.n(a),c=n(19),u=n.n(c),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(21),m=n.n(d),h=n(6),g=n.n(h),b=(n(5),n(3)),v=n(1),y=n(8),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.A,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,a=e.text,i=void 0===a?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):a,c=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(v.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error"},n&&React.createElement("img",{className:"wc-block-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content"},o&&React.createElement("p",{className:"wc-block-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text"},i),c&&React.createElement("p",{className:"wc-block-error__message"},s?s+" ":"",c)))};n(61);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var o=m()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p()(this,n)}}var w=function(e){l()(n,e);var t=j(n);function n(){var e;o()(this,n);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return e=t.call.apply(t,[this].concat(a)),g()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,a=e.errorMessagePrefix,i=this.state,c=i.errorMessage;return i.hasError?React.createElement(O,{errorMessage:r?c:null,header:t,imageUrl:n,text:o,errorMessagePrefix:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(b.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(b.Component);w.defaultProps={showErrorMessage:!0};t.a=w},function(e,t){!function(){e.exports=this.ReactDOM}()},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){!function(){e.exports=this.wp.autop}()},function(e,t){!function(){e.exports=this.wp.keycodes}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(46);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){var r=n(53);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=Object(r.createContext)("page"),a=function(){return Object(r.useContext)(o)};o.Provider},,,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";var r=n(60);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==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:a,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){},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(6),o=n.n(r),a=n(111),i=n(0);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s=function(){var e=Object(a.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,o=e.createSnackbarNotice,c=e.setIsSuppressed,s=Object(i.useRef)(t);Object(i.useEffect)((function(){s.current=t}),[t]);var l=Object(i.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.map((function(t){return null!==e&&t.status!==e||r(t.id),!0}))},removeNotice:r}}),[r]),f=Object(i.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,u({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,t)}}}),[n,o]);return u(u(u({notices:t},l),f),{},{setIsSuppressed:c})}},,function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(11)),a=r(n(73)),i=n(3),c=r(i),u=r(n(100)),s=r(n(19)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=i.useState(!1)[1];return i.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function m(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function h(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,a(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var a;return l.und(t[r])?o({},n,((a={})[r]=e[r],a)):n}),{});return o({to:t},n)}var g,b,v=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.removeChild(s(t))}))},t}return u(t,e),t}(v),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&e.removeChild(s(t))}))},t}u(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof v)&&(t[n]=r instanceof v?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(v);function j(e,t){g={fn:e,transform:t}}function w(e){b=e}var E,k=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},S=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function _(e){E=e}var x,R=function(){return Date.now()};function P(e){x=e}var C,N,T=function(e){return e.current};function A(e){C=e}var I=Object.freeze({get applyAnimatedValues(){return g},injectApplyAnimatedValues:j,get colorNames(){return b},injectColorNames:w,get requestFrame(){return k},get cancelFrame(){return S},injectFrame:function(e,t){k=e,S=t},get interpolation(){return E},injectStringInterpolator:_,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return x},injectDefaultElement:P,get animatedApi(){return T},injectAnimatedApi:function(e){T=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return N},injectManualFrameloop:function(e){N=e}}),F=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),D=!1,L=new Set,M=function e(){if(!D)return!1;var t=R(),n=L,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if((o=n.next()).done)break;a=o.value}for(var i=a,c=!1,u=0;u<i.configs.length;u++){for(var s=i.configs[u],l=void 0,f=void 0,p=0;p<s.animatedValues.length;p++){var d=s.animatedValues[p];if(!d.done){var m=s.fromValues[p],h=s.toValues[p],g=d.lastPosition,b=h instanceof v,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(b&&(h=h.getValue()),s.immediate)d.setValue(h),d.done=!0;else if("string"!=typeof m&&"string"!=typeof h){if(void 0!==s.duration)g=m+s.easing((t-d.startTime)/s.duration)*(h-m),l=t>=d.startTime+s.duration;else if(s.decay)g=m+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-g)<.1)&&(h=g);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:s.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j){g+=1*(y+=1*((-s.tension*(g-h)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(m<h?g>h:g<h),E=Math.abs(y)<=s.precision,S=0===s.tension||Math.abs(h-g)<=s.precision;l=w||E&&S,d.lastVelocity=y,d.lastTime=t}b&&!s.toValues[p].done&&(l=!1),l?(d.value!==h&&(g=h),d.done=!0):c=!0,d.setValue(g),d.lastPosition=g}else d.setValue(h),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),c||(L.delete(i),i.stop(!0))}return L.size?N?N():k(e):D=!1,D};function V(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return V({range:e,output:t,extrapolate:n});if(E&&"string"==typeof e.output[0])return E(e);var r=e,o=r.output,a=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",c=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,a);return function(e,t,n,r,o,a,i,c,u){var s=u?u(e):e;if(s<t){if("identity"===i)return s;"clamp"===i&&(s=t)}if(s>n){if("identity"===c)return s;"clamp"===c&&(s=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=a(s),r===-1/0?s=-s:o===1/0?s+=r:s=s*(o-r)+r;return s}(e,a[t],a[t+1],o[t],o[t+1],u,i,c,r.map)}}var B=function(e){function t(n,r,o,a){var i;return(i=e.call(this)||this).calc=void 0,i.payload=n instanceof y&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],i.calc=V(r,o,a),i}u(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=V(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var z=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}u(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new B(this,e,t,n)},t}(v),U=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new z(e)})),n}u(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new B(this,e,t)},t}(y),q=0,H=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=q++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=h(e),n=t.delay,r=void 0===n?0:n,i=t.to,c=a(t,["delay","to"]);if(l.arr(i)||l.fun(i))this.queue.push(o({},c,{delay:r,to:i}));else if(i){var u={};Object.entries(i).forEach((function(e){var t,n=e[0],a=e[1],i=o({to:(t={},t[n]=a,t),delay:m(r,n)},c),s=u[i.delay]&&u[i.delay].to;u[i.delay]=o({},u[i.delay],i,{to:o({},s,i.to)})})),this.queue=Object.values(u)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(c),this},t.start=function(e){var t,n=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,r=void 0===t?{}:t,a=e.to,i=void 0===a?{}:a;l.obj(r)&&(n.merged=o({},r,n.merged)),l.obj(i)&&(n.merged=o({},n.merged,i))}));var r=this.local=++this.guid,i=this.localQueue=this.queue;this.queue=[],i.forEach((function(t,o){var c=t.delay,u=a(t,["delay"]),s=function(t){o===i.length-1&&r===n.guid&&t&&(n.idle=!0,n.props.onRest&&n.props.onRest(n.merged)),e&&e()},f=l.arr(u.to)||l.fun(u.to);c?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),c):f?n.runAsync(u,s):n.diff(u).start(s)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,L.has(t)||L.add(t),D||(D=!0,k(N||M));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){var t;return this.stop(!0),e&&(t=this,L.has(t)&&L.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,a(e,["delay"])),i=this.local,c=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,a=o({},r,h(r.to[t]));l.arr(a.config)&&(a.config=a.config[t]),c=c.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(a).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;c=c.then((function(){return r.to((function(e){var t=o({},r,h(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,i===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}c.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,a=void 0===r?{}:r,i=n.to,c=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,h=n.attach,g=n.reset,v=n.immediate;if(f){var y=[c,a];a=y[0],c=y[1]}this.merged=o({},a,this.merged,c),this.hasChanged=!1;var O=h&&h(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],c=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!b[i],h=l.arr(i),y=!u&&!h&&!f,j=l.und(a[r])?i:a[r],w=u||h||f?i:1,k=m(s,r);O&&(w=O.animations[r].parent);var S,_=c.parent,x=c.interpolation,P=d(O?w.getPayload():w),C=i;y&&(C=E({range:[0,1],output:[i,i]})(1));var N,T=x&&x.getValue(),A=!l.und(_)&&c.animatedValues.some((function(e){return!e.done})),I=!l.equ(C,T),F=!l.equ(C,c.previous),D=!l.equ(k,c.config);if(g||F&&I||D){var L;if(u||f)_=x=c.parent||new z(j);else if(h)_=x=c.parent||new U(j);else if(y){var M=c.interpolation&&c.interpolation.calc(c.parent.value);M=void 0===M||g?j:M,c.parent?(_=c.parent).setValue(0,!1):_=new z(0);var V={output:[M,i]};c.interpolation?(x=c.interpolation,c.interpolation.updateConfig(V)):x=_.interpolate(V)}return P=d(O?w.getPayload():w),S=d(_.getPayload()),g&&!y&&_.setValue(j,!1),t.hasChanged=!0,S.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=A?e.lastVelocity:void 0,e.lastTime=A?e.lastTime:void 0,e.startTime=R(),e.done=!1,e.animatedStyles.clear()})),m(v,r)&&_.setValue(y?w:i,!1),o({},e,((L={})[r]=o({},c,{name:r,parent:_,interpolation:x,animatedValues:S,toValues:P,previous:C,config:k,fromValues:d(_.getValue()),immediate:m(v,r),initialVelocity:p(k.velocity,0),clamp:p(k.clamp,!1),precision:p(k.precision,.01),tension:p(k.tension,170),friction:p(k.friction,26),mass:p(k.mass,1),duration:k.duration,easing:p(k.easing,(function(e){return e})),decay:k.decay}),L))}return I?e:(y&&(_.setValue(1,!1),x.updateConfig({output:[C,C]})),_.done=!0,t.hasChanged=!0,o({},e,((N={})[r]=o({},e[r],{previous:C}),N)))}),this.animations),this.hasChanged)for(var j in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[j]=this.animations[j].interpolation,this.values[j]=this.animations[j].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),W=function(e,t){var n=i.useRef(!1),r=i.useRef(),o=l.fun(t),a=i.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var a=new H,i=o?m(t,r,a):t[r];return 0===r&&(n=i.ref),a.update(i),n||a.start(),a})),n]}),[e]),c=a[0],u=a[1];r.current=c;i.useImperativeHandle(u,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var s=i.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?m(e,n,t):e[n]),u||t.start()}))}}),[e]);i.useEffect((function(){n.current?o||s(t):u||r.current.forEach((function(e){return e.start()}))})),i.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var f=r.current.map((function(e){return e.getValues()}));return o?[f,s,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:f},K=0,Y=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},Q=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,i=a(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:Y(t,r)},i)};function G(e,t){var n=function(){if(o){if(a>=r.length)return"break";i=r[a++]}else{if((a=r.next()).done)return"break";i=a.value}var n=i.key,c=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(c),e.current.deleted=e.current.deleted.filter(c))},r=e.current.deleted,o=Array.isArray(r),a=0;for(r=o?r:r[Symbol.iterator]();;){var i;if("break"===n())break}e.current.forceUpdate()}var $=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof v||(t=g.transform(t)),n.payload=t,n}return u(t,e),t}(O),Z={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},J="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(J,J,J)),te=new RegExp("rgba"+X(J,J,J,J)),ne=new RegExp("hsl"+X(J,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(J,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",J)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ae=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{6})$/,ce=/^#([0-9a-fA-F]{8})$/;function ue(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function se(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,a=ue(o,r,e+1/3),i=ue(o,r,e),c=ue(o,r,e-1/3);return Math.round(255*a)<<24|Math.round(255*i)<<16|Math.round(255*c)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function me(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ie.exec(t))?parseInt(n[1]+"ff",16)>>>0:Z.hasOwnProperty(t)?Z[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|pe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ce.exec(t))?parseInt(n[1],16)>>>0:(n=ae.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|se(fe(n[1]),de(n[2]),de(n[3])))>>>0:(n=re.exec(t))?(se(fe(n[1]),de(n[2]),de(n[3]))|pe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var he=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ge=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,be=new RegExp("("+Object.keys(Z).join("|")+")","g"),ve={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}ve=Object.keys(ve).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ve);var je={};A((function(e){return new $(e)})),P("div"),_((function(e){var t=e.output.map((function(e){return e.replace(ge,me)})).map((function(e){return e.replace(be,me)})),n=t[0].match(he).map((function(){return[]}));t.forEach((function(e){e.match(he).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(he).map((function(t,r){return V(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(he,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),w(Z),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,i=t.scrollLeft,c=a(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var s in void 0!==o&&(e.scrollTop=o),void 0!==i&&(e.scrollLeft=i),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(s)){var l=0===s.indexOf("--"),f=Oe(s,n[s],l);"float"===s&&(s="cssFloat"),l?e.style.setProperty(s,f):e.style[s]=f}for(var p in c){var d=u?p:je[p]||(je[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,c[p])}}),(function(e){return e}));var we,Ee,ke=(we=function(e){return i.forwardRef((function(t,n){var r=f(),u=i.useRef(!0),s=i.useRef(null),p=i.useRef(null),d=i.useCallback((function(e){var t=s.current;s.current=new F(e,(function(){var e=!1;p.current&&(e=g.fn(p.current,s.current.getAnimatedValue())),p.current&&!1!==e||r()})),t&&t.detach()}),[]);i.useEffect((function(){return function(){u.current=!1,s.current&&s.current.detach()}}),[]),i.useImperativeHandle(n,(function(){return T(p,u,r)})),d(t);var m,h=s.current.getValue(),b=(h.scrollTop,h.scrollLeft,a(h,["scrollTop","scrollLeft"])),v=(m=e,!l.fun(m)||m.prototype instanceof c.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return c.createElement(e,o({},b,{ref:v}))}))},void 0===(Ee=!1)&&(Ee=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=Ee?t[0].toLowerCase()+t.substring(1):t;return e[n]=we(n),e}),we)}),Se=ke(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=ke,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=M,t.animated=Se,t.a=Se,t.interpolate=function(e,t,n){return e&&new B(e,t,n)},t.Globals=I,t.useSpring=function(e){var t=l.fun(e),n=W(1,t?e:[e]),r=n[0],o=n[1],a=n[2];return t?[r[0],o,a]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),a=m(t),c=i.useRef(),u=W(e,(function(e,t){return 0===e&&(c.current=[]),c.current.push(t),o({},a,{config:m(a.config,e),attach:e>0&&function(){return c.current[e-1]}})})),s=u[0],f=u[1],p=u[2],d=i.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,i=c.current[r];return o({},e,{config:m(e.config||a.config,t),attach:i&&function(){return i}})}))}}),[e,a.reverse]);return i.useEffect((function(){n.current&&!r&&d(t)})),i.useEffect((function(){n.current=!0}),[]),r?[s,d,p]:s},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),c=Q(r),u=c.lazy,s=void 0!==u&&u,l=(c.unique,c.reset),p=void 0!==l&&l,d=(c.enter,c.leave,c.update,c.onDestroyed),h=(c.keys,c.items,c.onFrame),g=c.onRest,b=c.onStart,v=c.ref,y=a(c,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=i.useRef(!1),w=i.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return i.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(w.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(w.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(w.current.instances).map((function(e){return e[1]}))}}})),w.current=function(e,t){var n=e.first,r=e.prevProps,i=a(e,["first","prevProps"]),c=Q(t),u=c.items,s=c.keys,l=c.initial,f=c.from,p=c.enter,d=c.leave,h=c.update,g=c.trail,b=void 0===g?0:g,v=c.unique,y=c.config,O=c.order,j=void 0===O?["enter","leave","update"]:O,w=Q(r),E=w.keys,k=w.items,S=o({},i.current),_=[].concat(i.deleted),x=Object.keys(S),R=new Set(x),P=new Set(s),C=s.filter((function(e){return!R.has(e)})),N=i.transitions.filter((function(e){return!e.destroyed&&!P.has(e.originalKey)})).map((function(e){return e.originalKey})),T=s.filter((function(e){return R.has(e)})),A=-b;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){v&&_.find((function(t){return t.originalKey===e}))&&(_=_.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],a=n&&void 0!==l?"initial":"enter";S[e]={slot:a,originalKey:e,key:v?String(e):K++,item:o,trail:A+=b,config:m(y,o,a),from:m(n&&void 0!==l?l||{}:f,o),to:m(p,o)}}));break;case"leave":N.forEach((function(e){var t=E.indexOf(e),n=k[t];_.unshift(o({},S[e],{slot:"leave",destroyed:!0,left:E[Math.max(0,t-1)],right:E[Math.min(E.length,t+1)],trail:A+=b,config:m(y,n,"leave"),to:m(d,n)})),delete S[e]}));break;case"update":T.forEach((function(e){var t=s.indexOf(e),n=u[t];S[e]=o({},S[e],{item:n,slot:"update",trail:A+=b,config:m(y,n,"update"),to:m(h,n)})}))}}var I=s.map((function(e){return S[e]}));return _.forEach((function(e){var t,n=e.left,r=(e.right,a(e,["left","right"]));-1!==(t=I.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),I=[].concat(I.slice(0,t),[r],I.slice(t))})),o({},i,{changed:C.length||N.length||T.length,first:n&&0===C.length,transitions:I,current:S,deleted:_,prevProps:t})}(w.current,r),w.current.changed&&w.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,a=e.config,i=e.trail,c=e.key,u=e.item;w.current.instances.has(c)||w.current.instances.set(c,new H);var l=w.current.instances.get(c),f=o({},y,{to:r,from:n,config:a,ref:v,onRest:function(n){w.current.mounted&&(e.destroyed&&(v||s||G(w,c),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(v||s)&&w.current.deleted.length>0&&G(w),g&&g(u,t,n))},onStart:b&&function(){return b(u,t)},onFrame:h&&function(e){return h(u,t,e)},delay:i,reset:p&&"enter"===t});l.update(f),w.current.paused||l.start()})),i.useEffect((function(){return w.current.mounted=j.current=!0,function(){w.current.mounted=j.current=!1,Array.from(w.current.instances).map((function(e){return e[1].destroy()})),w.current.instances.clear()}}),[]),w.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:w.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=i.useRef();i.useEffect((function(){l.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var a=e.current;if(a){var i=a.controllers;if(i.length){var c=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+c})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=W},function(e,t){!function(){e.exports=this.wp.wordcount}()},function(e,t,n){"use strict";var r=n(11),o=n.n(r),a=n(14),i=n.n(a),c=n(88),u=n(4),s=n.n(u),l=function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]),a=s()("dashicon","dashicons-arrow-down-alt2",t);return React.createElement(c.a,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:a,width:n,height:n},r),React.createElement("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))},f=function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]),a=s()("dashicon","dashicons-arrow-down-alt2",t);return React.createElement(c.a,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:a,width:n,height:n},r),React.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"}))},p=n(0);t.a=function(e){let t=function(){return null};switch(e.icon){case"arrow-down-alt2":t=l;break;case"no-alt":t=f}return Object(p.createElement)(t,{size:e.size||20,className:e.className})}},,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},function(e,t,n){"use strict";var r=n(26),o=n(9),a=n(29),i=n(0),c=n(67),u=n(88);t.a=function(e){var t=e.icon,n=void 0===t?null:t,s=e.size,l=Object(a.a)(e,["icon","size"]),f=s||20;if("string"==typeof n)return Object(i.createElement)(c.a,Object(o.a)({icon:n,size:f},l));if(n&&c.a===n.type)return Object(i.cloneElement)(n,Object(r.a)({size:f},l));var p=s||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,Object(r.a)({size:p},l)):n(Object(r.a)({size:p},l));if(n&&("svg"===n.type||n.type===u.a)){var d=Object(r.a)({width:p,height:p},n.props,l);return Object(i.createElement)(u.a,d)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,Object(r.a)({size:p},l)):n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(15),o=n(12),a=n(109),i=n(16),c=n(7),u={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(a.a)(),n=t.isEditor,s=t.previewData,l=(null==s?void 0:s.previewCart)||{},f=e.shouldSelect,p=Object(o.useSelect)((function(e,t){var o=t.dispatch;if(!f)return u;if(n)return{cartCoupons:l.coupons,cartItems:l.items,cartItemsCount:l.items_count,cartItemsWeight:l.items_weight,cartNeedsPayment:l.needs_payment,cartNeedsShipping:l.needs_shipping,cartItemErrors:[],cartTotals:l.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:l.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==l?void 0:l.receiveCart)?l.receiveCart:function(){}};var a=e(r.CART_STORE_KEY),s=a.getCartData(),p=a.getCartErrors(),d=a.getCartTotals(),m=!a.hasFinishedResolution("getCartData"),h=a.areShippingRatesLoading(),g=o(r.CART_STORE_KEY).receiveCart,b=Object(c.mapValues)(s.shippingAddress,(function(e){return Object(i.decodeEntities)(e)}));return{cartCoupons:s.coupons,cartItems:s.items,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:d,cartIsLoading:m,cartErrors:p,shippingAddress:b,shippingRates:s.shippingRates,shippingRatesLoading:h,hasShippingAddress:!!b.country,receiveCart:g}}),[f]);return p}},,function(e,t,n){"use strict";var r=n(26),o=n(29),a=n(4),i=n.n(a),c=n(0);t.a=Object(c.forwardRef)((function(e,t){var n=e.href,a=e.target,u=e.isPrimary,s=e.isLarge,l=e.isSmall,f=e.isTertiary,p=e.isToggled,d=e.isBusy,m=e.isDefault,h=e.isLink,g=e.isDestructive,b=e.className,v=e.disabled,y=Object(o.a)(e,["href","target","isPrimary","isLarge","isSmall","isTertiary","isToggled","isBusy","isDefault","isLink","isDestructive","className","disabled"]),O=i()("components-button",b,{"is-button":m||u||s||l,"is-default":m||!u&&(s||l),"is-primary":u,"is-large":s,"is-small":l,"is-tertiary":f,"is-toggled":p,"is-busy":d,"is-link":h,"is-destructive":g}),j=void 0===n||v?"button":"a",w="a"===j?{href:n,target:a}:{type:"button",disabled:v};return Object(c.createElement)(j,Object(r.a)({},w,y,{className:O,ref:t}))}))},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},,,function(e,t){!function(){e.exports=this.wp.deprecated}()},,function(e,t,n){"use strict";var r=n(0),o=n(66),a=n(48),i=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},c=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},u=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",r=c(e),o=r.split(" ").splice(0,t).join(" ");return Object(a.autop)(u(o,n))},l=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",o=c(e),i=o.slice(0,t);if(n)return Object(a.autop)(u(i,r));var s=i.match(/([\s]+)/g),l=s?s.length:0,f=o.slice(0,t+l);return Object(a.autop)(u(f,r))};t.a=function(e){var t=e.source,n=e.maxLength,c=void 0===n?15:n,u=e.countType,f=void 0===u?"words":u,p=e.className,d=void 0===p?"":p,m=Object(r.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",r=Object(a.autop)(e),c=Object(o.count)(r,n);if(c<=t)return r;var u=i(r),f=Object(o.count)(u,n);return f<=t?u:"words"===n?s(u,t):l(u,t,"characters_including_spaces"===n)}(t,c,f)}),[t,c,f]);return React.createElement(r.RawHTML,{className:d},m)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(10),o=n.n(r),a=n(0),i=function(){var e=Object(a.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(26),o=n(7),a=n(0),i=function(e){var t=Object(r.a)({},e,{role:"img","aria-hidden":"true",focusable:"false"});return Object(a.createElement)("svg",Object(o.omit)(t,"__unstableActive"))}},,function(e,t){},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return d}));var r=n(10),o=n.n(r),a=n(15),i=n(12),c=n(0),u=n(55),s=n(7),l=n(38),f=function(e){var t=Object(u.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(a.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(a.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(c.useCallback)((function(t){r(e,t)}),[e])]},p=function(e,t,n){var r=Object(u.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(a.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),s=Object(i.useDispatch)(a.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(c.useCallback)((function(t){s(n,e,t)}),[n,e])]},d=function(e,t){var n=Object(u.a)(),r=f(t=t||n),a=o()(r,2),i=a[0],p=a[1],d=Object(l.a)(e),m=Object(c.useRef)(!1);return Object(c.useEffect)((function(){p(Object(s.assign)({},i,d)),m.current=!0}),[d]),m.current?[i,p]:[e,p]}},function(e,t,n){"use strict";var r=n(9),o=n(0),a=n(7);var i=function(e,t){return function(n){var r=e(n),o=n.displayName,i=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(a.upperFirst)(Object(a.camelCase)(t)),"(").concat(i,")"),r}},c=new WeakMap;function u(e){return Object(o.useMemo)((function(){return function(e){var t=c.get(e)||0;return c.set(e,t+1),t}(e)}),[e])}t.a=i((function(e){return function(t){var n=u(e);return Object(o.createElement)(e,Object(r.a)({},t,{instanceId:n}))}}),"withInstanceId")},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(11),o=n.n(r),a=n(6),i=n.n(a),c=n(44),u=n(43);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=function(e){var t=e.Block,n=e.selector,r=e.getProps,a=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i,f=document.querySelectorAll(n);f.length&&Array.prototype.forEach.call(f,(function(e,n){var r=a(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(c.render)(React.createElement(u.a,i,React.createElement(t,o()({},r,{attributes:f}))),e)}))}},function(e,t){},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(12),a=n(0),i=n(85),c=n(38),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var m=Object(a.useRef)({results:[],isLoading:!0}),h=Object(c.a)(f),g=Object(c.a)(s),b=Object(i.a)(),v=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),a=[t,n,h,g],i=o.getCollectionError.apply(o,a);return i&&b(i),{results:o.getCollection.apply(o,a),isLoading:!o.hasFinishedResolution("getCollection",a)}}),[t,n,g,h,d]);return null!==v&&(m.current=v),m.current}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=(n(12),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{}})),a=function(){return Object(r.useContext)(o)}},,function(e,t,n){"use strict";n.d(t,"b",(function(){return F})),n.d(t,"a",(function(){return D}));var r=n(6),o=n.n(r),a=n(10),i=n.n(a),c=(n(5),n(0)),u=n(12),s=n(11),l=n.n(s),f=n(4),p=n.n(f),d=n(168),m=(n(99),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),h=function(e){var t=e.className,n=e.notices,r=F().removeNotice,o=p()(t,"wc-block-components-notices"),a=n.filter((function(e){return"snackbar"!==e.type}));return a.length?React.createElement("div",{className:o},a.map((function(e){return React.createElement(d.a,l()({key:"store-notice-"+e.id},e,{className:p()("wc-block-components-notices__notice","woocommerce-message",m(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)}))):null},g=n(9),b=n(22),v=n.n(b);function y(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){y(a,r,o,i,c,"next",e)}function c(e){y(a,r,o,i,c,"throw",e)}i(void 0)}))}}var j=n(27),w=n(7),E=n(65),k=n(25),S=n(1),_=n(77);var x=Object(c.forwardRef)((function(e,t){var n=e.className,r=e.children,o=e.actions,a=void 0===o?[]:o,i=e.onRemove,u=void 0===i?w.noop:i;Object(c.useEffect)((function(){var e=setTimeout((function(){u()}),1e4);return function(){return clearTimeout(e)}}),[]);var s=p()(n,"components-snackbar");return a&&a.length>1&&(console.warn("Snackbar can only have 1 action, use Notice if your message require many messages"),a=[a[0]]),Object(c.createElement)("div",{ref:t,className:s,onClick:u,tabIndex:"0",role:"button",onKeyPress:u,label:Object(S.__)("Dismiss this notice")},Object(c.createElement)("div",{className:"components-snackbar__content"},r,a.map((function(e,t){var n=e.label,r=e.onClick,o=e.url;return Object(c.createElement)(_.a,{key:t,href:o,isTertiary:!0,onClick:function(e){e.stopPropagation(),r&&r(e)},className:"components-snackbar__action"},n)}))))}));var R=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,a=void 0===o?w.noop:o,i=Object(k.useReducedMotion)(),u=Object(c.useState)((function(){return new WeakMap})),s=Object(j.a)(u,1)[0],l=Object(E.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=O(v.a.mark((function t(n){return v.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({opacity:1,height:s.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=O(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:i});n=p()("components-snackbar-list",n);var f=function(e){return function(){return a(e.id)}};return Object(c.createElement)("div",{className:n},r,l.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(c.createElement)(E.animated.div,{key:n,style:r},Object(c.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&s.set(t,e)}},Object(c.createElement)(x,Object(g.a)({},Object(w.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},P=n(63),C=n(109),N=function(){var e=Object(C.a)().isEditor,t=Object(P.a)(),n=t.notices,r=t.removeNotice,o=n.filter((function(e){return"snackbar"===e.type}));return e?null:React.createElement(R,{notices:o,className:"wc-block-notices__snackbar",onRemove:r})};function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var I=Object(c.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),F=function(){return Object(c.useContext)(I)},D=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,a=void 0===o||o,s=e.context,l=void 0===s?"wc/core":s,f=Object(u.useDispatch)("core/notices"),p=f.createNotice,d=f.removeNotice,m=Object(c.useState)(!1),g=i()(m,2),b=g[0],v=g[1],y=Object(c.useCallback)((function(){var 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]:{};p(e,t,A(A({},n),{},{context:n.context||l}))}),[p,l]),O=Object(c.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;d(e,t)}),[d,l]),j=Object(c.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y("default",e,A(A({},t),{},{type:"snackbar"}))}),[y]),w={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(l)}}),[l]).notices,createNotice:y,createSnackbarNotice:j,removeNotice:O,context:l,setIsSuppressed:v},E=b?null:React.createElement(h,{className:r,notices:w.notices}),k=b?null:React.createElement(N,null);return React.createElement(I.Provider,{value:w},a&&E,t,k)}},,,,,,,function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return h}));var r=n(6),o=n.n(r),a=n(20),i=n.n(a),c=n(2);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l,f,p={code:c.CURRENCY.code,symbol:c.CURRENCY.symbol,thousandSeparator:c.CURRENCY.thousandSeparator,decimalSeparator:c.CURRENCY.decimalSeparator,minorUnit:c.CURRENCY.precision,prefix:(l=c.CURRENCY.symbol,f=c.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[f]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(c.CURRENCY.symbol,c.CURRENCY.symbolPosition)},d=function(e){if(!e||"object"!==i()(e))return p;var t=e.currency_code,n=e.currency_symbol,r=e.currency_thousand_separator,o=e.currency_decimal_separator,a=e.currency_minor_unit,c=e.currency_prefix,u=e.currency_suffix;return{code:t||"USD",symbol:n||"$",thousandSeparator:"string"==typeof r?r:",",decimalSeparator:"string"==typeof o?o:".",minorUnit:Number.isFinite(a)?a:2,prefix:"string"==typeof c?c:"$",suffix:"string"==typeof u?u:""}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},p),e)},h=function(e,t){if(""===e||void 0===e)return"";var n=parseInt(e,10);if(!Number.isFinite(n))return"";var r=m(t),o=n/Math.pow(10,r.minorUnit),a=r.prefix+o+r.suffix,i=document.createElement("textarea");return i.innerHTML=a,i.value}},function(e,t,n){"use strict";var r=n(0),o=n(2),a=n(15),i=n(12);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(Object(o.getSetting)("restApiRoutes")),Object(i.useSelect)((function(e,t){if(n.current){var r=e(a.SCHEMA_STORE_KEY),o=r.isResolving,i=r.hasFinishedResolution,c=t.dispatch(a.SCHEMA_STORE_KEY),u=c.receiveRoutes,s=c.startResolution,l=c.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];o("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,function(e,t,n){"use strict";n(5);var r=n(4),o=n.n(r),a=n(28),i=n(94);n(137);t.a=Object(i.a)((function(e){var t=e.className,n=e.instanceId,r=e.defaultValue,i=e.label,c=e.onChange,u=e.options,s=e.screenReaderLabel,l=e.readOnly,f=e.value,p="wc-block-sort-select__select-".concat(n);return React.createElement("div",{className:o()("wc-block-sort-select",t)},React.createElement(a.a,{label:i,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select",defaultValue:r,onChange:c,readOnly:l,value:f},u.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,function(e,t,n){"use strict";var r=n(11),o=n.n(r),a=n(32),i=n.n(a),c=n(33),u=n.n(c),s=n(19),l=n.n(s),f=n(34),p=n.n(f),d=n(35),m=n.n(d),h=n(21),g=n.n(h),b=n(6),v=n.n(b),y=n(3);n(148);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g()(e);if(t){var o=g()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m()(this,n)}}t.a=function(e){var t=function(t){p()(r,t);var n=O(r);function r(){var e;return i()(this,r),e=n.call(this),v()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),v()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),v()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(y.createRef)(),e}return u()(r,[{key:"render",value:function(){return React.createElement(y.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),React.createElement(e,o()({},this.props,{scrollToTop:this.scrollToTop})))}}]),r}(y.Component);return t.displayName="withScrollToTop",t}},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(6),o=n.n(r),a=n(14),i=n.n(a),c=n(3);n(5);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,a=i()(e,["srcElement","size"]);return Object(c.isValidElement)(t)&&Object(c.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},a))}},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t){var n=[];return Object.keys(e).forEach((function(r){if(void 0!==t[r])switch(e[r].type){case"boolean":n[r]="false"!==t[r];break;case"number":n[r]=parseInt(t[r],10);break;case"array":case"object":n[r]=JSON.parse(t[r]);break;default:n[r]=t[r]}else n[r]=e[r].default})),n}},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(7),a=n(4),i=n.n(a),c=n(1),u=n(77),s=n(9),l=n(29);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}var m=n(62),h=n(13);function g(e,t){return!t||"object"!==Object(m.a)(t)&&"function"!=typeof t?Object(h.a)(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}var O=n(27),j=n(47),w=n(49),E=n(81),k=n.n(E),S=n(25),_=n(26),x=function(){return"rtl"===document.documentElement.dir};function R(e,t,n,r){var o=t.width;"left"===n&&x()?n="right":"right"===n&&x()&&(n="left");var a,i=Math.round(e.left+e.width/2),c={popoverLeft:i,contentWidth:(i-o/2>0?o/2:i)+(i+o/2>window.innerWidth?window.innerWidth-i:o/2)},u="middle"===r?e.left:i,s={popoverLeft:u,contentWidth:u-o>0?o:u},l="middle"===r?e.right:i,f={popoverLeft:l,contentWidth:l+o>window.innerWidth?window.innerWidth-l:o},p=null;if("center"===n&&c.contentWidth===o)a="center";else if("left"===n&&s.contentWidth===o)a="left";else if("right"===n&&f.contentWidth===o)a="right";else{var d="left"===(a=s.contentWidth>f.contentWidth?"left":"right")?s.contentWidth:f.contentWidth;p=d!==o?d:null}return{xAxis:a,popoverLeft:"center"===a?c.popoverLeft:"left"===a?s.popoverLeft:f.popoverLeft,contentWidth:p}}function P(e,t,n){var r,o=t.height,a=e.top+e.height/2,i={popoverTop:a,contentHeight:(a-o/2>0?o/2:a)+(a+o/2>window.innerHeight?window.innerHeight-a:o/2)},c={popoverTop:e.top,contentHeight:e.top-10-o>0?o:e.top-10},u={popoverTop:e.bottom,contentHeight:e.bottom+10+o>window.innerHeight?window.innerHeight-10-e.bottom:o},s=null;if("middle"===n&&i.contentHeight===o)r="middle";else if("top"===n&&c.contentHeight===o)r="top";else if("bottom"===n&&u.contentHeight===o)r="bottom";else{var l="top"===(r=c.contentHeight>u.contentHeight?"top":"bottom")?c.contentHeight:u.contentHeight;s=l!==o?l:null}return{yAxis:r,popoverTop:"middle"===r?i.popoverTop:"top"===r?c.popoverTop:u.popoverTop,contentHeight:s}}var C=n(36),N=Object(r.createContext)({focusHistory:[]}),T=N.Provider,A=N.Consumer;T.displayName="FocusReturnProvider",A.displayName="FocusReturnConsumer";r.Component;var I=Object(S.createHigherOrderComponent)((function e(t){if((a=t)instanceof r.Component||"function"==typeof a){var n=t;return e({})(n)}var a,i=t.onFocusReturn,c=void 0===i?o.stubTrue:i;return function(e){var t=function(t){function n(){var e;return f(this,n),(e=g(this,b(n).apply(this,arguments))).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return y(n,t),d(n,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==c())for(var r,a=[].concat(Object(C.a)(o.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(C.a)(n)))),[e]);r=a.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(r.createElement)(e,this.props.childProps))}}]),n}(r.Component);return function(e){return Object(r.createElement)(A,null,(function(n){return Object(r.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn"),F=Object(S.createHigherOrderComponent)((function(e){return function(t){function n(){var e;return f(this,n),(e=g(this,b(n).apply(this,arguments))).focusContainRef=Object(r.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(h.a)(e)),e}return y(n,t),d(n,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===w.TAB){var t=j.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(r.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(r.createElement)(e,this.props))}}]),n}(r.Component)}),"withConstrainedTabbing"),D=["button","submit"];var L=Object(S.createHigherOrderComponent)((function(e){return function(t){function n(){var e;return f(this,n),(e=g(this,b(n).apply(this,arguments))).bindNode=e.bindNode.bind(Object(h.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(h.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(h.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(h.a)(e)),e}return y(n,t),d(n,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(o.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(o.includes)(D,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(r.createElement)(e,Object(s.a)({ref:this.bindNode},this.props)))}}]),n}(r.Component)}),"withFocusOutside")(function(e){function t(){return f(this,t),g(this,b(t).apply(this,arguments))}return y(t,e),d(t,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),t}(r.Component));var M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,o=e.className,a=void 0===o?"lockscroll":o,i=0,c=0;function u(e){var t=n.scrollingElement||n.body;e&&(c=t.scrollTop);var r=e?"add":"remove";t.classList[r](a),n.documentElement.classList[r](a),e||(t.scrollTop=c)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){function t(){return f(this,t),g(this,b(t).apply(this,arguments))}return y(t,e),d(t,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),t}(r.Component)}();function V(e){e.stopPropagation()}var B=Object(r.forwardRef)((function(e,t){var n=e.children,o=Object(l.a)(e,["children"]);return Object(r.createElement)("div",Object(s.a)({},o,{ref:t,onMouseDown:V}),n)})),z=Object(r.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),U=z.Provider,q=z.Consumer,H=(r.Component,0);function W(e){var t=e.name,n=e.children,a=e.registerFill,i=e.unregisterFill,c=function(e){var t=Object(r.useContext)(z),n=t.getSlot,o=t.subscribe,a=Object(r.useState)(n(e)),i=Object(O.a)(a,2),c=i[0],u=i[1];return Object(r.useEffect)((function(){return u(n(e)),o((function(){u(n(e))}))}),[e]),c}(t),u=Object(r.useRef)({name:t,children:n});return u.current.occurrence||(u.current.occurrence=++H),Object(r.useLayoutEffect)((function(){return a(t,u.current),function(){return i(t,u.current)}}),[]),Object(r.useLayoutEffect)((function(){u.current.children=n,c&&!c.props.bubblesVirtually&&c.forceUpdate()}),[n]),Object(r.useLayoutEffect)((function(){t!==u.current.name&&(i(u.current.name,u.current),u.current.name=t,a(t,u.current))}),[t]),c&&c.node&&c.props.bubblesVirtually?(Object(o.isFunction)(n)&&(n=n(c.props.fillProps)),Object(r.createPortal)(n,c.node)):null}var K=function(e){return Object(r.createElement)(q,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(r.createElement)(W,Object(s.a)({},e,{registerFill:n,unregisterFill:o}))}))},Y=function(e){function t(){var e;return f(this,t),(e=g(this,b(t).apply(this,arguments))).bindNode=e.bindNode.bind(Object(h.a)(e)),e}return y(t,e),d(t,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){(0,this.props.unregisterSlot)(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,a=e.bubblesVirtually,i=void 0!==a&&a,c=e.fillProps,u=void 0===c?{}:c,s=e.getFills,l=e.className;if(i)return Object(r.createElement)("div",{ref:this.bindNode,className:l});var f=Object(o.map)(s(n,this),(function(e){var t=e.occurrence,n=Object(o.isFunction)(e.children)?e.children(u):e.children;return r.Children.map(n,(function(e,n){if(!e||Object(o.isString)(e))return e;var a="".concat(t,"---").concat(e.key||n);return Object(r.cloneElement)(e,{key:a})}))})).filter(Object(o.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(o.isFunction)(t)?t(f):f)}}]),t}(r.Component),Q=function(e){return Object(r.createElement)(q,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,a=t.getFills;return Object(r.createElement)(Y,Object(s.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:a}))}))},G=n(45);var $=function(e){var t=e.type,n=e.options,r=void 0===n?{}:n,o=e.children;if("appear"===t){var a,c=r.origin,u=(void 0===c?"top":c).split(" "),s=Object(O.a)(u,2),l=s[0],f=s[1],p=void 0===f?"center":f;return o({className:i()("components-animate__appear",(a={},Object(G.a)(a,"is-from-"+p,"center"!==p),Object(G.a)(a,"is-from-"+l,"middle"!==l),a))})}if("slide-in"===t){var d=r.origin,m=void 0===d?"left":d;return o({className:i()("components-animate__slide-in","is-from-"+m)})}return o("loading"===t?{className:i()("components-animate__loading")}:{})},Z=F(I((function(e){return e.children})));function J(e,t){var n=window.getComputedStyle(t),r=n.paddingTop,o=n.paddingBottom,a=n.paddingLeft,i=n.paddingRight,c=r?parseInt(r,10):0,u=o?parseInt(o,10):0,s=a?parseInt(a,10):0,l=i?parseInt(i,10):0;return{x:e.left+s,y:e.top+c,width:e.width-s-l,height:e.height-c-u,left:e.left+s,right:e.right-l,top:e.top+c,bottom:e.bottom-u}}function X(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function te(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var ne=function(e){var t=e.headerTitle,n=e.onClose,o=e.onKeyDown,a=e.children,c=e.className,u=e.noArrow,f=void 0!==u&&u,p=e.position,d=void 0===p?"top":p,m=(e.range,e.focusOnMount),h=void 0===m?"firstElement":m,g=e.anchorRef,b=e.shouldAnchorIncludePadding,v=e.anchorVerticalBuffer,y=e.anchorHorizontalBuffer,E=e.anchorRect,x=e.getAnchorRect,C=e.expandOnMobile,N=e.animate,T=void 0===N||N,A=e.onClickOutside,I=e.onFocusOutside,F=Object(l.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorVerticalBuffer","anchorHorizontalBuffer","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside"]),D=Object(r.useRef)(null),V=Object(r.useRef)(null),z=Object(r.useRef)(),U=Object(r.useRef)(),H=Object(S.useViewportMatch)("medium","<"),W=Object(r.useState)(),Y=Object(O.a)(W,2),Q=Y[0],G=Y[1],ne=C&&H;f=ne||f,Object(r.useEffect)((function(){var e=z.current,t=V.current;if(ne)return te(e,"is-without-arrow",f),X(e,"data-x-axis"),X(e,"data-y-axis"),ee(e,"top"),ee(e,"left"),ee(t,"maxHeight"),void ee(t,"maxWidth");var n=function(){var n=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!r)return;if(r instanceof window.Range)return Object(j.getRectangleFromRange)(r);var a=r.getBoundingClientRect();return o?a:J(a,r)}if(e.current){var i=e.current.parentNode,c=i.getBoundingClientRect();return o?c:J(c,i)}}(D,E,x,g,b);if(n){n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:e.left-n,y:e.top-t,width:e.width+2*n,height:e.height+2*t,left:e.left-n,right:e.right+n,top:e.top-t,bottom:e.bottom+t}}(n,v,y),U.current||(U.current=t.getBoundingClientRect());var r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=n.split(" "),o=Object(O.a)(r,2),a=o[0],i=o[1],c=void 0===i?"center":i,u=P(e,t,a),s=R(e,t,c,u.yAxis);return Object(_.a)({},s,u)}(n,U.current,d),o=r.popoverTop,a=r.popoverLeft,i=r.xAxis,c=r.yAxis,u=r.contentHeight,s=r.contentWidth;te(e,"is-without-arrow",f||"center"===i&&"middle"===c),X(e,"data-x-axis",i),X(e,"data-y-axis",c),ee(e,"top","number"==typeof o?o+"px":""),ee(e,"left","number"==typeof a?a+"px":""),ee(t,"maxHeight","number"==typeof u?u+"px":""),ee(t,"maxWidth","number"==typeof s?s+"px":"");G(({left:"right",right:"left"}[i]||"center")+" "+({top:"bottom",bottom:"top"}[c]||"middle"))}},r=window.setTimeout(n),o=window.setInterval(n,500);return window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),function(){window.clearTimeout(r),window.clearInterval(o),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}}),[ne,E,x,g,b,v,y,d]),function(e,t){Object(r.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=j.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(h,V);var re=function(e){e.keyCode===w.ESCAPE&&n&&(e.stopPropagation(),n()),o&&o(e)};var oe=Object(r.createElement)(L,{onFocusOutside:function(e){if(I)I(e);else if(A){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),k()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else n&&n()}},Object(r.createElement)($,{type:T&&Q?"appear":null,options:{origin:Q}},(function(e){var o=e.className;return Object(r.createElement)(B,Object(s.a)({className:i()("components-popover",c,o,{"is-expanded":ne,"is-without-arrow":f})},F,{onKeyDown:re,ref:z}),ne&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},t),Object(r.createElement)(ce,{className:"components-popover__close",icon:"no-alt",onClick:n})),Object(r.createElement)("div",{ref:V,className:"components-popover__content",tabIndex:"-1"},a))})));return h&&(oe=Object(r.createElement)(Z,null,oe)),Object(r.createElement)(q,null,(function(e){var t=e.getSlot;return t&&t("Popover")&&(oe=Object(r.createElement)(K,{name:"Popover"},oe)),Object(r.createElement)("span",{ref:D},oe,H&&C&&Object(r.createElement)(M,null))}))};ne.Slot=function(){return Object(r.createElement)(Q,{bubblesVirtually:!0,name:"Popover"})};var re=ne;var oe=function(e){var t,n,a=e.shortcut,i=e.className;return a?(Object(o.isString)(a)&&(t=a),Object(o.isObject)(a)&&(t=a.display,n=a.ariaLabel),Object(r.createElement)("span",{className:i,"aria-label":n},t)):null},ae=function(e){function t(){var e;return f(this,t),(e=g(this,b(t).apply(this,arguments))).delayedSetIsOver=Object(o.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return y(t,e),d(t,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===r.Children.count(n)){var o=r.Children.only(n);"function"==typeof o.props[e]&&o.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var a=Object(o.includes)(["focus","mouseenter"],r.type);a!==n.state.isOver&&(t?n.delayedSetIsOver(a):n.setState({isOver:a}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,o=e.text,a=e.shortcut;if(1!==r.Children.count(t))return t;var i=r.Children.only(t),c=this.state.isOver;return Object(r.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(r.concatChildren)(i.props.children,c&&Object(r.createElement)(re,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1},o,Object(r.createElement)(oe,{className:"components-tooltip__shortcut",shortcut:a})))})}}]),t}(r.Component),ie=n(74);var ce=Object(r.forwardRef)((function(e,t){var n=e.icon,a=e.children,c=e.label,f=e.className,p=e.tooltip,d=e.shortcut,m=e.labelPosition,h=e.size,g=Object(l.a)(e,["icon","children","label","className","tooltip","shortcut","labelPosition","size"]),b=i()("components-icon-button",f,{"has-text":a}),v=p||c,y=!g.disabled&&(p||d||!!c&&(!a||Object(o.isArray)(a)&&!a.length)&&!1!==p),O=Object(r.createElement)(u.a,Object(s.a)({"aria-label":c},g,{className:b,ref:t}),Object(r.createElement)(ie.a,{icon:n,size:h}),a);return y&&(O=Object(r.createElement)(ae,{text:v,shortcut:d,position:m},O)),O}));t.a=function(e){var t=e.className,n=e.status,a=e.children,s=e.onRemove,l=void 0===s?o.noop:s,f=e.isDismissible,p=void 0===f||f,d=e.actions,m=void 0===d?[]:d,h=e.__unstableHTML,g=i()(t,"components-notice","is-"+n,{"is-dismissible":p});return h&&(a=Object(r.createElement)(r.RawHTML,null,a)),Object(r.createElement)("div",{className:g},Object(r.createElement)("div",{className:"components-notice__content"},a,m.map((function(e,t){var n=e.className,o=e.label,a=e.noDefaultClasses,c=void 0!==a&&a,s=e.onClick,l=e.url;return Object(r.createElement)(u.a,{key:t,href:l,isDefault:!c&&!l,isLink:!c&&!!l,onClick:l?void 0:s,className:i()("components-notice__action",n)},o)}))),p&&Object(r.createElement)(ce,{className:"components-notice__dismiss",icon:"no-alt",label:Object(c.__)("Dismiss this notice"),onClick:l,tooltip:!1}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return ee}));var r=n(6),o=n.n(r),a=n(78),i=n(11),c=n.n(i),u=n(14),s=n.n(u),l=(n(5),n(4)),f=n.n(l),p=n(1),d=n(0),m=n(10),h=n.n(m),g=n(12),b=n(75),v=n(15),y=n(16),O=n(63),j=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},w=n(176),E=n(18),k=(n(139),function(e){var t=e.product,n=Object(d.useRef)(!0),r=t.id,o=t.permalink,a=t.add_to_cart,i=t.has_options,u=t.is_purchasable,s=t.is_in_stock,l=function(e){var t=Object(g.useDispatch)(v.CART_STORE_KEY).addItemToCart,n=Object(b.a)(),r=n.cartItems,o=n.cartIsLoading,a=Object(O.a)(),i=a.addErrorNotice,c=a.removeNotice,u=Object(d.useState)(!1),s=h()(u,2),l=s[0],f=s[1],p=Object(d.useRef)(j(r,e));return Object(d.useEffect)((function(){var t=j(r,e);t!==p.current&&(p.current=t)}),[r,e]),{cartQuantity:p.current,addingToCart:l,cartIsLoading:o,addToCart:function(){f(!0),t(e).then((function(e){!0===e&&c("add-to-cart")})).catch((function(e){i(Object(y.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){f(!1)}))}}}(r),m=l.cartQuantity,E=l.addingToCart,k=l.addToCart;Object(d.useEffect)((function(){n.current?n.current=!1:Object(w.a)()}),[m]);var S=Number.isFinite(m)&&m>0,_=!i&&u&&s,x=Object(y.decodeEntities)((null==a?void 0:a.description)||""),R=S?Object(p.sprintf)(Object(p._n)("%d in cart","%d in cart",m,"woo-gutenberg-products-block"),m):Object(y.decodeEntities)((null==a?void 0:a.text)||Object(p.__)("Add to cart","woo-gutenberg-products-block")),P=_?"button":"a",C={};return _?C.onClick=k:(C.href=o,C.rel="nofollow"),React.createElement(P,c()({"aria-label":x,className:f()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:E,added:S}),disabled:E},C),R)}),S=function(){return React.createElement("button",{className:f()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})},_=function(e){var t=e.className,n=s()(e,["className"]),r=Object(E.useInnerBlockLayoutContext)().parentClassName,o=Object(E.useProductDataContext)(),a=n.product||o.product;return React.createElement("div",{className:f()(t,"wp-block-button","wc-block-components-product-button","".concat(r,"__product-add-to-cart"))},a?React.createElement(k,{product:a}):React.createElement(S,null))},x=n(25),R=n(142),P=function(e){return function(t){return function(n){var r=Object(R.a)(e,n);return React.createElement(t,c()({},n,r))}}},C=n(8),N=n(28),T=(n(140),function(e){var t=e.className,n=e.align,r=s()(e,["className","align"]),o=Object(E.useInnerBlockLayoutContext)().parentClassName,a=Object(E.useProductDataContext)(),i=r.product||a.product;if(!i||!i.on_sale)return null;var c="string"==typeof n?"wc-block-components-product-sale-badge--align".concat(n):"";return React.createElement("div",{className:f()("wc-block-components-product-sale-badge",t,c,"".concat(o,"__product-onsale"))},React.createElement(N.a,{label:Object(p.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(p.__)("Product on sale","woo-gutenberg-products-block")}))}),A=(n(141),function(){return React.createElement("img",{src:C.p,alt:""})}),I=function(e){var t=e.image,n=e.onLoad,r=e.loaded,o=t||{},a=o.thumbnail,i=o.srcset,c=o.sizes,u=o.alt;return React.createElement(React.Fragment,null,React.createElement("img",{src:a,srcSet:i,sizes:c,alt:u,onLoad:n,hidden:!r}),!r&&React.createElement(A,null))},F=function(e){var t=e.className,n=e.productLink,r=void 0===n||n,o=e.showSaleBadge,a=e.saleBadgeAlign,i=void 0===a?"right":a,c=s()(e,["className","productLink","showSaleBadge","saleBadgeAlign"]),u=Object(E.useInnerBlockLayoutContext)().parentClassName,l=Object(E.useProductDataContext)(),p=c.product||l.product,m=Object(d.useState)(!1),g=h()(m,2),b=g[0],v=g[1];if(!p)return React.createElement("div",{className:f()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder","".concat(u,"__product-image"))},React.createElement(A,null));var y=(null==p?void 0:p.images)&&p.images.length?p.images[0]:null;return React.createElement("div",{className:f()(t,"wc-block-components-product-image","".concat(u,"__product-image"))},r?React.createElement("a",{href:p.permalink,rel:"nofollow"},!!o&&React.createElement(T,{align:i,product:p}),React.createElement(I,{image:y,onLoad:function(){return v(!0)},loaded:b})):React.createElement(React.Fragment,null,!!o&&React.createElement(T,{align:i,product:p}),React.createElement(I,{image:y,onLoad:function(){return v(!0)},loaded:b})))},D={productLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"}},L=Object(x.compose)(P(D))(F),M=n(31),V=n(118),B=(n(143),function(e){return e.price_range&&e.price_range.min_amount&&e.price_range.max_amount}),z=function(e){var t=e.currency,n=e.minAmount,r=e.maxAmount,o=Object(E.useInnerBlockLayoutContext)().parentClassName;return React.createElement("span",{className:f()("wc-block-components-product-price__value","".concat(o,"__product-price__value"))},React.createElement(M.a,{currency:t,value:n})," — ",React.createElement(M.a,{currency:t,value:r}))},U=function(e){var t=e.currency,n=e.price,r=e.regularPrice,o=Object(E.useInnerBlockLayoutContext)().parentClassName;return React.createElement(React.Fragment,null,r!==n&&React.createElement("del",{className:f()("wc-block-components-product-price__regular","".concat(o,"__product-price__regular"))},React.createElement(M.a,{currency:t,value:r})),React.createElement("span",{className:f()("wc-block-components-product-price__value","".concat(o,"__product-price__value"))},React.createElement(M.a,{currency:t,value:n})))},q=function(e){var t=e.className,n=s()(e,["className"]),r=Object(E.useInnerBlockLayoutContext)().parentClassName,o=Object(E.useProductDataContext)(),a=n.product||o.product;if(!a)return React.createElement("div",{className:f()(t,"price","wc-block-components-product-price","".concat(r,"__product-price"))});var i=a.prices||{},c=Object(V.c)(i);return React.createElement("div",{className:f()(t,"price","wc-block-components-product-price","".concat(r,"__product-price"))},B(i)?React.createElement(z,{currency:c,minAmount:i.price_range.min_amount,maxAmount:i.price_range.max_amount}):React.createElement(U,{currency:c,price:i.price,regularPrice:i.regular_price}))},H=(n(144),function(e){var t=parseFloat((null==e?void 0:e.average_rating)||0);return Number.isFinite(t)&&t>0?t:0}),W=function(e){var t=e.className,n=s()(e,["className"]),r=Object(E.useInnerBlockLayoutContext)().parentClassName,o=Object(E.useProductDataContext)(),a=n.product||o.product,i=H(a);if(!i)return null;var c={width:i/5*100+"%"},u=Object(p.sprintf)(Object(p.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return React.createElement("div",{className:f()(t,"star-rating","wc-block-components-product-rating","".concat(r,"__product-rating"))},React.createElement("div",{className:f()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":u},React.createElement("span",{style:c},u)))},K=n(83),Y=n(2),Q=(n(145),function(e){var t=e.className,n=s()(e,["className"]),r=Object(E.useInnerBlockLayoutContext)().parentClassName,o=(Object(E.useProductDataContext)()||n).product;if(!o)return React.createElement("div",{className:f()(t,"wc-block-components-product-summary")});var a=o.short_description?o.short_description:o.description;if(!a)return null;var i=Object(Y.getSetting)("wordCountType","words");return React.createElement(K.a,{className:f()(t,"wc-block-components-product-summary","".concat(r,"__product-summary")),source:a,maxLength:150,countType:i})}),G=(n(146),function(e){var t=e.className,n=e.headingLevel,r=void 0===n?2:n,o=e.productLink,a=void 0===o||o,i=s()(e,["className","headingLevel","productLink"]),c=Object(E.useInnerBlockLayoutContext)().parentClassName,u=Object(E.useProductDataContext)(),l=i.product||u.product,p="h".concat(r);if(!l)return React.createElement(p,{className:f()(t,"wc-block-components-product-title","".concat(c,"__product-title"))});var d=Object(y.decodeEntities)(l.name);return React.createElement(p,{className:f()(t,"wc-block-components-product-title","".concat(c,"__product-title"))},a?React.createElement("a",{href:l.permalink,rel:"nofollow"},d):d)}),$={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0}},Z=Object(x.compose)(P($))(G),J=(n(147),function(e){var t=e.className,n=s()(e,["className"]),r=Object(E.useInnerBlockLayoutContext)().parentClassName,o=Object(E.useProductDataContext)(),a=(n.product||o.product||{}).sku||"";return a?React.createElement("div",{className:f()(t,"wc-block-components-product-sku","".concat(r,"__product-sku"))},Object(p.__)("SKU:","woo-gutenberg-products-block")," ",React.createElement("strong",null,a)):null});function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ee=function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({"woocommerce/product-price":q,"woocommerce/product-image":L,"woocommerce/product-title":Z,"woocommerce/product-rating":W,"woocommerce/product-button":_,"woocommerce/product-summary":Q,"woocommerce/product-sale-badge":T,"woocommerce/product-sku":J},Object(a.getRegisteredInnerBlocks)(e))}},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),o=function(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,n.current]),n.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=window.Event||null,o=function(){if("function"==typeof r){var e=new r("wc_fragment_refresh",{bubbles:!0,cancelable:!0});document.body.dispatchEvent(e)}else{var t=document.createEvent("Event");t.initEvent("wc_fragment_refresh",!0,!0),document.body.dispatchEvent(t)}}},,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(119),o=n(111),a=n(98),i=n(32),c=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),m=n(21),h=n.n(m),g=n(3),b=(n(5),n(10)),v=n.n(b),y=n(0),O=n(20),j=n.n(O),w=n(14),E=n.n(w),k=n(6),S=n.n(k),_=n(1),x=n(7),R=n(4),P=n.n(R),C=n(28),N=(n(192),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,a=e.onPageChange,i=e.totalPages,c=function(e,t,n){if(n<=2)return{minIndex:null,maxIndex:null};var r=e-1,o=Math.max(Math.floor(t-r/2),2),a=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(a-t))),2),maxIndex:a}}(o,t,i),u=c.minIndex,s=c.maxIndex,l=n&&Boolean(1!==u),f=n&&Boolean(s!==i),p=n&&Boolean(u>3),d=n&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&s===i-2&&(s+=1);var m=[];if(u&&s)for(var h=u;h<=s;h++)m.push(h);return React.createElement("div",{className:"wc-block-pagination"},React.createElement(C.a,{screenReaderLabel:Object(_.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&React.createElement("button",{className:"wc-block-pagination-page",onClick:function(){return a(t-1)},title:Object(_.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(C.a,{label:"<",screenReaderLabel:Object(_.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:P()("wc-block-pagination-page",{"wc-block-pagination-page--active":1===t}),onClick:function(){return a(1)},disabled:1===t},React.createElement(C.a,{label:1,screenReaderLabel:Object(_.sprintf)(Object(_.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis","aria-hidden":"true"},Object(_.__)("…","woo-gutenberg-products-block")),m.map((function(e){return React.createElement("button",{key:e,className:P()("wc-block-pagination-page",{"wc-block-pagination-page--active":t===e}),onClick:t===e?null:function(){return a(e)},disabled:t===e},React.createElement(C.a,{label:e,screenReaderLabel:Object(_.sprintf)(Object(_.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis","aria-hidden":"true"},Object(_.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:P()("wc-block-pagination-page",{"wc-block-pagination-page--active":t===i}),onClick:function(){return a(i)},disabled:t===i},React.createElement(C.a,{label:i,screenReaderLabel:Object(_.sprintf)(Object(_.__)("Page %d","woo-gutenberg-products-block"),i)})),r&&React.createElement("button",{className:"wc-block-pagination-page",onClick:function(){return a(t+1)},title:Object(_.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(C.a,{label:">",screenReaderLabel:Object(_.__)("Next page","woo-gutenberg-products-block")})))});N.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var T=N,A=n(124),I=(n(191),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement(A.a,{className:"wc-block-product-sort-select",defaultValue:t,name:"orderby",onChange:n,options:[{key:"menu_order",label:Object(_.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(_.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(_.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(_.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(_.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(_.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(_.__)("Order products by","woo-gutenberg-products-block"),value:o})}),F=n(18),D=n(94),L=n(11),M=n.n(L),V=n(169),B=Object(D.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,a=Object(F.useInnerBlockLayoutContext)(),i=a.parentClassName,c=a.parentName,u=0===Object.keys(t).length,s=P()("".concat(i,"__product"),{"is-loading":u,"wc-block-layout--is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var a=Object(V.a)(t);return r.map((function(r,i){var c=v()(r,2),u=c[0],s=c[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=a[u];if(!p)return null;var d=n.id||0,m=["layout",u,i,o,d];return React.createElement(p,M()({key:m.join("_")},l,{children:f,product:n}))}))}}(c,t,o,r))})),z=n(93),U=n(106),q=n(15),H=n(12),W=n(38);function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Q=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(U.a)(Y(Y({},t),{},{query:e})),r=n.results,o=n.isLoading,a=function(e,t){var n=t.namespace,r=t.resourceName,o=t.resourceValues,a=void 0===o?[]:o,i=t.query,c=void 0===i?{}:i;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(W.a)(c),s=Object(W.a)(a),l=Object(H.useSelect)((function(t){var o=t(q.COLLECTIONS_STORE_KEY),a=[e,n,r,u,s];return{value:o.getCollectionHeader.apply(o,a),isLoading:o.hasFinishedResolution("getCollectionHeader",a)}}),[e,n,r,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}("x-wp-total",Y(Y({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(a,10),productsLoading:o}},G=n(175),$=n(126),Z=n(42),J=(n(190),n(138)),X=n(88),ee=React.createElement(X.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.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"})),te=function(){var e=Object(F.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(J.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:ee,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(_.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(_.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},ne=React.createElement(X.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.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"})),re=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(F.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(J.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:ne,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(_.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(_.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(_.__)("Reset Search","woo-gutenberg-products-block")))};function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ie=Object($.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,a=e.sortValue,i=e.scrollToTop,c=Object(z.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=r.columns,a=r.rows;return ae(ae({},function(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*a,page:n})}({attributes:t,sortValue:a,currentPage:n})),u=v()(c,1)[0],s=Q(u),l=s.products,f=s.totalProducts,p=s.productsLoading,d=Object(F.useInnerBlockLayoutContext)().parentClassName,m=function(e){e.order,e.orderby,e.page,e.per_page;return E()(e,["order","orderby","page","per_page"])}(u),h=Object(z.b)("attributes",[]),g=v()(h,2),b=g[0],O=g[1],w=Object(z.b)("min_price"),k=v()(w,2),S=k[0],R=k[1],C=Object(z.b)("max_price"),N=v()(C,2),A=N[0],D=N[1],L=Object(G.a)({totalQuery:m,totalProducts:f},(function(e){var t=e.totalQuery,n=e.totalProducts,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.totalQuery;return!Object(x.isEqual)(t,o)&&Number.isFinite(n)})),M="object"===j()(L)&&Object(x.isEqual)(m,L.totalQuery);Object(y.useEffect)((function(){M||(r(1),L&&function(e){Number.isFinite(e)&&(0===e?Object(Z.speak)(Object(_.__)("No products found","woo-gutenberg-products-block")):Object(Z.speak)(Object(_.sprintf)(Object(_._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(f))}),[u]);var V,U,q,H,W,K=t.contentVisibility,Y=t.columns*t.rows,$=!Number.isFinite(f)&&M?Math.ceil(L.totalProducts/Y):Math.ceil(f/Y),J=l.length?l:Array.from({length:Y}),X=0!==l.length||p,ee=b.length>0||Number.isFinite(S)||Number.isFinite(A);return React.createElement("div",{className:(V=t.columns,U=t.rows,q=t.alignButtons,H=t.align,W=void 0!==H?"align"+H:"",P()(d,W,"has-"+V+"-columns",{"has-multiple-rows":U>1,"has-aligned-buttons":q}))},K.orderBy&&X&&React.createElement(I,{onChange:o,value:a}),!X&&ee&&React.createElement(re,{resetCallback:function(){O([]),R(null),D(null)}}),!X&&!ee&&React.createElement(te,null),X&&React.createElement("ul",{className:"".concat(d,"__products")},J.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return React.createElement(B,{key:e.id||n,attributes:t,product:e})}))),$>1&&React.createElement(T,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:$}))})),ce=function(e){var t=e.attributes,n=Object(y.useState)(1),r=v()(n,2),o=r[0],a=r[1],i=Object(y.useState)(t.orderby),c=v()(i,2),u=c[0],s=c[1];Object(y.useEffect)((function(){s(t.orderby)}),[t.orderby]);return React.createElement(ie,{attributes:t,currentPage:o,onPageChange:function(e){a(e)},onSortChange:function(e){var t=e.target.value;s(t),a(1)},sortValue:u})},ue=n(8),se=React.createElement("img",{src:ue.A+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}});function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h()(e);if(t){var o=h()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var fe=function(e){f()(n,e);var t=le(n);function n(){return c()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.urlParameterSuffix;return t.isPreview?se:React.createElement(F.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ce,{attributes:t,urlParameterSuffix:n}))}}]),n}(g.Component);Object(a.a)({selector:".wp-block-woocommerce-all-products",Block:Object(r.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(fe,e))})),getProps:function(e){return{attributes:JSON.parse(e.dataset.attributes)}}})}]);
|
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=257)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wc.wcSettings}()},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){var r;
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var c=o.apply(null,r);c&&e.push(c)}else if("object"===a)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}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,n){e.exports=n(61)()},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}},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(73),o=n(74),a=n(54),c=n(75);e.exports=function(e,t){return r(e)||o(e,t)||a(e,t)||c()}},function(e,t,n){"use strict";n.d(t,"i",(function(){return o})),n.d(t,"s",(function(){return a})),n.d(t,"w",(function(){return c})),n.d(t,"p",(function(){return i})),n.d(t,"l",(function(){return u})),n.d(t,"o",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"x",(function(){return f})),n.d(t,"k",(function(){return p})),n.d(t,"j",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"m",(function(){return b})),n.d(t,"n",(function(){return h})),n.d(t,"A",(function(){return g})),n.d(t,"t",(function(){return v})),n.d(t,"a",(function(){return y})),n.d(t,"u",(function(){return O})),n.d(t,"b",(function(){return j})),n.d(t,"f",(function(){return w})),n.d(t,"v",(function(){return _})),n.d(t,"g",(function(){return S})),n.d(t,"r",(function(){return R})),n.d(t,"q",(function(){return x})),n.d(t,"z",(function(){return C})),n.d(t,"y",(function(){return N})),n.d(t,"d",(function(){return P})),n.d(t,"e",(function(){return T}));var r=n(2),o=Object(r.getSetting)("currentUserIsAdmin",!1),a=Object(r.getSetting)("reviewRatingsEnabled",!0),c=Object(r.getSetting)("showAvatars",!0),i=(Object(r.getSetting)("max_columns",6),Object(r.getSetting)("min_columns",1),Object(r.getSetting)("default_columns",3),Object(r.getSetting)("max_rows",6),Object(r.getSetting)("min_rows",1),Object(r.getSetting)("default_rows",3),Object(r.getSetting)("min_height",500),Object(r.getSetting)("default_height",500),Object(r.getSetting)("placeholderImgSrc","")),u=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),s=Object(r.getSetting)("limitTags"),l=(Object(r.getSetting)("hasProducts",!0),Object(r.getSetting)("hasTags",!0),Object(r.getSetting)("homeUrl",""),Object(r.getSetting)("couponsEnabled",!0)),f=(Object(r.getSetting)("shippingEnabled",!0),Object(r.getSetting)("taxesEnabled",!0)),p=Object(r.getSetting)("displayItemizedTaxes",!1),d=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),m=(Object(r.getSetting)("productCount",0),Object(r.getSetting)("attributes",[])),b=Object(r.getSetting)("isShippingCalculatorEnabled",!0),h=Object(r.getSetting)("isShippingCostHidden",!1),g=(Object(r.getSetting)("woocommerceBlocksPhase",1),Object(r.getSetting)("wcBlocksAssetUrl","")),v=Object(r.getSetting)("shippingCountries",{}),y=Object(r.getSetting)("allowedCountries",{}),O=Object(r.getSetting)("shippingStates",{}),j=Object(r.getSetting)("allowedStates",{}),w=(Object(r.getSetting)("shippingMethodsExist",!1),Object(r.getSetting)("checkoutShowLoginReminder",!0)),k={id:0,title:"",permalink:""},E=Object(r.getSetting)("storePages",{shop:k,cart:k,checkout:k,privacy:k,terms:k}),_=E.shop.permalink,S=(E.checkout.id,E.checkout.permalink),R=E.privacy.permalink,x=E.privacy.title,C=E.terms.permalink,N=E.terms.title,P=(E.cart.id,E.cart.permalink),T=Object(r.getSetting)("checkoutAllowsGuest",!1);Object(r.getSetting)("checkoutAllowsSignup",!1),n(41)},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){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},n.apply(this,arguments)}e.exports=n},function(e,t,n){var r=n(76);e.exports=function(e,t){if(null==e)return{};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},,function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},,function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(46);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){Object(r.a)(e,t,n[t])}))}return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(52);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw a}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";var r=n(6),o=n.n(r),a=(n(5),n(3)),c=n(4),i=n.n(c);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,c=e.wrapperProps,u=null!=n,l=null!=r;return!u&&l?(t=o||"span",c=s(s({},c),{},{className:i()(c.className,"screen-reader-text")}),React.createElement(t,c,r)):(t=o||a.Fragment,u&&l&&n!==r?React.createElement(t,c,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,c,n))};l.defaultProps={wrapperProps:{}},t.a=l},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(30);function o(e,t){if(null==e)return{};var n,o,a=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(11),o=n.n(r),a=n(6),c=n.n(a),i=n(12),u=n.n(i),s=n(3),l=n.n(s);function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(){return(p=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)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(){}function g(){}g.resetWarningCache=h;var v=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){e.exports=function(){function e(e,t,n,r,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){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:g,resetWarningCache:h};return n.PropTypes=n,n}()}));function y(){}function O(e){return!!(e||"").match(/\d/)}function j(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function w(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split("."),a=o[0],c=o[1]||"";return{beforeDecimal:a,afterDecimal:c,hasNagation:n,addNegation:r}}function k(e,t,n){for(var r="",o=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||o;return r}function E(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function _(e,t,n){return Math.min(Math.max(e,t),n)}function S(e){return Math.max(e.selectionStart,e.selectionEnd)}var R={thousandSeparator:v.oneOfType([v.string,v.oneOf([!0])]),decimalSeparator:v.string,allowedDecimalSeparators:v.arrayOf(v.string),thousandsGroupStyle:v.oneOf(["thousand","lakh","wan"]),decimalScale:v.number,fixedDecimalScale:v.bool,displayType:v.oneOf(["input","text"]),prefix:v.string,suffix:v.string,format:v.oneOfType([v.string,v.func]),removeFormatting:v.func,mask:v.oneOfType([v.string,v.arrayOf(v.string)]),value:v.oneOfType([v.number,v.string]),defaultValue:v.oneOfType([v.number,v.string]),isNumericString:v.bool,customInput:v.elementType,allowNegative:v.bool,allowEmptyFormatting:v.bool,allowLeadingZeros:v.bool,onValueChange:v.func,onKeyDown:v.func,onMouseUp:v.func,onChange:v.func,onFocus:v.func,onBlur:v.func,type:v.oneOf(["text","tel","password"]),isAllowed:v.func,renderText:v.func,getInputRef:v.oneOfType([v.func,v.shape({current:v.any})])},x={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:y,onChange:y,onKeyDown:y,onMouseUp:y,onFocus:y,onBlur:y,isAllowed:function(){return!0}},C=function(e){function t(e){var n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,n=!(o=d(t).call(this,e))||"object"!=typeof o&&"function"!=typeof o?b(r):o;var a=e.defaultValue;n.validateProps();var c=n.formatValueProp(a);return n.state={value:c,numAsString:n.removeFormatting(c)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(b(n)),n.onKeyDown=n.onKeyDown.bind(b(n)),n.onMouseUp=n.onMouseUp.bind(b(n)),n.onFocus=n.onFocus.bind(b(n)),n.onBlur=n.onBlur.bind(b(n)),n}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,a=n.numAsString,c=void 0===a?"":a;if(e!==t){this.validateProps();var i=this.formatNumString(c),u=void 0===t.value?i:this.formatValueProp(),s=this.removeFormatting(u),l=parseFloat(s),f=parseFloat(c);(isNaN(l)&&isNaN(f)||l===f)&&i===o&&(null!==r||u===o)||this.updateValue({formattedValue:u,numAsString:s,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),a="-"===e[0];a&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var c=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==c&&(e="".concat(e.substring(0,c),".").concat(e.substring(c+1,e.length).replace(new RegExp(j(r),"g"),""))),a&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,a=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!a||0===o||t||r?"":"|"+j(a)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n Mask ".concat(e," should not contain numeric character;\n "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){E(e,t),setTimeout((function(){e.value===n&&E(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,a=r.suffix,c=r.format;if(""===e)return 0;if(t=_(t,0,e.length),!c){var i="-"===e[0];return _(t,o.length+(i?1:0),e.length-a.length)}if("function"==typeof c)return t;if("#"===c[t]&&O(e[t]))return t;if("#"===c[t-1]&&O(e[t-1]))return t;var u=c.indexOf("#");t=_(t,u,c.lastIndexOf("#")+1);for(var s=c.substring(t,c.length).indexOf("#"),l=t,f=t+(-1===s?0:s);l>u&&("#"!==c[l]||!O(e[l]));)l-=1;return!O(e[f])||"left"===n&&t!==u||t-l<f-t?O(e[l])?l+1:l:f}},{key:"getCaretPosition",value:function(e,t,n){var r,o,a=this.props.format,c=this.state.value,i=this.getNumberRegex(!0),u=(e.match(i)||[]).join(""),s=(t.match(i)||[]).join("");for(r=0,o=0;o<n;o++){var l=e[o]||"",f=t[r]||"";if((l.match(i)||l===f)&&("0"!==l||!f.match(i)||"0"===f||u.length===s.length)){for(;l!==t[r]&&r<t.length;)r++;r++}}return"string"!=typeof a||c||(r=t.length),r=this.correctCaretPosition(t,r)}},{key:"removePrefixAndSuffix",value:function(e){var t=this.props,n=t.format,r=t.prefix,o=t.suffix;if(!n&&e){var a="-"===e[0];a&&(e=e.substring(1,e.length));var c=(e=r&&0===e.indexOf(r)?e.substring(r.length,e.length):e).lastIndexOf(o);e=o&&-1!==c&&c===e.length-o.length?e.substring(0,c):e,a&&(e="-"+e)}return e}},{key:"removePatternFormatting",value:function(e){for(var t=this.props.format.split("#").filter((function(e){return""!==e})),n=0,r="",o=0,a=t.length;o<=a;o++){var c=t[o]||"",i=o===a?e.length:e.indexOf(c,n);if(-1===i){r=e;break}r+=e.substring(n,i),n=i+c.length}return(r.match(/\d/g)||[]).join("")}},{key:"removeFormatting",value:function(e){var t=this.props,n=t.format,r=t.removeFormatting;return e?(n?e="string"==typeof n?this.removePatternFormatting(e):"function"==typeof r?r(e):(e.match(/\d/g)||[]).join(""):(e=this.removePrefixAndSuffix(e),e=this.getFloatString(e)),e):e}},{key:"formatWithPattern",value:function(e){for(var t=this.props.format,n=0,r=t.split(""),o=0,a=t.length;o<a;o++)"#"===t[o]&&(r[o]=e[n]||this.getMaskAtIndex(n),n+=1);return r.join("")}},{key:"formatAsNumber",value:function(e){var t=this.props,n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix,a=t.suffix,c=t.allowNegative,i=t.thousandsGroupStyle,u=this.getSeparators(),s=u.thousandSeparator,l=u.decimalSeparator,f=-1!==e.indexOf(".")||n&&r,p=w(e,c),d=p.beforeDecimal,m=p.afterDecimal,b=p.addNegation;return void 0!==n&&(m=k(m,n,r)),s&&(d=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(d,s,i)),o&&(d=o+d),a&&(m+=a),b&&(d="-"+d),e=d+(f&&l||"")+m}},{key:"formatNumString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return o=""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,a=t.allowEmptyFormatting,c=this.props,i=c.value,u=void 0===i?e:i,s=c.isNumericString,l=!u&&0!==u;return l&&a&&(u=""),l&&!a?"":("number"==typeof u&&(u=u.toString(),s=!0),"Infinity"===u&&s&&(u=""),s&&!n&&"number"==typeof r&&(u=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=w(e),a=o.beforeDecimal,c=o.afterDecimal,i=o.hasNagation,u=parseFloat("0.".concat(c||"0")).toFixed(t).split("."),s=a.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),u[0]),l=k(u[1]||"",Math.min(t,c.length),n),f=r?".":"";return"".concat(i?"-":"").concat(s).concat(f).concat(l)}(u,r,o)),s?this.formatNumString(u):this.formatInput(u))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),o&&!a&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,a=n.suffix,c=n.decimalScale,i=n.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e<o.length||e>=t.length-a.length||c&&i&&t[e]===u))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;r<t;r++)if(this.isCharacterAFormat(r,n))return!0;return!1}},{key:"correctInputValue",value:function(e,t,n){var r=this.props,o=r.format,a=r.allowNegative,c=r.prefix,i=r.suffix,u=r.decimalScale,s=this.getSeparators(),l=s.allowedDecimalSeparators,f=s.decimalSeparator,p=this.state.numAsString||"",d=this.selectionBeforeInput,m=d.selectionStart,b=d.selectionEnd,h=function(e,t){for(var n=0,r=0,o=e.length,a=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[a-1-r]&&a-r>n&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),g=h.start,v=h.end;if(!o&&g===v&&-1!==l.indexOf(n[m])){var y=0===u?"":f;return n.substr(0,m)+y+n.substr(m+1,n.length)}var O=o?0:c.length,j=t.length-(o?0:i.length);if(n.length>t.length||!n.length||g===v||0===m&&b===t.length||m===O&&b===j)return n;if(this.checkIfFormatGotDeleted(g,v,t)&&(n=t),!o){var k=this.removeFormatting(n),E=w(k,a),_=E.beforeDecimal,S=E.afterDecimal,R=E.addNegation,x=e<n.indexOf(f)+1;if(k.length<p.length&&x&&""===_&&!parseFloat(S))return R?"-":""}return n}},{key:"updateValue",value:function(e){var t=e.formattedValue,n=e.input,r=e.setCaretPosition,o=void 0===r||r,a=e.numAsString,c=e.caretPos,i=this.props.onValueChange,u=this.state.value;if(n)if(o){if(!c){var s=e.inputValue||n.value,l=S(n);n.value=t,c=this.getCaretPosition(s,t,l)}this.setPatchedCaretPosition(n,c,t)}else n.value=t;void 0===a&&(a=this.removeFormatting(t)),t!==u&&(this.setState({value:t,numAsString:a}),i(this.getValueObject(t,a)))}},{key:"onChange",value:function(e){var t=e.target,n=t.value,r=this.state,o=this.props,a=o.isAllowed,c=r.value||"",i=S(t);n=this.correctInputValue(i,c,n);var u=this.formatInput(n)||"",s=this.removeFormatting(u);a(this.getValueObject(u,s))||(u=c),this.updateValue({formattedValue:u,numAsString:s,inputValue:n,input:t}),o.onChange(e)}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,a=t.allowLeadingZeros,c=n.numAsString,i=n.value;if(this.focusedElm=null,this.focusTimeout&&clearTimeout(this.focusTimeout),!r){isNaN(parseFloat(c))&&(c=""),a||(c=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(c));var u=this.formatNumString(c);if(u!==i)return this.updateValue({formattedValue:u,numAsString:c,input:e.target,setCaretPosition:!1}),void o(e)}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,a=n.selectionEnd,c=n.value,i=void 0===c?"":c,u=this.props,s=u.decimalScale,l=u.fixedDecimalScale,f=u.prefix,p=u.suffix,d=u.format,m=u.onKeyDown,b=void 0!==s&&l,h=this.getNumberRegex(!1,b),g=new RegExp("-"),v="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:a},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===a){var y=t,O=v?d.indexOf("#"):f.length,j=v?d.lastIndexOf("#")+1:i.length-p.length;if("ArrowLeft"===r||"ArrowRight"===r){var w="ArrowLeft"===r?"left":"right";y=this.correctCaretPosition(i,t,w)}else if("Delete"!==r||h.test(i[t])||g.test(i[t])){if("Backspace"===r&&!h.test(i[t]))if(o<=O+1&&"-"===i[0]&&void 0===d){var k=i.substring(1);this.updateValue({formattedValue:k,caretPos:y,input:n})}else if(!g.test(i[t])){for(;!h.test(i[y-1])&&y>O;)y--;y=this.correctCaretPosition(i,y,"left")}}else for(;!h.test(i[y])&&y<j;)y++;(y!==t||t<O||t>j)&&(e.preventDefault(),this.setPatchedCaretPosition(n,y,i)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,y,i),m(e)}else m(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,a=void 0===o?"":o;if(n===r){var c=this.correctCaretPosition(a,n);c!==n&&this.setPatchedCaretPosition(t,c,a)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,a=n.value,c=void 0===a?"":a,i=t.correctCaretPosition(c,r);i===r||0===r&&o===c.length||t.setPatchedCaretPosition(n,i,c),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,o=r.type,a=r.displayType,c=r.customInput,i=r.renderText,u=r.getInputRef,s=this.state.value,f=(e=this.props,t=R,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),d=p({inputMode:"numeric"},f,{type:o,value:s,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===a)return i?i(s)||null:l.a.createElement("span",p({},f,{ref:u}),s);if(c){var m=c;return l.a.createElement(m,p({},d,{ref:u}))}return l.a.createElement("input",p({},d,{ref:u}))}}])&&f(n.prototype,r),o&&f(n,o),t}(l.a.Component);C.propTypes=R,C.defaultProps=x;var N=C,P=n(4),T=n.n(P);n(90);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,r=e.currency,a=e.onValueChange,c=u()(e,["className","value","currency","onValueChange"]);if("-"===n)return null;var i=n/Math.pow(10,r.minorUnit);if(!Number.isFinite(i))return null;var s=T()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),l=A(A(A({displayType:"text"},c),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(r)),{},{value:void 0,currency:void 0,onValueChange:void 0}),f=a?function(e){var t=e.value*Math.pow(10,r.minorUnit);a(t)}:function(){};return React.createElement(N,o()({className:s},l,{value:i,onValueChange:f}))}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(60);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(22),o=n(19);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(47);var o=n(52);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=n(38),a=n.n(o),c=function(e){var t=Object(r.useRef)();return a()(e,t.current)||(t.current=e),t.current}},,function(e,t){!function(){e.exports=this.wp.blocks}()},,function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t,n){"use strict";var r=n(32),o=n.n(r),a=n(33),c=n.n(a),i=n(19),u=n.n(i),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(24),m=n.n(d),b=n(6),h=n.n(b),g=(n(5),n(3)),v=n(1),y=n(9),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.A,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,a=e.text,c=void 0===a?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):a,i=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(v.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),c&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},c),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",i)))};n(63);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var o=m()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p()(this,n)}}var w=function(e){l()(n,e);var t=j(n);function n(){var e;o()(this,n);for(var r=arguments.length,a=new Array(r),c=0;c<r;c++)a[c]=arguments[c];return e=t.call.apply(t,[this].concat(a)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,a=e.errorMessagePrefix,c=this.state,i=c.errorMessage;return c.hasError?React.createElement(O,{errorMessage:r?i:null,header:t,imageUrl:n,text:o,errorMessagePrefix:a}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(g.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(g.Component);w.defaultProps={showErrorMessage:!0};t.a=w},function(e,t){!function(){e.exports=this.ReactDOM}()},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){!function(){e.exports=this.wp.autop}()},function(e,t){!function(){e.exports=this.wp.keycodes}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(47);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},,function(e,t,n){var r=n(55);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t,n){var r=n(91),o=n(92),a=n(54),c=n(93);e.exports=function(e){return r(e)||o(e)||a(e)||c()}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=Object(r.createContext)("page"),a=function(){return Object(r.useContext)(o)};o.Provider},,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";var r=n(62);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,c){if(c!==r){var i=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 i.name="Invariant Violation",i}}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:a,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){},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(6),o=n.n(r),a=n(112),c=n(0);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s=function(){var e=Object(a.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,o=e.createSnackbarNotice,i=e.setIsSuppressed,s=Object(c.useRef)(t);Object(c.useEffect)((function(){s.current=t}),[t]);var l=Object(c.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.map((function(t){return null!==e&&t.status!==e||r(t.id),!0}))},removeNotice:r}}),[r]),f=Object(c.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,u({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,t)}}}),[n,o]);return u(u(u({notices:t},l),f),{},{setIsSuppressed:i})}},,function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(11)),a=r(n(76)),c=n(3),i=r(c),u=r(n(104)),s=r(n(19)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=c.useState(!1)[1];return c.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function m(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function b(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,a(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var a;return l.und(t[r])?o({},n,((a={})[r]=e[r],a)):n}),{});return o({to:t},n)}var h,g,v=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof v&&e.removeChild(s(t))}))},t}return u(t,e),t}(v),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof v&&e.removeChild(s(t))}))},t}u(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof v)&&(t[n]=r instanceof v?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(v);function j(e,t){h={fn:e,transform:t}}function w(e){g=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},_=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function S(e){k=e}var R,x=function(){return Date.now()};function C(e){R=e}var N,P,T=function(e){return e.current};function I(e){N=e}var A=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return g},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return _},injectFrame:function(e,t){E=e,_=t},get interpolation(){return k},injectStringInterpolator:S,get now(){return x},injectNow:function(e){x=e},get defaultElement(){return R},injectDefaultElement:C,get animatedApi(){return T},injectAnimatedApi:function(e){T=e},get createAnimatedStyle(){return N},injectCreateAnimatedStyle:I,get manualFrameloop(){return P},injectManualFrameloop:function(e){P=e}}),D=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:N(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),F=!1,L=new Set,M=function e(){if(!F)return!1;var t=x(),n=L,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if((o=n.next()).done)break;a=o.value}for(var c=a,i=!1,u=0;u<c.configs.length;u++){for(var s=c.configs[u],l=void 0,f=void 0,p=0;p<s.animatedValues.length;p++){var d=s.animatedValues[p];if(!d.done){var m=s.fromValues[p],b=s.toValues[p],h=d.lastPosition,g=b instanceof v,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(g&&(b=b.getValue()),s.immediate)d.setValue(b),d.done=!0;else if("string"!=typeof m&&"string"!=typeof b){if(void 0!==s.duration)h=m+s.easing((t-d.startTime)/s.duration)*(b-m),l=t>=d.startTime+s.duration;else if(s.decay)h=m+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(b=h);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:s.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j){h+=1*(y+=1*((-s.tension*(h-b)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(m<b?h>b:h<b),k=Math.abs(y)<=s.precision,_=0===s.tension||Math.abs(b-h)<=s.precision;l=w||k&&_,d.lastVelocity=y,d.lastTime=t}g&&!s.toValues[p].done&&(l=!1),l?(d.value!==b&&(h=b),d.done=!0):i=!0,d.setValue(h),d.lastPosition=h}else d.setValue(b),d.done=!0}}c.props.onFrame&&(c.values[s.name]=s.interpolation.getValue())}c.props.onFrame&&c.props.onFrame(c.values),i||(L.delete(c),c.stop(!0))}return L.size?P?P():E(e):F=!1,F};function V(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return V({range:e,output:t,extrapolate:n});if(k&&"string"==typeof e.output[0])return k(e);var r=e,o=r.output,a=r.range||[0,1],c=r.extrapolateLeft||r.extrapolate||"extend",i=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,a);return function(e,t,n,r,o,a,c,i,u){var s=u?u(e):e;if(s<t){if("identity"===c)return s;"clamp"===c&&(s=t)}if(s>n){if("identity"===i)return s;"clamp"===i&&(s=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=a(s),r===-1/0?s=-s:o===1/0?s+=r:s=s*(o-r)+r;return s}(e,a[t],a[t+1],o[t],o[t+1],u,c,i,r.map)}}var B=function(e){function t(n,r,o,a){var c;return(c=e.call(this)||this).calc=void 0,c.payload=n instanceof y&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],c.calc=V(r,o,a),c}u(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=V(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var z=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}u(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new B(this,e,t,n)},t}(v),q=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new z(e)})),n}u(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new B(this,e,t)},t}(y),U=0,H=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=U++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=b(e),n=t.delay,r=void 0===n?0:n,c=t.to,i=a(t,["delay","to"]);if(l.arr(c)||l.fun(c))this.queue.push(o({},i,{delay:r,to:c}));else if(c){var u={};Object.entries(c).forEach((function(e){var t,n=e[0],a=e[1],c=o({to:(t={},t[n]=a,t),delay:m(r,n)},i),s=u[c.delay]&&u[c.delay].to;u[c.delay]=o({},u[c.delay],c,{to:o({},s,c.to)})})),this.queue=Object.values(u)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(i),this},t.start=function(e){var t,n=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,r=void 0===t?{}:t,a=e.to,c=void 0===a?{}:a;l.obj(r)&&(n.merged=o({},r,n.merged)),l.obj(c)&&(n.merged=o({},n.merged,c))}));var r=this.local=++this.guid,c=this.localQueue=this.queue;this.queue=[],c.forEach((function(t,o){var i=t.delay,u=a(t,["delay"]),s=function(t){o===c.length-1&&r===n.guid&&t&&(n.idle=!0,n.props.onRest&&n.props.onRest(n.merged)),e&&e()},f=l.arr(u.to)||l.fun(u.to);i?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),i):f?n.runAsync(u,s):n.diff(u).start(s)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,L.has(t)||L.add(t),F||(F=!0,E(P||M));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){var t;return this.stop(!0),e&&(t=this,L.has(t)&&L.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,a(e,["delay"])),c=this.local,i=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,a=o({},r,b(r.to[t]));l.arr(a.config)&&(a.config=a.config[t]),i=i.then((function(){if(c===n.guid)return new Promise((function(e){return n.diff(a).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;i=i.then((function(){return r.to((function(e){var t=o({},r,b(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,c===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}i.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,a=void 0===r?{}:r,c=n.to,i=void 0===c?{}:c,u=n.config,s=void 0===u?{}:u,f=n.reverse,b=n.attach,h=n.reset,v=n.immediate;if(f){var y=[i,a];a=y[0],i=y[1]}this.merged=o({},a,this.merged,i),this.hasChanged=!1;var O=b&&b(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],c=n[1],i=e[r]||{},u=l.num(c),f=l.str(c)&&!c.startsWith("#")&&!/\d/.test(c)&&!g[c],b=l.arr(c),y=!u&&!b&&!f,j=l.und(a[r])?c:a[r],w=u||b||f?c:1,E=m(s,r);O&&(w=O.animations[r].parent);var _,S=i.parent,R=i.interpolation,C=d(O?w.getPayload():w),N=c;y&&(N=k({range:[0,1],output:[c,c]})(1));var P,T=R&&R.getValue(),I=!l.und(S)&&i.animatedValues.some((function(e){return!e.done})),A=!l.equ(N,T),D=!l.equ(N,i.previous),F=!l.equ(E,i.config);if(h||D&&A||F){var L;if(u||f)S=R=i.parent||new z(j);else if(b)S=R=i.parent||new q(j);else if(y){var M=i.interpolation&&i.interpolation.calc(i.parent.value);M=void 0===M||h?j:M,i.parent?(S=i.parent).setValue(0,!1):S=new z(0);var V={output:[M,c]};i.interpolation?(R=i.interpolation,i.interpolation.updateConfig(V)):R=S.interpolate(V)}return C=d(O?w.getPayload():w),_=d(S.getPayload()),h&&!y&&S.setValue(j,!1),t.hasChanged=!0,_.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=I?e.lastVelocity:void 0,e.lastTime=I?e.lastTime:void 0,e.startTime=x(),e.done=!1,e.animatedStyles.clear()})),m(v,r)&&S.setValue(y?w:c,!1),o({},e,((L={})[r]=o({},i,{name:r,parent:S,interpolation:R,animatedValues:_,toValues:C,previous:N,config:E,fromValues:d(S.getValue()),immediate:m(v,r),initialVelocity:p(E.velocity,0),clamp:p(E.clamp,!1),precision:p(E.precision,.01),tension:p(E.tension,170),friction:p(E.friction,26),mass:p(E.mass,1),duration:E.duration,easing:p(E.easing,(function(e){return e})),decay:E.decay}),L))}return A?e:(y&&(S.setValue(1,!1),R.updateConfig({output:[N,N]})),S.done=!0,t.hasChanged=!0,o({},e,((P={})[r]=o({},e[r],{previous:N}),P)))}),this.animations),this.hasChanged)for(var j in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[j]=this.animations[j].interpolation,this.values[j]=this.animations[j].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),W=function(e,t){var n=c.useRef(!1),r=c.useRef(),o=l.fun(t),a=c.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var a=new H,c=o?m(t,r,a):t[r];return 0===r&&(n=c.ref),a.update(c),n||a.start(),a})),n]}),[e]),i=a[0],u=a[1];r.current=i;c.useImperativeHandle(u,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var s=c.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?m(e,n,t):e[n]),u||t.start()}))}}),[e]);c.useEffect((function(){n.current?o||s(t):u||r.current.forEach((function(e){return e.start()}))})),c.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var f=r.current.map((function(e){return e.getValues()}));return o?[f,s,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:f},K=0,Q=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},Y=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,c=a(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:Q(t,r)},c)};function G(e,t){var n=function(){if(o){if(a>=r.length)return"break";c=r[a++]}else{if((a=r.next()).done)return"break";c=a.value}var n=c.key,i=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(i),e.current.deleted=e.current.deleted.filter(i))},r=e.current.deleted,o=Array.isArray(r),a=0;for(r=o?r:r[Symbol.iterator]();;){var c;if("break"===n())break}e.current.forceUpdate()}var $=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof v||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),Z={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},J="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(J,J,J)),te=new RegExp("rgba"+X(J,J,J,J)),ne=new RegExp("hsl"+X(J,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(J,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",J)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ae=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{6})$/,ie=/^#([0-9a-fA-F]{8})$/;function ue(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function se(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,a=ue(o,r,e+1/3),c=ue(o,r,e),i=ue(o,r,e-1/3);return Math.round(255*a)<<24|Math.round(255*c)<<16|Math.round(255*i)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function me(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ce.exec(t))?parseInt(n[1]+"ff",16)>>>0:Z.hasOwnProperty(t)?Z[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|pe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ie.exec(t))?parseInt(n[1],16)>>>0:(n=ae.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|se(fe(n[1]),de(n[2]),de(n[3])))>>>0:(n=re.exec(t))?(se(fe(n[1]),de(n[2]),de(n[3]))|pe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var be=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,he=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ge=new RegExp("("+Object.keys(Z).join("|")+")","g"),ve={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}ve=Object.keys(ve).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ve);var je={};I((function(e){return new $(e)})),C("div"),S((function(e){var t=e.output.map((function(e){return e.replace(he,me)})).map((function(e){return e.replace(ge,me)})),n=t[0].match(be).map((function(){return[]}));t.forEach((function(e){e.match(be).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(be).map((function(t,r){return V(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(be,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),w(Z),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,c=t.scrollLeft,i=a(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var s in void 0!==o&&(e.scrollTop=o),void 0!==c&&(e.scrollLeft=c),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(s)){var l=0===s.indexOf("--"),f=Oe(s,n[s],l);"float"===s&&(s="cssFloat"),l?e.style.setProperty(s,f):e.style[s]=f}for(var p in i){var d=u?p:je[p]||(je[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,i[p])}}),(function(e){return e}));var we,ke,Ee=(we=function(e){return c.forwardRef((function(t,n){var r=f(),u=c.useRef(!0),s=c.useRef(null),p=c.useRef(null),d=c.useCallback((function(e){var t=s.current;s.current=new D(e,(function(){var e=!1;p.current&&(e=h.fn(p.current,s.current.getAnimatedValue())),p.current&&!1!==e||r()})),t&&t.detach()}),[]);c.useEffect((function(){return function(){u.current=!1,s.current&&s.current.detach()}}),[]),c.useImperativeHandle(n,(function(){return T(p,u,r)})),d(t);var m,b=s.current.getValue(),g=(b.scrollTop,b.scrollLeft,a(b,["scrollTop","scrollLeft"])),v=(m=e,!l.fun(m)||m.prototype instanceof i.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return i.createElement(e,o({},g,{ref:v}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=ke?t[0].toLowerCase()+t.substring(1):t;return e[n]=we(n),e}),we)}),_e=Ee(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Ee,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=M,t.animated=_e,t.a=_e,t.interpolate=function(e,t,n){return e&&new B(e,t,n)},t.Globals=A,t.useSpring=function(e){var t=l.fun(e),n=W(1,t?e:[e]),r=n[0],o=n[1],a=n[2];return t?[r[0],o,a]:r},t.useTrail=function(e,t){var n=c.useRef(!1),r=l.fun(t),a=m(t),i=c.useRef(),u=W(e,(function(e,t){return 0===e&&(i.current=[]),i.current.push(t),o({},a,{config:m(a.config,e),attach:e>0&&function(){return i.current[e-1]}})})),s=u[0],f=u[1],p=u[2],d=c.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,c=i.current[r];return o({},e,{config:m(e.config||a.config,t),attach:c&&function(){return c}})}))}}),[e,a.reverse]);return c.useEffect((function(){n.current&&!r&&d(t)})),c.useEffect((function(){n.current=!0}),[]),r?[s,d,p]:s},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),i=Y(r),u=i.lazy,s=void 0!==u&&u,l=(i.unique,i.reset),p=void 0!==l&&l,d=(i.enter,i.leave,i.update,i.onDestroyed),b=(i.keys,i.items,i.onFrame),h=i.onRest,g=i.onStart,v=i.ref,y=a(i,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=c.useRef(!1),w=c.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return c.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(w.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(w.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(w.current.instances).map((function(e){return e[1]}))}}})),w.current=function(e,t){var n=e.first,r=e.prevProps,c=a(e,["first","prevProps"]),i=Y(t),u=i.items,s=i.keys,l=i.initial,f=i.from,p=i.enter,d=i.leave,b=i.update,h=i.trail,g=void 0===h?0:h,v=i.unique,y=i.config,O=i.order,j=void 0===O?["enter","leave","update"]:O,w=Y(r),k=w.keys,E=w.items,_=o({},c.current),S=[].concat(c.deleted),R=Object.keys(_),x=new Set(R),C=new Set(s),N=s.filter((function(e){return!x.has(e)})),P=c.transitions.filter((function(e){return!e.destroyed&&!C.has(e.originalKey)})).map((function(e){return e.originalKey})),T=s.filter((function(e){return x.has(e)})),I=-g;for(;j.length;){switch(j.shift()){case"enter":N.forEach((function(e,t){v&&S.find((function(t){return t.originalKey===e}))&&(S=S.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],a=n&&void 0!==l?"initial":"enter";_[e]={slot:a,originalKey:e,key:v?String(e):K++,item:o,trail:I+=g,config:m(y,o,a),from:m(n&&void 0!==l?l||{}:f,o),to:m(p,o)}}));break;case"leave":P.forEach((function(e){var t=k.indexOf(e),n=E[t];S.unshift(o({},_[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:I+=g,config:m(y,n,"leave"),to:m(d,n)})),delete _[e]}));break;case"update":T.forEach((function(e){var t=s.indexOf(e),n=u[t];_[e]=o({},_[e],{item:n,slot:"update",trail:I+=g,config:m(y,n,"update"),to:m(b,n)})}))}}var A=s.map((function(e){return _[e]}));return S.forEach((function(e){var t,n=e.left,r=(e.right,a(e,["left","right"]));-1!==(t=A.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),A=[].concat(A.slice(0,t),[r],A.slice(t))})),o({},c,{changed:N.length||P.length||T.length,first:n&&0===N.length,transitions:A,current:_,deleted:S,prevProps:t})}(w.current,r),w.current.changed&&w.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,a=e.config,c=e.trail,i=e.key,u=e.item;w.current.instances.has(i)||w.current.instances.set(i,new H);var l=w.current.instances.get(i),f=o({},y,{to:r,from:n,config:a,ref:v,onRest:function(n){w.current.mounted&&(e.destroyed&&(v||s||G(w,i),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(v||s)&&w.current.deleted.length>0&&G(w),h&&h(u,t,n))},onStart:g&&function(){return g(u,t)},onFrame:b&&function(e){return b(u,t,e)},delay:c,reset:p&&"enter"===t});l.update(f),w.current.paused||l.start()})),c.useEffect((function(){return w.current.mounted=j.current=!0,function(){w.current.mounted=j.current=!1,Array.from(w.current.instances).map((function(e){return e[1].destroy()})),w.current.instances.clear()}}),[]),w.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:w.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=c.useRef();c.useEffect((function(){l.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var a=e.current;if(a){var c=a.controllers;if(c.length){var i=n*t[r];c.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+i})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=W},function(e,t){!function(){e.exports=this.wp.wordcount}()},function(e,t,n){"use strict";var r=n(11),o=n.n(r),a=n(12),c=n.n(a),i=n(72),u=n(4),s=n.n(u),l=function(e){var t=e.className,n=e.size,r=c()(e,["className","size"]),a=s()("dashicon","dashicons-arrow-down-alt2",t);return React.createElement(i.a,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:a,width:n,height:n},r),React.createElement("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))},f=function(e){var t=e.className,n=e.size,r=c()(e,["className","size"]),a=s()("dashicon","dashicons-arrow-down-alt2",t);return React.createElement(i.a,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:a,width:n,height:n},r),React.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"}))},p=n(0);t.a=function(e){let t=function(){return null};switch(e.icon){case"arrow-down-alt2":t=l;break;case"no-alt":t=f}return Object(p.createElement)(t,{size:e.size||20,className:e.className})}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(26),o=n(7),a=n(0),c=function(e){var t=Object(r.a)({},e,{role:"img","aria-hidden":"true",focusable:"false"});return Object(a.createElement)("svg",Object(o.omit)(t,"__unstableActive"))}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw a}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},function(e,t,n){"use strict";var r=n(26),o=n(10),a=n(29),c=n(0),i=n(69),u=n(72);t.a=function(e){var t=e.icon,n=void 0===t?null:t,s=e.size,l=Object(a.a)(e,["icon","size"]),f=s||20;if("string"==typeof n)return Object(c.createElement)(i.a,Object(o.a)({icon:n,size:f},l));if(n&&i.a===n.type)return Object(c.cloneElement)(n,Object(r.a)({size:f},l));var p=s||24;if("function"==typeof n)return n.prototype instanceof c.Component?Object(c.createElement)(n,Object(r.a)({size:p},l)):n(Object(r.a)({size:p},l));if(n&&("svg"===n.type||n.type===u.a)){var d=Object(r.a)({width:p,height:p},n.props,l);return Object(c.createElement)(u.a,d)}return Object(c.isValidElement)(n)?Object(c.cloneElement)(n,Object(r.a)({size:p},l)):n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(16),o=n(13),a=n(110),c=n(15),i=n(7),u={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(a.a)(),n=t.isEditor,s=t.previewData,l=(null==s?void 0:s.previewCart)||{},f=e.shouldSelect,p=Object(o.useSelect)((function(e,t){var o=t.dispatch;if(!f)return u;if(n)return{cartCoupons:l.coupons,cartItems:l.items,cartItemsCount:l.items_count,cartItemsWeight:l.items_weight,cartNeedsPayment:l.needs_payment,cartNeedsShipping:l.needs_shipping,cartItemErrors:[],cartTotals:l.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:l.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==l?void 0:l.receiveCart)?l.receiveCart:function(){}};var a=e(r.CART_STORE_KEY),s=a.getCartData(),p=a.getCartErrors(),d=a.getCartTotals(),m=!a.hasFinishedResolution("getCartData"),b=a.areShippingRatesLoading(),h=o(r.CART_STORE_KEY).receiveCart,g=Object(i.mapValues)(s.shippingAddress,(function(e){return Object(c.decodeEntities)(e)}));return{cartCoupons:s.coupons,cartItems:s.items||[],cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors||[],cartTotals:d,cartIsLoading:m,cartErrors:p,shippingAddress:g,shippingRates:s.shippingRates||[],shippingRatesLoading:b,hasShippingAddress:!!g.country,receiveCart:h}}),[f]);return p}},function(e,t,n){"use strict";var r=n(26),o=n(29),a=n(4),c=n.n(a),i=n(0);t.a=Object(i.forwardRef)((function(e,t){var n=e.href,a=e.target,u=e.isPrimary,s=e.isLarge,l=e.isSmall,f=e.isTertiary,p=e.isToggled,d=e.isBusy,m=e.isDefault,b=e.isLink,h=e.isDestructive,g=e.className,v=e.disabled,y=Object(o.a)(e,["href","target","isPrimary","isLarge","isSmall","isTertiary","isToggled","isBusy","isDefault","isLink","isDestructive","className","disabled"]),O=c()("components-button",g,{"is-button":m||u||s||l,"is-default":m||!u&&(s||l),"is-primary":u,"is-large":s,"is-small":l,"is-tertiary":f,"is-toggled":p,"is-busy":d,"is-link":b,"is-destructive":h}),j=void 0===n||v?"button":"a",w="a"===j?{href:n,target:a}:{type:"button",disabled:v};return Object(i.createElement)(j,Object(r.a)({},w,y,{className:O,ref:t}))}))},,,function(e,t){!function(){e.exports=this.wp.deprecated}()},,function(e,t,n){"use strict";var r=n(0),o=n(68),a=n(49),c=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},u=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",r=i(e),o=r.split(" ").splice(0,t).join(" ");return Object(a.autop)(u(o,n))},l=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",o=i(e),c=o.slice(0,t);if(n)return Object(a.autop)(u(c,r));var s=c.match(/([\s]+)/g),l=s?s.length:0,f=o.slice(0,t+l);return Object(a.autop)(u(f,r))};t.a=function(e){var t=e.source,n=e.maxLength,i=void 0===n?15:n,u=e.countType,f=void 0===u?"words":u,p=e.className,d=void 0===p?"":p,m=Object(r.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",r=Object(a.autop)(e),i=Object(o.count)(r,n);if(i<=t)return r;var u=c(r),f=Object(o.count)(u,n);return f<=t?u:"words"===n?s(u,t):l(u,t,"characters_including_spaces"===n)}(t,i,f)}),[t,i,f]);return React.createElement(r.RawHTML,{className:d},m)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),o=n.n(r),a=n(0),c=function(){var e=Object(a.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},,,,function(e,t){},function(e,t,n){var r=n(55);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,function(e,t){!function(){e.exports=this.wp.components}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return d}));var r=n(8),o=n.n(r),a=n(16),c=n(13),i=n(0),u=n(58),s=n(7),l=n(39),f=function(e){var t=Object(u.a)();e=e||t;var n=Object(c.useSelect)((function(t){return t(a.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(c.useDispatch)(a.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(i.useCallback)((function(t){r(e,t)}),[e])]},p=function(e,t,n){var r=Object(u.a)();n=n||r;var o=Object(c.useSelect)((function(r){return r(a.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),s=Object(c.useDispatch)(a.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(i.useCallback)((function(t){s(n,e,t)}),[n,e])]},d=function(e,t){var n=Object(u.a)(),r=f(t=t||n),a=o()(r,2),c=a[0],p=a[1],d=Object(l.a)(e),m=Object(i.useRef)(!1);return Object(i.useEffect)((function(){p(Object(s.assign)({},c,d)),m.current=!0}),[d]),m.current?[c,p]:[e,p]}},function(e,t,n){"use strict";var r=n(10),o=n(0),a=n(7);var c=function(e,t){return function(n){var r=e(n),o=n.displayName,c=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(a.upperFirst)(Object(a.camelCase)(t)),"(").concat(c,")"),r}},i=new WeakMap;function u(e){return Object(o.useMemo)((function(){return function(e){var t=i.get(e)||0;return i.set(e,t+1),t}(e)}),[e])}t.a=c((function(e){return function(t){var n=u(e);return Object(o.createElement)(e,Object(r.a)({},t,{instanceId:n}))}}),"withInstanceId")},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(11),o=n.n(r),a=n(6),c=n.n(a),i=n(45),u=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=function(e){var t=e.Block,n=e.selector,r=e.getProps,a=void 0===r?function(){}:r,c=e.getErrorBoundaryProps,s=void 0===c?function(){}:c,f=document.querySelectorAll(n);f.length&&Array.prototype.forEach.call(f,(function(e,n){var r=a(e,n),c=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(i.render)(React.createElement(u.a,c,React.createElement(t,o()({},r,{attributes:f}))),e)}))}},function(e,t){},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(16),o=n(13),a=n(0),c=n(86),i=n(39),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var m=Object(a.useRef)({results:[],isLoading:!0}),b=Object(i.a)(f),h=Object(i.a)(s),g=Object(c.a)(),v=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),a=[t,n,b,h],c=o.getCollectionError.apply(o,a);return c&&g(c),{results:o.getCollection.apply(o,a),isLoading:!o.hasFinishedResolution("getCollection",a)}}),[t,n,h,b,d]);return null!==v&&(m.current=v),m.current}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=(n(13),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{}})),a=function(){return Object(r.useContext)(o)}},,function(e,t,n){"use strict";n.d(t,"b",(function(){return D})),n.d(t,"a",(function(){return F}));var r=n(6),o=n.n(r),a=n(8),c=n.n(a),i=(n(5),n(0)),u=n(13),s=n(11),l=n.n(s),f=n(4),p=n.n(f),d=n(177),m=(n(103),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),b=function(e){var t=e.className,n=e.notices,r=D().removeNotice,o=p()(t,"wc-block-components-notices"),a=n.filter((function(e){return"snackbar"!==e.type}));return a.length?React.createElement("div",{className:o},a.map((function(e){return React.createElement(d.a,l()({key:"store-notice-"+e.id},e,{className:p()("wc-block-components-notices__notice","woocommerce-message",m(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)}))):null},h=n(10),g=n(25),v=n.n(g);function y(e,t,n,r,o,a,c){try{var i=e[a](c),u=i.value}catch(e){return void n(e)}i.done?t(u):Promise.resolve(u).then(r,o)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){y(a,r,o,c,i,"next",e)}function i(e){y(a,r,o,c,i,"throw",e)}c(void 0)}))}}var j=n(27),w=n(7),k=n(67),E=n(21),_=n(1),S=n(79);var R=Object(i.forwardRef)((function(e,t){var n=e.className,r=e.children,o=e.actions,a=void 0===o?[]:o,c=e.onRemove,u=void 0===c?w.noop:c;Object(i.useEffect)((function(){var e=setTimeout((function(){u()}),1e4);return function(){return clearTimeout(e)}}),[]);var s=p()(n,"components-snackbar");return a&&a.length>1&&(console.warn("Snackbar can only have 1 action, use Notice if your message require many messages"),a=[a[0]]),Object(i.createElement)("div",{ref:t,className:s,onClick:u,tabIndex:"0",role:"button",onKeyPress:u,label:Object(_.__)("Dismiss this notice")},Object(i.createElement)("div",{className:"components-snackbar__content"},r,a.map((function(e,t){var n=e.label,r=e.onClick,o=e.url;return Object(i.createElement)(S.a,{key:t,href:o,isTertiary:!0,onClick:function(e){e.stopPropagation(),r&&r(e)},className:"components-snackbar__action"},n)}))))}));var x=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,a=void 0===o?w.noop:o,c=Object(E.useReducedMotion)(),u=Object(i.useState)((function(){return new WeakMap})),s=Object(j.a)(u,1)[0],l=Object(k.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=O(v.a.mark((function t(n){return v.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({opacity:1,height:s.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=O(v.a.mark((function e(t){return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:c});n=p()("components-snackbar-list",n);var f=function(e){return function(){return a(e.id)}};return Object(i.createElement)("div",{className:n},r,l.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(i.createElement)(k.animated.div,{key:n,style:r},Object(i.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&s.set(t,e)}},Object(i.createElement)(R,Object(h.a)({},Object(w.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},C=n(65),N=n(110),P=function(){var e=Object(N.a)().isEditor,t=Object(C.a)(),n=t.notices,r=t.removeNotice,o=n.filter((function(e){return"snackbar"===e.type}));return e?null:React.createElement(x,{notices:o,className:"wc-block-components-notices__snackbar",onRemove:r})};function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var A=Object(i.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),D=function(){return Object(i.useContext)(A)},F=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,a=void 0===o||o,s=e.context,l=void 0===s?"wc/core":s,f=Object(u.useDispatch)("core/notices"),p=f.createNotice,d=f.removeNotice,m=Object(i.useState)(!1),h=c()(m,2),g=h[0],v=h[1],y=Object(i.useCallback)((function(){var 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]:{};p(e,t,I(I({},n),{},{context:n.context||l}))}),[p,l]),O=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;d(e,t)}),[d,l]),j=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y("default",e,I(I({},t),{},{type:"snackbar"}))}),[y]),w={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(l)}}),[l]).notices,createNotice:y,createSnackbarNotice:j,removeNotice:O,context:l,setIsSuppressed:v},k=g?null:React.createElement(b,{className:r,notices:w.notices}),E=g?null:React.createElement(P,null);return React.createElement(A.Provider,{value:w},a&&k,t,E)}},,,,,,,function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return b}));var r=n(6),o=n.n(r),a=n(22),c=n.n(a),i=n(2);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l,f,p={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(l=i.CURRENCY.symbol,f=i.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[f]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},d=function(e){if(!e||"object"!==c()(e))return p;var t=e.currency_code,n=e.currency_symbol,r=e.currency_thousand_separator,o=e.currency_decimal_separator,a=e.currency_minor_unit,i=e.currency_prefix,u=e.currency_suffix;return{code:t||"USD",symbol:n||"$",thousandSeparator:"string"==typeof r?r:",",decimalSeparator:"string"==typeof o?o:".",minorUnit:Number.isFinite(a)?a:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof u?u:""}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},p),e)},b=function(e,t){if(""===e||void 0===e)return"";var n=parseInt(e,10);if(!Number.isFinite(n))return"";var r=m(t),o=n/Math.pow(10,r.minorUnit),a=r.prefix+o+r.suffix,c=document.createElement("textarea");return c.innerHTML=a,c.value}},function(e,t,n){"use strict";var r=n(0),o=n(2),a=n(16),c=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(Object(o.getSetting)("restApiRoutes")),Object(c.useSelect)((function(e,t){if(n.current){var r=e(a.SCHEMA_STORE_KEY),o=r.isResolving,c=r.hasFinishedResolution,i=t.dispatch(a.SCHEMA_STORE_KEY),u=i.receiveRoutes,s=i.startResolution,l=i.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];o("getRoutes",[e])||c("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,function(e,t,n){"use strict";n(5);var r=n(4),o=n.n(r),a=n(28),c=n(98);n(138);t.a=Object(c.a)((function(e){var t=e.className,n=e.instanceId,r=e.defaultValue,c=e.label,i=e.onChange,u=e.options,s=e.screenReaderLabel,l=e.readOnly,f=e.value,p="wc-block-components-sort-select__select-".concat(n);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(a.a,{label:c,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:r,onChange:i,readOnly:l,value:f},u.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,function(e,t,n){"use strict";var r=n(11),o=n.n(r),a=n(32),c=n.n(a),i=n(33),u=n.n(i),s=n(19),l=n.n(s),f=n(34),p=n.n(f),d=n(35),m=n.n(d),b=n(24),h=n.n(b),g=n(6),v=n.n(g),y=n(3);n(155);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h()(e);if(t){var o=h()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return m()(this,n)}}t.a=function(e){var t=function(t){p()(r,t);var n=O(r);function r(){var e;return c()(this,r),e=n.call(this),v()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),v()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),v()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(y.createRef)(),e}return u()(r,[{key:"render",value:function(){return React.createElement(y.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),React.createElement(e,o()({},this.props,{scrollToTop:this.scrollToTop})))}}]),r}(y.Component);return t.displayName="withScrollToTop",t}},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(6),o=n.n(r),a=n(12),c=n.n(a),i=n(3);n(5);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,a=c()(e,["srcElement","size"]);return Object(i.isValidElement)(t)&&Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},a))}},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t){var n=[];return Object.keys(e).forEach((function(r){if(void 0!==t[r])switch(e[r].type){case"boolean":n[r]="false"!==t[r]&&!1!==t[r];break;case"number":n[r]=parseInt(t[r],10);break;case"array":case"object":n[r]=JSON.parse(t[r]);break;default:n[r]=t[r]}else n[r]=e[r].default})),n}},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){},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(7),a=n(4),c=n.n(a),i=n(1),u=n(79),s=n(10),l=n(29);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}var m=n(64),b=n(14);function h(e,t){return!t||"object"!==Object(m.a)(t)&&"function"!=typeof t?Object(b.a)(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}var O=n(27),j=n(48),w=n(50),k=n(82),E=n.n(k),_=n(21),S=n(26),R=function(){return"rtl"===document.documentElement.dir};function x(e,t,n,r){var o=t.width;"left"===n&&R()?n="right":"right"===n&&R()&&(n="left");var a,c=Math.round(e.left+e.width/2),i={popoverLeft:c,contentWidth:(c-o/2>0?o/2:c)+(c+o/2>window.innerWidth?window.innerWidth-c:o/2)},u="middle"===r?e.left:c,s={popoverLeft:u,contentWidth:u-o>0?o:u},l="middle"===r?e.right:c,f={popoverLeft:l,contentWidth:l+o>window.innerWidth?window.innerWidth-l:o},p=null;if("center"===n&&i.contentWidth===o)a="center";else if("left"===n&&s.contentWidth===o)a="left";else if("right"===n&&f.contentWidth===o)a="right";else{var d="left"===(a=s.contentWidth>f.contentWidth?"left":"right")?s.contentWidth:f.contentWidth;p=d!==o?d:null}return{xAxis:a,popoverLeft:"center"===a?i.popoverLeft:"left"===a?s.popoverLeft:f.popoverLeft,contentWidth:p}}function C(e,t,n){var r,o=t.height,a=e.top+e.height/2,c={popoverTop:a,contentHeight:(a-o/2>0?o/2:a)+(a+o/2>window.innerHeight?window.innerHeight-a:o/2)},i={popoverTop:e.top,contentHeight:e.top-10-o>0?o:e.top-10},u={popoverTop:e.bottom,contentHeight:e.bottom+10+o>window.innerHeight?window.innerHeight-10-e.bottom:o},s=null;if("middle"===n&&c.contentHeight===o)r="middle";else if("top"===n&&i.contentHeight===o)r="top";else if("bottom"===n&&u.contentHeight===o)r="bottom";else{var l="top"===(r=i.contentHeight>u.contentHeight?"top":"bottom")?i.contentHeight:u.contentHeight;s=l!==o?l:null}return{yAxis:r,popoverTop:"middle"===r?c.popoverTop:"top"===r?i.popoverTop:u.popoverTop,contentHeight:s}}var N=n(36),P=Object(r.createContext)({focusHistory:[]}),T=P.Provider,I=P.Consumer;T.displayName="FocusReturnProvider",I.displayName="FocusReturnConsumer";r.Component;var A=Object(_.createHigherOrderComponent)((function e(t){if((a=t)instanceof r.Component||"function"==typeof a){var n=t;return e({})(n)}var a,c=t.onFocusReturn,i=void 0===c?o.stubTrue:c;return function(e){var t=function(t){function n(){var e;return f(this,n),(e=h(this,g(n).apply(this,arguments))).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return y(n,t),d(n,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,a=[].concat(Object(N.a)(o.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(N.a)(n)))),[e]);r=a.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(r.createElement)(e,this.props.childProps))}}]),n}(r.Component);return function(e){return Object(r.createElement)(I,null,(function(n){return Object(r.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn"),D=Object(_.createHigherOrderComponent)((function(e){return function(t){function n(){var e;return f(this,n),(e=h(this,g(n).apply(this,arguments))).focusContainRef=Object(r.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(b.a)(e)),e}return y(n,t),d(n,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===w.TAB){var t=j.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(r.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(r.createElement)(e,this.props))}}]),n}(r.Component)}),"withConstrainedTabbing"),F=["button","submit"];var L=Object(_.createHigherOrderComponent)((function(e){return function(t){function n(){var e;return f(this,n),(e=h(this,g(n).apply(this,arguments))).bindNode=e.bindNode.bind(Object(b.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(b.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(b.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(b.a)(e)),e}return y(n,t),d(n,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(o.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(o.includes)(F,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(r.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(r.createElement)(e,Object(s.a)({ref:this.bindNode},this.props)))}}]),n}(r.Component)}),"withFocusOutside")(function(e){function t(){return f(this,t),h(this,g(t).apply(this,arguments))}return y(t,e),d(t,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),t}(r.Component));var M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,o=e.className,a=void 0===o?"lockscroll":o,c=0,i=0;function u(e){var t=n.scrollingElement||n.body;e&&(i=t.scrollTop);var r=e?"add":"remove";t.classList[r](a),n.documentElement.classList[r](a),e||(t.scrollTop=i)}function s(){0===c&&u(!0),++c}function l(){1===c&&u(!1),--c}return function(e){function t(){return f(this,t),h(this,g(t).apply(this,arguments))}return y(t,e),d(t,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),t}(r.Component)}();function V(e){e.stopPropagation()}var B=Object(r.forwardRef)((function(e,t){var n=e.children,o=Object(l.a)(e,["children"]);return Object(r.createElement)("div",Object(s.a)({},o,{ref:t,onMouseDown:V}),n)})),z=Object(r.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),q=z.Provider,U=z.Consumer,H=(r.Component,0);function W(e){var t=e.name,n=e.children,a=e.registerFill,c=e.unregisterFill,i=function(e){var t=Object(r.useContext)(z),n=t.getSlot,o=t.subscribe,a=Object(r.useState)(n(e)),c=Object(O.a)(a,2),i=c[0],u=c[1];return Object(r.useEffect)((function(){return u(n(e)),o((function(){u(n(e))}))}),[e]),i}(t),u=Object(r.useRef)({name:t,children:n});return u.current.occurrence||(u.current.occurrence=++H),Object(r.useLayoutEffect)((function(){return a(t,u.current),function(){return c(t,u.current)}}),[]),Object(r.useLayoutEffect)((function(){u.current.children=n,i&&!i.props.bubblesVirtually&&i.forceUpdate()}),[n]),Object(r.useLayoutEffect)((function(){t!==u.current.name&&(c(u.current.name,u.current),u.current.name=t,a(t,u.current))}),[t]),i&&i.node&&i.props.bubblesVirtually?(Object(o.isFunction)(n)&&(n=n(i.props.fillProps)),Object(r.createPortal)(n,i.node)):null}var K=function(e){return Object(r.createElement)(U,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(r.createElement)(W,Object(s.a)({},e,{registerFill:n,unregisterFill:o}))}))},Q=function(e){function t(){var e;return f(this,t),(e=h(this,g(t).apply(this,arguments))).bindNode=e.bindNode.bind(Object(b.a)(e)),e}return y(t,e),d(t,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){(0,this.props.unregisterSlot)(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,a=e.bubblesVirtually,c=void 0!==a&&a,i=e.fillProps,u=void 0===i?{}:i,s=e.getFills,l=e.className;if(c)return Object(r.createElement)("div",{ref:this.bindNode,className:l});var f=Object(o.map)(s(n,this),(function(e){var t=e.occurrence,n=Object(o.isFunction)(e.children)?e.children(u):e.children;return r.Children.map(n,(function(e,n){if(!e||Object(o.isString)(e))return e;var a="".concat(t,"---").concat(e.key||n);return Object(r.cloneElement)(e,{key:a})}))})).filter(Object(o.negate)(r.isEmptyElement));return Object(r.createElement)(r.Fragment,null,Object(o.isFunction)(t)?t(f):f)}}]),t}(r.Component),Y=function(e){return Object(r.createElement)(U,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,a=t.getFills;return Object(r.createElement)(Q,Object(s.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:a}))}))},G=n(46);var $=function(e){var t=e.type,n=e.options,r=void 0===n?{}:n,o=e.children;if("appear"===t){var a,i=r.origin,u=(void 0===i?"top":i).split(" "),s=Object(O.a)(u,2),l=s[0],f=s[1],p=void 0===f?"center":f;return o({className:c()("components-animate__appear",(a={},Object(G.a)(a,"is-from-"+p,"center"!==p),Object(G.a)(a,"is-from-"+l,"middle"!==l),a))})}if("slide-in"===t){var d=r.origin,m=void 0===d?"left":d;return o({className:c()("components-animate__slide-in","is-from-"+m)})}return o("loading"===t?{className:c()("components-animate__loading")}:{})},Z=D(A((function(e){return e.children})));function J(e,t){var n=window.getComputedStyle(t),r=n.paddingTop,o=n.paddingBottom,a=n.paddingLeft,c=n.paddingRight,i=r?parseInt(r,10):0,u=o?parseInt(o,10):0,s=a?parseInt(a,10):0,l=c?parseInt(c,10):0;return{x:e.left+s,y:e.top+i,width:e.width-s-l,height:e.height-i-u,left:e.left+s,right:e.right-l,top:e.top+i,bottom:e.bottom-u}}function X(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function te(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var ne=function(e){var t=e.headerTitle,n=e.onClose,o=e.onKeyDown,a=e.children,i=e.className,u=e.noArrow,f=void 0!==u&&u,p=e.position,d=void 0===p?"top":p,m=(e.range,e.focusOnMount),b=void 0===m?"firstElement":m,h=e.anchorRef,g=e.shouldAnchorIncludePadding,v=e.anchorVerticalBuffer,y=e.anchorHorizontalBuffer,k=e.anchorRect,R=e.getAnchorRect,N=e.expandOnMobile,P=e.animate,T=void 0===P||P,I=e.onClickOutside,A=e.onFocusOutside,D=Object(l.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorVerticalBuffer","anchorHorizontalBuffer","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside"]),F=Object(r.useRef)(null),V=Object(r.useRef)(null),z=Object(r.useRef)(),q=Object(r.useRef)(),H=Object(_.useViewportMatch)("medium","<"),W=Object(r.useState)(),Q=Object(O.a)(W,2),Y=Q[0],G=Q[1],ne=N&&H;f=ne||f,Object(r.useEffect)((function(){var e=z.current,t=V.current;if(ne)return te(e,"is-without-arrow",f),X(e,"data-x-axis"),X(e,"data-y-axis"),ee(e,"top"),ee(e,"left"),ee(t,"maxHeight"),void ee(t,"maxWidth");var n=function(){var n=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!r)return;if(r instanceof window.Range)return Object(j.getRectangleFromRange)(r);var a=r.getBoundingClientRect();return o?a:J(a,r)}if(e.current){var c=e.current.parentNode,i=c.getBoundingClientRect();return o?i:J(i,c)}}(F,k,R,h,g);if(n){n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:e.left-n,y:e.top-t,width:e.width+2*n,height:e.height+2*t,left:e.left-n,right:e.right+n,top:e.top-t,bottom:e.bottom+t}}(n,v,y),q.current||(q.current=t.getBoundingClientRect());var r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=n.split(" "),o=Object(O.a)(r,2),a=o[0],c=o[1],i=void 0===c?"center":c,u=C(e,t,a),s=x(e,t,i,u.yAxis);return Object(S.a)({},s,u)}(n,q.current,d),o=r.popoverTop,a=r.popoverLeft,c=r.xAxis,i=r.yAxis,u=r.contentHeight,s=r.contentWidth;te(e,"is-without-arrow",f||"center"===c&&"middle"===i),X(e,"data-x-axis",c),X(e,"data-y-axis",i),ee(e,"top","number"==typeof o?o+"px":""),ee(e,"left","number"==typeof a?a+"px":""),ee(t,"maxHeight","number"==typeof u?u+"px":""),ee(t,"maxWidth","number"==typeof s?s+"px":"");G(({left:"right",right:"left"}[c]||"center")+" "+({top:"bottom",bottom:"top"}[i]||"middle"))}},r=window.setTimeout(n),o=window.setInterval(n,500);return window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),function(){window.clearTimeout(r),window.clearInterval(o),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}}),[ne,k,R,h,g,v,y,d]),function(e,t){Object(r.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=j.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(b,V);var re=function(e){e.keyCode===w.ESCAPE&&n&&(e.stopPropagation(),n()),o&&o(e)};var oe=Object(r.createElement)(L,{onFocusOutside:function(e){if(A)A(e);else if(I){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),E()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),I(t)}else n&&n()}},Object(r.createElement)($,{type:T&&Y?"appear":null,options:{origin:Y}},(function(e){var o=e.className;return Object(r.createElement)(B,Object(s.a)({className:c()("components-popover",i,o,{"is-expanded":ne,"is-without-arrow":f})},D,{onKeyDown:re,ref:z}),ne&&Object(r.createElement)("div",{className:"components-popover__header"},Object(r.createElement)("span",{className:"components-popover__header-title"},t),Object(r.createElement)(ie,{className:"components-popover__close",icon:"no-alt",onClick:n})),Object(r.createElement)("div",{ref:V,className:"components-popover__content",tabIndex:"-1"},a))})));return b&&(oe=Object(r.createElement)(Z,null,oe)),Object(r.createElement)(U,null,(function(e){var t=e.getSlot;return t&&t("Popover")&&(oe=Object(r.createElement)(K,{name:"Popover"},oe)),Object(r.createElement)("span",{ref:F},oe,H&&N&&Object(r.createElement)(M,null))}))};ne.Slot=function(){return Object(r.createElement)(Y,{bubblesVirtually:!0,name:"Popover"})};var re=ne;var oe=function(e){var t,n,a=e.shortcut,c=e.className;return a?(Object(o.isString)(a)&&(t=a),Object(o.isObject)(a)&&(t=a.display,n=a.ariaLabel),Object(r.createElement)("span",{className:c,"aria-label":n},t)):null},ae=function(e){function t(){var e;return f(this,t),(e=h(this,g(t).apply(this,arguments))).delayedSetIsOver=Object(o.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return y(t,e),d(t,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===r.Children.count(n)){var o=r.Children.only(n);"function"==typeof o.props[e]&&o.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var a=Object(o.includes)(["focus","mouseenter"],r.type);a!==n.state.isOver&&(t?n.delayedSetIsOver(a):n.setState({isOver:a}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,o=e.text,a=e.shortcut;if(1!==r.Children.count(t))return t;var c=r.Children.only(t),i=this.state.isOver;return Object(r.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(r.concatChildren)(c.props.children,i&&Object(r.createElement)(re,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1},o,Object(r.createElement)(oe,{className:"components-tooltip__shortcut",shortcut:a})))})}}]),t}(r.Component),ce=n(77);var ie=Object(r.forwardRef)((function(e,t){var n=e.icon,a=e.children,i=e.label,f=e.className,p=e.tooltip,d=e.shortcut,m=e.labelPosition,b=e.size,h=Object(l.a)(e,["icon","children","label","className","tooltip","shortcut","labelPosition","size"]),g=c()("components-icon-button",f,{"has-text":a}),v=p||i,y=!h.disabled&&(p||d||!!i&&(!a||Object(o.isArray)(a)&&!a.length)&&!1!==p),O=Object(r.createElement)(u.a,Object(s.a)({"aria-label":i},h,{className:g,ref:t}),Object(r.createElement)(ce.a,{icon:n,size:b}),a);return y&&(O=Object(r.createElement)(ae,{text:v,shortcut:d,position:m},O)),O}));t.a=function(e){var t=e.className,n=e.status,a=e.children,s=e.onRemove,l=void 0===s?o.noop:s,f=e.isDismissible,p=void 0===f||f,d=e.actions,m=void 0===d?[]:d,b=e.__unstableHTML,h=c()(t,"components-notice","is-"+n,{"is-dismissible":p});return b&&(a=Object(r.createElement)(r.RawHTML,null,a)),Object(r.createElement)("div",{className:h},Object(r.createElement)("div",{className:"components-notice__content"},a,m.map((function(e,t){var n=e.className,o=e.label,a=e.noDefaultClasses,i=void 0!==a&&a,s=e.onClick,l=e.url;return Object(r.createElement)(u.a,{key:t,href:l,isDefault:!i&&!l,isLink:!i&&!!l,onClick:l?void 0:s,className:c()("components-notice__action",n)},o)}))),p&&Object(r.createElement)(ie,{className:"components-notice__dismiss",icon:"no-alt",label:Object(i.__)("Dismiss this notice"),onClick:l,tooltip:!1}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Be}));var r=n(37),o=n(11),a=n.n(o),c=n(12),i=n.n(c),u=(n(5),n(4)),s=n.n(u),l=n(1),f=n(0),p=n(8),d=n.n(p),m=n(13),b=n(78),h=n(16),g=n(15),v=n(65),y=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},O=function(e){var t=Object(m.useDispatch)(h.CART_STORE_KEY).addItemToCart,n=Object(b.a)(),r=n.cartItems,o=n.cartIsLoading,a=Object(v.a)(),c=a.addErrorNotice,i=a.removeNotice,u=Object(f.useState)(!1),s=d()(u,2),l=s[0],p=s[1],O=Object(f.useRef)(y(r,e));return Object(f.useEffect)((function(){var t=y(r,e);t!==O.current&&(O.current=t)}),[r,e]),{cartQuantity:Number.isFinite(O.current)?O.current:0,addingToCart:l,cartIsLoading:o,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;p(!0),t(e,n).then((function(e){!0===e&&i("add-to-cart")})).catch((function(e){c(Object(g.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){p(!1)}))}}},j=n(185),w=n(17),k=(n(140),function(e){var t=e.product,n=Object(f.useRef)(!0),r=t.id,o=t.permalink,c=t.add_to_cart,i=t.has_options,u=t.is_purchasable,p=t.is_in_stock,d=O(r),m=d.cartQuantity,b=d.addingToCart,h=d.addToCart;Object(f.useEffect)((function(){n.current?n.current=!1:Object(j.a)()}),[m]);var v=Number.isFinite(m)&&m>0,y=!i&&u&&p,w=Object(g.decodeEntities)((null==c?void 0:c.description)||""),k=v?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",m,"woo-gutenberg-products-block"),m):Object(g.decodeEntities)((null==c?void 0:c.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),E=y?"button":"a",_={};return y?_.onClick=function(){h()}:(_.href=o,_.rel="nofollow"),React.createElement(E,a()({"aria-label":w,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:b,added:v}),disabled:b},_),k)}),E=function(){return React.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})},_=function(e){var t=e.className,n=i()(e,["className"]),r=Object(w.useInnerBlockLayoutContext)().parentClassName,o=Object(w.useProductDataContext)(),a=n.product||o.product;return React.createElement("div",{className:s()(t,"wp-block-button","wc-block-components-product-button","".concat(r,"__product-add-to-cart"))},a?React.createElement(k,{product:a}):React.createElement(E,null))},S=n(21),R=n(143),x=function(e){return function(t){return function(n){var r=Object(R.a)(e,n);return React.createElement(t,a()({},n,r))}}},C=n(6),N=n.n(C),P=n(9),T=n(28),I=(n(141),function(e){var t=e.className,n=e.align,r=i()(e,["className","align"]),o=Object(w.useInnerBlockLayoutContext)().parentClassName,a=Object(w.useProductDataContext)(),c=r.product||a.product;if(!c||!c.on_sale)return null;var u="string"==typeof n?"wc-block-components-product-sale-badge--align".concat(n):"";return React.createElement("div",{className:s()("wc-block-components-product-sale-badge",t,u,"".concat(o,"__product-onsale"))},React.createElement(T.a,{label:Object(l.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(l.__)("Product on sale","woo-gutenberg-products-block")}))});n(142);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){N()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=function(){return React.createElement("img",{src:P.p,alt:""})},L=function(e){var t=e.image,n=e.onLoad,r=e.loaded,o=e.showFullSize,a=t||{},c=a.thumbnail,i=a.src,u=a.srcset,s=a.sizes,l={alt:a.alt,onLoad:n,hidden:!r,src:c};return o&&(l=D(D({},l),{},{src:i,srcSet:u,sizes:s})),React.createElement(React.Fragment,null,React.createElement("img",l),!r&&React.createElement(F,null))},M=function(e){var t=e.className,n=e.imageSizing,r=void 0===n?"full-size":n,o=e.productLink,a=void 0===o||o,c=e.showSaleBadge,u=e.saleBadgeAlign,l=void 0===u?"right":u,p=i()(e,["className","imageSizing","productLink","showSaleBadge","saleBadgeAlign"]),m=Object(w.useInnerBlockLayoutContext)().parentClassName,b=Object(w.useProductDataContext)(),h=p.product||b.product,g=Object(f.useState)(!1),v=d()(g,2),y=v[0],O=v[1];if(!h)return React.createElement("div",{className:s()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder","".concat(m,"__product-image"))},React.createElement(F,null));var j=(null==h?void 0:h.images)&&h.images.length?h.images[0]:null;return React.createElement("div",{className:s()(t,"wc-block-components-product-image","".concat(m,"__product-image"))},a?React.createElement("a",{href:h.permalink,rel:"nofollow"},!!c&&React.createElement(I,{align:l,product:h}),React.createElement(L,{image:j,onLoad:function(){return O(!0)},loaded:y,showFullSize:"cropped"!==r})):React.createElement(React.Fragment,null,!!c&&React.createElement(I,{align:l,product:h}),React.createElement(L,{image:j,onLoad:function(){return O(!0)},loaded:y,showFullSize:"cropped"!==r})))},V={productLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"}},B=Object(S.compose)(x(V))(M),z=n(31),q=n(119),U=(n(144),function(e){return e.price_range&&e.price_range.min_amount&&e.price_range.max_amount}),H=function(e){var t=e.currency,n=e.minAmount,r=e.maxAmount,o=Object(w.useInnerBlockLayoutContext)().parentClassName;return React.createElement("span",{className:s()("wc-block-components-product-price__value","".concat(o,"__product-price__value"))},React.createElement(z.a,{currency:t,value:n})," — ",React.createElement(z.a,{currency:t,value:r}))},W=function(e){var t=e.currency,n=e.price,r=e.regularPrice,o=Object(w.useInnerBlockLayoutContext)().parentClassName;return React.createElement(React.Fragment,null,r!==n&&React.createElement("del",{className:s()("wc-block-components-product-price__regular","".concat(o,"__product-price__regular"))},React.createElement(z.a,{currency:t,value:r})),React.createElement("span",{className:s()("wc-block-components-product-price__value","".concat(o,"__product-price__value"))},React.createElement(z.a,{currency:t,value:n})))},K=function(e){var t=e.className,n=i()(e,["className"]),r=Object(w.useInnerBlockLayoutContext)().parentClassName,o=Object(w.useProductDataContext)(),a=n.product||o.product;if(!a)return React.createElement("div",{className:s()(t,"price","wc-block-components-product-price","".concat(r,"__product-price"))});var c=a.prices||{},u=Object(q.c)(c);return React.createElement("div",{className:s()(t,"price","wc-block-components-product-price","".concat(r,"__product-price"))},U(c)?React.createElement(H,{currency:u,minAmount:c.price_range.min_amount,maxAmount:c.price_range.max_amount}):React.createElement(W,{currency:u,price:c.price,regularPrice:c.regular_price}))},Q=(n(145),function(e){var t=parseFloat((null==e?void 0:e.average_rating)||0);return Number.isFinite(t)&&t>0?t:0}),Y=function(e){var t=e.className,n=i()(e,["className"]),r=Object(w.useInnerBlockLayoutContext)().parentClassName,o=Object(w.useProductDataContext)(),a=n.product||o.product,c=Q(a);if(!c)return null;var u={width:c/5*100+"%"},f=Object(l.sprintf)(Object(l.__)("Rated %f out of 5","woo-gutenberg-products-block"),c);return React.createElement("div",{className:s()(t,"star-rating","wc-block-components-product-rating","".concat(r,"__product-rating"))},React.createElement("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":f},React.createElement("span",{style:u},f)))},G=n(84),$=n(2),Z=(n(146),function(e){var t=e.className,n=i()(e,["className"]),r=Object(w.useInnerBlockLayoutContext)().parentClassName,o=(Object(w.useProductDataContext)()||n).product;if(!o)return React.createElement("div",{className:s()(t,"wc-block-components-product-summary")});var a=o.short_description?o.short_description:o.description;if(!a)return null;var c=Object($.getSetting)("wordCountType","words");return React.createElement(G.a,{className:s()(t,"wc-block-components-product-summary","".concat(r,"__product-summary")),source:a,maxLength:150,countType:c})}),J=(n(147),function(e){var t=e.className,n=e.headingLevel,r=void 0===n?2:n,o=e.productLink,a=void 0===o||o,c=i()(e,["className","headingLevel","productLink"]),u=Object(w.useInnerBlockLayoutContext)().parentClassName,l=Object(w.useProductDataContext)(),f=c.product||l.product,p="h".concat(r);if(!f)return React.createElement(p,{className:s()(t,"wc-block-components-product-title","".concat(u,"__product-title"))});var d=Object(g.decodeEntities)(f.name);return React.createElement(p,{className:s()(t,"wc-block-components-product-title","".concat(u,"__product-title"))},a?React.createElement("a",{href:f.permalink,rel:"nofollow"},d):d)}),X={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0}},ee=Object(S.compose)(x(X))(J),te=(n(148),function(e){var t=e.className,n=i()(e,["className"]),r=Object(w.useInnerBlockLayoutContext)().parentClassName,o=Object(w.useProductDataContext)(),a=(n.product||o.product||{}).sku||"";return a?React.createElement("div",{className:s()(t,"wc-block-components-product-sku","".concat(r,"__product-sku"))},Object(l.__)("SKU:","woo-gutenberg-products-block")," ",React.createElement("strong",null,a)):null}),ne=n(7),re=(n(149),function(e){var t=e.className,n=i()(e,["className"]),r=Object(w.useInnerBlockLayoutContext)().parentClassName,o=(Object(w.useProductDataContext)()||n||{}).product;return Object(ne.isEmpty)(o)||Object(ne.isEmpty)(o.categories)?null:React.createElement("div",{className:s()(t,"wc-block-components-product-category-list","".concat(r,"__product-category-list"))},Object(l.__)("Categories:","woo-gutenberg-products-block")," ",React.createElement("ul",null,Object.values(o.categories).map((function(e){var t=e.name,n=e.link,r=e.slug;return React.createElement("li",{key:"category-list-item-".concat(r)},React.createElement("a",{href:n},t))}))))}),oe=(n(150),function(e){var t=e.className,n=i()(e,["className"]),r=Object(w.useInnerBlockLayoutContext)().parentClassName,o=(Object(w.useProductDataContext)()||n||{}).product;return Object(ne.isEmpty)(o)||Object(ne.isEmpty)(o.tags)?null:React.createElement("div",{className:s()(t,"wc-block-components-product-tag-list","".concat(r,"__product-tag-list"))},Object(l.__)("Tags:","woo-gutenberg-products-block")," ",React.createElement("ul",null,Object.values(o.tags).map((function(e){var t=e.name,n=e.link,r=e.slug;return React.createElement("li",{key:"tag-list-item-".concat(r)},React.createElement("a",{href:n},t))}))))}),ae=(n(151),function(e){return Object(l.sprintf)(Object(l.__)("%d left in stock","woo-gutenberg-products-block"),e)}),ce=function(e,t){return t?Object(l.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(l.__)("In Stock","woo-gutenberg-products-block"):Object(l.__)("Out of Stock","woo-gutenberg-products-block")},ie=function(e){var t=e.className,n=i()(e,["className"]),r=Object(w.useInnerBlockLayoutContext)().parentClassName,o=Object(w.useProductDataContext)(),a=n.product||o.product||{};if(Object(ne.isEmpty)(a)||!a.is_purchasable)return null;var c=!!a.is_in_stock,u=a.low_stock_remaining,l=a.is_on_backorder;return React.createElement("div",{className:s()(t,"wc-block-components-product-stock-indicator","".concat(r,"__stock-indicator"),{"wc-block-components-product-stock-indicator--in-stock":c,"wc-block-components-product-stock-indicator--out-of-stock":!c,"wc-block-components-product-stock-indicator--low-stock":!!u,"wc-block-components-product-stock-indicator--available-on-backorder":!!l})},u?ae(u):ce(c,l))},ue=Object(f.createContext)({product:{},productId:0,variationId:0,variationData:{},cartItemData:{},quantity:1,minQuantity:1,maxQuantity:99,quantityInCart:0,setQuantity:function(e){},setVariationId:function(e){},setVariationData:function(e){},setCartItemData:function(e){},showFormElements:!1,formInitialized:!1,formDisabled:!0,formSubmitting:!1,onChange:function(){},onSubmit:function(){},onSuccess:function(){},onFail:function(){}}),se=function(){return Object(f.useContext)(ue)},le=function(e){var t=e.children,n=e.product,r=e.showFormElements,o=n.id||0,a=Object(f.useState)(0),c=d()(a,2),i=c[0],u=c[1],s=Object(f.useState)({}),l=d()(s,2),p=l[0],m=l[1],b=Object(f.useState)({}),h=d()(b,2),g=h[0],v=h[1],y=Object(f.useState)(1),w=d()(y,2),k=w[0],E=w[1],_=O(o),S=_.addToCart,R=_.addingToCart,x=_.cartQuantity,C=_.cartIsLoading;!function(e){var t=Object(f.useRef)(!0);Object(f.useEffect)((function(){t.current?t.current=!1:Object(j.a)()}),[e])}(x);var N=!C&&o>0,P=R||!N||!fe(n),T=Object(f.useCallback)((function(){S(k)}),[S,k]),I=Object(f.useCallback)((function(){}),[]),A=Object(f.useCallback)((function(){}),[]),D=Object(f.useCallback)((function(){}),[]),F={product:n,productId:o,variationId:i,variationData:p,cartItemData:g,quantity:k,minQuantity:1,maxQuantity:n.quantity_limit||99,quantityInCart:x,setQuantity:E,setVariationId:u,setVariationData:m,setCartItemData:v,showFormElements:r,formInitialized:N,formDisabled:P,formSubmitting:R,onChange:I,onSubmit:T,onSuccess:A,onFail:D};return React.createElement(ue.Provider,{value:F},t)},fe=function(e){var t=e.is_purchasable;return void 0!==t&&t},pe=(n(152),n(79)),de=(n(153),function(e){var t=e.className,n=e.showSpinner,r=void 0!==n&&n,o=e.children,c=i()(e,["className","showSpinner","children"]),u=s()("wc-block-components-button",t,{"wc-block-components-button--loading":r});return React.createElement(pe.a,a()({className:u},c),r&&React.createElement("span",{className:"wc-block-components-button__spinner","aria-hidden":"true"}),React.createElement("span",{className:"wc-block-components-button__text"},o))}),me=n(139),be=n(186),he=function(e){var t=e.className,n=e.href,r=e.text;return React.createElement(de,{className:t,href:n,rel:"nofollow"},r)},ge=function(e){var t=e.className,n=e.quantityInCart,r=e.loading,o=e.disabled,a=e.onClick,c=Object(f.useState)(!1),i=d()(c,2),u=i[0],s=i[1];return React.createElement(de,{className:t,disabled:o,showSpinner:r,onClick:function(){a(),s(!0)}},n>0?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",n,"woo-gutenberg-products-block"),n):Object(l.__)("Add to cart","woo-gutenberg-products-block"),u&&React.createElement(me.a,{srcElement:be.a,alt:Object(l.__)("Done","woo-gutenberg-products-block")}))},ve=function(){var e=se(),t=e.showFormElements,n=e.product,r=e.quantityInCart,o=e.formDisabled,a=e.formSubmitting,c=e.onSubmit,i=n.is_purchasable,u=void 0===i||i,s=n.has_options,f=n.add_to_cart,p=void 0===f?{url:"",text:""}:f;return!t&&s||!u?React.createElement(he,{className:"wc-block-components-product-add-to-cart-button",href:p.url,text:p.text||Object(l.__)("View Product","woo-gutenberg-products-block")}):React.createElement(ge,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:r,disabled:o,loading:a,onClick:c})},ye=function(e){var t=e.disabled,n=e.min,r=e.max,o=e.value,a=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:n,max:r,hidden:1===r,disabled:t,onChange:function(e){a(e.target.value)}})},Oe=function(e){var t=e.reason,n=void 0===t?Object(l.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},n)},je=function(){var e=se(),t=e.product,n=e.quantity,r=e.minQuantity,o=e.maxQuantity,a=e.setQuantity,c=e.formDisabled;return t.id&&!t.is_purchasable?React.createElement(Oe,null):t.id&&!t.is_in_stock?React.createElement(Oe,{reason:Object(l.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(ye,{value:n,min:r,max:o,disabled:c,onChange:a}),React.createElement(ve,null))},we=(n(154),n(56)),ke=n.n(we),Ee=n(95),_e={value:"",label:Object(l.__)("Select an option","woo-gutenberg-products-block")},Se=function(e){var t=e.attributeName,n=e.options,r=void 0===n?[]:n,o=e.selected,a=void 0===o?"":o,c=e.onChange,i=void 0===c?function(){}:c;return React.createElement(Ee.SelectControl,{className:"wc-block-components-product-add-to-cart-attribute-picker__select",label:Object(g.decodeEntities)(t),value:a||"",options:[_e].concat(ke()(r)),onChange:i})},Re=function(e){var t=e.selectedAttributes,n=e.variationAttributes,r=e.attributeNames;return Object.keys(n).filter((function(e){return r.every((function(r){var o=t[r]||"",a=n[e][r];return""===o||(null===a||a===o)}))}))};function xe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(n),!0).forEach((function(t){N()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ne=function(e){var t=e.attributes,n=e.variationAttributes,r=Object(f.useState)(0),o=d()(r,2),a=o[0],c=o[1],i=Object(f.useState)([]),u=d()(i,2),s=u[0],l=u[1],p=Object.keys(t),m=Object.values(s).filter(Boolean).length>0,b=Object.values(s).filter((function(e){return""!==e})).length===p.length,h=Object(f.useMemo)((function(){var e=[];return p.forEach((function(r){var o=t[r],a=p.filter((function(e){return e!==r})),c=m?Re({selectedAttributes:s,variationAttributes:n,attributeNames:a}):null,i=null!==c?c.map((function(e){return n[e][r]})):null;e[r]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var n=e.name,r=e.slug;return null===t||t.includes(null)||t.includes(r)?{value:r,label:n}:null})).filter(Boolean)}(o.terms,i)})),e}),[t,n,p,s,m]);return Object(f.useEffect)((function(){if(b){var e=Re({selectedAttributes:s,variationAttributes:n,attributeNames:p});c(e[0]||0)}else c(0)}),[s,n,p,b]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},p.map((function(e){return React.createElement(Se,{key:e,attributeName:e,options:h[e],selected:s[e],onChange:function(t){l(Ce(Ce({},s),{},N()({},e,t)))}})})),React.createElement("p",null,"Matched variation ID: ",a))},Pe=function(e){var t=e.product,n=t.attributes,r=void 0===n?{}:n,o=t.variations,a=void 0===o?[]:o,c=function(e){return e?Object(ne.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):[]}(r),i=function(e){if(!e)return{};var t={};return e.forEach((function(e){var n=e.id,r=e.attributes;t[n]=r.reduce((function(e,t){var n=t.name,r=t.value;return e[n]=r,e}),[])})),t}(a);return 0===Object.keys(c).length||0===i.length?null:React.createElement(Ne,{attributes:c,variationAttributes:i})},Te=function(){var e=se(),t=e.product,n=e.quantity,r=e.minQuantity,o=e.maxQuantity,a=e.setQuantity,c=e.formDisabled;return t.id&&!t.is_purchasable?React.createElement(Oe,null):t.id&&!t.is_in_stock?React.createElement(Oe,{reason:Object(l.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Pe,{product:t}),React.createElement(ye,{value:n,min:r,max:o,disabled:c,onChange:a}),React.createElement(ve,null))},Ie=function(){return React.createElement(ve,null)},Ae=function(){return React.createElement(Ee.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},De=function(){return React.createElement(Ae,null)},Fe=function(e){var t=e.productType;return"variable"===t?React.createElement(Te,null):"grouped"===t?React.createElement(De,null):"external"===t?React.createElement(Ie,null):"simple"===t||"variation"===t?React.createElement(je,null):null},Le=function(e){var t=e.className,n=e.showFormElements,r=i()(e,["className","showFormElements"]),o=Object(w.useProductDataContext)(),a=r.product||o.product||{},c=s()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(ne.isEmpty)(a)});return React.createElement(le,{product:a,showFormElements:n},React.createElement("div",{className:c},React.createElement(React.Fragment,null,n?React.createElement(Fe,{productType:a.type||"simple"}):React.createElement(ve,null))))},Me={showFormElements:{type:"boolean",default:!1}},Ve=Object(S.compose)(x(Me))(Le);Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:K}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:B}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:ee}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Y}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:_}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Z}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:I}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:te}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:re}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:oe}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:ie}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Ve});var Be=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),o=function(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,n.current]),n.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=window.Event||null,o=function(){if("function"==typeof r){var e=new r("wc_fragment_refresh",{bubbles:!0,cancelable:!0});document.body.dispatchEvent(e)}else{var t=document.createEvent("Event");t.initEvent("wc_fragment_refresh",!0,!0),document.body.dispatchEvent(t)}}},function(e,t,n){"use strict";var r=n(72),o=React.createElement(r.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(120),o=n(112),a=n(102),c=n(32),i=n.n(c),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),m=n(24),b=n.n(m),h=n(3),g=(n(5),n(8)),v=n.n(g),y=n(0),O=n(22),j=n.n(O),w=n(12),k=n.n(w),E=n(6),_=n.n(E),S=n(1),R=n(7),x=n(4),C=n.n(x),N=n(28),P=(n(202),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,a=e.onPageChange,c=e.totalPages,i=function(e,t,n){if(n<=2)return{minIndex:null,maxIndex:null};var r=e-1,o=Math.max(Math.floor(t-r/2),2),a=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(a-t))),2),maxIndex:a}}(o,t,c),u=i.minIndex,s=i.maxIndex,l=n&&Boolean(1!==u),f=n&&Boolean(s!==c),p=n&&Boolean(u>3),d=n&&Boolean(s<c-2);l&&3===u&&(u-=1),f&&s===c-2&&(s+=1);var m=[];if(u&&s)for(var b=u;b<=s;b++)m.push(b);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(N.a,{screenReaderLabel:Object(S.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return a(t-1)},title:Object(S.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(N.a,{label:"<",screenReaderLabel:Object(S.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:C()("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:function(){return a(1)},disabled:1===t},React.createElement(N.a,{label:1,screenReaderLabel:Object(S.sprintf)(Object(S.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(S.__)("…","woo-gutenberg-products-block")),m.map((function(e){return React.createElement("button",{key:e,className:C()("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:function(){return a(e)},disabled:t===e},React.createElement(N.a,{label:e,screenReaderLabel:Object(S.sprintf)(Object(S.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(S.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:C()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===c,"wc-block-components-pagination__page--active":t===c}),onClick:function(){return a(c)},disabled:t===c},React.createElement(N.a,{label:c,screenReaderLabel:Object(S.sprintf)(Object(S.__)("Page %d","woo-gutenberg-products-block"),c)})),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return a(t+1)},title:Object(S.__)("Next page","woo-gutenberg-products-block"),disabled:t>=c},React.createElement(N.a,{label:">",screenReaderLabel:Object(S.__)("Next page","woo-gutenberg-products-block")})))});P.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var T=P,I=n(125),A=(n(201),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement(I.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:n,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:r,screenReaderLabel:Object(S.__)("Order products by","woo-gutenberg-products-block"),value:o})}),D=n(17),F=n(98),L=n(11),M=n.n(L),V=n(178),B=Object(F.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,a=Object(D.useInnerBlockLayoutContext)(),c=a.parentClassName,i=a.parentName,u=0===Object.keys(t).length,s=C()("".concat(c,"__product"),{"is-loading":u,"wc-block-layout--is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var a=Object(V.a)(t);return r.map((function(r,c){var i=v()(r,2),u=i[0],s=i[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=a[u];if(!p)return null;var d=n.id||0,m=["layout",u,c,o,d];return React.createElement(p,M()({key:m.join("_")},l,{children:f,product:n}))}))}}(i,t,o,r))})),z=n(97),q=n(107),U=n(16),H=n(13),W=n(39);function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Y=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(q.a)(Q(Q({},t),{},{query:e})),r=n.results,o=n.isLoading,a=function(e,t){var n=t.namespace,r=t.resourceName,o=t.resourceValues,a=void 0===o?[]:o,c=t.query,i=void 0===c?{}:c;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(W.a)(i),s=Object(W.a)(a),l=Object(H.useSelect)((function(t){var o=t(U.COLLECTIONS_STORE_KEY),a=[e,n,r,u,s];return{value:o.getCollectionHeader.apply(o,a),isLoading:o.hasFinishedResolution("getCollectionHeader",a)}}),[e,n,r,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}("x-wp-total",Q(Q({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(a,10),productsLoading:o}},G=n(184),$=n(127),Z=n(43),J=(n(200),n(139)),X=n(72),ee=React.createElement(X.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.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"})),te=function(){var e=Object(D.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(J.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:ee,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(S.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(S.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},ne=React.createElement(X.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.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"})),re=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(D.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(J.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:ne,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(S.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(S.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(S.__)("Reset Search","woo-gutenberg-products-block")))};function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){_()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ce=Object($.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,a=e.sortValue,c=e.scrollToTop,i=Object(z.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=r.columns,a=r.rows;return ae(ae({},function(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*a,page:n})}({attributes:t,sortValue:a,currentPage:n})),u=v()(i,1)[0],s=Y(u),l=s.products,f=s.totalProducts,p=s.productsLoading,d=Object(D.useInnerBlockLayoutContext)().parentClassName,m=function(e){e.order,e.orderby,e.page,e.per_page;return k()(e,["order","orderby","page","per_page"])}(u),b=Object(z.b)("attributes",[]),h=v()(b,2),g=h[0],O=h[1],w=Object(z.b)("min_price"),E=v()(w,2),_=E[0],x=E[1],N=Object(z.b)("max_price"),P=v()(N,2),I=P[0],F=P[1],L=Object(G.a)({totalQuery:m,totalProducts:f},(function(e){var t=e.totalQuery,n=e.totalProducts,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.totalQuery;return!Object(R.isEqual)(t,o)&&Number.isFinite(n)})),M="object"===j()(L)&&Object(R.isEqual)(m,L.totalQuery);Object(y.useEffect)((function(){M||(r(1),L&&function(e){Number.isFinite(e)&&(0===e?Object(Z.speak)(Object(S.__)("No products found","woo-gutenberg-products-block")):Object(Z.speak)(Object(S.sprintf)(Object(S._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(f))}),[u]);var V,q,U,H,W,K=t.contentVisibility,Q=t.columns*t.rows,$=!Number.isFinite(f)&&M?Math.ceil(L.totalProducts/Q):Math.ceil(f/Q),J=l.length?l:Array.from({length:Q}),X=0!==l.length||p,ee=g.length>0||Number.isFinite(_)||Number.isFinite(I);return React.createElement("div",{className:(V=t.columns,q=t.rows,U=t.alignButtons,H=t.align,W=void 0!==H?"align"+H:"",C()(d,W,"has-"+V+"-columns",{"has-multiple-rows":q>1,"has-aligned-buttons":U}))},K.orderBy&&X&&React.createElement(A,{onChange:o,value:a}),!X&&ee&&React.createElement(re,{resetCallback:function(){O([]),x(null),F(null)}}),!X&&!ee&&React.createElement(te,null),X&&React.createElement("ul",{className:"".concat(d,"__products")},J.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return React.createElement(B,{key:e.id||n,attributes:t,product:e})}))),$>1&&React.createElement(T,{currentPage:n,onPageChange:function(e){c({focusableSelector:"a, button"}),r(e)},totalPages:$}))})),ie=function(e){var t=e.attributes,n=Object(y.useState)(1),r=v()(n,2),o=r[0],a=r[1],c=Object(y.useState)(t.orderby),i=v()(c,2),u=i[0],s=i[1];Object(y.useEffect)((function(){s(t.orderby)}),[t.orderby]);return React.createElement(ce,{attributes:t,currentPage:o,onPageChange:function(e){a(e)},onSortChange:function(e){var t=e.target.value;s(t),a(1)},sortValue:u})},ue=n(9),se=React.createElement("img",{src:ue.A+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}});function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var fe=function(e){f()(n,e);var t=le(n);function n(){return i()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.urlParameterSuffix;return t.isPreview?se:React.createElement(D.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ie,{attributes:t,urlParameterSuffix:n}))}}]),n}(h.Component);Object(a.a)({selector:".wp-block-woocommerce-all-products",Block:Object(r.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(fe,e))})),getProps:function(e){return{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-settings', 'wc-shared-context', 'wp-a11y', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wc-shared-context', 'wp-a11y', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-wordcount'), 'version' => 'ee4ccfb4456fe1310edb596b7a39fa93');
|
build/all-products.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],u=t[1],s=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,s||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var u=r[i];0!==c[u]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={5:0},o=[];function a(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,a),r.l=!0,r.exports}a.m=e,a.c=n,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 n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));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 i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var l=u;return o.push([836,2,0,1]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},105:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(8),c=r.n(n),o=r(204),a=r(0);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s=function(){var e=Object(o.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,s=Object(a.useRef)(t);Object(a.useEffect)((function(){s.current=t}),[t]);var l=Object(a.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.map((function(t){return null!==e&&t.status!==e||n(t.id),!0}))},removeNotice:n}}),[n]),b=Object(a.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,u({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[r,c]);return u(u(u({notices:t},l),b),{},{setIsSuppressed:i})}},107:function(e,t){!function(){e.exports=this.wp.wordcount}()},129:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(39),c=r(35),o=r(202),a=r(33),i=r(6),u={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(o.b)(),r=t.isEditor,s=t.previewData,l=(null==s?void 0:s.previewCart)||{},b=e.shouldSelect,p=Object(c.useSelect)((function(e,t){var c=t.dispatch;if(!b)return u;if(r)return{cartCoupons:l.coupons,cartItems:l.items,cartItemsCount:l.items_count,cartItemsWeight:l.items_weight,cartNeedsPayment:l.needs_payment,cartNeedsShipping:l.needs_shipping,cartItemErrors:[],cartTotals:l.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:l.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==l?void 0:l.receiveCart)?l.receiveCart:function(){}};var o=e(n.CART_STORE_KEY),s=o.getCartData(),p=o.getCartErrors(),d=o.getCartTotals(),f=!o.hasFinishedResolution("getCartData"),g=o.areShippingRatesLoading(),m=c(n.CART_STORE_KEY).receiveCart,O=Object(i.mapValues)(s.shippingAddress,(function(e){return Object(a.decodeEntities)(e)}));return{cartCoupons:s.coupons,cartItems:s.items,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:d,cartIsLoading:f,cartErrors:p,shippingAddress:O,shippingRates:s.shippingRates,shippingRatesLoading:g,hasShippingAddress:!!O.country,receiveCart:m}}),[b]);return p}},130:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},133:function(e,t,r){"use strict";var n=r(23),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),u=r.n(i),s=r(44),l=r(40);r(481);t.a=function(e){var t=e.className,r=e.align,n=c()(e,["className","align"]),i=Object(l.useInnerBlockLayoutContext)().parentClassName,b=Object(l.useProductDataContext)(),p=n.product||b.product;if(!p||!p.on_sale)return null;var d="string"==typeof r?"wc-block-components-product-sale-badge--align".concat(r):"";return Object(o.createElement)("div",{className:u()("wc-block-components-product-sale-badge",t,d,"".concat(i,"__product-onsale"))},Object(o.createElement)(s.a,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}},139:function(e,t,r){"use strict";var n=r(0),c=r(63),o=Object(n.createElement)(c.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.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=o},14:function(e,t){!function(){e.exports=this.wp.blocks}()},143:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(44),i=r(182);r(278);t.a=Object(i.a)((function(e){var t=e.className,r=e.instanceId,c=e.defaultValue,i=e.label,u=e.onChange,s=e.options,l=e.screenReaderLabel,b=e.readOnly,p=e.value,d="wc-block-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:o()("wc-block-sort-select",t)},Object(n.createElement)(a.a,{label:i,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select",defaultValue:c,onChange:u,readOnly:b,value:p},s.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},145:function(e,t,r){"use strict";var n=r(20),c=r.n(n),o=r(26),a=r.n(o),i=r(21),u=r.n(i),s=r(22),l=r.n(s),b=r(12),p=r.n(b),d=r(0),f=r(6),g=r(1),m=r(4);function O(e){var t=e.level,r={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 r.hasOwnProperty(t)?Object(d.createElement)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(m.Path,{d:r[t]})):null}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var c=p()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return l()(this,r)}}var v=function(e){u()(r,e);var t=j(r);function r(){return c()(this,r),t.apply(this,arguments)}return a()(r,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(O,{level:e}),title:Object(g.sprintf)(Object(g.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(m.Toolbar,{isCollapsed:n,icon:Object(d.createElement)(O,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},146:function(e,t,r){"use strict";var n=r(0),c=r(107),o=r(77),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},u=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},s=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(u(c,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(u(a,n));var s=a.match(/([\s]+)/g),l=s?s.length:0,b=c.slice(0,t+l);return Object(o.autop)(u(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,u=e.countType,b=void 0===u?"words":u,p=e.className,d=void 0===p?"":p,f=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var u=a(n),b=Object(c.count)(u,r);return b<=t?u:"words"===r?s(u,t):l(u,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},148:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(11),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return function(e){return t((function(){throw e}))}}},15:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},160:function(e,t,r){"use strict";var n=r(0),c=r(63),o=Object(n.createElement)(c.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.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(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},165: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(11),c=r.n(n),o=r(39),a=r(35),i=r(0),u=r(96),s=r(6),l=r(57),b=function(e){var t=Object(u.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e])]},p=function(e,t,r){var n=Object(u.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e])]},d=function(e,t){var r=Object(u.a)(),n=b(t=t||r),o=c()(n,2),a=o[0],p=o[1],d=Object(l.a)(e),f=Object(i.useRef)(!1);return Object(i.useEffect)((function(){p(Object(s.assign)({},a,d)),f.current=!0}),[d]),f.current?[a,p]:[e,p]}},167:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(5),o=Object(n.createElement)("img",{src:c.Q+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},187:function(e,t,r){"use strict";r.d(t,"c",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return g}));var n=r(8),c=r.n(n),o=r(54),a=r.n(o),i=r(3);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l,b,p={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(l=i.CURRENCY.symbol,b=i.CURRENCY.symbolPosition,{left:l,left_space:" "+l,right:"",right_space:""}[b]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},d=function(e){if(!e||"object"!==a()(e))return p;var t=e.currency_code,r=e.currency_symbol,n=e.currency_thousand_separator,c=e.currency_decimal_separator,o=e.currency_minor_unit,i=e.currency_prefix,u=e.currency_suffix;return{code:t||"USD",symbol:r||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof c?c:".",minorUnit:Number.isFinite(o)?o:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof u?u:""}},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(s({},p),e)},g=function(e,t){if(""===e||void 0===e)return"";var r=parseInt(e,10);if(!Number.isFinite(r))return"";var n=f(t),c=r/Math.pow(10,n.minorUnit),o=n.prefix+c+n.suffix,a=document.createElement("textarea");return a.innerHTML=o,a.value}},189:function(e,t,r){"use strict";t.a={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0}}},190:function(e,t,r){"use strict";var n=r(23),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),u=r(33),s=r(40);r(478);t.a=function(e){var t=e.className,r=e.headingLevel,n=void 0===r?2:r,a=e.productLink,l=void 0===a||a,b=c()(e,["className","headingLevel","productLink"]),p=Object(s.useInnerBlockLayoutContext)().parentClassName,d=Object(s.useProductDataContext)(),f=b.product||d.product,g="h".concat(n);if(!f)return Object(o.createElement)(g,{className:i()(t,"wc-block-components-product-title","".concat(p,"__product-title"))});var m=Object(u.decodeEntities)(f.name);return Object(o.createElement)(g,{className:i()(t,"wc-block-components-product-title","".concat(p,"__product-title"))},l?Object(o.createElement)("a",{href:f.permalink,rel:"nofollow"},m):m)}},191:function(e,t,r){"use strict";var n=r(23),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),u=r(55),s=r(187),l=r(40),b=(r(479),function(e){return e.price_range&&e.price_range.min_amount&&e.price_range.max_amount}),p=function(e){var t=e.currency,r=e.minAmount,n=e.maxAmount,c=Object(l.useInnerBlockLayoutContext)().parentClassName;return Object(o.createElement)("span",{className:i()("wc-block-components-product-price__value","".concat(c,"__product-price__value"))},Object(o.createElement)(u.a,{currency:t,value:r})," — ",Object(o.createElement)(u.a,{currency:t,value:n}))},d=function(e){var t=e.currency,r=e.price,n=e.regularPrice,c=Object(l.useInnerBlockLayoutContext)().parentClassName;return Object(o.createElement)(o.Fragment,null,n!==r&&Object(o.createElement)("del",{className:i()("wc-block-components-product-price__regular","".concat(c,"__product-price__regular"))},Object(o.createElement)(u.a,{currency:t,value:n})),Object(o.createElement)("span",{className:i()("wc-block-components-product-price__value","".concat(c,"__product-price__value"))},Object(o.createElement)(u.a,{currency:t,value:r})))};t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(l.useInnerBlockLayoutContext)().parentClassName,a=Object(l.useProductDataContext)(),u=r.product||a.product;if(!u)return Object(o.createElement)("div",{className:i()(t,"price","wc-block-components-product-price","".concat(n,"__product-price"))});var f=u.prices||{},g=Object(s.c)(f);return Object(o.createElement)("div",{className:i()(t,"price","wc-block-components-product-price","".concat(n,"__product-price"))},b(f)?Object(o.createElement)(p,{currency:g,minAmount:f.price_range.min_amount,maxAmount:f.price_range.max_amount}):Object(o.createElement)(d,{currency:g,price:f.price,regularPrice:f.regular_price}))}},192:function(e,t,r){"use strict";t.a={productLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"}}},193:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(23),a=r.n(o),i=r(0),u=(r(2),r(7)),s=r.n(u),l=r(5),b=r(40),p=r(133),d=(r(482),function(){return Object(i.createElement)("img",{src:l.C,alt:""})}),f=function(e){var t=e.image,r=e.onLoad,n=e.loaded,c=t||{},o=c.thumbnail,a=c.srcset,u=c.sizes,s=c.alt;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("img",{src:o,srcSet:a,sizes:u,alt:s,onLoad:r,hidden:!n}),!n&&Object(i.createElement)(d,null))};t.a=function(e){var t=e.className,r=e.productLink,n=void 0===r||r,o=e.showSaleBadge,u=e.saleBadgeAlign,l=void 0===u?"right":u,g=a()(e,["className","productLink","showSaleBadge","saleBadgeAlign"]),m=Object(b.useInnerBlockLayoutContext)().parentClassName,O=Object(b.useProductDataContext)(),j=g.product||O.product,v=Object(i.useState)(!1),h=c()(v,2),w=h[0],y=h[1];if(!j)return Object(i.createElement)("div",{className:s()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder","".concat(m,"__product-image"))},Object(i.createElement)(d,null));var _=(null==j?void 0:j.images)&&j.images.length?j.images[0]:null;return Object(i.createElement)("div",{className:s()(t,"wc-block-components-product-image","".concat(m,"__product-image"))},n?Object(i.createElement)("a",{href:j.permalink,rel:"nofollow"},!!o&&Object(i.createElement)(p.a,{align:l,product:j}),Object(i.createElement)(f,{image:_,onLoad:function(){return y(!0)},loaded:w})):Object(i.createElement)(i.Fragment,null,!!o&&Object(i.createElement)(p.a,{align:l,product:j}),Object(i.createElement)(f,{image:_,onLoad:function(){return y(!0)},loaded:w})))}},194:function(e,t,r){"use strict";var n=r(23),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),u=r.n(i),s=r(40),l=(r(483),function(e){var t=parseFloat((null==e?void 0:e.average_rating)||0);return Number.isFinite(t)&&t>0?t:0});t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(s.useInnerBlockLayoutContext)().parentClassName,i=Object(s.useProductDataContext)(),b=r.product||i.product,p=l(b);if(!p)return null;var d={width:p/5*100+"%"},f=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),p);return Object(o.createElement)("div",{className:u()(t,"star-rating","wc-block-components-product-rating","".concat(n,"__product-rating"))},Object(o.createElement)("div",{className:u()("wc-block-components-product-rating__stars","".concat(n,"__product-rating__stars")),role:"img","aria-label":f},Object(o.createElement)("span",{style:d},f)))}},195:function(e,t,r){"use strict";var n=r(23),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),u=r(146),s=r(3),l=r(40);r(486);t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(l.useInnerBlockLayoutContext)().parentClassName,a=(Object(l.useProductDataContext)()||r).product;if(!a)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary")});var b=a.short_description?a.short_description:a.description;if(!b)return null;var p=Object(s.getSetting)("wordCountType","words");return Object(o.createElement)(u.a,{className:i()(t,"wc-block-components-product-summary","".concat(n,"__product-summary")),source:b,maxLength:150,countType:p})}},196:function(e,t,r){"use strict";var n=r(23),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),u=r.n(i),s=r(40);r(487);t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(s.useInnerBlockLayoutContext)().parentClassName,i=Object(s.useProductDataContext)(),l=(r.product||i.product||{}).sku||"";return l?Object(o.createElement)("div",{className:u()(t,"wc-block-components-product-sku","".concat(n,"__product-sku"))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,l)):null}},197:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(39),c=r(35),o=r(0),a=r(148),i=r(57),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,b=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),g=Object(i.a)(b),m=Object(i.a)(s),O=Object(a.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,g,m],a=c.getCollectionError.apply(c,o);return a&&O(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,m,g,d]);return null!==j&&(f.current=j),f.current}},198:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(23),a=r.n(o),i=r(0),u=(r(2),r(7)),s=r.n(u),l=r(1),b=r(11),p=r.n(b),d=r(35),f=r(129),g=r(39),m=r(33),O=r(105),j=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},v=r(485),h=r(40),w=(r(484),function(e){var t=e.product,r=Object(i.useRef)(!0),n=t.id,o=t.permalink,a=t.add_to_cart,u=t.has_options,b=t.is_purchasable,h=t.is_in_stock,w=function(e){var t=Object(d.useDispatch)(g.CART_STORE_KEY).addItemToCart,r=Object(f.a)(),n=r.cartItems,c=r.cartIsLoading,o=Object(O.a)(),a=o.addErrorNotice,u=o.removeNotice,s=Object(i.useState)(!1),l=p()(s,2),b=l[0],v=l[1],h=Object(i.useRef)(j(n,e));return Object(i.useEffect)((function(){var t=j(n,e);t!==h.current&&(h.current=t)}),[n,e]),{cartQuantity:h.current,addingToCart:b,cartIsLoading:c,addToCart:function(){v(!0),t(e).then((function(e){!0===e&&u("add-to-cart")})).catch((function(e){a(Object(m.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}(n),y=w.cartQuantity,_=w.addingToCart,E=w.addToCart;Object(i.useEffect)((function(){r.current?r.current=!1:Object(v.a)()}),[y]);var k=Number.isFinite(y)&&y>0,P=!u&&b&&h,C=Object(m.decodeEntities)((null==a?void 0:a.description)||""),S=k?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",y,"woo-gutenberg-products-block"),y):Object(m.decodeEntities)((null==a?void 0:a.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),N=P?"button":"a",x={};return P?x.onClick=E:(x.href=o,x.rel="nofollow"),Object(i.createElement)(N,c()({"aria-label":C,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:_,added:k}),disabled:_},x),S)}),y=function(){return Object(i.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.a=function(e){var t=e.className,r=a()(e,["className"]),n=Object(h.useInnerBlockLayoutContext)().parentClassName,c=Object(h.useProductDataContext)(),o=r.product||c.product;return Object(i.createElement)("div",{className:s()(t,"wp-block-button","wc-block-components-product-button","".concat(n,"__product-add-to-cart"))},o?Object(i.createElement)(w,{product:o}):Object(i.createElement)(y,null))}},202:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(35),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,u=void 0===i?{}:i,s={isEditor:!0,currentPostId:Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),previewData:u};return Object(n.createElement)(o.Provider,{value:s},t)}},204:function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return E}));var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(0),u=(r(2),r(35)),s=r(10),l=r.n(s),b=r(7),p=r.n(b),d=r(881),f=(r(279),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=_().removeNotice,c=p()(t,"wc-block-components-notices"),o=r.filter((function(e){return"snackbar"!==e.type}));return o.length?Object(i.createElement)("div",{className:c},o.map((function(e){return Object(i.createElement)(d.a,l()({key:"store-notice-"+e.id},e,{className:p()("wc-block-components-notices__notice","woocommerce-message",f(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)}))):null},m=r(885),O=r(105),j=r(202),v=function(){var e=Object(j.b)().isEditor,t=Object(O.a)(),r=t.notices,n=t.removeNotice,c=r.filter((function(e){return"snackbar"===e.type}));return e?null:Object(i.createElement)(m.a,{notices:c,className:"wc-block-notices__snackbar",onRemove:n})};function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),_=function(){return Object(i.useContext)(y)},E=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,s=e.context,l=void 0===s?"wc/core":s,b=Object(u.useDispatch)("core/notices"),p=b.createNotice,d=b.removeNotice,f=Object(i.useState)(!1),m=a()(f,2),O=m[0],j=m[1],h=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};p(e,t,w(w({},r),{},{context:r.context||l}))}),[p,l]),_=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;d(e,t)}),[d,l]),E=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h("default",e,w(w({},t),{},{type:"snackbar"}))}),[h]),k={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(l)}}),[l]).notices,createNotice:h,createSnackbarNotice:E,removeNotice:_,context:l,setIsSuppressed:j},P=O?null:Object(i.createElement)(g,{className:n,notices:k.notices}),C=O?null:Object(i.createElement)(v,null);return Object(i.createElement)(y.Provider,{value:k},o&&P,t,C)}},221:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(23),a=r.n(o),i=r(0),u=r(63),s=r(7),l=r.n(s),b=function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]),o=l()("dashicon","dashicons-arrow-down-alt2",t);return Object(i.createElement)(u.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:o,width:r,height:r},n),Object(i.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))},p=function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]),o=l()("dashicon","dashicons-arrow-down-alt2",t);return Object(i.createElement)(u.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:o,width:r,height:r},n),Object(i.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"}))};t.a=function(e){let t=function(){return null};switch(e.icon){case"arrow-down-alt2":t=b;break;case"no-alt":t=p}return Object(i.createElement)(t,{size:e.size||20,className:e.className})}},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},248:function(e,t){!function(){e.exports=this.wp.deprecated}()},249:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(58),a=r(160),i=r(3),u=r(24);t.a=function(e){var t=e.productId;return Object(n.createElement)(u.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details","woo-gutenberg-products-block"),Object(n.createElement)(o.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block"))))}},25:function(e,t){!function(){e.exports=this.wp.compose}()},250:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(20),a=r.n(o),i=r(26),u=r.n(i),s=r(19),l=r.n(s),b=r(21),p=r.n(b),d=r(22),f=r.n(d),g=r(12),m=r.n(g),O=r(8),j=r.n(O),v=r(0),h=r(9);r(489);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var c=m()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}t.a=function(e){var t=function(t){p()(n,t);var r=w(n);function n(){var e;return a()(this,n),e=r.call(this),j()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),j()(l()(e),"moveFocusToTop",(function(t){var r=e.scrollPointRef.current.parentElement.querySelectorAll(t);r.length&&r[0].focus()})),j()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(h.createRef)(),e}return u()(n,[{key:"render",value:function(){return Object(v.createElement)(h.Fragment,null,Object(v.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(v.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(h.Component);return t.displayName="withScrollToTop",t}},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},33:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},35:function(e,t){!function(){e.exports=this.wp.data}()},39:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},4:function(e,t){!function(){e.exports=this.wp.components}()},40:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},44:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(9)),i=r(7),u=r.n(i);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,i=e.wrapperProps,s=null!=r,b=null!=n;return!s&&b?(t=c||"span",i=l(l({},i),{},{className:u()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,n)):(t=c||a.Fragment,s&&b&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))};b.defaultProps={wrapperProps:{}},t.a=b},48:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},480:function(e,t,r){"use strict";var n=r(0),c=r(63),o=Object(n.createElement)(c.a,{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:"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=o},485:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=window.Event||null,c=function(){if("function"==typeof n){var e=new n("wc_fragment_refresh",{bubbles:!0,cancelable:!0});document.body.dispatchEvent(e)}else{var t=document.createEvent("Event");t.initEvent("wc_fragment_refresh",!0,!0),document.body.dispatchEvent(t)}}},488:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(9),c=function(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,r.current]),r.current}},5:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"G",(function(){return o})),r.d(t,"M",(function(){return a})),r.d(t,"x",(function(){return i})),r.d(t,"z",(function(){return u})),r.d(t,"l",(function(){return s})),r.d(t,"y",(function(){return l})),r.d(t,"B",(function(){return b})),r.d(t,"n",(function(){return p})),r.d(t,"A",(function(){return d})),r.d(t,"m",(function(){return f})),r.d(t,"C",(function(){return g})),r.d(t,"t",(function(){return m})),r.d(t,"w",(function(){return O})),r.d(t,"q",(function(){return j})),r.d(t,"r",(function(){return v})),r.d(t,"s",(function(){return h})),r.d(t,"j",(function(){return w})),r.d(t,"I",(function(){return y})),r.d(t,"N",(function(){return _})),r.d(t,"p",(function(){return E})),r.d(t,"o",(function(){return k})),r.d(t,"F",(function(){return P})),r.d(t,"c",(function(){return C})),r.d(t,"u",(function(){return S})),r.d(t,"v",(function(){return N})),r.d(t,"Q",(function(){return D})),r.d(t,"H",(function(){return B})),r.d(t,"a",(function(){return L})),r.d(t,"K",(function(){return R})),r.d(t,"b",(function(){return T})),r.d(t,"J",(function(){return I})),r.d(t,"h",(function(){return V})),r.d(t,"L",(function(){return A})),r.d(t,"g",(function(){return H})),r.d(t,"i",(function(){return F})),r.d(t,"E",(function(){return U})),r.d(t,"D",(function(){return Y})),r.d(t,"P",(function(){return Q})),r.d(t,"O",(function(){return q})),r.d(t,"d",(function(){return K})),r.d(t,"e",(function(){return W})),r.d(t,"f",(function(){return G})),r.d(t,"R",(function(){return $})),r.d(t,"S",(function(){return X}));var n=r(3),c=Object(n.getSetting)("currentUserIsAdmin",!1),o=Object(n.getSetting)("reviewRatingsEnabled",!0),a=Object(n.getSetting)("showAvatars",!0),i=Object(n.getSetting)("max_columns",6),u=Object(n.getSetting)("min_columns",1),s=Object(n.getSetting)("default_columns",3),l=Object(n.getSetting)("max_rows",6),b=Object(n.getSetting)("min_rows",1),p=Object(n.getSetting)("default_rows",3),d=Object(n.getSetting)("min_height",500),f=Object(n.getSetting)("default_height",500),g=Object(n.getSetting)("placeholderImgSrc",""),m=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),O=Object(n.getSetting)("limitTags"),j=Object(n.getSetting)("hasProducts",!0),v=Object(n.getSetting)("hasTags",!0),h=Object(n.getSetting)("homeUrl",""),w=Object(n.getSetting)("couponsEnabled",!0),y=Object(n.getSetting)("shippingEnabled",!0),_=Object(n.getSetting)("taxesEnabled",!0),E=Object(n.getSetting)("displayItemizedTaxes",!1),k=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),P=Object(n.getSetting)("productCount",0),C=Object(n.getSetting)("attributes",[]),S=Object(n.getSetting)("isShippingCalculatorEnabled",!0),N=Object(n.getSetting)("isShippingCostHidden",!1),x=Object(n.getSetting)("woocommerceBlocksPhase",1),D=Object(n.getSetting)("wcBlocksAssetUrl",""),B=Object(n.getSetting)("shippingCountries",{}),L=Object(n.getSetting)("allowedCountries",{}),R=Object(n.getSetting)("shippingStates",{}),T=Object(n.getSetting)("allowedStates",{}),I=Object(n.getSetting)("shippingMethodsExist",!1),V=Object(n.getSetting)("checkoutShowLoginReminder",!0),z={id:0,title:"",permalink:""},M=Object(n.getSetting)("storePages",{shop:z,cart:z,checkout:z,privacy:z,terms:z}),A=M.shop.permalink,H=M.checkout.id,F=M.checkout.permalink,U=M.privacy.permalink,Y=M.privacy.title,Q=M.terms.permalink,q=M.terms.title,K=M.cart.id,W=M.cart.permalink,G=Object(n.getSetting)("checkoutAllowsGuest",!1),J=(Object(n.getSetting)("checkoutAllowsSignup",!1),r(14)),$=function(e,t){if(x>2)return Object(J.registerBlockType)(e,t)},X=function(e,t){if(x>1)return Object(J.registerBlockType)(e,t)}},53:function(e,t){!function(){e.exports=this.wp.keycodes}()},55:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(8),a=r.n(o),i=r(23),u=r.n(i),s=r(0),l=r(152),b=r(7),p=r.n(b);r(246);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=u()(e,["className","value","currency","onValueChange"]);if("-"===r)return null;var i=r/Math.pow(10,n.minorUnit);if(!Number.isFinite(i))return null;var b=p()("wc-block-formatted-money-amount",t),d=f(f(f({displayType:"text"},a),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),g=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(s.createElement)(l.a,c()({className:b},d,{value:i,onValueChange:g}))}},57:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(48),o=r.n(c),a=function(e){var t=Object(n.useRef)();return o()(e,t.current)||(t.current=e),t.current}},58:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(23),a=r.n(o),i=r(9);r(2);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,["srcElement","size"]);return Object(i.isValidElement)(t)&&Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o))}},6:function(e,t){!function(){e.exports=this.lodash}()},70:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(20),a=r.n(o),i=r(26),u=r.n(i),s=r(19),l=r.n(s),b=r(21),p=r.n(b),d=r(22),f=r.n(d),g=r(12),m=r.n(g),O=r(0),j=r(6),v=r(7),h=r.n(v),w=r(4),y=r(25);r(168);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var c=m()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}var E=function(e){p()(r,e);var t=_(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return u()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,u=r.help,s=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return u&&(e=Object(j.isFunction)(u)?u(o):u),Object(O.createElement)(w.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(O.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(O.createElement)(w.ButtonGroup,{"aria-labelledby":b+"__label"},s.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isDefault=!0,o["aria-pressed"]=!1),Object(O.createElement)(w.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),r}(O.Component);t.a=Object(y.withInstanceId)(E)},73:function(e,t){!function(){e.exports=this.wp.dom}()},75:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(4)),i=r(5);t.a=function(e){var t=e.columns,r=e.rows,u=e.setAttributes,s=e.alignButtons;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:function(e){var t=Object(o.clamp)(e,i.z,i.x);u({columns:Object(o.isNaN)(t)?"":t})},min:i.z,max:i.x}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,i.B,i.y);u({rows:Object(o.isNaN)(t)?"":t})},min:i.B,max:i.y}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:function(){return u({alignButtons:!s})}}))}},77:function(e,t){!function(){e.exports=this.wp.autop}()},770:function(e,t,r){"use strict";var n=r(0),c=r(63),o=Object(n.createElement)(c.a,{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:"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(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.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=o},775:function(e,t,r){"use strict";var n=r(0),c=r(63),o=Object(n.createElement)(c.a,{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:"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=o},776:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(5),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("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:c.Q+"img/pennant.jpg",thumbnail:c.Q+"img/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(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},777:function(e,t,r){"use strict";var n=r(0),c=r(63),o=Object(n.createElement)(c.a,{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:"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=o},783:function(e,t,r){"use strict";var n=r(0),c=r(63),o=Object(n.createElement)(c.a,{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:"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=o},784:function(e,t,r){},82:function(e,t){!function(){e.exports=this.wp.a11y}()},836:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(10),a=r.n(o),i=r(0),u=r(1),s=r(24),l=r(14),b=r(58),p=r(63),d=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.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"})),f=r(7),g=r.n(f),m=function(e){var t=e.attributes;return Object(i.createElement)("div",{className:g()("is-loading",t.className)})},O={category:"woocommerce",keywords:[Object(u.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:["woocommerce/all-products","woocommerce/single-product"],save:m,deprecated:[{save:function(){}}]},j=r(189),v=r(4),h=r(145),w=r(190);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E={title:Object(u.__)("Product Title","woo-gutenberg-products-block"),description:Object(u.__)("Display the name of a product.","woo-gutenberg-products-block"),icon:{src:"heading",foreground:"#96588a"},attributes:j.a,edit:function(e){var t=e.attributes,r=e.setAttributes,n=t.headingLevel,c=t.productLink;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)("p",null,Object(u.__)("Level","woo-gutenberg-products-block")),Object(i.createElement)(h.a,{isCollapsed:!1,minLevel:1,maxLevel:7,selectedLevel:n,onChange:function(e){return r({headingLevel:e})}}),Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(u.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:c,onChange:function(){return r({productLink:!c})}}))),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(w.a,t)))}};Object(l.registerBlockType)("woocommerce/product-title",_(_({},O),E));var k=r(480),P=r(191);function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N={title:Object(u.__)("Product Price","woo-gutenberg-products-block"),description:Object(u.__)("Display the price of a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:k.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(P.a,t)}};Object(l.registerBlockType)("woocommerce/product-price",S(S({},O),N));var x=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.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"})),D=r(192),B=r(70),L=r(193);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var I={title:Object(u.__)("Product Image","woo-gutenberg-products-block"),description:Object(u.__)("Display the main product image","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:x}),foreground:"#96588a"},attributes:D.a,edit:function(e){var t=e.attributes,r=e.setAttributes,n=t.productLink,c=t.showSaleBadge,o=t.saleBadgeAlign;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(u.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({productLink:!n})}}),Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(u.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:c,onChange:function(){return r({showSaleBadge:!c})}}),c&&Object(i.createElement)(B.a,{label:Object(u.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:o,options:[{label:Object(u.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(u.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(u.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}))),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(L.a,t)))}};Object(l.registerBlockType)("woocommerce/product-image",T(T({},O),I));var V=r(775),z=r(194);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var H={title:Object(u.__)("Product Rating","woo-gutenberg-products-block"),description:Object(u.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:V.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(z.a,t)}};Object(l.registerBlockType)("woocommerce/product-rating",A(A({},O),H));var F=r(783),U=r(198);function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var q={title:Object(u.__)("Add to Cart Button","woo-gutenberg-products-block"),description:Object(u.__)("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:Object(i.createElement)(b.a,{srcElement:F.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(v.Disabled,null,Object(i.createElement)(U.a,t))}};Object(l.registerBlockType)("woocommerce/product-button",Q(Q({},O),q));var K=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),W=r(195);function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $={title:Object(u.__)("Product Summary","woo-gutenberg-products-block"),description:Object(u.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:K}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(W.a,t)}};Object(l.registerBlockType)("woocommerce/product-summary",J(J({},O),$));var X=r(770),Z=r(133);function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var re={title:Object(u.__)("On-Sale Badge","woo-gutenberg-products-block"),description:Object(u.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:X.a}),foreground:"#96588a"},supports:{html:!1},edit:function(e){var t=e.attributes;return Object(i.createElement)(Z.a,t)}};Object(l.registerBlockType)("woocommerce/product-sale-badge",te(te({},O),re));var ne=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#626262",d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),ce=r(249),oe=r(40),ae=r(196);function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var se={title:Object(u.__)("Product SKU","woo-gutenberg-products-block"),description:Object(u.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:ne}),foreground:"#96588a"},edit:function(e){var t=e.attributes,r=Object(oe.useProductDataContext)().product||{};return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ce.a,{productId:r.id}),Object(i.createElement)(ae.a,t))}};Object(l.registerBlockType)("woocommerce/product-sku",ue(ue({},O),se));var le=r(11),be=r.n(le),pe=r(20),de=r.n(pe),fe=r(19),ge=r.n(fe),me=r(21),Oe=r.n(me),je=r(22),ve=r.n(je),he=r(12),we=r.n(he),ye=r(35),_e=r(25),Ee=(r(2),r(75)),ke=r(5),Pe=r(848),Ce=r(776),Se=r(3),Ne=r(160),xe=function(e,t){var r=t.className,n=t.contentVisibility;return g()(e,r,{"has-image":n&&n.image,"has-title":n&&n.title,"has-rating":n&&n.rating,"has-price":n&&n.price,"has-button":n&&n.button})},De=function(e,t){return Object(i.createElement)(v.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(u.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(v.Button,{className:"wc-block-products__add-product-button",isDefault:!0,isLarge:!0,href:Se.adminUrl+"post-new.php?post_type=product"},Object(u.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:Ne.a})),Object(i.createElement)(v.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(u.__)("Learn more","woo-gutenberg-products-block")))},Be=function(e,t){return Object(i.createElement)(v.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(u.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Te=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Ie=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Re(Re({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};r(784);function Ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Me=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:ze(ze({},r),{},{orderBy:!r.orderBy})})}})},Ae=function(e,t){return Object(i.createElement)(v.SelectControl,{label:Object(u.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(u.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(u.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(u.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(u.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(u.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(u.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},He=r(26),Fe=r.n(He),Ue=r(9),Ye=r(54),Qe=r.n(Ye),qe=r(23),Ke=r.n(qe),We=r(6),Ge=r(44),Je=(r(787),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,s=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,c=Math.max(Math.floor(t-n/2),2),o=Math.min(Math.ceil(t+(n-(t-c))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(o-t))),2),maxIndex:o}}(c,t,a),l=s.minIndex,b=s.maxIndex,p=r&&Boolean(1!==l),d=r&&Boolean(b!==a),f=r&&Boolean(l>3),m=r&&Boolean(b<a-2);p&&3===l&&(l-=1),d&&b===a-2&&(b+=1);var O=[];if(l&&b)for(var j=l;j<=b;j++)O.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination"},Object(i.createElement)(Ge.a,{screenReaderLabel:Object(u.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page",onClick:function(){return o(t-1)},title:Object(u.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(Ge.a,{label:"<",screenReaderLabel:Object(u.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:g()("wc-block-pagination-page",{"wc-block-pagination-page--active":1===t}),onClick:function(){return o(1)},disabled:1===t},Object(i.createElement)(Ge.a,{label:1,screenReaderLabel:Object(u.sprintf)(Object(u.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis","aria-hidden":"true"},Object(u.__)("…","woo-gutenberg-products-block")),O.map((function(e){return Object(i.createElement)("button",{key:e,className:g()("wc-block-pagination-page",{"wc-block-pagination-page--active":t===e}),onClick:t===e?null:function(){return o(e)},disabled:t===e},Object(i.createElement)(Ge.a,{label:e,screenReaderLabel:Object(u.sprintf)(Object(u.__)("Page %d","woo-gutenberg-products-block"),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis","aria-hidden":"true"},Object(u.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:g()("wc-block-pagination-page",{"wc-block-pagination-page--active":t===a}),onClick:function(){return o(a)},disabled:t===a},Object(i.createElement)(Ge.a,{label:a,screenReaderLabel:Object(u.sprintf)(Object(u.__)("Page %d","woo-gutenberg-products-block"),a)})),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page",onClick:function(){return o(t+1)},title:Object(u.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(Ge.a,{label:">",screenReaderLabel:Object(u.__)("Next page","woo-gutenberg-products-block")})))});Je.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var $e=Je,Xe=r(143),Ze=(r(786),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(Xe.a,{className:"wc-block-product-sort-select",defaultValue:t,name:"orderby",onChange:r,options:[{key:"menu_order",label:Object(u.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(u.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(u.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(u.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(u.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(u.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(u.__)("Order products by","woo-gutenberg-products-block"),value:c})}),et=r(182),tt=Object(et.a)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(oe.useInnerBlockLayoutContext)(),u=o.parentClassName,s=o.parentName,l=0===Object.keys(t).length,b=g()("".concat(u,"__product"),{"is-loading":l,"wc-block-layout--is-loading":l});return Object(i.createElement)("li",{className:b,"aria-hidden":l},function e(t,r,n,c){if(n){var o=Object(Pe.a)(t);return n.map((function(n,u){var s=be()(n,2),l=s[0],b=s[1],p=void 0===b?{}:b,d=[];p.children&&p.children.length>0&&(d=e(t,r,p.children,c));var f=o[l];if(!f)return null;var g=r.id||0,m=["layout",l,u,c,g];return Object(i.createElement)(f,a()({key:m.join("_")},p,{children:d,product:r}))}))}}(s,t,c,n))})),rt=r(165),nt=r(197),ct=r(39),ot=r(57);function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function it(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ut=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(nt.a)(it(it({},t),{},{query:e})),n=r.results,c=r.isLoading,o=function(e,t){var r=t.namespace,n=t.resourceName,c=t.resourceValues,o=void 0===c?[]:c,a=t.query,i=void 0===a?{}:a;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(ot.a)(i),s=Object(ot.a)(o),l=Object(ye.useSelect)((function(t){var c=t(ct.COLLECTIONS_STORE_KEY),o=[e,r,n,u,s];return{value:c.getCollectionHeader.apply(c,o),isLoading:c.hasFinishedResolution("getCollectionHeader",o)}}),[e,r,n,s,u]),b=l.value,p=l.isLoading;return{value:b,isLoading:void 0===p||p}}("x-wp-total",it(it({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},st=r(488),lt=r(250),bt=r(82),pt=(r(785),r(139)),dt=function(){var e=Object(oe.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(e,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:pt.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(u.__)("No products","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(u.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},ft=r(777),gt=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(oe.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(n,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:ft.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(u.__)("No products found","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(u.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(i.createElement)("button",{onClick:r},Object(u.__)("Reset Search","woo-gutenberg-products-block")))};function mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ot(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jt=Object(lt.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,s=Object(rt.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows;return Ot(Ot({},function(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:c*o,page:r})}({attributes:t,sortValue:o,currentPage:r})),l=be()(s,1)[0],b=ut(l),p=b.products,d=b.totalProducts,f=b.productsLoading,m=Object(oe.useInnerBlockLayoutContext)().parentClassName,O=function(e){e.order,e.orderby,e.page,e.per_page;return Ke()(e,["order","orderby","page","per_page"])}(l),j=Object(rt.b)("attributes",[]),v=be()(j,2),h=v[0],w=v[1],y=Object(rt.b)("min_price"),_=be()(y,2),E=_[0],k=_[1],P=Object(rt.b)("max_price"),C=be()(P,2),S=C[0],N=C[1],x=Object(st.a)({totalQuery:O,totalProducts:d},(function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(We.isEqual)(t,c)&&Number.isFinite(r)})),D="object"===Qe()(x)&&Object(We.isEqual)(O,x.totalQuery);Object(i.useEffect)((function(){D||(n(1),x&&function(e){Number.isFinite(e)&&(0===e?Object(bt.speak)(Object(u.__)("No products found","woo-gutenberg-products-block")):Object(bt.speak)(Object(u.sprintf)(Object(u._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[l]);var B,L,R,T,I,V=t.contentVisibility,z=t.columns*t.rows,M=!Number.isFinite(d)&&D?Math.ceil(x.totalProducts/z):Math.ceil(d/z),A=p.length?p:Array.from({length:z}),H=0!==p.length||f,F=h.length>0||Number.isFinite(E)||Number.isFinite(S);return Object(i.createElement)("div",{className:(B=t.columns,L=t.rows,R=t.alignButtons,T=t.align,I=void 0!==T?"align"+T:"",g()(m,I,"has-"+B+"-columns",{"has-multiple-rows":L>1,"has-aligned-buttons":R}))},V.orderBy&&H&&Object(i.createElement)(Ze,{onChange:c,value:o}),!H&&F&&Object(i.createElement)(gt,{resetCallback:function(){w([]),k(null),N(null)}}),!H&&!F&&Object(i.createElement)(dt,null),H&&Object(i.createElement)("ul",{className:"".concat(m,"__products")},A.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(tt,{key:e.id||r,attributes:t,product:e})}))),M>1&&Object(i.createElement)($e,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:M}))})),vt=function(e){var t=e.attributes,r=Object(i.useState)(1),n=be()(r,2),c=n[0],o=n[1],a=Object(i.useState)(t.orderby),u=be()(a,2),s=u[0],l=u[1];Object(i.useEffect)((function(){l(t.orderby)}),[t.orderby]);return Object(i.createElement)(jt,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;l(t),o(1)},sortValue:s})},ht=r(167);function wt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=we()(e);if(t){var c=we()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return ve()(this,r)}}var yt=function(e){Oe()(r,e);var t=wt(r);function r(){return de()(this,r),t.apply(this,arguments)}return Fe()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?ht.a:Object(i.createElement)(oe.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(vt,{attributes:t,urlParameterSuffix:r}))}}]),r}(Ue.Component);function _t(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=we()(e);if(t){var c=we()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return ve()(this,r)}}var Et=function(e){Oe()(r,e);var t=_t(r);function r(){var e;de()(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),c()(ge()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(ge()(e),"blockMap",Object(Pe.a)("woocommerce/all-products")),c()(ge()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(ge()(e),"getTitle",(function(){return Object(u.__)("All Products","woo-gutenberg-products-block")})),c()(ge()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(ge()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(u.__)("Showing All Products block preview.","woo-gutenberg-products-block"))})),c()(ge()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(s.InspectorControls,{key:"inspector"},Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Ee.a,{columns:c,rows:o,alignButtons:a,setAttributes:n})),Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Content Settings","woo-gutenberg-products-block")},Me(r,n),Ae(r,n)))})),c()(ge()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(s.BlockControls,null,Object(i.createElement)(v.Toolbar,{controls:[{icon:"edit",title:Object(u.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(ge()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(v.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(u.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(v.Tip,null,Object(u.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(i.createElement)(oe.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(oe.ProductDataContextProvider,{product:Ce.a[0]},Object(i.createElement)(s.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(v.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,isLarge:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Ie(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(u.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(v.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(u.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(v.IconButton,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(u.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];Te.map((function(e){var t=be()(e,2),r=t[0],n=t[1];return c.push(Object(l.createBlock)(r,n)),!0})),n(r.clientId,c,!1),e.setState({innerBlocks:r.innerBlocks})}},Object(u.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(ge()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(v.Disabled,null,Object(i.createElement)(yt,{attributes:t})):Be(c,o)})),c()(ge()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return ke.q?Object(i.createElement)("div",{className:xe("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode()):De(n,c)})),e}return r}(i.Component),kt=Object(_e.compose)(v.withSpokenMessages,Object(ye.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(ye.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Et),Pt={columns:ke.l,rows:ke.n,alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Te,isPreview:!1};function Ct(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function St(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Nt={title:Object(u.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(u.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(u.__)("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:Pt,edit:function(e){return Object(i.createElement)(kt,e)},save:function(e){var t=e.attributes,r={};Object.keys(t).sort().forEach((function(e){r[e]=t[e]}));var n={"data-attributes":JSON.stringify(r)};return Object(i.createElement)("div",a()({className:xe("wc-block-all-products",t)},n),Object(i.createElement)(s.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",St(St({},Nt),{},{deprecated:[{attributes:Object.assign({},Nt.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:xe("wc-block-all-products",t)},r),Object(i.createElement)(s.InnerBlocks.Content,null))}}]}))},848:function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));var n=r(8),c=r.n(n),o=r(130),a=r(198),i=r(25),u=r(10),s=r.n(u),l=r(0),b=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r},p=function(e){return function(t){return function(r){var n=b(e,r);return Object(l.createElement)(t,s()({},r,n))}}},d=r(193),f=r(192),g=Object(i.compose)(p(f.a))(d.a),m=r(191),O=r(194),j=r(133),v=r(195),h=r(190),w=r(189),y=Object(i.compose)(p(w.a))(h.a),_=r(196);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var k=function(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({"woocommerce/product-price":m.a,"woocommerce/product-image":g,"woocommerce/product-title":y,"woocommerce/product-rating":O.a,"woocommerce/product-button":a.a,"woocommerce/product-summary":v.a,"woocommerce/product-sale-badge":j.a,"woocommerce/product-sku":_.a},Object(o.getRegisteredInnerBlocks)(e))}},9:function(e,t){!function(){e.exports=this.React}()},96:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=Object(n.createContext)("page"),o=function(){return Object(n.useContext)(c)};c.Provider}});
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],u=t[1],l=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);p.length;)p.shift()();return o.push.apply(o,l||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var u=r[i];0!==c[u]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={5:0},o=[];function a(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,a),r.l=!0,r.exports}a.m=e,a.c=n,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 n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));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 i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var s=u;return o.push([855,2,0,1]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},106:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(8),c=r.n(n),o=r(211),a=r(0);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(o.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,l=Object(a.useRef)(t);Object(a.useEffect)((function(){l.current=t}),[t]);var s=Object(a.useMemo)((function(){return{hasNoticesOfType:function(e){return l.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;l.current.map((function(t){return null!==e&&t.status!==e||n(t.id),!0}))},removeNotice:n}}),[n]),b=Object(a.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,u({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,u({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,u({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,u({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,u({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[r,c]);return u(u(u({notices:t},s),b),{},{setIsSuppressed:i})}},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(41),c=r(36),o=r(209),a=r(30),i=r(6),u={cartCoupons:[],cartItems:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{},cartIsLoading:!0,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:[],shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:function(){}},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(o.b)(),r=t.isEditor,l=t.previewData,s=(null==l?void 0:l.previewCart)||{},b=e.shouldSelect,p=Object(c.useSelect)((function(e,t){var c=t.dispatch;if(!b)return u;if(r)return{cartCoupons:s.coupons,cartItems:s.items,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:[],cartTotals:s.totals,cartIsLoading:!1,cartErrors:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},shippingRates:s.shipping_rates,shippingRatesLoading:!1,hasShippingAddress:!1,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:function(){}};var o=e(n.CART_STORE_KEY),l=o.getCartData(),p=o.getCartErrors(),d=o.getCartTotals(),m=!o.hasFinishedResolution("getCartData"),g=o.areShippingRatesLoading(),f=c(n.CART_STORE_KEY).receiveCart,O=Object(i.mapValues)(l.shippingAddress,(function(e){return Object(a.decodeEntities)(e)}));return{cartCoupons:l.coupons,cartItems:l.items||[],cartItemsCount:l.itemsCount,cartItemsWeight:l.itemsWeight,cartNeedsPayment:l.needsPayment,cartNeedsShipping:l.needsShipping,cartItemErrors:l.errors||[],cartTotals:d,cartIsLoading:m,cartErrors:p,shippingAddress:O,shippingRates:l.shippingRates||[],shippingRatesLoading:g,hasShippingAddress:!!O.country,receiveCart:f}}),[b]);return p}},109:function(e,t){!function(){e.exports=this.wp.wordcount}()},131:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(60),a=r(161),i=r(3),u=r(22),l=r(37);t.a=function(e){var t=(Object(l.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(u.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details","woo-gutenberg-products-block"),Object(n.createElement)(o.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},134:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),u=r.n(i),l=r(44),s=r(37);r(492);t.a=function(e){var t=e.className,r=e.align,n=c()(e,["className","align"]),i=Object(s.useInnerBlockLayoutContext)().parentClassName,b=Object(s.useProductDataContext)(),p=n.product||b.product;if(!p||!p.on_sale)return null;var d="string"==typeof r?"wc-block-components-product-sale-badge--align".concat(r):"";return Object(o.createElement)("div",{className:u()("wc-block-components-product-sale-badge",t,d,"".concat(i,"__product-onsale"))},Object(o.createElement)(l.a,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}},14:function(e,t){!function(){e.exports=this.wp.blocks}()},140:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.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=o},145:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(44),i=r(183);r(283);t.a=Object(i.a)((function(e){var t=e.className,r=e.instanceId,c=e.defaultValue,i=e.label,u=e.onChange,l=e.options,s=e.screenReaderLabel,b=e.readOnly,p=e.value,d="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.a,{label:i,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:c,onChange:u,readOnly:b,value:p},l.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},147:function(e,t,r){"use strict";var n=r(23),c=r.n(n),o=r(26),a=r.n(o),i=r(24),u=r.n(i),l=r(25),s=r.n(l),b=r(12),p=r.n(b),d=r(0),m=r(6),g=r(1),f=r(4);function O(e){var t=e.level,r={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 r.hasOwnProperty(t)?Object(d.createElement)(f.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(f.Path,{d:r[t]})):null}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var c=p()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return s()(this,r)}}var v=function(e){u()(r,e);var t=j(r);function r(){return c()(this,r),t.apply(this,arguments)}return a()(r,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(O,{level:e}),title:Object(g.sprintf)(Object(g.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(f.Toolbar,{isCollapsed:n,icon:Object(d.createElement)(O,{level:a}),controls:Object(m.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},148:function(e,t,r){"use strict";var n=r(0),c=r(109),o=r(78),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},u=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},l=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(u(c,r))},s=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(u(a,n));var l=a.match(/([\s]+)/g),s=l?l.length:0,b=c.slice(0,t+s);return Object(o.autop)(u(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,u=e.countType,b=void 0===u?"words":u,p=e.className,d=void 0===p?"":p,m=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var u=a(n),b=Object(c.count)(u,r);return b<=t?u:"words"===r?l(u,t):s(u,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},m)}},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(11),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return function(e){return t((function(){throw e}))}}},16:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},161:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.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(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},166: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(11),c=r.n(n),o=r(41),a=r(36),i=r(0),u=r(97),l=r(6),s=r(58),b=function(e){var t=Object(u.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e])]},p=function(e,t,r){var n=Object(u.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),l=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){l(r,e,t)}),[r,e])]},d=function(e,t){var r=Object(u.a)(),n=b(t=t||r),o=c()(n,2),a=o[0],p=o[1],d=Object(s.a)(e),m=Object(i.useRef)(!1);return Object(i.useEffect)((function(){p(Object(l.assign)({},a,d)),m.current=!0}),[d]),m.current?[a,p]:[e,p]}},168:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(5),o=Object(n.createElement)("img",{src:c.Q+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},189:function(e,t,r){"use strict";r.d(t,"c",(function(){return d})),r.d(t,"b",(function(){return m})),r.d(t,"a",(function(){return g}));var n=r(8),c=r.n(n),o=r(55),a=r.n(o),i=r(3);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s,b,p={code:i.CURRENCY.code,symbol:i.CURRENCY.symbol,thousandSeparator:i.CURRENCY.thousandSeparator,decimalSeparator:i.CURRENCY.decimalSeparator,minorUnit:i.CURRENCY.precision,prefix:(s=i.CURRENCY.symbol,b=i.CURRENCY.symbolPosition,{left:s,left_space:" "+s,right:"",right_space:""}[b]||""),suffix:function(e,t){return{left:"",left_space:"",right:e,right_space:" "+e}[t]||""}(i.CURRENCY.symbol,i.CURRENCY.symbolPosition)},d=function(e){if(!e||"object"!==a()(e))return p;var t=e.currency_code,r=e.currency_symbol,n=e.currency_thousand_separator,c=e.currency_decimal_separator,o=e.currency_minor_unit,i=e.currency_prefix,u=e.currency_suffix;return{code:t||"USD",symbol:r||"$",thousandSeparator:"string"==typeof n?n:",",decimalSeparator:"string"==typeof c?c:".",minorUnit:Number.isFinite(o)?o:2,prefix:"string"==typeof i?i:"$",suffix:"string"==typeof u?u:""}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l(l({},p),e)},g=function(e,t){if(""===e||void 0===e)return"";var r=parseInt(e,10);if(!Number.isFinite(r))return"";var n=m(t),c=r/Math.pow(10,n.minorUnit),o=n.prefix+c+n.suffix,a=document.createElement("textarea");return a.innerHTML=o,a.value}},191:function(e,t,r){"use strict";t.a={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0}}},192:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),u=r(30),l=r(37);r(489);t.a=function(e){var t=e.className,r=e.headingLevel,n=void 0===r?2:r,a=e.productLink,s=void 0===a||a,b=c()(e,["className","headingLevel","productLink"]),p=Object(l.useInnerBlockLayoutContext)().parentClassName,d=Object(l.useProductDataContext)(),m=b.product||d.product,g="h".concat(n);if(!m)return Object(o.createElement)(g,{className:i()(t,"wc-block-components-product-title","".concat(p,"__product-title"))});var f=Object(u.decodeEntities)(m.name);return Object(o.createElement)(g,{className:i()(t,"wc-block-components-product-title","".concat(p,"__product-title"))},s?Object(o.createElement)("a",{href:m.permalink,rel:"nofollow"},f):f)}},193:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),u=r(54),l=r(189),s=r(37),b=(r(490),function(e){return e.price_range&&e.price_range.min_amount&&e.price_range.max_amount}),p=function(e){var t=e.currency,r=e.minAmount,n=e.maxAmount,c=Object(s.useInnerBlockLayoutContext)().parentClassName;return Object(o.createElement)("span",{className:i()("wc-block-components-product-price__value","".concat(c,"__product-price__value"))},Object(o.createElement)(u.a,{currency:t,value:r})," — ",Object(o.createElement)(u.a,{currency:t,value:n}))},d=function(e){var t=e.currency,r=e.price,n=e.regularPrice,c=Object(s.useInnerBlockLayoutContext)().parentClassName;return Object(o.createElement)(o.Fragment,null,n!==r&&Object(o.createElement)("del",{className:i()("wc-block-components-product-price__regular","".concat(c,"__product-price__regular"))},Object(o.createElement)(u.a,{currency:t,value:n})),Object(o.createElement)("span",{className:i()("wc-block-components-product-price__value","".concat(c,"__product-price__value"))},Object(o.createElement)(u.a,{currency:t,value:r})))};t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(s.useInnerBlockLayoutContext)().parentClassName,a=Object(s.useProductDataContext)(),u=r.product||a.product;if(!u)return Object(o.createElement)("div",{className:i()(t,"price","wc-block-components-product-price","".concat(n,"__product-price"))});var m=u.prices||{},g=Object(l.c)(m);return Object(o.createElement)("div",{className:i()(t,"price","wc-block-components-product-price","".concat(n,"__product-price"))},b(m)?Object(o.createElement)(p,{currency:g,minAmount:m.price_range.min_amount,maxAmount:m.price_range.max_amount}):Object(o.createElement)(d,{currency:g,price:m.price,regularPrice:m.regular_price}))}},194:function(e,t,r){"use strict";t.a={productLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"}}},195:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(15),u=r.n(i),l=r(0),s=(r(2),r(7)),b=r.n(s),p=r(5),d=r(37),m=r(134);r(493);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(){return Object(l.createElement)("img",{src:p.C,alt:""})},j=function(e){var t=e.image,r=e.onLoad,n=e.loaded,c=e.showFullSize,o=t||{},a=o.thumbnail,i=o.src,u=o.srcset,s=o.sizes,b={alt:o.alt,onLoad:r,hidden:!n,src:a};return c&&(b=f(f({},b),{},{src:i,srcSet:u,sizes:s})),Object(l.createElement)(l.Fragment,null,Object(l.createElement)("img",b),!n&&Object(l.createElement)(O,null))};t.a=function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.productLink,o=void 0===c||c,i=e.showSaleBadge,s=e.saleBadgeAlign,p=void 0===s?"right":s,g=u()(e,["className","imageSizing","productLink","showSaleBadge","saleBadgeAlign"]),f=Object(d.useInnerBlockLayoutContext)().parentClassName,v=Object(d.useProductDataContext)(),h=g.product||v.product,w=Object(l.useState)(!1),y=a()(w,2),_=y[0],k=y[1];if(!h)return Object(l.createElement)("div",{className:b()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder","".concat(f,"__product-image"))},Object(l.createElement)(O,null));var E=(null==h?void 0:h.images)&&h.images.length?h.images[0]:null;return Object(l.createElement)("div",{className:b()(t,"wc-block-components-product-image","".concat(f,"__product-image"))},o?Object(l.createElement)("a",{href:h.permalink,rel:"nofollow"},!!i&&Object(l.createElement)(m.a,{align:p,product:h}),Object(l.createElement)(j,{image:E,onLoad:function(){return k(!0)},loaded:_,showFullSize:"cropped"!==n})):Object(l.createElement)(l.Fragment,null,!!i&&Object(l.createElement)(m.a,{align:p,product:h}),Object(l.createElement)(j,{image:E,onLoad:function(){return k(!0)},loaded:_,showFullSize:"cropped"!==n})))}},196:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),u=r.n(i),l=r(37),s=(r(494),function(e){var t=parseFloat((null==e?void 0:e.average_rating)||0);return Number.isFinite(t)&&t>0?t:0});t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)(),b=r.product||i.product,p=s(b);if(!p)return null;var d={width:p/5*100+"%"},m=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),p);return Object(o.createElement)("div",{className:u()(t,"star-rating","wc-block-components-product-rating","".concat(n,"__product-rating"))},Object(o.createElement)("div",{className:u()("wc-block-components-product-rating__stars","".concat(n,"__product-rating__stars")),role:"img","aria-label":m},Object(o.createElement)("span",{style:d},m)))}},197:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(15),a=r.n(o),i=r(0),u=(r(2),r(7)),l=r.n(u),s=r(1),b=r(357),p=r(30),d=r(291),m=r(37),g=(r(495),function(e){var t=e.product,r=Object(i.useRef)(!0),n=t.id,o=t.permalink,a=t.add_to_cart,u=t.has_options,m=t.is_purchasable,g=t.is_in_stock,f=Object(b.a)(n),O=f.cartQuantity,j=f.addingToCart,v=f.addToCart;Object(i.useEffect)((function(){r.current?r.current=!1:Object(d.a)()}),[O]);var h=Number.isFinite(O)&&O>0,w=!u&&m&&g,y=Object(p.decodeEntities)((null==a?void 0:a.description)||""),_=h?Object(s.sprintf)(Object(s._n)("%d in cart","%d in cart",O,"woo-gutenberg-products-block"),O):Object(p.decodeEntities)((null==a?void 0:a.text)||Object(s.__)("Add to cart","woo-gutenberg-products-block")),k=w?"button":"a",E={};return w?E.onClick=function(){v()}:(E.href=o,E.rel="nofollow"),Object(i.createElement)(k,c()({"aria-label":y,className:l()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},E),_)}),f=function(){return Object(i.createElement)("button",{className:l()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.a=function(e){var t=e.className,r=a()(e,["className"]),n=Object(m.useInnerBlockLayoutContext)().parentClassName,c=Object(m.useProductDataContext)(),o=r.product||c.product;return Object(i.createElement)("div",{className:l()(t,"wp-block-button","wc-block-components-product-button","".concat(n,"__product-add-to-cart"))},o?Object(i.createElement)(g,{product:o}):Object(i.createElement)(f,null))}},198:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),u=r(148),l=r(3),s=r(37);r(496);t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(s.useInnerBlockLayoutContext)().parentClassName,a=(Object(s.useProductDataContext)()||r).product;if(!a)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary")});var b=a.short_description?a.short_description:a.description;if(!b)return null;var p=Object(l.getSetting)("wordCountType","words");return Object(o.createElement)(u.a,{className:i()(t,"wc-block-components-product-summary","".concat(n,"__product-summary")),source:b,maxLength:150,countType:p})}},199:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),u=r.n(i),l=r(37);r(497);t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)(),s=(r.product||i.product||{}).sku||"";return s?Object(o.createElement)("div",{className:u()(t,"wc-block-components-product-sku","".concat(n,"__product-sku"))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,s)):null}},200:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),u=r.n(i),l=r(37),s=r(6);r(498);t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=(Object(l.useProductDataContext)()||r||{}).product;return Object(s.isEmpty)(i)||Object(s.isEmpty)(i.categories)?null:Object(o.createElement)("div",{className:u()(t,"wc-block-components-product-category-list","".concat(n,"__product-category-list"))},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(i.categories).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"category-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}},201:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),u=r.n(i),l=r(37),s=r(6);r(499);t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=(Object(l.useProductDataContext)()||r||{}).product;return Object(s.isEmpty)(i)||Object(s.isEmpty)(i.tags)?null:Object(o.createElement)("div",{className:u()(t,"wc-block-components-product-tag-list","".concat(n,"__product-tag-list"))},Object(a.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(i.tags).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}},202:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),u=r.n(i),l=r(37),s=r(6),b=(r(500),function(e){return Object(a.sprintf)(Object(a.__)("%d left in stock","woo-gutenberg-products-block"),e)}),p=function(e,t){return t?Object(a.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(a.__)("In Stock","woo-gutenberg-products-block"):Object(a.__)("Out of Stock","woo-gutenberg-products-block")};t.a=function(e){var t=e.className,r=c()(e,["className"]),n=Object(l.useInnerBlockLayoutContext)().parentClassName,a=Object(l.useProductDataContext)(),i=r.product||a.product||{};if(Object(s.isEmpty)(i)||!i.is_purchasable)return null;var d=!!i.is_in_stock,m=i.low_stock_remaining,g=i.is_on_backorder;return Object(o.createElement)("div",{className:u()(t,"wc-block-components-product-stock-indicator","".concat(n,"__stock-indicator"),{"wc-block-components-product-stock-indicator--in-stock":d,"wc-block-components-product-stock-indicator--out-of-stock":!d,"wc-block-components-product-stock-indicator--low-stock":!!m,"wc-block-components-product-stock-indicator--available-on-backorder":!!g})},m?b(m):p(d,g))}},203:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1}}},204:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(41),c=r(36),o=r(0),a=r(150),i=r(58),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,l=void 0===u?[]:u,s=e.query,b=void 0===s?{}:s,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var m=Object(o.useRef)({results:[],isLoading:!0}),g=Object(i.a)(b),f=Object(i.a)(l),O=Object(a.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,g,f],a=c.getCollectionError.apply(c,o);return a&&O(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,f,g,d]);return null!==j&&(m.current=j),m.current}},205:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),u=r(11),l=r.n(u),s=r(357),b=r(291),p=Object(o.createContext)({product:{},productId:0,variationId:0,variationData:{},cartItemData:{},quantity:1,minQuantity:1,maxQuantity:99,quantityInCart:0,setQuantity:function(e){},setVariationId:function(e){},setVariationData:function(e){},setCartItemData:function(e){},showFormElements:!1,formInitialized:!1,formDisabled:!0,formSubmitting:!1,onChange:function(){},onSubmit:function(){},onSuccess:function(){},onFail:function(){}}),d=function(){return Object(o.useContext)(p)},m=function(e){var t=e.children,r=e.product,n=e.showFormElements,c=r.id||0,a=Object(o.useState)(0),i=l()(a,2),u=i[0],d=i[1],m=Object(o.useState)({}),f=l()(m,2),O=f[0],j=f[1],v=Object(o.useState)({}),h=l()(v,2),w=h[0],y=h[1],_=Object(o.useState)(1),k=l()(_,2),E=k[0],P=k[1],C=Object(s.a)(c),S=C.addToCart,N=C.addingToCart,x=C.cartQuantity,D=C.cartIsLoading;!function(e){var t=Object(o.useRef)(!0);Object(o.useEffect)((function(){t.current?t.current=!1:Object(b.a)()}),[e])}(x);var B=!D&&c>0,L=N||!B||!g(r),R=Object(o.useCallback)((function(){S(E)}),[S,E]),I=Object(o.useCallback)((function(){}),[]),T=Object(o.useCallback)((function(){}),[]),z=Object(o.useCallback)((function(){}),[]),V={product:r,productId:c,variationId:u,variationData:O,cartItemData:w,quantity:E,minQuantity:1,maxQuantity:r.quantity_limit||99,quantityInCart:x,setQuantity:P,setVariationId:d,setVariationData:j,setCartItemData:y,showFormElements:n,formInitialized:B,formDisabled:L,formSubmitting:N,onChange:I,onSubmit:R,onSuccess:T,onFail:z};return Object(o.createElement)(p.Provider,{value:V},t)},g=function(e){var t=e.is_purchasable;return void 0!==t&&t},f=r(37),O=r(6),j=(r(352),r(1)),v=r(10),h=r.n(v),w=r(295),y=(r(501),function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,a=e.children,u=c()(e,["className","showSpinner","children"]),l=i()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(o.createElement)(w.a,h()({className:l},u),n&&Object(o.createElement)("span",{className:"wc-block-components-button__spinner","aria-hidden":"true"}),Object(o.createElement)("span",{className:"wc-block-components-button__text"},a))}),_=r(60),k=r(502),E=function(e){var t=e.className,r=e.href,n=e.text;return Object(o.createElement)(y,{className:t,href:r,rel:"nofollow"},n)},P=function(e){var t=e.className,r=e.quantityInCart,n=e.loading,c=e.disabled,a=e.onClick,i=Object(o.useState)(!1),u=l()(i,2),s=u[0],b=u[1];return Object(o.createElement)(y,{className:t,disabled:c,showSpinner:n,onClick:function(){a(),b(!0)}},r>0?Object(j.sprintf)(Object(j._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(j.__)("Add to cart","woo-gutenberg-products-block"),s&&Object(o.createElement)(_.a,{srcElement:k.a,alt:Object(j.__)("Done","woo-gutenberg-products-block")}))},C=function(){var e=d(),t=e.showFormElements,r=e.product,n=e.quantityInCart,c=e.formDisabled,a=e.formSubmitting,i=e.onSubmit,u=r.is_purchasable,l=void 0===u||u,s=r.has_options,b=r.add_to_cart,p=void 0===b?{url:"",text:""}:b;return!t&&s||!l?Object(o.createElement)(E,{className:"wc-block-components-product-add-to-cart-button",href:p.url,text:p.text||Object(j.__)("View Product","woo-gutenberg-products-block")}):Object(o.createElement)(P,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:n,disabled:c,loading:a,onClick:i})},S=function(e){var t=e.disabled,r=e.min,n=e.max,c=e.value,a=e.onChange;return Object(o.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:c,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){a(e.target.value)}})},N=function(e){var t=e.reason,r=void 0===t?Object(j.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(o.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},x=function(){var e=d(),t=e.product,r=e.quantity,n=e.minQuantity,c=e.maxQuantity,a=e.setQuantity,i=e.formDisabled;return t.id&&!t.is_purchasable?Object(o.createElement)(N,null):t.id&&!t.is_in_stock?Object(o.createElement)(N,{reason:Object(j.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(S,{value:r,min:n,max:c,disabled:i,onChange:a}),Object(o.createElement)(C,null))},D=(r(503),r(8)),B=r.n(D),L=r(62),R=r.n(L),I=r(30),T=r(4),z={value:"",label:Object(j.__)("Select an option","woo-gutenberg-products-block")},V=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,c=e.selected,a=void 0===c?"":c,i=e.onChange,u=void 0===i?function(){}:i;return Object(o.createElement)(T.SelectControl,{className:"wc-block-components-product-add-to-cart-attribute-picker__select",label:Object(I.decodeEntities)(t),value:a||"",options:[z].concat(R()(n)),onChange:u})},M=function(e){var t=e.selectedAttributes,r=e.variationAttributes,n=e.attributeNames;return Object.keys(r).filter((function(e){return n.every((function(n){var c=t[n]||"",o=r[e][n];return""===c||(null===o||o===c)}))}))};function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){B()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F=function(e){var t=e.attributes,r=e.variationAttributes,n=Object(o.useState)(0),c=l()(n,2),a=c[0],i=c[1],u=Object(o.useState)([]),s=l()(u,2),b=s[0],p=s[1],d=Object.keys(t),m=Object.values(b).filter(Boolean).length>0,g=Object.values(b).filter((function(e){return""!==e})).length===d.length,f=Object(o.useMemo)((function(){var e=[];return d.forEach((function(n){var c=t[n],o=d.filter((function(e){return e!==n})),a=m?M({selectedAttributes:b,variationAttributes:r,attributeNames:o}):null,i=null!==a?a.map((function(e){return r[e][n]})):null;e[n]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:r}:null})).filter(Boolean)}(c.terms,i)})),e}),[t,r,d,b,m]);return Object(o.useEffect)((function(){if(g){var e=M({selectedAttributes:b,variationAttributes:r,attributeNames:d});i(e[0]||0)}else i(0)}),[b,r,d,g]),Object(o.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},d.map((function(e){return Object(o.createElement)(V,{key:e,attributeName:e,options:f[e],selected:b[e],onChange:function(t){p(H(H({},b),{},B()({},e,t)))}})})),Object(o.createElement)("p",null,"Matched variation ID: ",a))},Q=function(e){var t=e.product,r=t.attributes,n=void 0===r?{}:r,c=t.variations,a=void 0===c?[]:c,i=function(e){return e?Object(O.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):[]}(n),u=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t[r]=n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),[])})),t}(a);return 0===Object.keys(i).length||0===u.length?null:Object(o.createElement)(F,{attributes:i,variationAttributes:u})},U=function(){var e=d(),t=e.product,r=e.quantity,n=e.minQuantity,c=e.maxQuantity,a=e.setQuantity,i=e.formDisabled;return t.id&&!t.is_purchasable?Object(o.createElement)(N,null):t.id&&!t.is_in_stock?Object(o.createElement)(N,{reason:Object(j.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(Q,{product:t}),Object(o.createElement)(S,{value:r,min:n,max:c,disabled:i,onChange:a}),Object(o.createElement)(C,null))},q=function(){return Object(o.createElement)(C,null)},Y=function(){return Object(o.createElement)(T.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},G=function(){return Object(o.createElement)(Y,null)},K=function(e){var t=e.productType;return"variable"===t?Object(o.createElement)(U,null):"grouped"===t?Object(o.createElement)(G,null):"external"===t?Object(o.createElement)(q,null):"simple"===t||"variation"===t?Object(o.createElement)(x,null):null};t.a=function(e){var t=e.className,r=e.showFormElements,n=c()(e,["className","showFormElements"]),a=Object(f.useProductDataContext)(),u=n.product||a.product||{},l=i()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(O.isEmpty)(u)});return Object(o.createElement)(m,{product:u,showFormElements:r},Object(o.createElement)("div",{className:l},Object(o.createElement)(o.Fragment,null,r?Object(o.createElement)(K,{productType:u.type||"simple"}):Object(o.createElement)(C,null))))}},209:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(36),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,u=void 0===i?{}:i,l={isEditor:!0,currentPostId:Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),previewData:u};return Object(n.createElement)(o.Provider,{value:l},t)}},21:function(e,t){!function(){e.exports=this.wp.compose}()},211:function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return k}));var n=r(8),c=r.n(n),o=r(11),a=r.n(o),i=r(0),u=(r(2),r(36)),l=r(10),s=r.n(l),b=r(7),p=r.n(b),d=r(900),m=(r(284),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=_().removeNotice,c=p()(t,"wc-block-components-notices"),o=r.filter((function(e){return"snackbar"!==e.type}));return o.length?Object(i.createElement)("div",{className:c},o.map((function(e){return Object(i.createElement)(d.a,s()({key:"store-notice-"+e.id},e,{className:p()("wc-block-components-notices__notice","woocommerce-message",m(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)}))):null},f=r(904),O=r(106),j=r(209),v=function(){var e=Object(j.b)().isEditor,t=Object(O.a)(),r=t.notices,n=t.removeNotice,c=r.filter((function(e){return"snackbar"===e.type}));return e?null:Object(i.createElement)(f.a,{notices:c,className:"wc-block-components-notices__snackbar",onRemove:n})};function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),_=function(){return Object(i.useContext)(y)},k=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,l=e.context,s=void 0===l?"wc/core":l,b=Object(u.useDispatch)("core/notices"),p=b.createNotice,d=b.removeNotice,m=Object(i.useState)(!1),f=a()(m,2),O=f[0],j=f[1],h=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};p(e,t,w(w({},r),{},{context:r.context||s}))}),[p,s]),_=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;d(e,t)}),[d,s]),k=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h("default",e,w(w({},t),{},{type:"snackbar"}))}),[h]),E={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(s)}}),[s]).notices,createNotice:h,createSnackbarNotice:k,removeNotice:_,context:s,setIsSuppressed:j},P=O?null:Object(i.createElement)(g,{className:n,notices:E.notices}),C=O?null:Object(i.createElement)(v,null);return Object(i.createElement)(y.Provider,{value:E},o&&P,t,C)}},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},230:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(15),a=r.n(o),i=r(0),u=r(59),l=r(7),s=r.n(l),b=function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]),o=s()("dashicon","dashicons-arrow-down-alt2",t);return Object(i.createElement)(u.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:o,width:r,height:r},n),Object(i.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7z"}))},p=function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]),o=s()("dashicon","dashicons-arrow-down-alt2",t);return Object(i.createElement)(u.a,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:o,width:r,height:r},n),Object(i.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"}))};t.a=function(e){let t=function(){return null};switch(e.icon){case"arrow-down-alt2":t=b;break;case"no-alt":t=p}return Object(i.createElement)(t,{size:e.size||20,className:e.className})}},254:function(e,t){!function(){e.exports=this.wp.deprecated}()},255:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(23),a=r.n(o),i=r(26),u=r.n(i),l=r(20),s=r.n(l),b=r(24),p=r.n(b),d=r(25),m=r.n(d),g=r(12),f=r.n(g),O=r(8),j=r.n(O),v=r(0),h=r(9);r(505);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var c=f()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return m()(this,r)}}t.a=function(e){var t=function(t){p()(n,t);var r=w(n);function n(){var e;return a()(this,n),e=r.call(this),j()(s()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),j()(s()(e),"moveFocusToTop",(function(t){var r=e.scrollPointRef.current.parentElement.querySelectorAll(t);r.length&&r[0].focus()})),j()(s()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(h.createRef)(),e}return u()(n,[{key:"render",value:function(){return Object(v.createElement)(h.Fragment,null,Object(v.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(v.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(h.Component);return t.displayName="withScrollToTop",t}},291:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=window.Event||null,c=function(){if("function"==typeof n){var e=new n("wc_fragment_refresh",{bubbles:!0,cancelable:!0});document.body.dispatchEvent(e)}else{var t=document.createEvent("Event");t.initEvent("wc_fragment_refresh",!0,!0),document.body.dispatchEvent(t)}}},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},30:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},357:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(11),c=r.n(n),o=r(0),a=r(36),i=r(107),u=r(41),l=r(30),s=r(106),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(u.CART_STORE_KEY).addItemToCart,r=Object(i.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(s.a)(),m=d.addErrorNotice,g=d.removeNotice,f=Object(o.useState)(!1),O=c()(f,2),j=O[0],v=O[1],h=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==h.current&&(h.current=t)}),[n,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;v(!0),t(e,r).then((function(e){!0===e&&g("add-to-cart")})).catch((function(e){m(Object(l.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},36:function(e,t){!function(){e.exports=this.wp.data}()},37:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},4:function(e,t){!function(){e.exports=this.wp.components}()},41:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},44:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(9)),i=r(7),u=r.n(i);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,i=e.wrapperProps,l=null!=r,b=null!=n;return!l&&b?(t=c||"span",i=s(s({},i),{},{className:u()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,n)):(t=c||a.Fragment,l&&b&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))};b.defaultProps={wrapperProps:{}},t.a=b},48:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},491:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{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:"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=o},5:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"G",(function(){return o})),r.d(t,"M",(function(){return a})),r.d(t,"x",(function(){return i})),r.d(t,"z",(function(){return u})),r.d(t,"l",(function(){return l})),r.d(t,"y",(function(){return s})),r.d(t,"B",(function(){return b})),r.d(t,"n",(function(){return p})),r.d(t,"A",(function(){return d})),r.d(t,"m",(function(){return m})),r.d(t,"C",(function(){return g})),r.d(t,"t",(function(){return f})),r.d(t,"w",(function(){return O})),r.d(t,"q",(function(){return j})),r.d(t,"r",(function(){return v})),r.d(t,"s",(function(){return h})),r.d(t,"j",(function(){return w})),r.d(t,"I",(function(){return y})),r.d(t,"N",(function(){return _})),r.d(t,"p",(function(){return k})),r.d(t,"o",(function(){return E})),r.d(t,"F",(function(){return P})),r.d(t,"c",(function(){return C})),r.d(t,"u",(function(){return S})),r.d(t,"v",(function(){return N})),r.d(t,"Q",(function(){return D})),r.d(t,"H",(function(){return B})),r.d(t,"a",(function(){return L})),r.d(t,"K",(function(){return R})),r.d(t,"b",(function(){return I})),r.d(t,"J",(function(){return T})),r.d(t,"h",(function(){return z})),r.d(t,"L",(function(){return A})),r.d(t,"g",(function(){return H})),r.d(t,"i",(function(){return F})),r.d(t,"E",(function(){return Q})),r.d(t,"D",(function(){return U})),r.d(t,"P",(function(){return q})),r.d(t,"O",(function(){return Y})),r.d(t,"d",(function(){return G})),r.d(t,"e",(function(){return K})),r.d(t,"f",(function(){return W})),r.d(t,"R",(function(){return $})),r.d(t,"S",(function(){return X}));var n=r(3),c=Object(n.getSetting)("currentUserIsAdmin",!1),o=Object(n.getSetting)("reviewRatingsEnabled",!0),a=Object(n.getSetting)("showAvatars",!0),i=Object(n.getSetting)("max_columns",6),u=Object(n.getSetting)("min_columns",1),l=Object(n.getSetting)("default_columns",3),s=Object(n.getSetting)("max_rows",6),b=Object(n.getSetting)("min_rows",1),p=Object(n.getSetting)("default_rows",3),d=Object(n.getSetting)("min_height",500),m=Object(n.getSetting)("default_height",500),g=Object(n.getSetting)("placeholderImgSrc",""),f=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),O=Object(n.getSetting)("limitTags"),j=Object(n.getSetting)("hasProducts",!0),v=Object(n.getSetting)("hasTags",!0),h=Object(n.getSetting)("homeUrl",""),w=Object(n.getSetting)("couponsEnabled",!0),y=Object(n.getSetting)("shippingEnabled",!0),_=Object(n.getSetting)("taxesEnabled",!0),k=Object(n.getSetting)("displayItemizedTaxes",!1),E=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),P=Object(n.getSetting)("productCount",0),C=Object(n.getSetting)("attributes",[]),S=Object(n.getSetting)("isShippingCalculatorEnabled",!0),N=Object(n.getSetting)("isShippingCostHidden",!1),x=Object(n.getSetting)("woocommerceBlocksPhase",1),D=Object(n.getSetting)("wcBlocksAssetUrl",""),B=Object(n.getSetting)("shippingCountries",{}),L=Object(n.getSetting)("allowedCountries",{}),R=Object(n.getSetting)("shippingStates",{}),I=Object(n.getSetting)("allowedStates",{}),T=Object(n.getSetting)("shippingMethodsExist",!1),z=Object(n.getSetting)("checkoutShowLoginReminder",!0),V={id:0,title:"",permalink:""},M=Object(n.getSetting)("storePages",{shop:V,cart:V,checkout:V,privacy:V,terms:V}),A=M.shop.permalink,H=M.checkout.id,F=M.checkout.permalink,Q=M.privacy.permalink,U=M.privacy.title,q=M.terms.permalink,Y=M.terms.title,G=M.cart.id,K=M.cart.permalink,W=Object(n.getSetting)("checkoutAllowsGuest",!1),J=(Object(n.getSetting)("checkoutAllowsSignup",!1),r(14)),$=function(e,t){if(x>2)return Object(J.registerBlockType)(e,t)},X=function(e,t){if(x>1)return Object(J.registerBlockType)(e,t)}},502:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{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:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},504:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(9),c=function(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,r.current]),r.current}},53:function(e,t){!function(){e.exports=this.wp.keycodes}()},54:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(8),a=r.n(o),i=r(15),u=r.n(i),l=r(0),s=r(154),b=r(7),p=r.n(b);r(252);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=u()(e,["className","value","currency","onValueChange"]);if("-"===r)return null;var i=r/Math.pow(10,n.minorUnit);if(!Number.isFinite(i))return null;var b=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),d=m(m(m({displayType:"text"},a),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),g=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(l.createElement)(s.a,c()({className:b},d,{value:i,onValueChange:g}))}},57:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},58:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(48),o=r.n(c),a=function(e){var t=Object(n.useRef)();return o()(e,t.current)||(t.current=e),t.current}},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(15),a=r.n(o),i=r(9);r(2);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,["srcElement","size"]);return Object(i.isValidElement)(t)&&Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o))}},71:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(23),a=r.n(o),i=r(26),u=r.n(i),l=r(20),s=r.n(l),b=r(24),p=r.n(b),d=r(25),m=r.n(d),g=r(12),f=r.n(g),O=r(0),j=r(6),v=r(7),h=r.n(v),w=r(4),y=r(21);r(169);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var c=f()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return m()(this,r)}}var k=function(e){p()(r,e);var t=_(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return u()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,u=r.help,l=r.options,s=r.value,b="inspector-toggle-button-control-".concat(a);return u&&(e=Object(j.isFunction)(u)?u(o):u),Object(O.createElement)(w.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(O.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(O.createElement)(w.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isDefault=!0,o["aria-pressed"]=!1),Object(O.createElement)(w.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),r}(O.Component);t.a=Object(y.withInstanceId)(k)},74:function(e,t){!function(){e.exports=this.wp.dom}()},76:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(4)),i=r(5);t.a=function(e){var t=e.columns,r=e.rows,u=e.setAttributes,l=e.alignButtons;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:function(e){var t=Object(o.clamp)(e,i.z,i.x);u({columns:Object(o.isNaN)(t)?"":t})},min:i.z,max:i.x}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,i.B,i.y);u({rows:Object(o.isNaN)(t)?"":t})},min:i.B,max:i.y}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:l?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:l,onChange:function(){return u({alignButtons:!l})}}))}},78:function(e,t){!function(){e.exports=this.wp.autop}()},785:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{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:"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=o},789:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{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:"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(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.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=o},794:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{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:"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=o},795:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(5),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("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:c.Q+"img/pennant.jpg",thumbnail:c.Q+"img/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(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},796:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{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:"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=o},802:function(e,t,r){"use strict";var n=r(0),c=r(59),o=Object(n.createElement)(c.a,{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:"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=o},803:function(e,t,r){},84:function(e,t){!function(){e.exports=this.wp.a11y}()},855:function(e,t,r){"use strict";r.r(t);var n=r(8),c=r.n(n),o=r(10),a=r.n(o),i=r(0),u=r(1),l=r(22),s=r(14),b=r(60),p=r(59),d=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.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"})),m=r(7),g=r.n(m),f=function(e){var t=e.attributes;return Object(i.createElement)("div",{className:g()("is-loading",t.className)})},O={category:"woocommerce",keywords:[Object(u.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:["woocommerce/all-products","woocommerce/single-product"],save:f,deprecated:[{save:function(){}}]},j=r(191),v=r(4),h=r(147),w=r(192);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var k={title:Object(u.__)("Product Title","woo-gutenberg-products-block"),description:Object(u.__)("Display the name of a product.","woo-gutenberg-products-block"),icon:{src:"heading",foreground:"#96588a"},attributes:j.a,edit:function(e){var t=e.attributes,r=e.setAttributes,n=t.headingLevel,c=t.productLink;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)("p",null,Object(u.__)("Level","woo-gutenberg-products-block")),Object(i.createElement)(h.a,{isCollapsed:!1,minLevel:1,maxLevel:7,selectedLevel:n,onChange:function(e){return r({headingLevel:e})}}),Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(u.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:c,onChange:function(){return r({productLink:!c})}}))),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(w.a,t)))}};Object(s.registerBlockType)("woocommerce/product-title",_(_({},O),k));var E=r(491),P=r(193);function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N={title:Object(u.__)("Product Price","woo-gutenberg-products-block"),description:Object(u.__)("Display the price of a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:E.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(P.a,t)}};Object(s.registerBlockType)("woocommerce/product-price",S(S({},O),N));var x=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.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"})),D=r(194),B=r(182),L=r(71),R=r(3),I=r(195);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V={title:Object(u.__)("Product Image","woo-gutenberg-products-block"),description:Object(u.__)("Display the main product image","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:x}),foreground:"#96588a"},attributes:D.a,edit:function(e){var t=e.attributes,r=e.setAttributes,n=t.productLink,c=t.imageSizing,o=t.showSaleBadge,a=t.saleBadgeAlign;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(u.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({productLink:!n})}}),Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(u.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showSaleBadge:!o})}}),o&&Object(i.createElement)(L.a,{label:Object(u.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:a,options:[{label:Object(u.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(u.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(u.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}),Object(i.createElement)(L.a,{label:Object(u.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(B.a)(Object(u.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(i.createElement)("a",{href:"".concat(Object(R.getAdminLink)("customize.php"),"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images"),target:"_blank",rel:"noopener noreferrer"})}),value:c,options:[{label:Object(u.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(u.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:function(e){return r({imageSizing:e})}}))),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(I.a,t)))}};Object(s.registerBlockType)("woocommerce/product-image",z(z({},O),V));var M=r(794),A=r(196);function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q={title:Object(u.__)("Product Rating","woo-gutenberg-products-block"),description:Object(u.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:M.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(A.a,t)}};Object(s.registerBlockType)("woocommerce/product-rating",F(F({},O),Q));var U=r(802),q=r(197);function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var K={title:Object(u.__)("Add to Cart Button","woo-gutenberg-products-block"),description:Object(u.__)("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:Object(i.createElement)(b.a,{srcElement:U.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(v.Disabled,null,Object(i.createElement)(q.a,t))}};Object(s.registerBlockType)("woocommerce/product-button",G(G({},O),K));var W=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),J=r(198);function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Z={title:Object(u.__)("Product Summary","woo-gutenberg-products-block"),description:Object(u.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:W}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(J.a,t)}};Object(s.registerBlockType)("woocommerce/product-summary",X(X({},O),Z));var ee=r(789),te=r(134);function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ce={title:Object(u.__)("On-Sale Badge","woo-gutenberg-products-block"),description:Object(u.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:ee.a}),foreground:"#96588a"},supports:{html:!1},edit:function(e){var t=e.attributes;return Object(i.createElement)(te.a,t)}};Object(s.registerBlockType)("woocommerce/product-sale-badge",ne(ne({},O),ce));var oe=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),ae=r(5),ie=r(131),ue=r(199);function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var be={title:Object(u.__)("Product SKU","woo-gutenberg-products-block"),description:Object(u.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:oe}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ie.a,null),Object(i.createElement)(ue.a,t))}};Object(ae.R)("woocommerce/product-sku",se(se({},O),be));var pe=r(785),de=r(200);function me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?me(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fe={title:Object(u.__)("Product Category List","woo-gutenberg-products-block"),description:Object(u.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:pe.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ie.a,null),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(de.a,t)))}};Object(ae.R)("woocommerce/product-category-list",ge(ge({},O),fe));var Oe=r(201);function je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?je(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var he={title:Object(u.__)("Product Tag List","woo-gutenberg-products-block"),description:Object(u.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:ee.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ie.a,null),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(Oe.a,t)))}};Object(ae.R)("woocommerce/product-tag-list",ve(ve({},O),he));var we=Object(i.createElement)(p.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)("g",{fillRule:"evenodd"},Object(i.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(i.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"}))),ye=r(202);function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ee={title:Object(u.__)("Product Stock Indicator","woo-gutenberg-products-block"),description:Object(u.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:we}),foreground:"#96588a"},edit:function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ie.a,null),Object(i.createElement)(ye.a,t))}};Object(ae.R)("woocommerce/product-stock-indicator",ke(ke({},O),Ee));var Pe=r(37),Ce=(r(352),r(205)),Se=r(203);function Ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var De={title:Object(u.__)("Add to Cart","woo-gutenberg-products-block"),description:Object(u.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:U.a}),foreground:"#96588a"},edit:function(e){var t=e.attributes,r=e.setAttributes,n=Object(Pe.useProductDataContext)().product||{},c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:g()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(ie.a,{productId:n.id||0}),"external"!==n.type&&Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Layout","woo-gutenberg-products-block")},Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Display form elements","woo-gutenberg-products-block"),help:Object(u.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:o,onChange:function(){return r({showFormElements:!o})}}))),Object(i.createElement)(v.Disabled,null,Object(i.createElement)(Ce.a,t)))},attributes:Se.a};Object(ae.R)("woocommerce/product-add-to-cart",xe(xe({},O),De));var Be=r(11),Le=r.n(Be),Re=r(23),Ie=r.n(Re),Te=r(20),ze=r.n(Te),Ve=r(24),Me=r.n(Ve),Ae=r(25),He=r.n(Ae),Fe=r(12),Qe=r.n(Fe),Ue=r(36),qe=r(21),Ye=(r(2),r(76)),Ge=r(863),Ke=r(795),We=r(161),Je=function(e,t){var r=t.className,n=t.contentVisibility;return g()(e,r,{"has-image":n&&n.image,"has-title":n&&n.title,"has-rating":n&&n.rating,"has-price":n&&n.price,"has-button":n&&n.button})},$e=function(e,t){return Object(i.createElement)(v.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(u.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(v.Button,{className:"wc-block-products__add-product-button",isDefault:!0,isLarge:!0,href:R.adminUrl+"post-new.php?post_type=product"},Object(u.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:We.a})),Object(i.createElement)(v.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(u.__)("Learn more","woo-gutenberg-products-block")))},Xe=function(e,t){return Object(i.createElement)(v.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(u.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],rt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,et(et({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};r(803);function nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ct(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ot=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(v.ToggleControl,{label:Object(u.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:ct(ct({},r),{},{orderBy:!r.orderBy})})}})},at=function(e,t){return Object(i.createElement)(v.SelectControl,{label:Object(u.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(u.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(u.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(u.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(u.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(u.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(u.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},it=r(26),ut=r.n(it),lt=r(9),st=r(55),bt=r.n(st),pt=r(15),dt=r.n(pt),mt=r(6),gt=r(44),ft=(r(806),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,l=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,c=Math.max(Math.floor(t-n/2),2),o=Math.min(Math.ceil(t+(n-(t-c))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(o-t))),2),maxIndex:o}}(c,t,a),s=l.minIndex,b=l.maxIndex,p=r&&Boolean(1!==s),d=r&&Boolean(b!==a),m=r&&Boolean(s>3),f=r&&Boolean(b<a-2);p&&3===s&&(s-=1),d&&b===a-2&&(b+=1);var O=[];if(s&&b)for(var j=s;j<=b;j++)O.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(gt.a,{screenReaderLabel:Object(u.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return o(t-1)},title:Object(u.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(gt.a,{label:"<",screenReaderLabel:Object(u.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:g()("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:function(){return o(1)},disabled:1===t},Object(i.createElement)(gt.a,{label:1,screenReaderLabel:Object(u.sprintf)(Object(u.__)("Page %d","woo-gutenberg-products-block"),1)})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(u.__)("…","woo-gutenberg-products-block")),O.map((function(e){return Object(i.createElement)("button",{key:e,className:g()("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:function(){return o(e)},disabled:t===e},Object(i.createElement)(gt.a,{label:e,screenReaderLabel:Object(u.sprintf)(Object(u.__)("Page %d","woo-gutenberg-products-block"),e)}))})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(u.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:g()("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:function(){return o(a)},disabled:t===a},Object(i.createElement)(gt.a,{label:a,screenReaderLabel:Object(u.sprintf)(Object(u.__)("Page %d","woo-gutenberg-products-block"),a)})),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return o(t+1)},title:Object(u.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(gt.a,{label:">",screenReaderLabel:Object(u.__)("Next page","woo-gutenberg-products-block")})))});ft.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var Ot=ft,jt=r(145),vt=(r(805),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(jt.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:r,options:[{key:"menu_order",label:Object(u.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(u.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(u.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(u.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(u.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(u.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(u.__)("Order products by","woo-gutenberg-products-block"),value:c})}),ht=r(183),wt=Object(ht.a)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(Pe.useInnerBlockLayoutContext)(),u=o.parentClassName,l=o.parentName,s=0===Object.keys(t).length,b=g()("".concat(u,"__product"),{"is-loading":s,"wc-block-layout--is-loading":s});return Object(i.createElement)("li",{className:b,"aria-hidden":s},function e(t,r,n,c){if(n){var o=Object(Ge.a)(t);return n.map((function(n,u){var l=Le()(n,2),s=l[0],b=l[1],p=void 0===b?{}:b,d=[];p.children&&p.children.length>0&&(d=e(t,r,p.children,c));var m=o[s];if(!m)return null;var g=r.id||0,f=["layout",s,u,c,g];return Object(i.createElement)(m,a()({key:f.join("_")},p,{children:d,product:r}))}))}}(l,t,c,n))})),yt=r(166),_t=r(204),kt=r(41),Et=r(58);function Pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var St=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(_t.a)(Ct(Ct({},t),{},{query:e})),n=r.results,c=r.isLoading,o=function(e,t){var r=t.namespace,n=t.resourceName,c=t.resourceValues,o=void 0===c?[]:c,a=t.query,i=void 0===a?{}:a;if(!r||!n)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(Et.a)(i),l=Object(Et.a)(o),s=Object(Ue.useSelect)((function(t){var c=t(kt.COLLECTIONS_STORE_KEY),o=[e,r,n,u,l];return{value:c.getCollectionHeader.apply(c,o),isLoading:c.hasFinishedResolution("getCollectionHeader",o)}}),[e,r,n,l,u]),b=s.value,p=s.isLoading;return{value:b,isLoading:void 0===p||p}}("x-wp-total",Ct(Ct({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},Nt=r(504),xt=r(255),Dt=r(84),Bt=(r(804),r(140)),Lt=function(){var e=Object(Pe.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(e,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:Bt.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(u.__)("No products","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(u.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Rt=r(796),It=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(Pe.useInnerBlockLayoutContext)().parentClassName;return Object(i.createElement)("div",{className:"".concat(n,"__no-products")},Object(i.createElement)(b.a,{className:"".concat(n,"__no-products-image"),alt:"",srcElement:Rt.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(u.__)("No products found","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(u.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(i.createElement)("button",{onClick:r},Object(u.__)("Reset Search","woo-gutenberg-products-block")))};function Tt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Vt=Object(xt.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,l=Object(yt.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=n.columns,o=n.rows;return zt(zt({},function(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:c*o,page:r})}({attributes:t,sortValue:o,currentPage:r})),s=Le()(l,1)[0],b=St(s),p=b.products,d=b.totalProducts,m=b.productsLoading,f=Object(Pe.useInnerBlockLayoutContext)().parentClassName,O=function(e){e.order,e.orderby,e.page,e.per_page;return dt()(e,["order","orderby","page","per_page"])}(s),j=Object(yt.b)("attributes",[]),v=Le()(j,2),h=v[0],w=v[1],y=Object(yt.b)("min_price"),_=Le()(y,2),k=_[0],E=_[1],P=Object(yt.b)("max_price"),C=Le()(P,2),S=C[0],N=C[1],x=Object(Nt.a)({totalQuery:O,totalProducts:d},(function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(mt.isEqual)(t,c)&&Number.isFinite(r)})),D="object"===bt()(x)&&Object(mt.isEqual)(O,x.totalQuery);Object(i.useEffect)((function(){D||(n(1),x&&function(e){Number.isFinite(e)&&(0===e?Object(Dt.speak)(Object(u.__)("No products found","woo-gutenberg-products-block")):Object(Dt.speak)(Object(u.sprintf)(Object(u._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[s]);var B,L,R,I,T,z=t.contentVisibility,V=t.columns*t.rows,M=!Number.isFinite(d)&&D?Math.ceil(x.totalProducts/V):Math.ceil(d/V),A=p.length?p:Array.from({length:V}),H=0!==p.length||m,F=h.length>0||Number.isFinite(k)||Number.isFinite(S);return Object(i.createElement)("div",{className:(B=t.columns,L=t.rows,R=t.alignButtons,I=t.align,T=void 0!==I?"align"+I:"",g()(f,T,"has-"+B+"-columns",{"has-multiple-rows":L>1,"has-aligned-buttons":R}))},z.orderBy&&H&&Object(i.createElement)(vt,{onChange:c,value:o}),!H&&F&&Object(i.createElement)(It,{resetCallback:function(){w([]),E(null),N(null)}}),!H&&!F&&Object(i.createElement)(Lt,null),H&&Object(i.createElement)("ul",{className:"".concat(f,"__products")},A.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(wt,{key:e.id||r,attributes:t,product:e})}))),M>1&&Object(i.createElement)(Ot,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:M}))})),Mt=function(e){var t=e.attributes,r=Object(i.useState)(1),n=Le()(r,2),c=n[0],o=n[1],a=Object(i.useState)(t.orderby),u=Le()(a,2),l=u[0],s=u[1];Object(i.useEffect)((function(){s(t.orderby)}),[t.orderby]);return Object(i.createElement)(Vt,{attributes:t,currentPage:c,onPageChange:function(e){o(e)},onSortChange:function(e){var t=e.target.value;s(t),o(1)},sortValue:l})},At=r(168);function Ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qe()(e);if(t){var c=Qe()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return He()(this,r)}}var Ft=function(e){Me()(r,e);var t=Ht(r);function r(){return Ie()(this,r),t.apply(this,arguments)}return ut()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;return t.isPreview?At.a:Object(i.createElement)(Pe.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Mt,{attributes:t,urlParameterSuffix:r}))}}]),r}(lt.Component);function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qe()(e);if(t){var c=Qe()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return He()(this,r)}}var Ut=function(e){Me()(r,e);var t=Qt(r);function r(){var e;Ie()(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),c()(ze()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(ze()(e),"blockMap",Object(Ge.a)("woocommerce/all-products")),c()(ze()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(ze()(e),"getTitle",(function(){return Object(u.__)("All Products","woo-gutenberg-products-block")})),c()(ze()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(ze()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(u.__)("Showing All Products block preview.","woo-gutenberg-products-block"))})),c()(ze()(e),"getInspectorControls",(function(){var t=e.props,r=t.attributes,n=t.setAttributes,c=r.columns,o=r.rows,a=r.alignButtons;return Object(i.createElement)(l.InspectorControls,{key:"inspector"},Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Ye.a,{columns:c,rows:o,alignButtons:a,setAttributes:n})),Object(i.createElement)(v.PanelBody,{title:Object(u.__)("Content Settings","woo-gutenberg-products-block")},ot(r,n),at(r,n)))})),c()(ze()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(l.BlockControls,null,Object(i.createElement)(v.Toolbar,{controls:[{icon:"edit",title:Object(u.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(ze()(e),"renderEditMode",(function(){var t={template:e.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(e.blockMap)};return 0!==e.props.attributes.layoutConfig.length&&(t.renderAppender=!1),Object(i.createElement)(v.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(u.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(i.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(i.createElement)(v.Tip,null,Object(u.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(i.createElement)(Pe.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(Pe.ProductDataContextProvider,{product:Ke.a[0]},Object(i.createElement)(l.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(v.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,isLarge:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:rt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(u.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(v.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=e.state.innerBlocks;n(r.clientId,c,!1),e.togglePreview()}},Object(u.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(v.IconButton,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(u.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];tt.map((function(e){var t=Le()(e,2),r=t[0],n=t[1];return c.push(Object(s.createBlock)(r,n)),!0})),n(r.clientId,c,!1),e.setState({innerBlocks:r.innerBlocks})}},Object(u.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(ze()(e),"renderViewMode",(function(){var t=e.props.attributes,r=t.layoutConfig,n=r&&0!==r.length,c=e.getTitle(),o=e.getIcon();return n?Object(i.createElement)(v.Disabled,null,Object(i.createElement)(Ft,{attributes:t})):Xe(c,o)})),c()(ze()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return ae.q?Object(i.createElement)("div",{className:Je("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode()):$e(n,c)})),e}return r}(i.Component),qt=Object(qe.compose)(v.withSpokenMessages,Object(Ue.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Ue.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Ut),Yt={columns:ae.l,rows:ae.n,alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:tt,isPreview:!1};function Gt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Wt={title:Object(u.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(u.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(u.__)("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:Yt,edit:function(e){return Object(i.createElement)(qt,e)},save:function(e){var t=e.attributes,r={};Object.keys(t).sort().forEach((function(e){r[e]=t[e]}));var n={"data-attributes":JSON.stringify(r)};return Object(i.createElement)("div",a()({className:Je("wc-block-all-products",t)},n),Object(i.createElement)(l.InnerBlocks.Content,null))}};Object(s.registerBlockType)("woocommerce/all-products",Kt(Kt({},Wt),{},{deprecated:[{attributes:Object.assign({},Wt.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Je("wc-block-all-products",t)},r),Object(i.createElement)(l.InnerBlocks.Content,null))}}]}))},863:function(e,t,r){"use strict";r.d(t,"a",(function(){return S}));var n=r(57),c=r(197),o=r(21),a=r(10),i=r.n(a),u=r(0),l=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r},s=function(e){return function(t){return function(r){var n=l(e,r);return Object(u.createElement)(t,i()({},r,n))}}},b=r(195),p=r(194),d=Object(o.compose)(s(p.a))(b.a),m=r(193),g=r(196),f=r(134),O=r(198),j=r(192),v=r(191),h=Object(o.compose)(s(v.a))(j.a),w=r(199),y=r(200),_=r(201),k=r(202),E=r(205),P=r(203),C=Object(o.compose)(s(P.a))(E.a);Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:m.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:d}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:h}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:g.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:c.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:O.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:f.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:w.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:y.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:_.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:k.a}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:C});var S=function(e){return Object(n.getRegisteredBlockComponents)(e)}},9:function(e,t){!function(){e.exports=this.React}()},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=Object(n.createContext)("page"),o=function(){return Object(n.useContext)(c)};c.Provider}});
|
build/all-reviews-legacy.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'), 'version' => '
|
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'), 'version' => '2b1150fe4fdeafe70e984219477bfa4c');
|
build/all-reviews-legacy.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],b=0,d=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={4:0},c=[];function a(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,a),r.l=!0,r.exports}a.m=e,a.c=n,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 n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));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 i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=s;return c.push([611,2,0,1]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},101:function(e,t,r){},102: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}}},103:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(0),a=(r(101),r(44));t.a=function(e){var t=e.attributes,r=t.categoryIds,n=t.imageType,i=t.orderby,s=t.productId,l={"data-image-type":n,"data-orderby":i,"data-reviews-on-page-load":t.reviewsOnPageLoad,"data-reviews-on-load-more":t.reviewsOnLoadMore,"data-show-load-more":t.showLoadMore,"data-show-orderby":t.showOrderby},u="wc-block-all-reviews";return s&&(l["data-product-id"]=s,u="wc-block-reviews-by-product"),Array.isArray(r)&&(l["data-category-ids"]=r.join(","),u="wc-block-reviews-by-category"),Object(c.createElement)("div",o()({className:Object(a.a)(u,t)},l))}},104:function(e,t,r){"use strict";var n=r(18),o=r.n(n),c=r(19),a=r.n(c),i=r(20),s=r.n(i),l=r(21),u=r.n(l),b=r(10),d=r.n(b),p=r(0),g=r(1),w=r(11),m=(r(2),r(5)),v=r(4),f=r(6),h=r(57),O=r(8),j=r.n(O),y=r(7),_=r.n(y);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){j()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,c=e.wrapperProps,a=null!=r,i=null!=n;return!a&&i?(t=o||"span",c=R(R({},c),{},{className:_()(c.className,"screen-reader-text")}),Object(p.createElement)(t,c,n)):(t=o||w.Fragment,a&&i&&r!==n?Object(p.createElement)(t,c,Object(p.createElement)("span",{"aria-hidden":"true"},r),Object(p.createElement)("span",{className:"screen-reader-text"},n)):Object(p.createElement)(t,c,r))};E.defaultProps={wrapperProps:{}};var P=E,S=(r(212),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(P,{label:r,screenReaderLabel:n})))});S.defaultProps={label:Object(g.__)("Load more","woo-gutenberg-products-block")};var C=S,N=r(22),x=(r(209),Object(N.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.defaultValue,o=e.label,c=e.onChange,a=e.options,i=e.screenReaderLabel,s=e.readOnly,l=e.value,u="wc-block-sort-select__select-".concat(r);return Object(p.createElement)("div",{className:_()("wc-block-sort-select",t)},Object(p.createElement)(P,{label:o,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label",htmlFor:u}}),Object(p.createElement)("select",{id:u,className:"wc-block-sort-select__select",defaultValue:n,onChange:c,readOnly:s,value:l},a.map((function(e){return Object(p.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))),L=(r(208),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(x,{className:"wc-block-review-sort-select",defaultValue:t,label:Object(g.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(g.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(g.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(g.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(g.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),T=r(17),D=r.n(T),I=r(123),M=r.n(I),A=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=M()(e,{suffix:r,limit:t});return n.html},H=function(e,t,r,n){var o=B(e,t,r);return A(e,o-n.length,n)},B=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=A(e,n.middle),n=F(n,t.clientHeight,r);return n.middle},F=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var z=function(e){s()(r,e);var t=V(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(w.createRef)(),n.reviewContent=Object(w.createRef)(),n.getButton=n.getButton.bind(D()(n)),n.onClick=n.onClick.bind(D()(n)),n}return a()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:H(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(w.Component);z.defaultProps={maxLines:3,ellipsis:"…",moreText:Object(g.__)("Read more","woo-gutenberg-products-block"),lessText:Object(g.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var W=z;r(211);var U=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,a=t.showReviewerName,i=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,b=n.rating,d=!Object.keys(n).length>0,w=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:_()("wc-block-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||a||i||w)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info"},i&&function(e,t,r){var n,o;return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.src)||"",className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x",className:"wc-block-review-list-item__image",width:"48",height:"48"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified",title:Object(g.__)("Verified buyer","woo-gutenberg-products-block")},Object(g.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,d),(u||a||w||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta"},w&&function(e){var t=e.rating,r={width:t/5*100+"%"};return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars",role:"img"},Object(p.createElement)("span",{style:r},Object(g.sprintf)(Object(g.__)("Rated %f out of 5","woo-gutenberg-products-block"),t))))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),a&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(W,{maxLines:10,moreText:Object(g.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(g.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(210);function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){j()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var q=function(e){var t=e.attributes,r=e.reviews,n=(f.n||"product"===t.imageType)&&t.showReviewImage,o=f.m&&t.showReviewRating,c=G(G({},t),{},{showReviewImage:n,showReviewRating:o});return Object(p.createElement)("ul",{className:"wc-block-review-list"},0===r.length?Object(p.createElement)(U,{attributes:c}):r.map((function(e,t){return Object(p.createElement)(U,{key:e.id||t,attributes:c,review:e})})))},Y=r(16),K=r.n(Y),Q=r(13),X=r.n(Q),Z=r(24),$=r.n(Z),ee=r(70),te=r.n(ee),re=r(44),ne=r(26);function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var ae=function(e){var t=function(t){s()(n,t);var r=oe(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),a=0;a<t;a++)c[a]=arguments[a];return e=r.call.apply(r,[this].concat(c)),j()(D()(e),"isPreview",!!e.props.attributes.previewReviews),j()(D()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),j()(D()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),j()(D()(e),"setError",function(){var t=$()(X.a.mark((function t(r){var n,o;return X.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object(ne.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return a()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!te()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(re.b)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,a=r.totalReviews;return Object(p.createElement)(e,K()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:a}))}}]),n}(w.Component);j()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=ce(r);function r(){return o()(this,r),t.apply(this,arguments)}return a()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,a=e.totalReviews;return r?Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(v.Disabled,null,t.showOrderby&&f.m&&Object(p.createElement)(L,{readOnly:!0,value:t.orderby}),Object(p.createElement)(q,{attributes:t,reviews:c}),t.showLoadMore&&a>c.length&&Object(p.createElement)(C,{screenReaderLabel:Object(g.__)("Load more reviews","woo-gutenberg-products-block")})):Object(p.createElement)(o,{attributes:t})}}]),r}(w.Component));function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var se=function(e){s()(r,e);var t=ie(r);function r(){return o()(this,r),t.apply(this,arguments)}return a()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(v.Placeholder,{icon:t,label:r},Object(g.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.className,n=e.noReviewsPlaceholder,o=t.categoryIds,c=t.productId,a=t.reviewsOnPageLoad,i=t.showProductName,s=t.showReviewDate,l=t.showReviewerName,u=t.showReviewContent,b=t.showReviewImage,d=t.showReviewRating,g=Object(re.c)(t.orderby),w=g.order,v=g.orderby;return!(u||d||s||l||b||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(re.a)(r,t)},Object(p.createElement)(ae,{attributes:t,categoryIds:o,delayFunction:function(e){return Object(m.debounce)(e,400)},noReviewsPlaceholder:n,orderby:v,order:w,productId:c,reviewsToDisplay:a}))}}]),r}(w.Component);t.a=se},11:function(e,t){!function(){e.exports=this.React}()},13:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},15:function(e,t){!function(){e.exports=this.wp.blocks}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},23:function(e,t){!function(){e.exports=this.wp.blockEditor}()},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(13),o=r.n(n),c=r(24),a=r.n(c),i=function(){var e=a()(o.a.mark((function e(t){var r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()},28:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},30:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(28));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},4:function(e,t){!function(){e.exports=this.wp.components}()},44:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return u}));var n=r(9),o=r.n(n),c=r(7),a=r.n(c),i=r(6),s=function(e){if(i.m){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=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e,t){var r=t.className,n=t.showReviewDate,o=t.showReviewerName,c=t.showReviewContent,i=t.showProductName,s=t.showReviewImage,l=t.showReviewRating;return a()(e,r,{"has-image":s,"has-name":o,"has-date":n,"has-rating":l,"has-content":c,"has-product-name":i})}},5:function(e,t){!function(){e.exports=this.lodash}()},57:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(63)),a=r(633),i=Object(n.createElement)(a.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.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"})),s=r(7),l=r.n(s),u=r(4),b=r(30);r(98),t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,s=e.onRetry;return Object(n.createElement)(u.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:l()("wc-block-api-error",t)},Object(n.createElement)(b.a,{error:r}),s&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(u.Spinner,null):Object(n.createElement)(u.Button,{isDefault:!0,onClick:s},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},6:function(e,t,r){"use strict";r.d(t,"m",(function(){return o})),r.d(t,"n",(function(){return c})),r.d(t,"h",(function(){return a})),r.d(t,"j",(function(){return i})),r.d(t,"a",(function(){return s})),r.d(t,"i",(function(){return l})),r.d(t,"l",(function(){return u})),r.d(t,"c",(function(){return b})),r.d(t,"k",(function(){return d})),r.d(t,"b",(function(){return p})),r.d(t,"f",(function(){return g})),r.d(t,"g",(function(){return w})),r.d(t,"d",(function(){return m})),r.d(t,"e",(function(){return v})),r.d(t,"o",(function(){return f}));var n=r(3),o=(Object(n.getSetting)("currentUserIsAdmin",!1),Object(n.getSetting)("reviewRatingsEnabled",!0)),c=Object(n.getSetting)("showAvatars",!0),a=Object(n.getSetting)("max_columns",6),i=Object(n.getSetting)("min_columns",1),s=Object(n.getSetting)("default_columns",3),l=Object(n.getSetting)("max_rows",6),u=Object(n.getSetting)("min_rows",1),b=Object(n.getSetting)("default_rows",3),d=Object(n.getSetting)("min_height",500),p=Object(n.getSetting)("default_height",500),g=(Object(n.getSetting)("placeholderImgSrc",""),Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),w=Object(n.getSetting)("limitTags"),m=(Object(n.getSetting)("hasProducts",!0),Object(n.getSetting)("hasTags",!0)),v=Object(n.getSetting)("homeUrl",""),f=(Object(n.getSetting)("couponsEnabled",!0),Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0),Object(n.getSetting)("displayItemizedTaxes",!1),Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1),Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[]),Object(n.getSetting)("isShippingCalculatorEnabled",!0),Object(n.getSetting)("isShippingCostHidden",!1),Object(n.getSetting)("woocommerceBlocksPhase",1),Object(n.getSetting)("wcBlocksAssetUrl","")),h=(Object(n.getSetting)("shippingCountries",{}),Object(n.getSetting)("allowedCountries",{}),Object(n.getSetting)("shippingStates",{}),Object(n.getSetting)("allowedStates",{}),Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("checkoutShowLoginReminder",!0),{id:0,title:"",permalink:""}),O=Object(n.getSetting)("storePages",{shop:h,cart:h,checkout:h,privacy:h,terms:h});O.shop.permalink,O.checkout.id,O.checkout.permalink,O.privacy.permalink,O.privacy.title,O.terms.permalink,O.terms.title,O.cart.id,O.cart.permalink,Object(n.getSetting)("checkoutAllowsGuest",!1),Object(n.getSetting)("checkoutAllowsSignup",!1),r(15)},611:function(e,t,r){"use strict";r.r(t);var n=r(8),o=r.n(n),c=r(0),a=r(1),i=r(15),s=r(63),l=r(633),u=Object(c.createElement)(l.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.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"})),b=(r(101),r(23)),d=r(4),p=(r(2),r(104)),g=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(a.__)("All Reviews","woo-gutenberg-products-block")},Object(a.__)("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(71),m=function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(a.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(w.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("List Settings","woo-gutenberg-products-block")},Object(w.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(a.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:g}))},v=r(102),f=r(103),h=r(90);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(i.registerBlockType)("woocommerce/all-reviews",{title:Object(a.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1},example:j(j({},h.a),{},{attributes:j(j({},h.a.attributes),{},{showProductName:!0})}),attributes:j(j({},v.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(m,e)},save:f.a})},63:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(37),a=r.n(c),i=r(11);r(2);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,["srcElement","size"]);return Object(i.isValidElement)(t)&&Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c))}},70:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},71:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return p}));var n=r(0),o=r(1),c=r(125),a=r(4),i=r(23),s=r(3),l=r(6),u=r(89),b=function(e,t){return Object(n.createElement)(i.BlockControls,null,Object(n.createElement)(a.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!l.m&&Object(n.createElement)(a.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!l.n&&Object(n.createElement)(a.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},p=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(a.SelectControl,{label:Object(o.__)("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:function(e){return t({orderby:e})}}),Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},89:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(18),a=r.n(c),i=r(19),s=r.n(i),l=r(17),u=r.n(l),b=r(20),d=r.n(b),p=r(21),g=r.n(p),w=r(10),m=r.n(w),v=r(0),f=r(5),h=r(7),O=r.n(h),j=r(4),y=r(22);r(161);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var o=m()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(f.isFunction)(s)?s(c):s),Object(v.createElement)(j.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",i)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(v.createElement)(j.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(v.createElement)(j.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(v.Component);t.a=Object(y.withInstanceId)(k)},9:function(e,t){!function(){e.exports=this.wp.apiFetch}()},90:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(6),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(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o+"img/avatar.jpg",96:o.o+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o+"img/avatar.jpg",96:o.o+"img/avatar.jpg"},rating:null,verified:!1}]}}},98:function(e,t,r){}});
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,i,a=t[0],s=t[1],l=t[2],b=0,d=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&d.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={4:0},c=[];function i(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,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=s;return c.push([614,2,0,1]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},101:function(e,t,r){},102: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}}},103:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(0),i=(r(101),r(44));t.a=function(e){var t=e.attributes,r=t.categoryIds,n=t.imageType,a=t.orderby,s=t.productId,l={"data-image-type":n,"data-orderby":a,"data-reviews-on-page-load":t.reviewsOnPageLoad,"data-reviews-on-load-more":t.reviewsOnLoadMore,"data-show-load-more":t.showLoadMore,"data-show-orderby":t.showOrderby},u="wc-block-all-reviews";return s&&(l["data-product-id"]=s,u="wc-block-reviews-by-product"),Array.isArray(r)&&(l["data-category-ids"]=r.join(","),u="wc-block-reviews-by-category"),Object(c.createElement)("div",o()({className:Object(i.a)(u,t)},l))}},104:function(e,t,r){"use strict";var n=r(18),o=r.n(n),c=r(19),i=r.n(c),a=r(20),s=r.n(a),l=r(21),u=r.n(l),b=r(10),d=r.n(b),p=r(0),w=r(1),g=r(11),m=(r(2),r(5)),v=r(4),f=r(6),h=r(57),O=r(8),j=r.n(O),y=r(7),_=r.n(y);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){j()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,c=e.wrapperProps,i=null!=r,a=null!=n;return!i&&a?(t=o||"span",c=R(R({},c),{},{className:_()(c.className,"screen-reader-text")}),Object(p.createElement)(t,c,n)):(t=o||g.Fragment,i&&a&&r!==n?Object(p.createElement)(t,c,Object(p.createElement)("span",{"aria-hidden":"true"},r),Object(p.createElement)("span",{className:"screen-reader-text"},n)):Object(p.createElement)(t,c,r))};E.defaultProps={wrapperProps:{}};var P=E,S=(r(213),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(P,{label:r,screenReaderLabel:n})))});S.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var C=S,N=r(22),x=(r(210),Object(N.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.defaultValue,o=e.label,c=e.onChange,i=e.options,a=e.screenReaderLabel,s=e.readOnly,l=e.value,u="wc-block-components-sort-select__select-".concat(r);return Object(p.createElement)("div",{className:_()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(p.createElement)(P,{label:o,screenReaderLabel:a,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(p.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:n,onChange:c,readOnly:s,value:l},i.map((function(e){return Object(p.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))),L=(r(209),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(x,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(w.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(w.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(w.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(w.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(w.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),T=r(17),D=r.n(T),I=r(126),M=r.n(I),A=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=M()(e,{suffix:r,limit:t});return n.html},H=function(e,t,r,n){var o=B(e,t,r);return A(e,o-n.length,n)},B=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=A(e,n.middle),n=F(n,t.clientHeight,r);return n.middle},F=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var z=function(e){s()(r,e);var t=V(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(g.createRef)(),n.reviewContent=Object(g.createRef)(),n.getButton=n.getButton.bind(D()(n)),n.onClick=n.onClick.bind(D()(n)),n}return i()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:H(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(g.Component);z.defaultProps={maxLines:3,ellipsis:"…",moreText:Object(w.__)("Read more","woo-gutenberg-products-block"),lessText:Object(w.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var W=z;r(212);var U=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,i=t.showReviewerName,a=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,b=n.rating,d=!Object.keys(n).length>0,g=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:_()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||g)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},a&&function(e,t,r){var n,o;return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.thumbnail)||""}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(w.__)("Verified buyer","woo-gutenberg-products-block")},Object(w.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,d),(u||i||g||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},g&&function(e){var t=e.rating,r={width:t/5*100+"%"};return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img"},Object(p.createElement)("span",{style:r},Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t))))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(W,{maxLines:10,moreText:Object(w.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(w.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(211);function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){j()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var q=function(e){var t=e.attributes,r=e.reviews,n=(f.n||"product"===t.imageType)&&t.showReviewImage,o=f.m&&t.showReviewRating,c=G(G({},t),{},{showReviewImage:n,showReviewRating:o});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(U,{attributes:c}):r.map((function(e,t){return Object(p.createElement)(U,{key:e.id||t,attributes:c,review:e})})))},Y=r(16),K=r.n(Y),Q=r(13),X=r.n(Q),Z=r(24),$=r.n(Z),ee=r(70),te=r.n(ee),re=r(44),ne=r(26);function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var ie=function(e){var t=function(t){s()(n,t);var r=oe(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),j()(D()(e),"isPreview",!!e.props.attributes.previewReviews),j()(D()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),j()(D()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),j()(D()(e),"setError",function(){var t=$()(X.a.mark((function t(r){var n,o;return X.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object(ne.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return i()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!te()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(re.b)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,i=r.totalReviews;return Object(p.createElement)(e,K()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(g.Component);j()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=ce(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,i=e.totalReviews;return r?Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(v.Disabled,null,t.showOrderby&&f.m&&Object(p.createElement)(L,{readOnly:!0,value:t.orderby}),Object(p.createElement)(q,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(C,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")})):Object(p.createElement)(o,{attributes:t})}}]),r}(g.Component));function ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var se=function(e){s()(r,e);var t=ae(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(v.Placeholder,{icon:t,label:r},Object(w.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.className,n=e.noReviewsPlaceholder,o=t.categoryIds,c=t.productId,i=t.reviewsOnPageLoad,a=t.showProductName,s=t.showReviewDate,l=t.showReviewerName,u=t.showReviewContent,b=t.showReviewImage,d=t.showReviewRating,w=Object(re.c)(t.orderby),g=w.order,v=w.orderby;return!(u||d||s||l||b||a)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(re.a)(r,t)},Object(p.createElement)(ie,{attributes:t,categoryIds:o,delayFunction:function(e){return Object(m.debounce)(e,400)},noReviewsPlaceholder:n,orderby:v,order:g,productId:c,reviewsToDisplay:i}))}}]),r}(g.Component);t.a=se},11:function(e,t){!function(){e.exports=this.React}()},13:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},15:function(e,t){!function(){e.exports=this.wp.blocks}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},23:function(e,t){!function(){e.exports=this.wp.blockEditor}()},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(13),o=r.n(n),c=r(24),i=r.n(c),a=function(){var e=i()(o.a.mark((function e(t){var r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()},28:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},30:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(28));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},4:function(e,t){!function(){e.exports=this.wp.components}()},44:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return u}));var n=r(9),o=r.n(n),c=r(7),i=r.n(c),a=r(6),s=function(e){if(a.m){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=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e,t){var r=t.className,n=t.showReviewDate,o=t.showReviewerName,c=t.showReviewContent,a=t.showProductName,s=t.showReviewImage,l=t.showReviewRating;return i()(e,r,{"has-image":s,"has-name":o,"has-date":n,"has-rating":l,"has-content":c,"has-product-name":a})}},5:function(e,t){!function(){e.exports=this.lodash}()},57:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(63)),i=r(636),a=Object(n.createElement)(i.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.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"})),s=r(7),l=r.n(s),u=r(4),b=r(30);r(98),t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,s=e.onRetry;return Object(n.createElement)(u.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:l()("wc-block-api-error",t)},Object(n.createElement)(b.a,{error:r}),s&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(u.Spinner,null):Object(n.createElement)(u.Button,{isDefault:!0,onClick:s},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},6:function(e,t,r){"use strict";r.d(t,"m",(function(){return o})),r.d(t,"n",(function(){return c})),r.d(t,"h",(function(){return i})),r.d(t,"j",(function(){return a})),r.d(t,"a",(function(){return s})),r.d(t,"i",(function(){return l})),r.d(t,"l",(function(){return u})),r.d(t,"c",(function(){return b})),r.d(t,"k",(function(){return d})),r.d(t,"b",(function(){return p})),r.d(t,"f",(function(){return w})),r.d(t,"g",(function(){return g})),r.d(t,"d",(function(){return m})),r.d(t,"e",(function(){return v})),r.d(t,"o",(function(){return f}));var n=r(3),o=(Object(n.getSetting)("currentUserIsAdmin",!1),Object(n.getSetting)("reviewRatingsEnabled",!0)),c=Object(n.getSetting)("showAvatars",!0),i=Object(n.getSetting)("max_columns",6),a=Object(n.getSetting)("min_columns",1),s=Object(n.getSetting)("default_columns",3),l=Object(n.getSetting)("max_rows",6),u=Object(n.getSetting)("min_rows",1),b=Object(n.getSetting)("default_rows",3),d=Object(n.getSetting)("min_height",500),p=Object(n.getSetting)("default_height",500),w=(Object(n.getSetting)("placeholderImgSrc",""),Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),g=Object(n.getSetting)("limitTags"),m=(Object(n.getSetting)("hasProducts",!0),Object(n.getSetting)("hasTags",!0)),v=Object(n.getSetting)("homeUrl",""),f=(Object(n.getSetting)("couponsEnabled",!0),Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0),Object(n.getSetting)("displayItemizedTaxes",!1),Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1),Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[]),Object(n.getSetting)("isShippingCalculatorEnabled",!0),Object(n.getSetting)("isShippingCostHidden",!1),Object(n.getSetting)("woocommerceBlocksPhase",1),Object(n.getSetting)("wcBlocksAssetUrl","")),h=(Object(n.getSetting)("shippingCountries",{}),Object(n.getSetting)("allowedCountries",{}),Object(n.getSetting)("shippingStates",{}),Object(n.getSetting)("allowedStates",{}),Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("checkoutShowLoginReminder",!0),{id:0,title:"",permalink:""}),O=Object(n.getSetting)("storePages",{shop:h,cart:h,checkout:h,privacy:h,terms:h});O.shop.permalink,O.checkout.id,O.checkout.permalink,O.privacy.permalink,O.privacy.title,O.terms.permalink,O.terms.title,O.cart.id,O.cart.permalink,Object(n.getSetting)("checkoutAllowsGuest",!1),Object(n.getSetting)("checkoutAllowsSignup",!1),r(15)},614:function(e,t,r){"use strict";r.r(t);var n=r(8),o=r.n(n),c=r(0),i=r(1),a=r(15),s=r(63),l=r(636),u=Object(c.createElement)(l.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.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"})),b=(r(101),r(23)),d=r(4),p=(r(2),r(104)),w=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(i.__)("All Reviews","woo-gutenberg-products-block")},Object(i.__)("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"))},g=r(71),m=function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(i.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(i.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(g.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(g.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(i.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))},v=r(102),f=r(103),h=r(91);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/all-reviews",{title:Object(i.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1},example:j(j({},h.a),{},{attributes:j(j({},h.a.attributes),{},{showProductName:!0})}),attributes:j(j({},v.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(m,e)},save:f.a})},63:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(37),i=r.n(c),a=r(11);r(2);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,["srcElement","size"]);return Object(a.isValidElement)(t)&&Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c))}},70:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},71:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return p}));var n=r(0),o=r(1),c=r(128),i=r(4),a=r(23),s=r(3),l=r(6),u=r(90),b=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!l.m&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!l.n&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},p=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(i.SelectControl,{label:Object(o.__)("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:function(e){return t({orderby:e})}}),Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},9:function(e,t){!function(){e.exports=this.wp.apiFetch}()},90:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(18),i=r.n(c),a=r(19),s=r.n(a),l=r(17),u=r.n(l),b=r(20),d=r.n(b),p=r(21),w=r.n(p),g=r(10),m=r.n(g),v=r(0),f=r(5),h=r(7),O=r.n(h),j=r(4),y=r(22);r(161);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var o=m()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(i);return s&&(e=Object(f.isFunction)(s)?s(c):s),Object(v.createElement)(j.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",a)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(v.createElement)(j.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(v.createElement)(j.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(v.Component);t.a=Object(y.withInstanceId)(k)},91:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(6),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(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o+"img/avatar.jpg",96:o.o+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.o+"img/avatar.jpg",96:o.o+"img/avatar.jpg"},rating:null,verified:!1}]}}},98:function(e,t,r){}});
|
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'), 'version' => '
|
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'), 'version' => '5cf3c8b739046a62f1db74587dcc68f1');
|
build/all-reviews.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,i,a=t[0],s=t[1],l=t[2],b=0,d=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&d.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={6:0},c=[];function i(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,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=s;return c.push([850,2,0,1]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},13:function(e,t){!function(){e.exports=this.wp.apiFetch}()},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return p}));var n=r(0),o=r(1),c=r(181),i=r(4),a=r(24),s=r(3),l=r(5),u=r(70),b=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!l.G&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!l.M&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},p=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(i.SelectControl,{label:Object(o.__)("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:function(e){return t({orderby:e})}}),Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},139:function(e,t,r){"use strict";var n=r(0),o=r(63),c=Object(n.createElement)(o.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.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},14:function(e,t){!function(){e.exports=this.wp.blocks}()},141:function(e,t,r){},143:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),i=r(44),a=r(182);r(278);t.a=Object(a.a)((function(e){var t=e.className,r=e.instanceId,o=e.defaultValue,a=e.label,s=e.onChange,l=e.options,u=e.screenReaderLabel,b=e.readOnly,d=e.value,p="wc-block-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select",t)},Object(n.createElement)(i.a,{label:a,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select",defaultValue:o,onChange:s,readOnly:b,value:d},l.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},15:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(5),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(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.Q+"img/avatar.jpg",96:o.Q+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.Q+"img/avatar.jpg",96:o.Q+"img/avatar.jpg"},rating:null,verified:!1}]}}},169:function(e,t,r){},174: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}}},175:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(0),i=(r(169),r(76));t.a=function(e){var t=e.attributes,r=t.categoryIds,n=t.imageType,a=t.orderby,s=t.productId,l={"data-image-type":n,"data-orderby":a,"data-reviews-on-page-load":t.reviewsOnPageLoad,"data-reviews-on-load-more":t.reviewsOnLoadMore,"data-show-load-more":t.showLoadMore,"data-show-orderby":t.showOrderby},u="wc-block-all-reviews";return s&&(l["data-product-id"]=s,u="wc-block-reviews-by-product"),Array.isArray(r)&&(l["data-category-ids"]=r.join(","),u="wc-block-reviews-by-category"),Object(c.createElement)("div",o()({className:Object(i.a)(u,t)},l))}},178:function(e,t,r){"use strict";var n=r(20),o=r.n(n),c=r(26),i=r.n(c),a=r(21),s=r.n(a),l=r(22),u=r.n(l),b=r(12),d=r.n(b),p=r(0),g=r(1),w=r(9),f=(r(2),r(6)),v=r(4),m=r(5),h=r(88),O=r(44),j=(r(342),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(O.a,{label:r,screenReaderLabel:n})))});j.defaultProps={label:Object(g.__)("Load more","woo-gutenberg-products-block")};var y=j,_=r(143),k=(r(339),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(_.a,{className:"wc-block-review-sort-select",defaultValue:t,label:Object(g.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(g.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(g.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(g.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(g.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),R=r(8),E=r.n(R),P=r(7),S=r.n(P),C=r(19),N=r.n(C),x=r(223),L=r.n(x),T=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=L()(e,{suffix:r,limit:t});return n.html},D=function(e,t,r,n){var o=I(e,t,r);return T(e,o-n.length,n)},I=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=T(e,n.middle),n=M(n,t.clientHeight,r);return n.middle},M=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var B=function(e){s()(r,e);var t=A(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(w.createRef)(),n.reviewContent=Object(w.createRef)(),n.getButton=n.getButton.bind(N()(n)),n.onClick=n.onClick.bind(N()(n)),n}return i()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:D(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(w.Component);B.defaultProps={maxLines:3,ellipsis:"…",moreText:Object(g.__)("Read more","woo-gutenberg-products-block"),lessText:Object(g.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=B;r(341);var F=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,i=t.showReviewerName,a=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,b=n.rating,d=!Object.keys(n).length>0,w=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:S()("wc-block-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||w)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info"},a&&function(e,t,r){var n,o;return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.src)||"",className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x",className:"wc-block-review-list-item__image",width:"48",height:"48"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified",title:Object(g.__)("Verified buyer","woo-gutenberg-products-block")},Object(g.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,d),(u||i||w||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta"},w&&function(e){var t=e.rating,r={width:t/5*100+"%"};return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars",role:"img"},Object(p.createElement)("span",{style:r},Object(g.sprintf)(Object(g.__)("Rated %f out of 5","woo-gutenberg-products-block"),t))))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(g.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(g.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(340);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var G=function(e){var t=e.attributes,r=e.reviews,n=(m.M||"product"===t.imageType)&&t.showReviewImage,o=m.G&&t.showReviewRating,c=z(z({},t),{},{showReviewImage:n,showReviewRating:o});return Object(p.createElement)("ul",{className:"wc-block-review-list"},0===r.length?Object(p.createElement)(F,{attributes:c}):r.map((function(e,t){return Object(p.createElement)(F,{key:e.id||t,attributes:c,review:e})})))},W=r(10),J=r.n(W),Q=r(15),U=r.n(Q),q=r(37),K=r.n(q),Y=r(48),X=r.n(Y),Z=r(76),$=r(43);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var re=function(e){var t=function(t){s()(n,t);var r=ee(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),E()(N()(e),"isPreview",!!e.props.attributes.previewReviews),E()(N()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(N()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(N()(e),"setError",function(){var t=K()(U.a.mark((function t(r){var n,o;return U.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object($.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return i()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.b)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,i=r.totalReviews;return Object(p.createElement)(e,J()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(w.Component);E()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=te(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,i=e.totalReviews;return r?Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(v.Disabled,null,t.showOrderby&&m.G&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(G,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(y,{screenReaderLabel:Object(g.__)("Load more reviews","woo-gutenberg-products-block")})):Object(p.createElement)(o,{attributes:t})}}]),r}(w.Component));function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var oe=function(e){s()(r,e);var t=ne(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(v.Placeholder,{icon:t,label:r},Object(g.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.className,n=e.noReviewsPlaceholder,o=t.categoryIds,c=t.productId,i=t.reviewsOnPageLoad,a=t.showProductName,s=t.showReviewDate,l=t.showReviewerName,u=t.showReviewContent,b=t.showReviewImage,d=t.showReviewRating,g=Object(Z.c)(t.orderby),w=g.order,v=g.orderby;return!(u||d||s||l||b||a)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(Z.a)(r,t)},Object(p.createElement)(re,{attributes:t,categoryIds:o,delayFunction:function(e){return Object(f.debounce)(e,400)},noReviewsPlaceholder:n,orderby:v,order:w,productId:c,reviewsToDisplay:i}))}}]),r}(w.Component);t.a=oe},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.compose}()},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},4:function(e,t){!function(){e.exports=this.wp.components}()},43:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(15),o=r.n(n),c=r(37),i=r.n(c),a=function(){var e=i()(o.a.mark((function e(t){var r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()},44:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(0),i=(r(2),r(9)),a=r(7),s=r.n(a);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,l=null!=r,b=null!=n;return!l&&b?(t=o||"span",a=u(u({},a),{},{className:s()(a.className,"screen-reader-text")}),Object(c.createElement)(t,a,n)):(t=o||i.Fragment,l&&b&&r!==n?Object(c.createElement)(t,a,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,a,r))};b.defaultProps={wrapperProps:{}},t.a=b},47:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},48:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},49:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(47));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},5:function(e,t,r){"use strict";r.d(t,"k",(function(){return o})),r.d(t,"G",(function(){return c})),r.d(t,"M",(function(){return i})),r.d(t,"x",(function(){return a})),r.d(t,"z",(function(){return s})),r.d(t,"l",(function(){return l})),r.d(t,"y",(function(){return u})),r.d(t,"B",(function(){return b})),r.d(t,"n",(function(){return d})),r.d(t,"A",(function(){return p})),r.d(t,"m",(function(){return g})),r.d(t,"C",(function(){return w})),r.d(t,"t",(function(){return f})),r.d(t,"w",(function(){return v})),r.d(t,"q",(function(){return m})),r.d(t,"r",(function(){return h})),r.d(t,"s",(function(){return O})),r.d(t,"j",(function(){return j})),r.d(t,"I",(function(){return y})),r.d(t,"N",(function(){return _})),r.d(t,"p",(function(){return k})),r.d(t,"o",(function(){return R})),r.d(t,"F",(function(){return E})),r.d(t,"c",(function(){return P})),r.d(t,"u",(function(){return S})),r.d(t,"v",(function(){return C})),r.d(t,"Q",(function(){return x})),r.d(t,"H",(function(){return L})),r.d(t,"a",(function(){return T})),r.d(t,"K",(function(){return D})),r.d(t,"b",(function(){return I})),r.d(t,"J",(function(){return M})),r.d(t,"h",(function(){return A})),r.d(t,"L",(function(){return F})),r.d(t,"g",(function(){return V})),r.d(t,"i",(function(){return z})),r.d(t,"E",(function(){return G})),r.d(t,"D",(function(){return W})),r.d(t,"P",(function(){return J})),r.d(t,"O",(function(){return Q})),r.d(t,"d",(function(){return U})),r.d(t,"e",(function(){return q})),r.d(t,"f",(function(){return K})),r.d(t,"R",(function(){return X})),r.d(t,"S",(function(){return Z}));var n=r(3),o=Object(n.getSetting)("currentUserIsAdmin",!1),c=Object(n.getSetting)("reviewRatingsEnabled",!0),i=Object(n.getSetting)("showAvatars",!0),a=Object(n.getSetting)("max_columns",6),s=Object(n.getSetting)("min_columns",1),l=Object(n.getSetting)("default_columns",3),u=Object(n.getSetting)("max_rows",6),b=Object(n.getSetting)("min_rows",1),d=Object(n.getSetting)("default_rows",3),p=Object(n.getSetting)("min_height",500),g=Object(n.getSetting)("default_height",500),w=Object(n.getSetting)("placeholderImgSrc",""),f=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),v=Object(n.getSetting)("limitTags"),m=Object(n.getSetting)("hasProducts",!0),h=Object(n.getSetting)("hasTags",!0),O=Object(n.getSetting)("homeUrl",""),j=Object(n.getSetting)("couponsEnabled",!0),y=Object(n.getSetting)("shippingEnabled",!0),_=Object(n.getSetting)("taxesEnabled",!0),k=Object(n.getSetting)("displayItemizedTaxes",!1),R=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),E=Object(n.getSetting)("productCount",0),P=Object(n.getSetting)("attributes",[]),S=Object(n.getSetting)("isShippingCalculatorEnabled",!0),C=Object(n.getSetting)("isShippingCostHidden",!1),N=Object(n.getSetting)("woocommerceBlocksPhase",1),x=Object(n.getSetting)("wcBlocksAssetUrl",""),L=Object(n.getSetting)("shippingCountries",{}),T=Object(n.getSetting)("allowedCountries",{}),D=Object(n.getSetting)("shippingStates",{}),I=Object(n.getSetting)("allowedStates",{}),M=Object(n.getSetting)("shippingMethodsExist",!1),A=Object(n.getSetting)("checkoutShowLoginReminder",!0),B={id:0,title:"",permalink:""},H=Object(n.getSetting)("storePages",{shop:B,cart:B,checkout:B,privacy:B,terms:B}),F=H.shop.permalink,V=H.checkout.id,z=H.checkout.permalink,G=H.privacy.permalink,W=H.privacy.title,J=H.terms.permalink,Q=H.terms.title,U=H.cart.id,q=H.cart.permalink,K=Object(n.getSetting)("checkoutAllowsGuest",!1),Y=(Object(n.getSetting)("checkoutAllowsSignup",!1),r(14)),X=function(e,t){if(N>2)return Object(Y.registerBlockType)(e,t)},Z=function(e,t){if(N>1)return Object(Y.registerBlockType)(e,t)}},58:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(23),i=r.n(c),a=r(9);r(2);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,["srcElement","size"]);return Object(a.isValidElement)(t)&&Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c))}},6:function(e,t){!function(){e.exports=this.lodash}()},70:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(20),i=r.n(c),a=r(26),s=r.n(a),l=r(19),u=r.n(l),b=r(21),d=r.n(b),p=r(22),g=r.n(p),w=r(12),f=r.n(w),v=r(0),m=r(6),h=r(7),O=r.n(h),j=r(4),y=r(25);r(168);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var o=f()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(i);return s&&(e=Object(m.isFunction)(s)?s(c):s),Object(v.createElement)(j.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",a)},Object(v.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(v.createElement)(j.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(v.createElement)(j.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(v.Component);t.a=Object(y.withInstanceId)(k)},76:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return u}));var n=r(13),o=r.n(n),c=r(7),i=r.n(c),a=r(5),s=function(e){if(a.G){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=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e,t){var r=t.className,n=t.showReviewDate,o=t.showReviewerName,c=t.showReviewContent,a=t.showProductName,s=t.showReviewImage,l=t.showReviewRating;return i()(e,r,{"has-image":s,"has-name":o,"has-date":n,"has-rating":l,"has-content":c,"has-product-name":a})}},850:function(e,t,r){"use strict";r.r(t);var n=r(8),o=r.n(n),c=r(0),i=r(1),a=r(14),s=r(58),l=r(63),u=Object(c.createElement)(l.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.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"})),b=(r(169),r(24)),d=r(4),p=(r(2),r(178)),g=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(i.__)("All Reviews","woo-gutenberg-products-block")},Object(i.__)("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(134),f=function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(i.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(i.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(w.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(w.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(i.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:g}))},v=r(174),m=r(175),h=r(150);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/all-reviews",{title:Object(i.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1},example:j(j({},h.a),{},{attributes:j(j({},h.a.attributes),{},{showProductName:!0})}),attributes:j(j({},v.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(f,e)},save:m.a})},88:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(58)),i=r(139),a=r(7),s=r.n(a),l=r(4),u=r(49);r(141);t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isDefault:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},9:function(e,t){!function(){e.exports=this.React}()}});
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,i,a=t[0],s=t[1],l=t[2],b=0,d=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&d.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={6:0},c=[];function i(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,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=s;return c.push([869,2,0,1]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},13:function(e,t){!function(){e.exports=this.wp.apiFetch}()},135:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return p}));var n=r(0),o=r(1),c=r(182),i=r(4),a=r(22),s=r(3),l=r(5),u=r(71),b=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!l.G&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!l.M&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},p=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(i.SelectControl,{label:Object(o.__)("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:function(e){return t({orderby:e})}}),Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},14:function(e,t){!function(){e.exports=this.wp.blocks}()},140:function(e,t,r){"use strict";var n=r(0),o=r(59),c=Object(n.createElement)(o.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.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},143:function(e,t,r){},145:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),i=r(44),a=r(183);r(283);t.a=Object(a.a)((function(e){var t=e.className,r=e.instanceId,o=e.defaultValue,a=e.label,s=e.onChange,l=e.options,u=e.screenReaderLabel,b=e.readOnly,d=e.value,p="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(i.a,{label:a,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:o,onChange:s,readOnly:b,value:d},l.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},152:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(5),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(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.Q+"img/avatar.jpg",96:o.Q+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.Q+"img/avatar.jpg",96:o.Q+"img/avatar.jpg"},rating:null,verified:!1}]}}},16:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},170:function(e,t,r){},175: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}}},176:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(0),i=(r(170),r(77));t.a=function(e){var t=e.attributes,r=t.categoryIds,n=t.imageType,a=t.orderby,s=t.productId,l={"data-image-type":n,"data-orderby":a,"data-reviews-on-page-load":t.reviewsOnPageLoad,"data-reviews-on-load-more":t.reviewsOnLoadMore,"data-show-load-more":t.showLoadMore,"data-show-orderby":t.showOrderby},u="wc-block-all-reviews";return s&&(l["data-product-id"]=s,u="wc-block-reviews-by-product"),Array.isArray(r)&&(l["data-category-ids"]=r.join(","),u="wc-block-reviews-by-category"),Object(c.createElement)("div",o()({className:Object(i.a)(u,t)},l))}},179:function(e,t,r){"use strict";var n=r(23),o=r.n(n),c=r(26),i=r.n(c),a=r(24),s=r.n(a),l=r(25),u=r.n(l),b=r(12),d=r.n(b),p=r(0),w=r(1),g=r(9),f=(r(2),r(6)),m=r(4),v=r(5),h=r(89),O=r(44),j=(r(349),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(O.a,{label:r,screenReaderLabel:n})))});j.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var y=j,_=r(145),k=(r(346),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(_.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(w.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(w.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(w.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(w.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(w.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),R=r(8),E=r.n(R),P=r(7),S=r.n(P),C=r(20),N=r.n(C),x=r(232),L=r.n(x),T=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=L()(e,{suffix:r,limit:t});return n.html},D=function(e,t,r,n){var o=I(e,t,r);return T(e,o-n.length,n)},I=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=T(e,n.middle),n=M(n,t.clientHeight,r);return n.middle},M=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var B=function(e){s()(r,e);var t=A(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(g.createRef)(),n.reviewContent=Object(g.createRef)(),n.getButton=n.getButton.bind(N()(n)),n.onClick=n.onClick.bind(N()(n)),n}return i()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:D(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(g.Component);B.defaultProps={maxLines:3,ellipsis:"…",moreText:Object(w.__)("Read more","woo-gutenberg-products-block"),lessText:Object(w.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=B;r(348);var F=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,i=t.showReviewerName,a=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,b=n.rating,d=!Object.keys(n).length>0,g=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:S()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||g)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},a&&function(e,t,r){var n,o;return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.thumbnail)||""}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(w.__)("Verified buyer","woo-gutenberg-products-block")},Object(w.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,d),(u||i||g||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},g&&function(e){var t=e.rating,r={width:t/5*100+"%"};return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img"},Object(p.createElement)("span",{style:r},Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t))))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(w.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(w.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(347);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var G=function(e){var t=e.attributes,r=e.reviews,n=(v.M||"product"===t.imageType)&&t.showReviewImage,o=v.G&&t.showReviewRating,c=z(z({},t),{},{showReviewImage:n,showReviewRating:o});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(F,{attributes:c}):r.map((function(e,t){return Object(p.createElement)(F,{key:e.id||t,attributes:c,review:e})})))},W=r(10),J=r.n(W),Q=r(16),U=r.n(Q),q=r(39),K=r.n(q),Y=r(48),X=r.n(Y),Z=r(77),$=r(43);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var re=function(e){var t=function(t){s()(n,t);var r=ee(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),E()(N()(e),"isPreview",!!e.props.attributes.previewReviews),E()(N()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(N()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(N()(e),"setError",function(){var t=K()(U.a.mark((function t(r){var n,o;return U.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object($.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return i()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.b)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,i=r.totalReviews;return Object(p.createElement)(e,J()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(g.Component);E()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=te(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,i=e.totalReviews;return r?Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(m.Disabled,null,t.showOrderby&&v.G&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(G,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(y,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")})):Object(p.createElement)(o,{attributes:t})}}]),r}(g.Component));function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var oe=function(e){s()(r,e);var t=ne(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(m.Placeholder,{icon:t,label:r},Object(w.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.className,n=e.noReviewsPlaceholder,o=t.categoryIds,c=t.productId,i=t.reviewsOnPageLoad,a=t.showProductName,s=t.showReviewDate,l=t.showReviewerName,u=t.showReviewContent,b=t.showReviewImage,d=t.showReviewRating,w=Object(Z.c)(t.orderby),g=w.order,m=w.orderby;return!(u||d||s||l||b||a)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(Z.a)(r,t)},Object(p.createElement)(re,{attributes:t,categoryIds:o,delayFunction:function(e){return Object(f.debounce)(e,400)},noReviewsPlaceholder:n,orderby:m,order:g,productId:c,reviewsToDisplay:i}))}}]),r}(g.Component);t.a=oe},21:function(e,t){!function(){e.exports=this.wp.compose}()},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},4:function(e,t){!function(){e.exports=this.wp.components}()},43:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(16),o=r.n(n),c=r(39),i=r.n(c),a=function(){var e=i()(o.a.mark((function e(t){var r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()},44:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(0),i=(r(2),r(9)),a=r(7),s=r.n(a);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,a=e.wrapperProps,l=null!=r,b=null!=n;return!l&&b?(t=o||"span",a=u(u({},a),{},{className:s()(a.className,"screen-reader-text")}),Object(c.createElement)(t,a,n)):(t=o||i.Fragment,l&&b&&r!==n?Object(c.createElement)(t,a,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,a,r))};b.defaultProps={wrapperProps:{}},t.a=b},47:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},48:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},49:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(47));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},5:function(e,t,r){"use strict";r.d(t,"k",(function(){return o})),r.d(t,"G",(function(){return c})),r.d(t,"M",(function(){return i})),r.d(t,"x",(function(){return a})),r.d(t,"z",(function(){return s})),r.d(t,"l",(function(){return l})),r.d(t,"y",(function(){return u})),r.d(t,"B",(function(){return b})),r.d(t,"n",(function(){return d})),r.d(t,"A",(function(){return p})),r.d(t,"m",(function(){return w})),r.d(t,"C",(function(){return g})),r.d(t,"t",(function(){return f})),r.d(t,"w",(function(){return m})),r.d(t,"q",(function(){return v})),r.d(t,"r",(function(){return h})),r.d(t,"s",(function(){return O})),r.d(t,"j",(function(){return j})),r.d(t,"I",(function(){return y})),r.d(t,"N",(function(){return _})),r.d(t,"p",(function(){return k})),r.d(t,"o",(function(){return R})),r.d(t,"F",(function(){return E})),r.d(t,"c",(function(){return P})),r.d(t,"u",(function(){return S})),r.d(t,"v",(function(){return C})),r.d(t,"Q",(function(){return x})),r.d(t,"H",(function(){return L})),r.d(t,"a",(function(){return T})),r.d(t,"K",(function(){return D})),r.d(t,"b",(function(){return I})),r.d(t,"J",(function(){return M})),r.d(t,"h",(function(){return A})),r.d(t,"L",(function(){return F})),r.d(t,"g",(function(){return V})),r.d(t,"i",(function(){return z})),r.d(t,"E",(function(){return G})),r.d(t,"D",(function(){return W})),r.d(t,"P",(function(){return J})),r.d(t,"O",(function(){return Q})),r.d(t,"d",(function(){return U})),r.d(t,"e",(function(){return q})),r.d(t,"f",(function(){return K})),r.d(t,"R",(function(){return X})),r.d(t,"S",(function(){return Z}));var n=r(3),o=Object(n.getSetting)("currentUserIsAdmin",!1),c=Object(n.getSetting)("reviewRatingsEnabled",!0),i=Object(n.getSetting)("showAvatars",!0),a=Object(n.getSetting)("max_columns",6),s=Object(n.getSetting)("min_columns",1),l=Object(n.getSetting)("default_columns",3),u=Object(n.getSetting)("max_rows",6),b=Object(n.getSetting)("min_rows",1),d=Object(n.getSetting)("default_rows",3),p=Object(n.getSetting)("min_height",500),w=Object(n.getSetting)("default_height",500),g=Object(n.getSetting)("placeholderImgSrc",""),f=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),m=Object(n.getSetting)("limitTags"),v=Object(n.getSetting)("hasProducts",!0),h=Object(n.getSetting)("hasTags",!0),O=Object(n.getSetting)("homeUrl",""),j=Object(n.getSetting)("couponsEnabled",!0),y=Object(n.getSetting)("shippingEnabled",!0),_=Object(n.getSetting)("taxesEnabled",!0),k=Object(n.getSetting)("displayItemizedTaxes",!1),R=(Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1)),E=Object(n.getSetting)("productCount",0),P=Object(n.getSetting)("attributes",[]),S=Object(n.getSetting)("isShippingCalculatorEnabled",!0),C=Object(n.getSetting)("isShippingCostHidden",!1),N=Object(n.getSetting)("woocommerceBlocksPhase",1),x=Object(n.getSetting)("wcBlocksAssetUrl",""),L=Object(n.getSetting)("shippingCountries",{}),T=Object(n.getSetting)("allowedCountries",{}),D=Object(n.getSetting)("shippingStates",{}),I=Object(n.getSetting)("allowedStates",{}),M=Object(n.getSetting)("shippingMethodsExist",!1),A=Object(n.getSetting)("checkoutShowLoginReminder",!0),B={id:0,title:"",permalink:""},H=Object(n.getSetting)("storePages",{shop:B,cart:B,checkout:B,privacy:B,terms:B}),F=H.shop.permalink,V=H.checkout.id,z=H.checkout.permalink,G=H.privacy.permalink,W=H.privacy.title,J=H.terms.permalink,Q=H.terms.title,U=H.cart.id,q=H.cart.permalink,K=Object(n.getSetting)("checkoutAllowsGuest",!1),Y=(Object(n.getSetting)("checkoutAllowsSignup",!1),r(14)),X=function(e,t){if(N>2)return Object(Y.registerBlockType)(e,t)},Z=function(e,t){if(N>1)return Object(Y.registerBlockType)(e,t)}},6:function(e,t){!function(){e.exports=this.lodash}()},60:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(15),i=r.n(c),a=r(9);r(2);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,["srcElement","size"]);return Object(a.isValidElement)(t)&&Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c))}},71:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(23),i=r.n(c),a=r(26),s=r.n(a),l=r(20),u=r.n(l),b=r(24),d=r.n(b),p=r(25),w=r.n(p),g=r(12),f=r.n(g),m=r(0),v=r(6),h=r(7),O=r.n(h),j=r(4),y=r(21);r(169);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var o=f()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(i);return s&&(e=Object(v.isFunction)(s)?s(c):s),Object(m.createElement)(j.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",a)},Object(m.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(m.createElement)(j.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(m.createElement)(j.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(m.Component);t.a=Object(y.withInstanceId)(k)},77:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return u}));var n=r(13),o=r.n(n),c=r(7),i=r.n(c),a=r(5),s=function(e){if(a.G){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=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e,t){var r=t.className,n=t.showReviewDate,o=t.showReviewerName,c=t.showReviewContent,a=t.showProductName,s=t.showReviewImage,l=t.showReviewRating;return i()(e,r,{"has-image":s,"has-name":o,"has-date":n,"has-rating":l,"has-content":c,"has-product-name":a})}},869:function(e,t,r){"use strict";r.r(t);var n=r(8),o=r.n(n),c=r(0),i=r(1),a=r(14),s=r(60),l=r(59),u=Object(c.createElement)(l.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.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"})),b=(r(170),r(22)),d=r(4),p=(r(2),r(179)),w=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(i.__)("All Reviews","woo-gutenberg-products-block")},Object(i.__)("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"))},g=r(135),f=function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(i.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(i.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(g.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(g.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(i.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))},m=r(175),v=r(176),h=r(152);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/all-reviews",{title:Object(i.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1},example:j(j({},h.a),{},{attributes:j(j({},h.a.attributes),{},{showProductName:!0})}),attributes:j(j({},m.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(f,e)},save:v.a})},89:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(60)),i=r(140),a=r(7),s=r.n(a),l=r(4),u=r(49);r(143);t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isDefault:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},9:function(e,t){!function(){e.exports=this.React}()}});
|
build/attribute-filter-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '8064412922a0e8f9d51afeacc285ed82');
|
build/attribute-filter-frontend.js
CHANGED
@@ -1,9 +1,9 @@
|
|
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=
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!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)&&r.length){var u=o.apply(null,r);u&&e.push(u)}else if("object"===i)for(var c in r)n.call(r,c)&&r[c]&&e.push(c)}}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,n){e.exports=n(59)()},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}},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){"use strict";n.d(t,"i",(function(){return o})),n.d(t,"s",(function(){return i})),n.d(t,"w",(function(){return u})),n.d(t,"p",(function(){return c})),n.d(t,"l",(function(){return a})),n.d(t,"o",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"x",(function(){return p})),n.d(t,"k",(function(){return f})),n.d(t,"j",(function(){return d})),n.d(t,"c",(function(){return g})),n.d(t,"m",(function(){return b})),n.d(t,"n",(function(){return m})),n.d(t,"A",(function(){return h})),n.d(t,"t",(function(){return v})),n.d(t,"a",(function(){return y})),n.d(t,"u",(function(){return O})),n.d(t,"b",(function(){return w})),n.d(t,"f",(function(){return j})),n.d(t,"v",(function(){return E})),n.d(t,"g",(function(){return x})),n.d(t,"r",(function(){return R})),n.d(t,"q",(function(){return k})),n.d(t,"z",(function(){return _})),n.d(t,"y",(function(){return P})),n.d(t,"d",(function(){return C})),n.d(t,"e",(function(){return D}));var r=n(2),o=Object(r.getSetting)("currentUserIsAdmin",!1),i=Object(r.getSetting)("reviewRatingsEnabled",!0),u=Object(r.getSetting)("showAvatars",!0),c=(Object(r.getSetting)("max_columns",6),Object(r.getSetting)("min_columns",1),Object(r.getSetting)("default_columns",3),Object(r.getSetting)("max_rows",6),Object(r.getSetting)("min_rows",1),Object(r.getSetting)("default_rows",3),Object(r.getSetting)("min_height",500),Object(r.getSetting)("default_height",500),Object(r.getSetting)("placeholderImgSrc","")),a=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),s=Object(r.getSetting)("limitTags"),l=(Object(r.getSetting)("hasProducts",!0),Object(r.getSetting)("hasTags",!0),Object(r.getSetting)("homeUrl",""),Object(r.getSetting)("couponsEnabled",!0)),p=(Object(r.getSetting)("shippingEnabled",!0),Object(r.getSetting)("taxesEnabled",!0)),f=Object(r.getSetting)("displayItemizedTaxes",!1),d=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),g=(Object(r.getSetting)("productCount",0),Object(r.getSetting)("attributes",[])),b=Object(r.getSetting)("isShippingCalculatorEnabled",!0),m=Object(r.getSetting)("isShippingCostHidden",!1),h=(Object(r.getSetting)("woocommerceBlocksPhase",1),Object(r.getSetting)("wcBlocksAssetUrl","")),v=Object(r.getSetting)("shippingCountries",{}),y=Object(r.getSetting)("allowedCountries",{}),O=Object(r.getSetting)("shippingStates",{}),w=Object(r.getSetting)("allowedStates",{}),j=(Object(r.getSetting)("shippingMethodsExist",!1),Object(r.getSetting)("checkoutShowLoginReminder",!0)),S={id:0,title:"",permalink:""},I=Object(r.getSetting)("storePages",{shop:S,cart:S,checkout:S,privacy:S,terms:S}),E=I.shop.permalink,x=(I.checkout.id,I.checkout.permalink),R=I.privacy.permalink,k=I.privacy.title,_=I.terms.permalink,P=I.terms.title,C=(I.cart.id,I.cart.permalink),D=Object(r.getSetting)("checkoutAllowsGuest",!1);Object(r.getSetting)("checkoutAllowsSignup",!1),n(39)},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){var r=n(70),o=n(71),i=n(52),u=n(72);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||u()}},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},n.apply(this,arguments)}e.exports=n},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},,function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},,,function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},,,,,,,function(e,t,n){"use strict";var r=n(6),o=n.n(r),i=(n(5),n(3)),u=n(4),c=n.n(u);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,u=e.wrapperProps,a=null!=n,l=null!=r;return!a&&l?(t=o||"span",u=s(s({},u),{},{className:c()(u.className,"screen-reader-text")}),React.createElement(t,u,r)):(t=o||i.Fragment,a&&l&&n!==r?React.createElement(t,u,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,u,n))};l.defaultProps={wrapperProps:{}},t.a=l},,function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(58);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(20),o=n(19);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},,function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(0),o=n(37),i=n.n(o),u=function(e){var t=Object(r.useRef)();return i()(e,t.current)||(t.current=e),t.current}},function(e,t){!function(){e.exports=this.wp.blocks}()},,,function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t,n){"use strict";var r=n(32),o=n.n(r),i=n(33),u=n.n(i),c=n(19),a=n.n(c),s=n(34),l=n.n(s),p=n(35),f=n.n(p),d=n(21),g=n.n(d),b=n(6),m=n.n(b),h=(n(5),n(3)),v=n(1),y=n(8),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.A,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,i=e.text,u=void 0===i?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):i,c=e.errorMessage,a=e.errorMessagePrefix,s=void 0===a?Object(v.__)("Error:","woo-gutenberg-products-block"):a;return React.createElement("div",{className:"wc-block-error"},n&&React.createElement("img",{className:"wc-block-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content"},o&&React.createElement("p",{className:"wc-block-error__header"},o),u&&React.createElement("p",{className:"wc-block-error__text"},u),c&&React.createElement("p",{className:"wc-block-error__message"},s?s+" ":"",c)))};n(61);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g()(e);if(t){var o=g()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f()(this,n)}}var j=function(e){l()(n,e);var t=w(n);function n(){var e;o()(this,n);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return e=t.call.apply(t,[this].concat(i)),m()(a()(e),"state",{errorMessage:"",hasError:!1}),e}return u()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,u=this.state,c=u.errorMessage;return u.hasError?React.createElement(O,{errorMessage:r?c:null,header:t,imageUrl:n,text:o,errorMessagePrefix:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(h.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(h.Component);j.defaultProps={showErrorMessage:!0};t.a=j},function(e,t){!function(){e.exports=this.ReactDOM}()},,,,,,,,function(e,t,n){var r=n(53);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(o)};o.Provider},,,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";var r=n(60);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,u){if(u!==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){},,,,,,,,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=e[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,,,function(e,t,n){var r=n(101),o=n(102),i=n(52),u=n(103);e.exports=function(e){return r(e)||o(e)||i(e)||u()}},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,i=Object(r.useRef)(null),u=Object(r.useRef)([]),c=n.leading,a=void 0===n.trailing||n.trailing,s=Object(r.useRef)(!1),l=Object(r.useRef)(null),p=Object(r.useRef)(!1),f=Object(r.useRef)(e);f.current=e;var d=Object(r.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,u.current=[],l.current=null,s.current=!1}),[]);Object(r.useEffect)((function(){return function(){p.current=!0}}),[]);var g=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];u.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!c||s.current||(f.current.apply(f,e),s.current=!0),l.current=setTimeout((function(){var t=!0;c&&s.current&&(t=!1),d(),!p.current&&a&&t&&f.current.apply(f,e)}),t),o&&!i.current&&a&&(i.current=setTimeout((function(){var e=u.current;d(),p.current||f.current.apply(null,e)}),o))}),[o,t,d,c,a]),b=Object(r.useCallback)((function(){l.current&&(f.current.apply(null,u.current),d())}),[d]);return[g,d,b]}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),o=n.n(r),i=n(0),u=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},function(e,t,n){"use strict";e.exports=n(120)},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return d}));var r=n(10),o=n.n(r),i=n(15),u=n(12),c=n(0),a=n(55),s=n(7),l=n(38),p=function(e){var t=Object(a.a)();e=e||t;var n=Object(u.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(u.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(c.useCallback)((function(t){r(e,t)}),[e])]},f=function(e,t,n){var r=Object(a.a)();n=n||r;var o=Object(u.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),s=Object(u.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(c.useCallback)((function(t){s(n,e,t)}),[n,e])]},d=function(e,t){var n=Object(a.a)(),r=p(t=t||n),i=o()(r,2),u=i[0],f=i[1],d=Object(l.a)(e),g=Object(c.useRef)(!1);return Object(c.useEffect)((function(){f(Object(s.assign)({},u,d)),g.current=!0}),[d]),g.current?[u,f]:[e,f]}},,,function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function o(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function i(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return o(n.overflowY,t)||o(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function u(e,t,n,r,o,i,u,c){return i<e&&u>t||i>e&&u<t?0:i<=e&&c<=n||u>=t&&c>=n?i-e-r:u>t&&c<n||i<e&&c>n?u-t+o:0}t.a=function(e,t){var n=t.scrollMode,o=t.block,c=t.inline,a=t.boundary,s=t.skipOverflowHiddenElements,l="function"==typeof a?a:function(e){return e!==a};if(!r(e))throw new TypeError("Invalid target");for(var p=document.scrollingElement||document.documentElement,f=[],d=e;r(d)&&l(d);){if((d=d.parentNode)===p){f.push(d);break}d===document.body&&i(d)&&!i(document.documentElement)||i(d,s)&&f.push(d)}for(var g=window.visualViewport?visualViewport.width:innerWidth,b=window.visualViewport?visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,v=e.getBoundingClientRect(),y=v.height,O=v.width,w=v.top,j=v.right,S=v.bottom,I=v.left,E="start"===o||"nearest"===o?w:"end"===o?S:w+y/2,x="center"===c?I+O/2:"end"===c?j:I,R=[],k=0;k<f.length;k++){var _=f[k],P=_.getBoundingClientRect(),C=P.height,D=P.width,T=P.top,M=P.right,A=P.bottom,H=P.left;if("if-needed"===n&&w>=0&&I>=0&&S<=b&&j<=g&&w>=T&&S<=A&&I>=H&&j<=M)return R;var N=getComputedStyle(_),L=parseInt(N.borderLeftWidth,10),V=parseInt(N.borderTopWidth,10),B=parseInt(N.borderRightWidth,10),K=parseInt(N.borderBottomWidth,10),F=0,U=0,q="offsetWidth"in _?_.offsetWidth-_.clientWidth-L-B:0,$="offsetHeight"in _?_.offsetHeight-_.clientHeight-V-K:0;if(p===_)F="start"===o?E:"end"===o?E-b:"nearest"===o?u(h,h+b,b,V,K,h+E,h+E+y,y):E-b/2,U="start"===c?x:"center"===c?x-g/2:"end"===c?x-g:u(m,m+g,g,L,B,m+x,m+x+O,O),F=Math.max(0,F+h),U=Math.max(0,U+m);else{F="start"===o?E-T-V:"end"===o?E-A+K+$:"nearest"===o?u(T,A,C,V,K+$,E,E+y,y):E-(T+C/2)+$/2,U="start"===c?x-H-L:"center"===c?x-(H+D/2)+q/2:"end"===c?x-M+B+q:u(H,M,D,L,B+q,x,x+O,O);var W=_.scrollLeft,Y=_.scrollTop;E+=Y-(F=Math.max(0,Math.min(Y+F,_.scrollHeight-C+$))),x+=W-(U=Math.max(0,Math.min(W+U,_.scrollWidth-D+q)))}R.push({el:_,top:F,left:U})}return R}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(11),o=n.n(r),i=n(6),u=n.n(i),c=n(44),a=n(43);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){u()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=function(e){var t=e.Block,n=e.selector,r=e.getProps,i=void 0===r?function(){}:r,u=e.getErrorBoundaryProps,s=void 0===u?function(){}:u,p=document.querySelectorAll(n);p.length&&Array.prototype.forEach.call(p,(function(e,n){var r=i(e,n),u=s(e,n),p=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(c.render)(React.createElement(a.a,u,React.createElement(t,o()({},r,{attributes:p}))),e)}))}},,,function(e,t,n){var r=n(53);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(15),o=n(12),i=n(0),u=n(85),c=n(38),a=function(e){var t=e.namespace,n=e.resourceName,a=e.resourceValues,s=void 0===a?[]:a,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,d=void 0===f||f;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var g=Object(i.useRef)({results:[],isLoading:!0}),b=Object(c.a)(p),m=Object(c.a)(s),h=Object(u.a)(),v=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,b,m],u=o.getCollectionError.apply(o,i);return u&&h(u),{results:o.getCollection.apply(o,i),isLoading:!o.hasFinishedResolution("getCollection",i)}}),[t,n,m,b,d]);return null!==v&&(g.current=v),g.current}},,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(2),i=n(15),u=n(12);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(Object(o.getSetting)("restApiRoutes")),Object(u.useSelect)((function(e,t){if(n.current){var r=e(i.SCHEMA_STORE_KEY),o=r.isResolving,u=r.hasFinishedResolution,c=t.dispatch(i.SCHEMA_STORE_KEY),a=c.receiveRoutes,s=c.startResolution,l=c.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];o("getRoutes",[e])||u("getRoutes",[e])||(s("getRoutes",[e]),a(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},function(e,t,n){"use strict";
|
7 |
/** @license React v16.13.1
|
8 |
* react-is.production.min.js
|
9 |
*
|
@@ -11,4 +11,4 @@
|
|
11 |
*
|
12 |
* This source code is licensed under the MIT license found in the
|
13 |
* LICENSE file in the root directory of this source tree.
|
14 |
-
*/var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,u=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function j(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case f:case u:case a:case c:case g:return e;default:switch(e=e&&e.$$typeof){case l:case d:case h:case m:case s:return e;default:return t}}case i:return t}}}function S(e){return j(e)===f}t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=s,t.Element=o,t.ForwardRef=d,t.Fragment=u,t.Lazy=h,t.Memo=m,t.Portal=i,t.Profiler=a,t.StrictMode=c,t.Suspense=g,t.isAsyncMode=function(e){return S(e)||j(e)===p},t.isConcurrentMode=S,t.isContextConsumer=function(e){return j(e)===l},t.isContextProvider=function(e){return j(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return j(e)===d},t.isFragment=function(e){return j(e)===u},t.isLazy=function(e){return j(e)===h},t.isMemo=function(e){return j(e)===m},t.isPortal=function(e){return j(e)===i},t.isProfiler=function(e){return j(e)===a},t.isStrictMode=function(e){return j(e)===c},t.isSuspense=function(e){return j(e)===g},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===u||e===f||e===a||e===c||e===g||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===l||e.$$typeof===d||e.$$typeof===y||e.$$typeof===O||e.$$typeof===w||e.$$typeof===v)},t.typeOf=j},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(3),o=n(82);function i(e,t){return e===t}function u(e,t,n){var u=n&&n.equalityFn?n.equalityFn:i,c=Object(r.useState)(e),a=c[0],s=c[1],l=Object(o.a)(Object(r.useCallback)((function(e){return s(e)}),[]),t,n),p=l[0],f=l[1],d=l[2],g=Object(r.useRef)(e);return Object(r.useEffect)((function(){u(g.current,e)||(p(e),g.current=e)}),[e,p,u]),[a,f,d]}},function(e,t,n){"use strict";var r=n(1),o=(n(5),n(4)),i=n.n(o),u=n(28),c=(n(149),function(e){var t=e.className,n=e.disabled,o=e.label,c=void 0===o?Object(r.__)("Go","woo-gutenberg-products-block"):o,a=e.onClick,s=e.screenReaderLabel,l=void 0===s?Object(r.__)("Apply filter","woo-gutenberg-products-block"):s;return React.createElement("button",{type:"submit",className:i()("wc-block-filter-submit-button",t),disabled:n,onClick:a},React.createElement(u.a,{label:c,screenReaderLabel:l}))});c.defaultProps={disabled:!1},t.a=c},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u}));var r=n(8),o=r.c.reduce((function(e,t){var n,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;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return o.find((function(t){return t.id===e}))},u=function(e){if(e)return o.find((function(t){return 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(7),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=e.filter((function(e){return e.attribute===n.taxonomy})),u=i.length?i[0]:null;if(u&&u.slug&&Array.isArray(u.slug)&&u.slug.includes(o)){var c=u.slug.filter((function(e){return e!==o})),a=e.filter((function(e){return e.attribute!==n.taxonomy}));c.length>0&&(u.slug=c.sort(),a.push(u)),t(Object(r.sortBy)(a,"attribute"))}},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},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",u=e.filter((function(e){return e.attribute!==n.taxonomy}));0===o.length?t(u):(u.push({attribute:n.taxonomy,operator:i,slug:Object(r.map)(o,"slug").sort()}),t(Object(r.sortBy)(u,"attribute")))}},,,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(6),o=n.n(r),i=n(76),u=n.n(i),c=n(20),a=n.n(c),s=n(10),l=n.n(s),p=n(0),f=n(93),d=n(106),g=n(55),b=n(127),m=n(7),h=n(38);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryState,o=Object(g.a)();o="".concat(o,"-collection-data");var i=Object(f.a)(o),c=l()(i,1)[0],s=Object(f.b)("calculate_attribute_counts",[],o),v=l()(s,2),O=v[0],w=v[1],j=Object(f.b)("calculate_price_range",null,o),S=l()(j,2),I=S[0],E=S[1],x=Object(h.a)(t||{}),R=Object(h.a)(n);Object(p.useEffect)((function(){"object"===a()(x)&&Object.keys(x).length&&(O.find((function(e){return e.taxonomy===x.taxonomy}))||w([].concat(u()(O),[x])))}),[x,O,w]),Object(p.useEffect)((function(){I!==R&&void 0!==R&&E(R)}),[R,E,I]);var k=Object(p.useState)(!1),_=l()(k,2),P=_[0],C=_[1],D=Object(b.a)(P,200),T=l()(D,1)[0];P||C(!0);var M=Object(p.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(m.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(c)}),[c]);return Object(d.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:y(y({},r),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},M),shouldSelect:T})}},,function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(119),o=n(98),i=n(6),u=n.n(i),c=n(10),a=n.n(c),s=n(1),l=n(42),p=n(93),f=n(106),d=n(193),g=n(38),b=n(0),m=n(76),h=n.n(m),v=n(5),y=n.n(v),O=n(4),w=n.n(O),j=(n(197),function(e){var t=e.className,n=e.onChange,r=void 0===n?function(){}:n,o=e.options,i=void 0===o?[]:o,u=e.checked,c=void 0===u?[]:u,l=e.isLoading,p=void 0!==l&&l,f=e.isDisabled,d=void 0!==f&&f,g=e.limit,m=void 0===g?10:g,v=Object(b.useState)(!1),y=a()(v,2),O=y[0],j=y[1],S=Object(b.useMemo)((function(){return h()(Array(5)).map((function(e,t){return React.createElement("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),I=Object(b.useMemo)((function(){var e=i.length-m;return!O&&React.createElement("li",{key:"show-more",className:"show-more"},React.createElement("button",{onClick:function(){j(!0)},"aria-expanded":!1,"aria-label":Object(s.sprintf)(Object(s._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(s.sprintf)(Object(s._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))}),[i,m,O]),E=Object(b.useMemo)((function(){return O&&React.createElement("li",{key:"show-less",className:"show-less"},React.createElement("button",{onClick:function(){j(!1)},"aria-expanded":!0,"aria-label":Object(s.__)("Show less options","woo-gutenberg-products-block")},Object(s.__)("Show less","woo-gutenberg-products-block")))}),[O]),x=Object(b.useMemo)((function(){var e=i.length>m+5;return React.createElement(b.Fragment,null,i.map((function(t,n){return React.createElement(b.Fragment,{key:t.value},React.createElement("li",e&&!O&&n>=m&&{hidden:!0},React.createElement("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:c.includes(t.value),disabled:d}),React.createElement("label",{htmlFor:t.value},t.label)),e&&n===m-1&&I)})),e&&E)}),[i,c,O,m,E,I,d]),R=w()("wc-block-checkbox-list",{"is-loading":p},t);return React.createElement("ul",{className:R},p?S:x)}),S=n(30),I=n(9),E=n(13),x=n(96),R=n(3),k=(n(86),n(97)),_=0;function P(e){return"function"==typeof e?e:C}function C(){}function D(e,t){null!==e&&Object(k.a)(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function T(e,t){return e===t||e.contains&&e.contains(t)}function M(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function H(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function N(e){var t=e.isOpen,n=e.selectedItem,r=e.resultCount,o=e.previousResultCount,i=e.itemToString;return t?r?r!==o?r+" result"+(1===r?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":n?i(n):""}function L(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function V(e){return"string"==typeof e.type}function B(e){return e.props}var K=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function F(e){void 0===e&&(e={});var t={};return K.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function U(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=q(t,r)?t[r]:e[r],n}),{})}function q(e,t){return void 0!==e[t]}function $(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function W(e,t,n,r,o){void 0===o&&(o=!0);var i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var u=t+e;u<0?u=o?i:0:u>i&&(u=o?0:i);var c=Y(e,u,n,r,o);return-1===c?t:c}function Y(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var u=t+1;u<n;u++)if(!r(u).hasAttribute("disabled"))return u}else for(var c=t-1;c>=0;c--)if(!r(c).hasAttribute("disabled"))return c;return o?e>0?Y(1,0,n,r,!1):Y(-1,n-1,n,r,!1):-1}function Q(e,t,n,r,o){return void 0===o&&(o=!0),[t,n].some((function(t){return t&&(T(t,e)||o&&T(t,r.activeElement))}))}var z=M((function(){X().textContent=""}),500);function G(e,t){var n=X(t);e&&(n.textContent=e,z())}function X(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var J=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Z=function(){var e=function(e){function t(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(_++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=F(t),n.internalSetState(Object(I.a)({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=F(t),n.internalSetState(Object(I.a)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,Object(I.a)({},n.getStateAndHelpers(),{},e)),n.setState((function(t){t=n.getState(t);var c=u?e(t):e;c=n.props.stateReducer(t,c),r=c.hasOwnProperty("selectedItem");var a={},s={};return r&&c.selectedItem!==t.selectedItem&&(o=c.selectedItem),c.type=c.type||0,Object.keys(c).forEach((function(e){t[e]!==c[e]&&(i[e]=c[e]),"type"!==e&&(s[e]=c[e],q(n.props,e)||(a[e]=c[e]))})),u&&c.hasOwnProperty("inputValue")&&n.props.onInputValueChange(c.inputValue,Object(I.a)({},n.getStateAndHelpers(),{},c)),a}),(function(){P(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,u=void 0===i?"ref":i,c=o.ref,a=Object(S.a)(o,["refKey","ref"]),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;n.getRootProps.called=!0,n.getRootProps.refKey=u,n.getRootProps.suppressRefError=l;var p=n.getState().isOpen;return Object(I.a)(((r={})[u]=H(c,n.rootRef),r.role="combobox",r["aria-expanded"]=p,r["aria-haspopup"]="listbox",r["aria-owns"]=p?n.menuId:null,r["aria-labelledby"]=n.labelId,r),a)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=W(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=W(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},n.buttonKeyDownHandlers=Object(I.a)({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=Object(I.a)({},n.keyDownHandlers,{Home:function(e){var t=this;e.preventDefault();var n=this.getItemCount(),r=this.getState().isOpen;if(!(n<=0)&&r){var o=Y(1,0,n,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}},End:function(e){var t=this;e.preventDefault();var n=this.getItemCount(),r=this.getState().isOpen;if(!(n<=0)&&r){var o=Y(-1,n-1,n,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick,o=(t.onPress,t.onKeyDown),i=t.onKeyUp,u=t.onBlur,c=Object(S.a)(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),a=n.getState().isOpen,s={onClick:A(r,n.buttonHandleClick),onKeyDown:A(o,n.buttonHandleKeyDown),onKeyUp:A(i,n.buttonHandleKeyUp),onBlur:A(u,n.buttonHandleBlur)},l=c.disabled?{}:s;return Object(I.a)({type:"button",role:"button","aria-label":a?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},l,{},c)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=$(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(Object(E.a)(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return Object(I.a)({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,u=t.onInput,c=(t.onChangeText,Object(S.a)(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),a={};var s,l=n.getState(),p=l.inputValue,f=l.isOpen,d=l.highlightedIndex;c.disabled||((s={}).onChange=A(i,u,n.inputHandleChange),s.onKeyDown=A(r,n.inputHandleKeyDown),s.onBlur=A(o,n.inputHandleBlur),a=s);return Object(I.a)({"aria-autocomplete":"list","aria-activedescendant":f&&"number"==typeof d&&d>=0?n.getItemId(d):null,"aria-controls":f?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:p,id:n.inputId},a,{},c)},n.inputHandleKeyDown=function(e){var t=$(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(Object(E.a)(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,u=void 0===i?"ref":i,c=o.ref,a=Object(S.a)(o,["refKey","ref"]),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;return n.getMenuProps.called=!0,n.getMenuProps.refKey=u,n.getMenuProps.suppressRefError=l,Object(I.a)(((r={})[u]=H(c,n.menuRef),r.role="listbox",r["aria-labelledby"]=a&&a["aria-label"]?null:n.labelId,r.id=n.menuId,r),a)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,u=r.onClick,c=(r.onPress,r.index),a=r.item,s=void 0===a?void 0:a,l=Object(S.a)(r,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===c?(n.items.push(s),c=n.items.indexOf(s)):n.items[c]=s;var p=u,f=((t={onMouseMove:A(o,(function(){c!==n.getState().highlightedIndex&&(n.setHighlightedIndex(c,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:A(i,(function(e){e.preventDefault()}))}).onClick=A(p,(function(){n.selectItemAtIndex(c,{type:9})})),t),d=l.disabled?{onMouseDown:f.onMouseDown}:f;return Object(I.a)({id:n.getItemId(c),role:"option","aria-selected":n.getState().highlightedIndex===c},d,{},l)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=F(e),n.internalSetState((function(t){var r=t.selectedItem;return Object(I.a)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=F(e),n.internalSetState((function(t){var r=t.isOpen;return Object(I.a)({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},{},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),P(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=M((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(Object(I.a)({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,G(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,u=void 0===i?o:i,c=r.defaultIsOpen,a=r.initialIsOpen,s=void 0===a?c:a,l=r.initialInputValue,p=void 0===l?"":l,f=r.initialSelectedItem,d=void 0===f?null:f,g=n.getState({highlightedIndex:u,isOpen:s,inputValue:p,selectedItem:d});return null!=g.selectedItem&&void 0===n.props.initialInputValue&&(g.inputValue=n.props.itemToString(g.selectedItem)),n.state=g,n}Object(x.a)(t,e);var n=t.prototype;return n.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},n.getState=function(e){return void 0===e&&(e=this.state),U(e,this.props)},n.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},n.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},n.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},n.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var i=W(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},n.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,u=this.id,c=this.getRootProps,a=this.getToggleButtonProps,s=this.getLabelProps,l=this.getMenuProps,p=this.getInputProps,f=this.getItemProps,d=this.openMenu,g=this.closeMenu,b=this.toggleMenu,m=this.selectItem,h=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,O=this.clearSelection,w=this.clearItems;return{getRootProps:c,getToggleButtonProps:a,getLabelProps:s,getMenuProps:l,getInputProps:p,getItemProps:f,reset:this.reset,openMenu:d,closeMenu:g,toggleMenu:b,selectItem:m,selectItemAtIndex:h,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:O,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},n.componentDidMount=function(){var e=this;var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Q(t.target,e._rootNode,e._menuNode,e.props.environment.document)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},i=function(t){var n=Q(t.target,e._rootNode,e._menuNode,e.props.environment.document,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",r),u.addEventListener("touchmove",o),u.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",r),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",i)}},n.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},n.componentDidUpdate=function(e,t){q(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},n.componentWillUnmount=function(){this.cleanup()},n.render=function(){var e=L(this.props.children,C);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=L(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:V(t)?Object(R.cloneElement)(t,this.getRootProps(B(t))):void 0:null},t}(R.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:N,itemToString:function(e){return null==e?"":String(e)},onStateChange:C,onInputValueChange:C,onUserAction:C,onChange:C,onSelect:C,onOuterClick:C,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:D},e.stateChangeTypes=J,e}();var ee={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11yStatusMessage:function(e){var t=e.isOpen,n=e.items;if(!n)return"";var r=n.length;return t?0===r?"No results are available":r+" result"+(1===r?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":""},getA11ySelectionMessage:function(e){var t=e.selectedItem;return(0,e.itemToString)(t)+" has been selected."},scrollIntoView:D,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})});y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})}),Object(I.a)({},ee,{circularNavigation:!0});var te=Z,ne=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,o=e.isDisabled,i=e.onFocus,u=e.onRemoveItem,c=e.placeholder,a=e.tabIndex,s=e.value;return React.createElement("input",n({ref:r,className:"wc-block-dropdown-selector__input",disabled:o,onFocus:i,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&u(t[t.length-1])},placeholder:c,tabIndex:a}))},re=function(e){var t=e.children,n=e.onClick;return React.createElement("div",{className:"wc-block-dropdown-selector__input-wrapper",onClick:n},t)},oe=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,o=e.highlightedIndex,i=e.options;return React.createElement("ul",r({className:"wc-block-dropdown-selector__list"}),i.map((function(e,r){var i=t.includes(e.value);return React.createElement("li",n({key:e.value,className:w()("wc-block-dropdown-selector__list-item",{"is-selected":i,"is-highlighted":o===r}),index:r,item:e.value,"aria-label":i?Object(s.sprintf)(Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},ie=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement("button",{className:"wc-block-dropdown-selector__selected-chip",onClick:function(){t(n.value)},onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||t(n.value)},"aria-label":Object(s.sprintf)(Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),n.name)},React.createElement("span",{className:"wc-block-dropdown-selector__selected-chip__label"},n.label),React.createElement("span",{className:"wc-block-dropdown-selector__selected-chip__remove"},"𝘅"))},ue=function(e){var t=e.onClick,n=e.onRemoveItem,r=e.option,o=Object(b.useRef)(null);return Object(b.useEffect)((function(){o.current.focus()}),[o]),React.createElement("div",{className:"wc-block-dropdown-selector__selected-value"},React.createElement("button",{ref:o,className:"wc-block-dropdown-selector__selected-value__label",onClick:function(e){e.stopPropagation(),t(r.value)},"aria-label":Object(s.sprintf)(Object(s.__)("Replace current %s filter","woo-gutenberg-products-block"),r.name)},r.label),React.createElement("button",{className:"wc-block-dropdown-selector__selected-value__remove",onClick:function(){n(r.value)},onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||n(r.value)},"aria-label":Object(s.sprintf)(Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},"𝘅"))};n(196);function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach((function(t){u()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var se=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,o=e.checked,i=void 0===o?[]:o,u=e.inputLabel,c=void 0===u?"":u,a=e.isDisabled,l=void 0!==a&&a,p=e.isLoading,f=void 0!==p&&p,d=e.multiple,g=void 0!==d&&d,m=e.onChange,h=void 0===m?function(){}:m,v=e.options,y=void 0===v?[]:v,O=Object(b.useRef)(null),j=w()(r,"wc-block-dropdown-selector",{"is-disabled":l,"is-loading":f}),S=Object(b.useCallback)((function(e,t){switch(t.type){case te.stateChangeTypes.keyDownEnter:case te.stateChangeTypes.clickItem:return ae(ae({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:g,inputValue:""});case te.stateChangeTypes.blurInput:case te.stateChangeTypes.mouseUp:return ae(ae({},t),{},{inputValue:e.inputValue});default:return t}}),[g]);return React.createElement(te,{onChange:h,selectedItem:null,stateReducer:S},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,u=e.getMenuProps,a=e.highlightedIndex,p=e.inputValue,f=e.isOpen,d=e.openMenu;return React.createElement("div",{className:w()(j,{"is-multiple":g,"is-single":!g})},React.createElement("label",o({className:"screen-reader-text"}),c),React.createElement(re,{isOpen:f,onClick:function(){return O.current.focus()}},i.map((function(e){var t=y.find((function(t){return t.value===e})),n=function(e){h(e),O.current.focus()};return g?React.createElement(ie,{key:e,onRemoveItem:n,option:t}):React.createElement(ue,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(ne,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:d,onRemoveItem:function(e){h(e),O.current.focus()},placeholder:i.length>0&&g?null:Object(s.sprintf)(Object(s.__)("Any %s","woo-gutenberg-products-block"),n),tabIndex:!g&&i.length>0?"-1":"0",value:p})),f&&!l&&React.createElement(oe,{checked:i,getItemProps:r,getMenuProps:u,highlightedIndex:a,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},le=n(128),pe=n(37),fe=n.n(pe),de=n(16),ge=n(129),be=n(130),me=n(28),he=function(e){var t=e.name,n=e.count;return React.createElement(b.Fragment,null,t,Number.isFinite(n)&&React.createElement(me.a,{label:n,screenReaderLabel:Object(s.sprintf)(Object(s._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-block-attribute-filter-list-count"}}))},ve=[{value:"preview-1",name:"Blue",label:React.createElement(he,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(he,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(he,{name:"Red",count:2})}],ye={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(195);function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach((function(t){u()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var je=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,o=t.isPreview&&!t.attributeId?ye:Object(ge.a)(t.attributeId),i=Object(b.useState)([]),u=a()(i,2),c=u[0],m=u[1],h=Object(b.useState)(t.isPreview&&!t.attributeId?ve:[]),v=a()(h,2),y=v[0],O=v[1],w=Object(p.a)(),S=a()(w,1)[0],I=Object(p.b)("attributes",[]),E=a()(I,2),x=E[0],R=E[1],k=Object(f.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[o.id],shouldSelect:t.attributeId>0}),_=k.results,P=k.isLoading,C="dropdown"!==t.displayStyle&&"and"===t.queryType,D=Object(d.a)({queryAttribute:{taxonomy:o.taxonomy,queryType:t.queryType},queryState:we(we({},S),{},{attributes:C?S.attributes:null})}),T=D.results,M=D.isLoading,A=Object(b.useCallback)((function(e){return T.attribute_counts?T.attribute_counts.find((function(t){return t.term===e})):null}),[T]);Object(b.useEffect)((function(){if(!P&&!M){var e=_.map((function(e){var n,r=A(e.id);if(!(r||c.includes(e.slug)||(n=e.slug,S&&S.attributes&&S.attributes.some((function(e){var t=e.attribute,r=e.slug,i=void 0===r?[]:r;return t===o.taxonomy&&i.includes(n)})))))return null;var i=r?r.count:0;return{value:e.slug,name:Object(de.decodeEntities)(e.name),label:React.createElement(he,{name:Object(de.decodeEntities)(e.name),count:t.showCounts?i:null})}})).filter(Boolean);O(e)}}),[o.taxonomy,_,P,t.showCounts,M,A,c,S.attributes]),Object(b.useEffect)((function(){t.showFilterButton||V()}),[c,V]);var H=Object(b.useMemo)((function(){return x.filter((function(e){return e.attribute===o.taxonomy})).flatMap((function(e){return e.slug}))}),[x,o.taxonomy]),N=Object(g.a)(H);Object(b.useEffect)((function(){fe()(c,H)||m(H)}),[N]);var L=Object(b.useCallback)((function(e){return _.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[_]),V=function(){r||Object(be.b)(x,R,o,L(c),"or"===t.queryType?"in":"and")},B="dropdown"!==t.displayStyle||"or"===t.queryType,K=Object(b.useCallback)((function(e){var t,n=function(e){return y.find((function(t){return t.value===e})).name},r=function(e){var t=e.filterAdded,r=e.filterRemoved,o=t?n(t):null,i=r?n(r):null;o&&i?Object(l.speak)(Object(s.sprintf)(Object(s.__)("%s filter replaced with %s.","woo-gutenberg-products-block"),o,i)):o?Object(l.speak)(Object(s.sprintf)(Object(s.__)("%s filter added.","woo-gutenberg-products-block"),o)):i&&Object(l.speak)(Object(s.sprintf)(Object(s.__)("%s filter removed.","woo-gutenberg-products-block"),i))},o=c.includes(e);B?(t=c.filter((function(t){return t!==e})),o?r({filterRemoved:e}):(t.push(e),t.sort(),r({filterAdded:e}))):(t=o?[]:[e],r({filterAdded:o?null:e,filterRemoved:1===c.length?c[0]:null}));m(t)}),[c,y,B]);if(0===y.length&&!P)return null;var F="h".concat(t.headingLevel),U=!t.isPreview&&P,q=!t.isPreview&&M;return React.createElement(b.Fragment,null,!r&&t.heading&&React.createElement(F,null,t.heading),React.createElement("div",{className:"wc-block-attribute-filter"},"dropdown"===t.displayStyle?React.createElement(se,{attributeLabel:o.label,checked:c,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:U,multiple:B,onChange:K,options:y}):React.createElement(j,{className:"wc-block-attribute-filter-list",options:y,checked:c,onChange:K,isLoading:U,isDisabled:q}),t.showFilterButton&&React.createElement(le.a,{className:"wc-block-attribute-filter__button",disabled:U||q,onClick:V})))};Object(o.a)({selector:".wp-block-woocommerce-attribute-filter",Block:Object(r.a)(je),getProps:function(e){return{attributes:{attributeId:parseInt(e.dataset.attributeId||0,10),showCounts:"true"===e.dataset.showCounts,queryType:e.dataset.queryType,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3,displayStyle:e.dataset.displayStyle,showFilterButton:"true"===e.dataset.showFilterButton}}}})}]);
|
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=259)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wc.wcSettings}()},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){var r;
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!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)&&r.length){var c=o.apply(null,r);c&&e.push(c)}else if("object"===i)for(var u in r)n.call(r,u)&&r[u]&&e.push(u)}}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,n){e.exports=n(61)()},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}},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(73),o=n(74),i=n(54),c=n(75);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||c()}},function(e,t,n){"use strict";n.d(t,"i",(function(){return o})),n.d(t,"s",(function(){return i})),n.d(t,"w",(function(){return c})),n.d(t,"p",(function(){return u})),n.d(t,"l",(function(){return a})),n.d(t,"o",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"x",(function(){return p})),n.d(t,"k",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"c",(function(){return b})),n.d(t,"m",(function(){return g})),n.d(t,"n",(function(){return m})),n.d(t,"A",(function(){return h})),n.d(t,"t",(function(){return v})),n.d(t,"a",(function(){return y})),n.d(t,"u",(function(){return O})),n.d(t,"b",(function(){return w})),n.d(t,"f",(function(){return j})),n.d(t,"v",(function(){return E})),n.d(t,"g",(function(){return _})),n.d(t,"r",(function(){return x})),n.d(t,"q",(function(){return k})),n.d(t,"z",(function(){return R})),n.d(t,"y",(function(){return P})),n.d(t,"d",(function(){return C})),n.d(t,"e",(function(){return D}));var r=n(2),o=Object(r.getSetting)("currentUserIsAdmin",!1),i=Object(r.getSetting)("reviewRatingsEnabled",!0),c=Object(r.getSetting)("showAvatars",!0),u=(Object(r.getSetting)("max_columns",6),Object(r.getSetting)("min_columns",1),Object(r.getSetting)("default_columns",3),Object(r.getSetting)("max_rows",6),Object(r.getSetting)("min_rows",1),Object(r.getSetting)("default_rows",3),Object(r.getSetting)("min_height",500),Object(r.getSetting)("default_height",500),Object(r.getSetting)("placeholderImgSrc","")),a=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),s=Object(r.getSetting)("limitTags"),l=(Object(r.getSetting)("hasProducts",!0),Object(r.getSetting)("hasTags",!0),Object(r.getSetting)("homeUrl",""),Object(r.getSetting)("couponsEnabled",!0)),p=(Object(r.getSetting)("shippingEnabled",!0),Object(r.getSetting)("taxesEnabled",!0)),d=Object(r.getSetting)("displayItemizedTaxes",!1),f=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),b=(Object(r.getSetting)("productCount",0),Object(r.getSetting)("attributes",[])),g=Object(r.getSetting)("isShippingCalculatorEnabled",!0),m=Object(r.getSetting)("isShippingCostHidden",!1),h=(Object(r.getSetting)("woocommerceBlocksPhase",1),Object(r.getSetting)("wcBlocksAssetUrl","")),v=Object(r.getSetting)("shippingCountries",{}),y=Object(r.getSetting)("allowedCountries",{}),O=Object(r.getSetting)("shippingStates",{}),w=Object(r.getSetting)("allowedStates",{}),j=(Object(r.getSetting)("shippingMethodsExist",!1),Object(r.getSetting)("checkoutShowLoginReminder",!0)),S={id:0,title:"",permalink:""},I=Object(r.getSetting)("storePages",{shop:S,cart:S,checkout:S,privacy:S,terms:S}),E=I.shop.permalink,_=(I.checkout.id,I.checkout.permalink),x=I.privacy.permalink,k=I.privacy.title,R=I.terms.permalink,P=I.terms.title,C=(I.cart.id,I.cart.permalink),D=Object(r.getSetting)("checkoutAllowsGuest",!1);Object(r.getSetting)("checkoutAllowsSignup",!1),n(41)},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){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},n.apply(this,arguments)}e.exports=n},,function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},,,function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},,,function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},,function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},,,,function(e,t,n){"use strict";var r=n(6),o=n.n(r),i=(n(5),n(3)),c=n(4),u=n.n(c);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(e){var t,n=e.label,r=e.screenReaderLabel,o=e.wrapperElement,c=e.wrapperProps,a=null!=n,l=null!=r;return!a&&l?(t=o||"span",c=s(s({},c),{},{className:u()(c.className,"screen-reader-text")}),React.createElement(t,c,r)):(t=o||i.Fragment,a&&l&&n!==r?React.createElement(t,c,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},r)):React.createElement(t,c,n))};l.defaultProps={wrapperProps:{}},t.a=l},,function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(60);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(22),o=n(19);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},,,function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=n(38),i=n.n(o),c=function(e){var t=Object(r.useRef)();return i()(e,t.current)||(t.current=e),t.current}},,function(e,t){!function(){e.exports=this.wp.blocks}()},,function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t,n){"use strict";var r=n(32),o=n.n(r),i=n(33),c=n.n(i),u=n(19),a=n.n(u),s=n(34),l=n.n(s),p=n(35),d=n.n(p),f=n(24),b=n.n(f),g=n(6),m=n.n(g),h=(n(5),n(3)),v=n(1),y=n(9),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.A,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(v.__)("Oops!","woo-gutenberg-products-block"):r,i=e.text,c=void 0===i?Object(v.__)("There was an error loading the content.","woo-gutenberg-products-block"):i,u=e.errorMessage,a=e.errorMessagePrefix,s=void 0===a?Object(v.__)("Error:","woo-gutenberg-products-block"):a;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),c&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},c),u&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",u)))};n(63);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d()(this,n)}}var j=function(e){l()(n,e);var t=w(n);function n(){var e;o()(this,n);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=t.call.apply(t,[this].concat(i)),m()(a()(e),"state",{errorMessage:"",hasError:!1}),e}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,i=e.errorMessagePrefix,c=this.state,u=c.errorMessage;return c.hasError?React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(h.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(h.Component);j.defaultProps={showErrorMessage:!0};t.a=j},function(e,t){!function(){e.exports=this.ReactDOM}()},,,,,,,,,function(e,t,n){var r=n(55);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t,n){var r=n(91),o=n(92),i=n(54),c=n(93);e.exports=function(e){return r(e)||o(e)||i(e)||c()}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=Object(r.createContext)("page"),i=function(){return Object(r.useContext)(o)};o.Provider},,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";var r=n(62);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,c){if(c!==r){var u=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 u.name="Invariant Violation",u}}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){},,,,,,,,,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(r=(c=u.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){void 0===n&&(n={});var o=n.maxWait,i=Object(r.useRef)(null),c=Object(r.useRef)([]),u=n.leading,a=void 0===n.trailing||n.trailing,s=Object(r.useRef)(!1),l=Object(r.useRef)(null),p=Object(r.useRef)(!1),d=Object(r.useRef)(e);d.current=e;var f=Object(r.useCallback)((function(){clearTimeout(l.current),clearTimeout(i.current),i.current=null,c.current=[],l.current=null,s.current=!1}),[]);Object(r.useEffect)((function(){return function(){p.current=!0}}),[]);var b=Object(r.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];c.current=e,clearTimeout(l.current),s.current&&(s.current=!1),l.current||!u||s.current||(d.current.apply(d,e),s.current=!0),l.current=setTimeout((function(){var t=!0;u&&s.current&&(t=!1),f(),!p.current&&a&&t&&d.current.apply(d,e)}),t),o&&!i.current&&a&&(i.current=setTimeout((function(){var e=c.current;f(),p.current||d.current.apply(null,e)}),o))}),[o,t,f,u,a]),g=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,c.current),f())}),[f]);return[b,f,g]}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8),o=n.n(r),i=n(0),c=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return function(e){return t((function(){throw e}))}}},function(e,t,n){"use strict";e.exports=n(121)},,,,function(e,t,n){var r=n(55);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return f}));var r=n(8),o=n.n(r),i=n(16),c=n(13),u=n(0),a=n(58),s=n(7),l=n(39),p=function(e){var t=Object(a.a)();e=e||t;var n=Object(c.useSelect)((function(t){return t(i.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(c.useDispatch)(i.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(u.useCallback)((function(t){r(e,t)}),[e])]},d=function(e,t,n){var r=Object(a.a)();n=n||r;var o=Object(c.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),s=Object(c.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(u.useCallback)((function(t){s(n,e,t)}),[n,e])]},f=function(e,t){var n=Object(a.a)(),r=p(t=t||n),i=o()(r,2),c=i[0],d=i[1],f=Object(l.a)(e),b=Object(u.useRef)(!1);return Object(u.useEffect)((function(){d(Object(s.assign)({},c,f)),b.current=!0}),[f]),b.current?[c,d]:[e,d]}},,,function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function o(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function i(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return o(n.overflowY,t)||o(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function c(e,t,n,r,o,i,c,u){return i<e&&c>t||i>e&&c<t?0:i<=e&&u<=n||c>=t&&u>=n?i-e-r:c>t&&u<n||i<e&&u>n?c-t+o:0}t.a=function(e,t){var n=t.scrollMode,o=t.block,u=t.inline,a=t.boundary,s=t.skipOverflowHiddenElements,l="function"==typeof a?a:function(e){return e!==a};if(!r(e))throw new TypeError("Invalid target");for(var p=document.scrollingElement||document.documentElement,d=[],f=e;r(f)&&l(f);){if((f=f.parentNode)===p){d.push(f);break}f===document.body&&i(f)&&!i(document.documentElement)||i(f,s)&&d.push(f)}for(var b=window.visualViewport?visualViewport.width:innerWidth,g=window.visualViewport?visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,v=e.getBoundingClientRect(),y=v.height,O=v.width,w=v.top,j=v.right,S=v.bottom,I=v.left,E="start"===o||"nearest"===o?w:"end"===o?S:w+y/2,_="center"===u?I+O/2:"end"===u?j:I,x=[],k=0;k<d.length;k++){var R=d[k],P=R.getBoundingClientRect(),C=P.height,D=P.width,T=P.top,M=P.right,A=P.bottom,H=P.left;if("if-needed"===n&&w>=0&&I>=0&&S<=g&&j<=b&&w>=T&&S<=A&&I>=H&&j<=M)return x;var N=getComputedStyle(R),L=parseInt(N.borderLeftWidth,10),V=parseInt(N.borderTopWidth,10),B=parseInt(N.borderRightWidth,10),K=parseInt(N.borderBottomWidth,10),F=0,U=0,q="offsetWidth"in R?R.offsetWidth-R.clientWidth-L-B:0,$="offsetHeight"in R?R.offsetHeight-R.clientHeight-V-K:0;if(p===R)F="start"===o?E:"end"===o?E-g:"nearest"===o?c(h,h+g,g,V,K,h+E,h+E+y,y):E-g/2,U="start"===u?_:"center"===u?_-b/2:"end"===u?_-b:c(m,m+b,b,L,B,m+_,m+_+O,O),F=Math.max(0,F+h),U=Math.max(0,U+m);else{F="start"===o?E-T-V:"end"===o?E-A+K+$:"nearest"===o?c(T,A,C,V,K+$,E,E+y,y):E-(T+C/2)+$/2,U="start"===u?_-H-L:"center"===u?_-(H+D/2)+q/2:"end"===u?_-M+B+q:c(H,M,D,L,B+q,_,_+O,O);var W=R.scrollLeft,Y=R.scrollTop;E+=Y-(F=Math.max(0,Math.min(Y+F,R.scrollHeight-C+$))),_+=W-(U=Math.max(0,Math.min(W+U,R.scrollWidth-D+q)))}x.push({el:R,top:F,left:U})}return x}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(11),o=n.n(r),i=n(6),c=n.n(i),u=n(45),a=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=function(e){var t=e.Block,n=e.selector,r=e.getProps,i=void 0===r?function(){}:r,c=e.getErrorBoundaryProps,s=void 0===c?function(){}:c,p=document.querySelectorAll(n);p.length&&Array.prototype.forEach.call(p,(function(e,n){var r=i(e,n),c=s(e,n),p=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(u.render)(React.createElement(a.a,c,React.createElement(t,o()({},r,{attributes:p}))),e)}))}},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(16),o=n(13),i=n(0),c=n(86),u=n(39),a=function(e){var t=e.namespace,n=e.resourceName,a=e.resourceValues,s=void 0===a?[]:a,l=e.query,p=void 0===l?{}:l,d=e.shouldSelect,f=void 0===d||d;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(i.useRef)({results:[],isLoading:!0}),g=Object(u.a)(p),m=Object(u.a)(s),h=Object(c.a)(),v=Object(o.useSelect)((function(e){if(!f)return null;var o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,g,m],c=o.getCollectionError.apply(o,i);return c&&h(c),{results:o.getCollection.apply(o,i),isLoading:!o.hasFinishedResolution("getCollection",i)}}),[t,n,m,g,f]);return null!==v&&(b.current=v),b.current}},,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(2),i=n(16),c=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(Object(o.getSetting)("restApiRoutes")),Object(c.useSelect)((function(e,t){if(n.current){var r=e(i.SCHEMA_STORE_KEY),o=r.isResolving,c=r.hasFinishedResolution,u=t.dispatch(i.SCHEMA_STORE_KEY),a=u.receiveRoutes,s=u.startResolution,l=u.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];o("getRoutes",[e])||c("getRoutes",[e])||(s("getRoutes",[e]),a(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},function(e,t,n){"use strict";
|
7 |
/** @license React v16.13.1
|
8 |
* react-is.production.min.js
|
9 |
*
|
11 |
*
|
12 |
* This source code is licensed under the MIT license found in the
|
13 |
* LICENSE file in the root directory of this source tree.
|
14 |
+
*/var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,b=r?Symbol.for("react.suspense"):60113,g=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function j(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case d:case c:case a:case u:case b:return e;default:switch(e=e&&e.$$typeof){case l:case f:case h:case m:case s:return e;default:return t}}case i:return t}}}function S(e){return j(e)===d}t.AsyncMode=p,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=s,t.Element=o,t.ForwardRef=f,t.Fragment=c,t.Lazy=h,t.Memo=m,t.Portal=i,t.Profiler=a,t.StrictMode=u,t.Suspense=b,t.isAsyncMode=function(e){return S(e)||j(e)===p},t.isConcurrentMode=S,t.isContextConsumer=function(e){return j(e)===l},t.isContextProvider=function(e){return j(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return j(e)===f},t.isFragment=function(e){return j(e)===c},t.isLazy=function(e){return j(e)===h},t.isMemo=function(e){return j(e)===m},t.isPortal=function(e){return j(e)===i},t.isProfiler=function(e){return j(e)===a},t.isStrictMode=function(e){return j(e)===u},t.isSuspense=function(e){return j(e)===b},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===d||e===a||e===u||e===b||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===l||e.$$typeof===f||e.$$typeof===y||e.$$typeof===O||e.$$typeof===w||e.$$typeof===v)},t.typeOf=j},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(3),o=n(83);function i(e,t){return e===t}function c(e,t,n){var c=n&&n.equalityFn?n.equalityFn:i,u=Object(r.useState)(e),a=u[0],s=u[1],l=Object(o.a)(Object(r.useCallback)((function(e){return s(e)}),[]),t,n),p=l[0],d=l[1],f=l[2],b=Object(r.useRef)(e);return Object(r.useEffect)((function(){c(b.current,e)||(p(e),b.current=e)}),[e,p,c]),[a,d,f]}},function(e,t,n){"use strict";var r=n(1),o=(n(5),n(4)),i=n.n(o),c=n(28),u=(n(156),function(e){var t=e.className,n=e.disabled,o=e.label,u=void 0===o?Object(r.__)("Go","woo-gutenberg-products-block"):o,a=e.onClick,s=e.screenReaderLabel,l=void 0===s?Object(r.__)("Apply filter","woo-gutenberg-products-block"):s;return React.createElement("button",{type:"submit",className:i()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:a},React.createElement(c.a,{label:u,screenReaderLabel:l}))});u.defaultProps={disabled:!1},t.a=u},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(9),o=r.c.reduce((function(e,t){var n,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;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return o.find((function(t){return t.id===e}))},c=function(e){if(e)return o.find((function(t){return 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(7),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=e.filter((function(e){return e.attribute===n.taxonomy})),c=i.length?i[0]:null;if(c&&c.slug&&Array.isArray(c.slug)&&c.slug.includes(o)){var u=c.slug.filter((function(e){return e!==o})),a=e.filter((function(e){return e.attribute!==n.taxonomy}));u.length>0&&(c.slug=u.sort(),a.push(c)),t(Object(r.sortBy)(a,"attribute"))}},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},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",c=e.filter((function(e){return e.attribute!==n.taxonomy}));0===o.length?t(c):(c.push({attribute:n.taxonomy,operator:i,slug:Object(r.map)(o,"slug").sort()}),t(Object(r.sortBy)(c,"attribute")))}},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(6),o=n.n(r),i=n(56),c=n.n(i),u=n(22),a=n.n(u),s=n(8),l=n.n(s),p=n(0),d=n(97),f=n(107),b=n(58),g=n(128),m=n(7),h=n(39);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(e){var t=e.queryAttribute,n=e.queryPrices,r=e.queryState,o=Object(b.a)();o="".concat(o,"-collection-data");var i=Object(d.a)(o),u=l()(i,1)[0],s=Object(d.b)("calculate_attribute_counts",[],o),v=l()(s,2),O=v[0],w=v[1],j=Object(d.b)("calculate_price_range",null,o),S=l()(j,2),I=S[0],E=S[1],_=Object(h.a)(t||{}),x=Object(h.a)(n);Object(p.useEffect)((function(){"object"===a()(_)&&Object.keys(_).length&&(O.find((function(e){return e.taxonomy===_.taxonomy}))||w([].concat(c()(O),[_])))}),[_,O,w]),Object(p.useEffect)((function(){I!==x&&void 0!==x&&E(x)}),[x,E,I]);var k=Object(p.useState)(!1),R=l()(k,2),P=R[0],C=R[1],D=Object(g.a)(P,200),T=l()(D,1)[0];P||C(!0);var M=Object(p.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(m.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(u)}),[u]);return Object(f.a)({namespace:"/wc/store",resourceName:"products/collection-data",query:y(y({},r),{},{page:void 0,per_page:void 0,orderby:void 0,order:void 0},M),shouldSelect:T})}},,function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(120),o=n(102),i=n(6),c=n.n(i),u=n(8),a=n.n(u),s=n(1),l=n(43),p=n(97),d=n(107),f=n(203),b=n(39),g=n(0),m=n(56),h=n.n(m),v=n(5),y=n.n(v),O=n(4),w=n.n(O),j=(n(207),function(e){var t=e.className,n=e.onChange,r=void 0===n?function(){}:n,o=e.options,i=void 0===o?[]:o,c=e.checked,u=void 0===c?[]:c,l=e.isLoading,p=void 0!==l&&l,d=e.isDisabled,f=void 0!==d&&d,b=e.limit,m=void 0===b?10:b,v=Object(g.useState)(!1),y=a()(v,2),O=y[0],j=y[1],S=Object(g.useMemo)((function(){return h()(Array(5)).map((function(e,t){return React.createElement("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),I=Object(g.useMemo)((function(){var e=i.length-m;return!O&&React.createElement("li",{key:"show-more",className:"show-more"},React.createElement("button",{onClick:function(){j(!0)},"aria-expanded":!1,"aria-label":Object(s.sprintf)(Object(s._n)("Show %s more option","Show %s more options",e,"woo-gutenberg-products-block"),e)},Object(s.sprintf)(Object(s._n)("Show %s more","Show %s more",e,"woo-gutenberg-products-block"),e)))}),[i,m,O]),E=Object(g.useMemo)((function(){return O&&React.createElement("li",{key:"show-less",className:"show-less"},React.createElement("button",{onClick:function(){j(!1)},"aria-expanded":!0,"aria-label":Object(s.__)("Show less options","woo-gutenberg-products-block")},Object(s.__)("Show less","woo-gutenberg-products-block")))}),[O]),_=Object(g.useMemo)((function(){var e=i.length>m+5;return React.createElement(g.Fragment,null,i.map((function(t,n){return React.createElement(g.Fragment,{key:t.value},React.createElement("li",e&&!O&&n>=m&&{hidden:!0},React.createElement("input",{type:"checkbox",id:t.value,value:t.value,onChange:function(e){r(e.target.value)},checked:u.includes(t.value),disabled:f}),React.createElement("label",{htmlFor:t.value},t.label)),e&&n===m-1&&I)})),e&&E)}),[i,u,O,m,E,I,f]),x=w()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":p},t);return React.createElement("ul",{className:x},p?S:_)}),S=n(30),I=n(10),E=n(14),_=n(100),x=n(3),k=(n(87),n(101)),R=0;function P(e){return"function"==typeof e?e:C}function C(){}function D(e,t){null!==e&&Object(k.a)(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function T(e,t){return e===t||e.contains&&e.contains(t)}function M(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function H(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function N(e){var t=e.isOpen,n=e.selectedItem,r=e.resultCount,o=e.previousResultCount,i=e.itemToString;return t?r?r!==o?r+" result"+(1===r?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":n?i(n):""}function L(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function V(e){return"string"==typeof e.type}function B(e){return e.props}var K=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function F(e){void 0===e&&(e={});var t={};return K.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function U(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=q(t,r)?t[r]:e[r],n}),{})}function q(e,t){return void 0!==e[t]}function $(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function W(e,t,n,r,o){void 0===o&&(o=!0);var i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var c=t+e;c<0?c=o?i:0:c>i&&(c=o?0:i);var u=Y(e,c,n,r,o);return-1===u?t:u}function Y(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var c=t+1;c<n;c++)if(!r(c).hasAttribute("disabled"))return c}else for(var u=t-1;u>=0;u--)if(!r(u).hasAttribute("disabled"))return u;return o?e>0?Y(1,0,n,r,!1):Y(-1,n-1,n,r,!1):-1}function Q(e,t,n,r,o){return void 0===o&&(o=!0),[t,n].some((function(t){return t&&(T(t,e)||o&&T(t,r.activeElement))}))}var z=M((function(){X().textContent=""}),500);function G(e,t){var n=X(t);e&&(n.textContent=e,z())}function X(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var J=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Z=function(){var e=function(e){function t(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(R++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=F(t),n.internalSetState(Object(I.a)({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=F(t),n.internalSetState(Object(I.a)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},c="function"==typeof e;return!c&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,Object(I.a)({},n.getStateAndHelpers(),{},e)),n.setState((function(t){t=n.getState(t);var u=c?e(t):e;u=n.props.stateReducer(t,u),r=u.hasOwnProperty("selectedItem");var a={},s={};return r&&u.selectedItem!==t.selectedItem&&(o=u.selectedItem),u.type=u.type||0,Object.keys(u).forEach((function(e){t[e]!==u[e]&&(i[e]=u[e]),"type"!==e&&(s[e]=u[e],q(n.props,e)||(a[e]=u[e]))})),c&&u.hasOwnProperty("inputValue")&&n.props.onInputValueChange(u.inputValue,Object(I.a)({},n.getStateAndHelpers(),{},u)),a}),(function(){P(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,c=void 0===i?"ref":i,u=o.ref,a=Object(S.a)(o,["refKey","ref"]),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;n.getRootProps.called=!0,n.getRootProps.refKey=c,n.getRootProps.suppressRefError=l;var p=n.getState().isOpen;return Object(I.a)(((r={})[c]=H(u,n.rootRef),r.role="combobox",r["aria-expanded"]=p,r["aria-haspopup"]="listbox",r["aria-owns"]=p?n.menuId:null,r["aria-labelledby"]=n.labelId,r),a)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=W(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=W(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},n.buttonKeyDownHandlers=Object(I.a)({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=Object(I.a)({},n.keyDownHandlers,{Home:function(e){var t=this;e.preventDefault();var n=this.getItemCount(),r=this.getState().isOpen;if(!(n<=0)&&r){var o=Y(1,0,n,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}},End:function(e){var t=this;e.preventDefault();var n=this.getItemCount(),r=this.getState().isOpen;if(!(n<=0)&&r){var o=Y(-1,n-1,n,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick,o=(t.onPress,t.onKeyDown),i=t.onKeyUp,c=t.onBlur,u=Object(S.a)(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),a=n.getState().isOpen,s={onClick:A(r,n.buttonHandleClick),onKeyDown:A(o,n.buttonHandleKeyDown),onKeyUp:A(i,n.buttonHandleKeyUp),onBlur:A(c,n.buttonHandleBlur)},l=u.disabled?{}:s;return Object(I.a)({type:"button",role:"button","aria-label":a?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},l,{},u)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=$(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(Object(E.a)(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return Object(I.a)({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,c=t.onInput,u=(t.onChangeText,Object(S.a)(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),a={};var s,l=n.getState(),p=l.inputValue,d=l.isOpen,f=l.highlightedIndex;u.disabled||((s={}).onChange=A(i,c,n.inputHandleChange),s.onKeyDown=A(r,n.inputHandleKeyDown),s.onBlur=A(o,n.inputHandleBlur),a=s);return Object(I.a)({"aria-autocomplete":"list","aria-activedescendant":d&&"number"==typeof f&&f>=0?n.getItemId(f):null,"aria-controls":d?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:p,id:n.inputId},a,{},u)},n.inputHandleKeyDown=function(e){var t=$(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(Object(E.a)(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,c=void 0===i?"ref":i,u=o.ref,a=Object(S.a)(o,["refKey","ref"]),s=(void 0===t?{}:t).suppressRefError,l=void 0!==s&&s;return n.getMenuProps.called=!0,n.getMenuProps.refKey=c,n.getMenuProps.suppressRefError=l,Object(I.a)(((r={})[c]=H(u,n.menuRef),r.role="listbox",r["aria-labelledby"]=a&&a["aria-label"]?null:n.labelId,r.id=n.menuId,r),a)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,c=r.onClick,u=(r.onPress,r.index),a=r.item,s=void 0===a?void 0:a,l=Object(S.a)(r,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===u?(n.items.push(s),u=n.items.indexOf(s)):n.items[u]=s;var p=c,d=((t={onMouseMove:A(o,(function(){u!==n.getState().highlightedIndex&&(n.setHighlightedIndex(u,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:A(i,(function(e){e.preventDefault()}))}).onClick=A(p,(function(){n.selectItemAtIndex(u,{type:9})})),t),f=l.disabled?{onMouseDown:d.onMouseDown}:d;return Object(I.a)({id:n.getItemId(u),role:"option","aria-selected":n.getState().highlightedIndex===u},f,{},l)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=F(e),n.internalSetState((function(t){var r=t.selectedItem;return Object(I.a)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=F(e),n.internalSetState((function(t){var r=t.isOpen;return Object(I.a)({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},{},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),P(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=M((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(Object(I.a)({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,G(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,c=void 0===i?o:i,u=r.defaultIsOpen,a=r.initialIsOpen,s=void 0===a?u:a,l=r.initialInputValue,p=void 0===l?"":l,d=r.initialSelectedItem,f=void 0===d?null:d,b=n.getState({highlightedIndex:c,isOpen:s,inputValue:p,selectedItem:f});return null!=b.selectedItem&&void 0===n.props.initialInputValue&&(b.inputValue=n.props.itemToString(b.selectedItem)),n.state=b,n}Object(_.a)(t,e);var n=t.prototype;return n.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},n.getState=function(e){return void 0===e&&(e=this.state),U(e,this.props)},n.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},n.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},n.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},n.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var i=W(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},n.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,c=this.id,u=this.getRootProps,a=this.getToggleButtonProps,s=this.getLabelProps,l=this.getMenuProps,p=this.getInputProps,d=this.getItemProps,f=this.openMenu,b=this.closeMenu,g=this.toggleMenu,m=this.selectItem,h=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,O=this.clearSelection,w=this.clearItems;return{getRootProps:u,getToggleButtonProps:a,getLabelProps:s,getMenuProps:l,getInputProps:p,getItemProps:d,reset:this.reset,openMenu:f,closeMenu:b,toggleMenu:g,selectItem:m,selectItemAtIndex:h,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:O,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:c,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},n.componentDidMount=function(){var e=this;var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Q(t.target,e._rootNode,e._menuNode,e.props.environment.document)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},i=function(t){var n=Q(t.target,e._rootNode,e._menuNode,e.props.environment.document,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},c=this.props.environment;c.addEventListener("mousedown",t),c.addEventListener("mouseup",n),c.addEventListener("touchstart",r),c.addEventListener("touchmove",o),c.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),c.removeEventListener("mousedown",t),c.removeEventListener("mouseup",n),c.removeEventListener("touchstart",r),c.removeEventListener("touchmove",o),c.removeEventListener("touchend",i)}},n.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},n.componentDidUpdate=function(e,t){q(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},n.componentWillUnmount=function(){this.cleanup()},n.render=function(){var e=L(this.props.children,C);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=L(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:V(t)?Object(x.cloneElement)(t,this.getRootProps(B(t))):void 0:null},t}(x.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:N,itemToString:function(e){return null==e?"":String(e)},onStateChange:C,onInputValueChange:C,onUserAction:C,onChange:C,onSelect:C,onOuterClick:C,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:D},e.stateChangeTypes=J,e}();var ee={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11yStatusMessage:function(e){var t=e.isOpen,n=e.items;if(!n)return"";var r=n.length;return t?0===r?"No results are available":r+" result"+(1===r?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":""},getA11ySelectionMessage:function(e){var t=e.selectedItem;return(0,e.itemToString)(t)+" has been selected."},scrollIntoView:D,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})});y.a.array.isRequired,y.a.func,y.a.func,y.a.func,y.a.bool,y.a.number,y.a.number,y.a.number,y.a.bool,y.a.bool,y.a.bool,y.a.any,y.a.any,y.a.any,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.string,y.a.func,y.a.string,y.a.string,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.func,y.a.shape({addEventListener:y.a.func,removeEventListener:y.a.func,document:y.a.shape({getElementById:y.a.func,activeElement:y.a.any,body:y.a.any})}),Object(I.a)({},ee,{circularNavigation:!0});var te=Z,ne=function(e){var t=e.checked,n=e.getInputProps,r=e.inputRef,o=e.isDisabled,i=e.onFocus,c=e.onRemoveItem,u=e.placeholder,a=e.tabIndex,s=e.value;return React.createElement("input",n({ref:r,className:"wc-block-dropdown-selector__input wc-block-components-dropdown-selector__input",disabled:o,onFocus:i,onKeyDown:function(e){"Backspace"===e.key&&!s&&t.length>0&&c(t[t.length-1])},placeholder:u,tabIndex:a}))},re=function(e){var t=e.children,n=e.onClick;return React.createElement("div",{className:"wc-block-dropdown-selector__input-wrapper wc-block-components-dropdown-selector__input-wrapper",onClick:n},t)},oe=function(e){var t=e.checked,n=e.getItemProps,r=e.getMenuProps,o=e.highlightedIndex,i=e.options;return React.createElement("ul",r({className:"wc-block-dropdown-selector__list wc-block-components-dropdown-selector__list"}),i.map((function(e,r){var i=t.includes(e.value);return React.createElement("li",n({key:e.value,className:w()("wc-block-dropdown-selector__list-item","wc-block-components-dropdown-selector__list-item",{"is-selected":i,"is-highlighted":o===r}),index:r,item:e.value,"aria-label":i?Object(s.sprintf)(Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),e.name):null}),e.label)})))},ie=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement("button",{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",onClick:function(){t(n.value)},onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||t(n.value)},"aria-label":Object(s.sprintf)(Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),n.name)},React.createElement("span",{className:"wc-block-dropdown-selector__selected-chip__label wc-block-components-dropdown-selector__selected-chip__label"},n.label),React.createElement("span",{className:"wc-block-dropdown-selector__selected-chip__remove wc-block-components-dropdown-selector__selected-chip__remove"},"𝘅"))},ce=function(e){var t=e.onClick,n=e.onRemoveItem,r=e.option,o=Object(g.useRef)(null);return Object(g.useEffect)((function(){o.current.focus()}),[o]),React.createElement("div",{className:"wc-block-dropdown-selector__selected-value wc-block-components-dropdown-selector__selected-value"},React.createElement("button",{ref:o,className:"wc-block-dropdown-selector__selected-value__label wc-block-components-dropdown-selector__selected-value__label",onClick:function(e){e.stopPropagation(),t(r.value)},"aria-label":Object(s.sprintf)(Object(s.__)("Replace current %s filter","woo-gutenberg-products-block"),r.name)},r.label),React.createElement("button",{className:"wc-block-dropdown-selector__selected-value__remove wc-block-components-dropdown-selector__selected-value__remove",onClick:function(){n(r.value)},onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||n(r.value)},"aria-label":Object(s.sprintf)(Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),r.name)},"𝘅"))};n(206);function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var se=function(e){var t=e.attributeLabel,n=void 0===t?"":t,r=e.className,o=e.checked,i=void 0===o?[]:o,c=e.inputLabel,u=void 0===c?"":c,a=e.isDisabled,l=void 0!==a&&a,p=e.isLoading,d=void 0!==p&&p,f=e.multiple,b=void 0!==f&&f,m=e.onChange,h=void 0===m?function(){}:m,v=e.options,y=void 0===v?[]:v,O=Object(g.useRef)(null),j=w()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":l,"is-loading":d}),S=Object(g.useCallback)((function(e,t){switch(t.type){case te.stateChangeTypes.keyDownEnter:case te.stateChangeTypes.clickItem:return ae(ae({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:b,inputValue:""});case te.stateChangeTypes.blurInput:case te.stateChangeTypes.mouseUp:return ae(ae({},t),{},{inputValue:e.inputValue});default:return t}}),[b]);return React.createElement(te,{onChange:h,selectedItem:null,stateReducer:S},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,c=e.getMenuProps,a=e.highlightedIndex,p=e.inputValue,d=e.isOpen,f=e.openMenu;return React.createElement("div",{className:w()(j,{"is-multiple":b,"is-single":!b})},React.createElement("label",o({className:"screen-reader-text"}),u),React.createElement(re,{isOpen:d,onClick:function(){return O.current.focus()}},i.map((function(e){var t=y.find((function(t){return t.value===e})),n=function(e){h(e),O.current.focus()};return b?React.createElement(ie,{key:e,onRemoveItem:n,option:t}):React.createElement(ce,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(ne,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:f,onRemoveItem:function(e){h(e),O.current.focus()},placeholder:i.length>0&&b?null:Object(s.sprintf)(Object(s.__)("Any %s","woo-gutenberg-products-block"),n),tabIndex:!b&&i.length>0?"-1":"0",value:p})),d&&!l&&React.createElement(oe,{checked:i,getItemProps:r,getMenuProps:c,highlightedIndex:a,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},le=n(129),pe=n(38),de=n.n(pe),fe=n(15),be=n(130),ge=n(131),me=n(28),he=function(e){var t=e.name,n=e.count;return React.createElement(g.Fragment,null,t,Number.isFinite(n)&&React.createElement(me.a,{label:n,screenReaderLabel:Object(s.sprintf)(Object(s._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-block-attribute-filter-list-count"}}))},ve=[{value:"preview-1",name:"Blue",label:React.createElement(he,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(he,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(he,{name:"Red",count:2})}],ye={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(205);function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var je=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,o=t.isPreview&&!t.attributeId?ye:Object(be.a)(t.attributeId),i=Object(g.useState)([]),c=a()(i,2),u=c[0],m=c[1],h=Object(g.useState)(t.isPreview&&!t.attributeId?ve:[]),v=a()(h,2),y=v[0],O=v[1],w=Object(p.a)(),S=a()(w,1)[0],I=Object(p.b)("attributes",[]),E=a()(I,2),_=E[0],x=E[1],k=Object(d.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[o.id],shouldSelect:t.attributeId>0}),R=k.results,P=k.isLoading,C="dropdown"!==t.displayStyle&&"and"===t.queryType,D=Object(f.a)({queryAttribute:{taxonomy:o.taxonomy,queryType:t.queryType},queryState:we(we({},S),{},{attributes:C?S.attributes:null})}),T=D.results,M=D.isLoading,A=Object(g.useCallback)((function(e){return T.attribute_counts?T.attribute_counts.find((function(t){return t.term===e})):null}),[T]);Object(g.useEffect)((function(){if(!P&&!M){var e=R.map((function(e){var n,r=A(e.id);if(!(r||u.includes(e.slug)||(n=e.slug,S&&S.attributes&&S.attributes.some((function(e){var t=e.attribute,r=e.slug,i=void 0===r?[]:r;return t===o.taxonomy&&i.includes(n)})))))return null;var i=r?r.count:0;return{value:e.slug,name:Object(fe.decodeEntities)(e.name),label:React.createElement(he,{name:Object(fe.decodeEntities)(e.name),count:t.showCounts?i:null})}})).filter(Boolean);O(e)}}),[o.taxonomy,R,P,t.showCounts,M,A,u,S.attributes]),Object(g.useEffect)((function(){t.showFilterButton||V()}),[u,V]);var H=Object(g.useMemo)((function(){return _.filter((function(e){return e.attribute===o.taxonomy})).flatMap((function(e){return e.slug}))}),[_,o.taxonomy]),N=Object(b.a)(H);Object(g.useEffect)((function(){de()(u,H)||m(H)}),[N]);var L=Object(g.useCallback)((function(e){return R.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[R]),V=function(){r||Object(ge.b)(_,x,o,L(u),"or"===t.queryType?"in":"and")},B="dropdown"!==t.displayStyle||"or"===t.queryType,K=Object(g.useCallback)((function(e){var t,n=function(e){return y.find((function(t){return t.value===e})).name},r=function(e){var t=e.filterAdded,r=e.filterRemoved,o=t?n(t):null,i=r?n(r):null;o&&i?Object(l.speak)(Object(s.sprintf)(Object(s.__)("%s filter replaced with %s.","woo-gutenberg-products-block"),o,i)):o?Object(l.speak)(Object(s.sprintf)(Object(s.__)("%s filter added.","woo-gutenberg-products-block"),o)):i&&Object(l.speak)(Object(s.sprintf)(Object(s.__)("%s filter removed.","woo-gutenberg-products-block"),i))},o=u.includes(e);B?(t=u.filter((function(t){return t!==e})),o?r({filterRemoved:e}):(t.push(e),t.sort(),r({filterAdded:e}))):(t=o?[]:[e],r({filterAdded:o?null:e,filterRemoved:1===u.length?u[0]:null}));m(t)}),[u,y,B]);if(0===y.length&&!P)return null;var F="h".concat(t.headingLevel),U=!t.isPreview&&P,q=!t.isPreview&&M;return React.createElement(g.Fragment,null,!r&&t.heading&&React.createElement(F,null,t.heading),React.createElement("div",{className:"wc-block-attribute-filter"},"dropdown"===t.displayStyle?React.createElement(se,{attributeLabel:o.label,checked:u,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:U,multiple:B,onChange:K,options:y}):React.createElement(j,{className:"wc-block-attribute-filter-list",options:y,checked:u,onChange:K,isLoading:U,isDisabled:q}),t.showFilterButton&&React.createElement(le.a,{className:"wc-block-attribute-filter__button",disabled:U||q,onClick:V})))};Object(o.a)({selector:".wp-block-woocommerce-attrib
|