Version Description
- 2021-06-07 =
Enhancements
- Hide the Cart and Checkout blocks from the new block-based widget editor. (4303)
- Provide block transforms for legacy widgets with a feature-complete block equivalent. (4292)
Bug Fixes
- Fix some missing translations from the Cart and Checkout blocks. (4295)
- Fix the flickering of the Proceed to Checkout button on quantity update in the Cart Block. (4293)
- Fix a bug in which Cart Widget didn't update when adding items from the All Products block. (4291)
- Fix a display issue when itemized taxes are enabled, but no products in the cart are taxable. (4284)
- Fix an issue where an attempt to add an out-of-stock product to the cart was made when clicking the "Read more" button. (4265)
Compatibility
- Add the ability for extensions to register callbacks to be executed by Blocks when the cart/extensions endpoint is hit. Extensions can now tell Blocks they need to do some server-side processing which will update the cart. (4298)
Various
- Add Slot in the Discounts section of the cart sidebar to allow third party extensions to render their own components there. (4248)
- Move
ValidatedTextInput
to the@woocommerce/blocks-checkout
package. (4238)
Download this release
Release Info
Developer | automattic |
Plugin | WooCommerce Gutenberg Products Block |
Version | 5.3.0 |
Comparing to | |
See all releases |
Code changes from version 5.2.0 to 5.3.0
- assets/js/base/components/cart-checkout/order-summary/order-summary-item.js +1 -3
- assets/js/base/components/cart-checkout/totals/discount/index.js +0 -2
- assets/js/base/components/cart-checkout/totals/footer-item/index.js +0 -3
- assets/js/base/components/text-input/style.scss +12 -0
- assets/js/base/components/text-input/text-input.tsx +37 -1
- assets/js/base/components/text-input/validated-text-input.tsx +6 -0
- assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts +15 -18
- assets/js/base/context/providers/store-notices/components/snackbar-notices-container.js +7 -1
- assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.tsx +1 -3
- assets/js/blocks/cart-checkout/cart/full-cart/index.tsx +10 -2
- assets/js/blocks/cart-checkout/cart/test/__snapshots__/block.js.snap +9 -0
- assets/js/blocks/product-categories/index.js +21 -1
- assets/js/blocks/product-search/index.js +20 -1
- assets/js/blocks/reviews/all-reviews/index.js +22 -1
- assets/js/data/cart/index.ts +3 -2
- 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 +1 -1
- build/all-products.asset.php +1 -1
- build/all-products.js +1 -1
- build/all-reviews.asset.php +1 -1
- build/all-reviews.js +1 -1
- build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js +1 -1
- build/atomic-block-components/add-to-cart--atomic-block-components/button.js +1 -1
- build/atomic-block-components/add-to-cart-frontend.js +1 -1
- build/atomic-block-components/add-to-cart.js +1 -1
- build/atomic-block-components/button.js +1 -1
- build/atomic-block-components/category-list.js +1 -1
- build/atomic-block-components/image.js +1 -1
- build/atomic-block-components/price-frontend.js +1 -1
- build/atomic-block-components/price.js +1 -1
- build/atomic-block-components/rating.js +1 -1
- build/atomic-block-components/sale-badge.js +1 -1
- build/atomic-block-components/sku.js +1 -1
- build/atomic-block-components/stock-indicator.js +1 -1
- build/atomic-block-components/summary.js +1 -1
- build/atomic-block-components/tag-list.js +1 -1
- build/atomic-block-components/title-frontend.js +1 -1
- build/atomic-block-components/title.js +1 -1
- build/attribute-filter-frontend.asset.php +1 -1
- build/attribute-filter-frontend.js +2 -2
assets/js/base/components/cart-checkout/order-summary/order-summary-item.js
CHANGED
@@ -7,7 +7,6 @@ import ProductName from '@woocommerce/base-components/product-name';
|
|
7 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
8 |
import {
|
9 |
__experimentalApplyCheckoutFilter,
|
10 |
-
mustBeString,
|
11 |
mustContain,
|
12 |
Label,
|
13 |
} from '@woocommerce/blocks-checkout';
|
@@ -48,7 +47,7 @@ const OrderSummaryItem = ( { cartItem } ) => {
|
|
48 |
const { receiveCart, ...cart } = useStoreCart();
|
49 |
|
50 |
const productPriceValidation = useCallback(
|
51 |
-
( value ) =>
|
52 |
[]
|
53 |
);
|
54 |
|
@@ -68,7 +67,6 @@ const OrderSummaryItem = ( { cartItem } ) => {
|
|
68 |
defaultValue: initialName,
|
69 |
extensions,
|
70 |
arg,
|
71 |
-
validation: mustBeString,
|
72 |
} );
|
73 |
|
74 |
const regularPriceSingle = Dinero( {
|
7 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
8 |
import {
|
9 |
__experimentalApplyCheckoutFilter,
|
|
|
10 |
mustContain,
|
11 |
Label,
|
12 |
} from '@woocommerce/blocks-checkout';
|
47 |
const { receiveCart, ...cart } = useStoreCart();
|
48 |
|
49 |
const productPriceValidation = useCallback(
|
50 |
+
( value ) => mustContain( value, '<price/>' ),
|
51 |
[]
|
52 |
);
|
53 |
|
67 |
defaultValue: initialName,
|
68 |
extensions,
|
69 |
arg,
|
|
|
70 |
} );
|
71 |
|
72 |
const regularPriceSingle = Dinero( {
|
assets/js/base/components/cart-checkout/totals/discount/index.js
CHANGED
@@ -7,7 +7,6 @@ import { RemovableChip } from '@woocommerce/base-components/chip';
|
|
7 |
import PropTypes from 'prop-types';
|
8 |
import {
|
9 |
__experimentalApplyCheckoutFilter,
|
10 |
-
mustBeString,
|
11 |
TotalsItem,
|
12 |
} from '@woocommerce/blocks-checkout';
|
13 |
import { getSetting } from '@woocommerce/settings';
|
@@ -60,7 +59,6 @@ const TotalsDiscount = ( {
|
|
60 |
{ cartCoupons.map( ( cartCoupon ) => {
|
61 |
const filteredCouponCode = __experimentalApplyCheckoutFilter(
|
62 |
{
|
63 |
-
validation: mustBeString,
|
64 |
arg: {
|
65 |
context: 'summary',
|
66 |
coupon: cartCoupon,
|
7 |
import PropTypes from 'prop-types';
|
8 |
import {
|
9 |
__experimentalApplyCheckoutFilter,
|
|
|
10 |
TotalsItem,
|
11 |
} from '@woocommerce/blocks-checkout';
|
12 |
import { getSetting } from '@woocommerce/settings';
|
59 |
{ cartCoupons.map( ( cartCoupon ) => {
|
60 |
const filteredCouponCode = __experimentalApplyCheckoutFilter(
|
61 |
{
|
|
|
62 |
arg: {
|
63 |
context: 'summary',
|
64 |
coupon: cartCoupon,
|
assets/js/base/components/cart-checkout/totals/footer-item/index.js
CHANGED
@@ -7,7 +7,6 @@ import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-mone
|
|
7 |
import PropTypes from 'prop-types';
|
8 |
import {
|
9 |
__experimentalApplyCheckoutFilter,
|
10 |
-
mustBeString,
|
11 |
TotalsItem,
|
12 |
} from '@woocommerce/blocks-checkout';
|
13 |
import { useStoreCart } from '@woocommerce/base-context/hooks';
|
@@ -34,8 +33,6 @@ const TotalsFooterItem = ( { currency, values } ) => {
|
|
34 |
defaultValue: __( 'Total', 'woo-gutenberg-products-block' ),
|
35 |
extensions: cart.extensions,
|
36 |
arg: { cart },
|
37 |
-
// Only accept strings.
|
38 |
-
validation: mustBeString,
|
39 |
} );
|
40 |
|
41 |
const parsedTaxValue = parseInt( totalTax, 10 );
|
7 |
import PropTypes from 'prop-types';
|
8 |
import {
|
9 |
__experimentalApplyCheckoutFilter,
|
|
|
10 |
TotalsItem,
|
11 |
} from '@woocommerce/blocks-checkout';
|
12 |
import { useStoreCart } from '@woocommerce/base-context/hooks';
|
33 |
defaultValue: __( 'Total', 'woo-gutenberg-products-block' ),
|
34 |
extensions: cart.extensions,
|
35 |
arg: { cart },
|
|
|
|
|
36 |
} );
|
37 |
|
38 |
const parsedTaxValue = parseInt( totalTax, 10 );
|
assets/js/base/components/text-input/style.scss
CHANGED
@@ -40,6 +40,7 @@
|
|
40 |
input[type="tel"],
|
41 |
input[type="url"],
|
42 |
input[type="text"],
|
|
|
43 |
input[type="email"] {
|
44 |
@include font-size(regular);
|
45 |
background-color: #fff;
|
@@ -72,9 +73,20 @@
|
|
72 |
}
|
73 |
}
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
&.is-active input[type="tel"],
|
76 |
&.is-active input[type="url"],
|
77 |
&.is-active input[type="text"],
|
|
|
78 |
&.is-active input[type="email"] {
|
79 |
padding: em($gap-large) 0 em($gap-smallest) $gap;
|
80 |
}
|
40 |
input[type="tel"],
|
41 |
input[type="url"],
|
42 |
input[type="text"],
|
43 |
+
input[type="number"],
|
44 |
input[type="email"] {
|
45 |
@include font-size(regular);
|
46 |
background-color: #fff;
|
73 |
}
|
74 |
}
|
75 |
|
76 |
+
input[type="number"] {
|
77 |
+
-moz-appearance: textfield;
|
78 |
+
|
79 |
+
&::-webkit-outer-spin-button,
|
80 |
+
&::-webkit-inner-spin-button {
|
81 |
+
appearance: none;
|
82 |
+
margin: 0;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
&.is-active input[type="tel"],
|
87 |
&.is-active input[type="url"],
|
88 |
&.is-active input[type="text"],
|
89 |
+
&.is-active input[type="number"],
|
90 |
&.is-active input[type="email"] {
|
91 |
padding: em($gap-large) 0 em($gap-smallest) $gap;
|
92 |
}
|
assets/js/base/components/text-input/text-input.tsx
CHANGED
@@ -11,6 +11,13 @@ import { Label } from '@woocommerce/blocks-checkout';
|
|
11 |
*/
|
12 |
import './style.scss';
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
interface TextInputProps
|
15 |
extends Omit<
|
16 |
InputHTMLAttributes< HTMLInputElement >,
|
@@ -28,7 +35,10 @@ interface TextInputProps
|
|
28 |
onBlur?: ( newValue: string ) => void;
|
29 |
}
|
30 |
|
31 |
-
const TextInput = forwardRef<
|
|
|
|
|
|
|
32 |
(
|
33 |
{
|
34 |
className,
|
@@ -44,6 +54,9 @@ const TextInput = forwardRef< HTMLInputElement, TextInputProps >(
|
|
44 |
autoComplete = 'off',
|
45 |
value = '',
|
46 |
onChange,
|
|
|
|
|
|
|
47 |
required = false,
|
48 |
onBlur = () => {
|
49 |
/* Do nothing */
|
@@ -54,6 +67,28 @@ const TextInput = forwardRef< HTMLInputElement, TextInputProps >(
|
|
54 |
) => {
|
55 |
const [ isActive, setIsActive ] = useState( false );
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
return (
|
58 |
<div
|
59 |
className={ classnames(
|
@@ -87,6 +122,7 @@ const TextInput = forwardRef< HTMLInputElement, TextInputProps >(
|
|
87 |
: ariaDescribedBy
|
88 |
}
|
89 |
required={ required }
|
|
|
90 |
/>
|
91 |
<Label
|
92 |
label={ label }
|
11 |
*/
|
12 |
import './style.scss';
|
13 |
|
14 |
+
interface TextInputPropsWithNumberType {
|
15 |
+
type: 'number';
|
16 |
+
step?: number;
|
17 |
+
min?: number;
|
18 |
+
max?: number;
|
19 |
+
}
|
20 |
+
|
21 |
interface TextInputProps
|
22 |
extends Omit<
|
23 |
InputHTMLAttributes< HTMLInputElement >,
|
35 |
onBlur?: ( newValue: string ) => void;
|
36 |
}
|
37 |
|
38 |
+
const TextInput = forwardRef<
|
39 |
+
HTMLInputElement,
|
40 |
+
TextInputProps & ( Record< string, never > | TextInputPropsWithNumberType )
|
41 |
+
>(
|
42 |
(
|
43 |
{
|
44 |
className,
|
54 |
autoComplete = 'off',
|
55 |
value = '',
|
56 |
onChange,
|
57 |
+
min,
|
58 |
+
max,
|
59 |
+
step,
|
60 |
required = false,
|
61 |
onBlur = () => {
|
62 |
/* Do nothing */
|
67 |
) => {
|
68 |
const [ isActive, setIsActive ] = useState( false );
|
69 |
|
70 |
+
const numberAttributesFromProps: {
|
71 |
+
[ prop: string ]: string | number | undefined;
|
72 |
+
} =
|
73 |
+
type === 'number'
|
74 |
+
? {
|
75 |
+
step,
|
76 |
+
min,
|
77 |
+
max,
|
78 |
+
}
|
79 |
+
: {};
|
80 |
+
|
81 |
+
const numberProps: {
|
82 |
+
[ prop: string ]: string | number | undefined;
|
83 |
+
} = {};
|
84 |
+
|
85 |
+
Object.keys( numberAttributesFromProps ).forEach( ( key ) => {
|
86 |
+
if ( typeof numberAttributesFromProps[ key ] === 'undefined' ) {
|
87 |
+
return;
|
88 |
+
}
|
89 |
+
numberProps[ key ] = numberAttributesFromProps[ key ];
|
90 |
+
} );
|
91 |
+
|
92 |
return (
|
93 |
<div
|
94 |
className={ classnames(
|
122 |
: ariaDescribedBy
|
123 |
}
|
124 |
required={ required }
|
125 |
+
{ ...numberProps }
|
126 |
/>
|
127 |
<Label
|
128 |
label={ label }
|
assets/js/base/components/text-input/validated-text-input.tsx
CHANGED
@@ -9,6 +9,7 @@ import {
|
|
9 |
useValidationContext,
|
10 |
} from '@woocommerce/base-context';
|
11 |
import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
|
|
|
12 |
|
13 |
/**
|
14 |
* Internal dependencies
|
@@ -36,6 +37,7 @@ type ValidatedTextInputProps = (
|
|
36 |
validateOnMount?: boolean;
|
37 |
focusOnMount?: boolean;
|
38 |
showError?: boolean;
|
|
|
39 |
onChange: ( newValue: string ) => void;
|
40 |
};
|
41 |
|
@@ -49,6 +51,7 @@ const ValidatedTextInput = ( {
|
|
49 |
focusOnMount = false,
|
50 |
onChange,
|
51 |
showError = true,
|
|
|
52 |
...rest
|
53 |
}: ValidatedTextInputProps ) => {
|
54 |
const [ isPristine, setIsPristine ] = useState( true );
|
@@ -123,6 +126,9 @@ const ValidatedTextInput = ( {
|
|
123 |
message?: string;
|
124 |
hidden?: boolean;
|
125 |
};
|
|
|
|
|
|
|
126 |
const hasError = errorMessage.message && ! errorMessage.hidden;
|
127 |
const describedBy =
|
128 |
showError && hasError && getValidationErrorId( errorIdString )
|
9 |
useValidationContext,
|
10 |
} from '@woocommerce/base-context';
|
11 |
import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
|
12 |
+
import { isString } from '@woocommerce/types';
|
13 |
|
14 |
/**
|
15 |
* Internal dependencies
|
37 |
validateOnMount?: boolean;
|
38 |
focusOnMount?: boolean;
|
39 |
showError?: boolean;
|
40 |
+
errorMessage?: string;
|
41 |
onChange: ( newValue: string ) => void;
|
42 |
};
|
43 |
|
51 |
focusOnMount = false,
|
52 |
onChange,
|
53 |
showError = true,
|
54 |
+
errorMessage: passedErrorMessage = '',
|
55 |
...rest
|
56 |
}: ValidatedTextInputProps ) => {
|
57 |
const [ isPristine, setIsPristine ] = useState( true );
|
126 |
message?: string;
|
127 |
hidden?: boolean;
|
128 |
};
|
129 |
+
if ( isString( passedErrorMessage ) && passedErrorMessage !== '' ) {
|
130 |
+
errorMessage.message = passedErrorMessage;
|
131 |
+
}
|
132 |
const hasError = errorMessage.message && ! errorMessage.hidden;
|
133 |
const describedBy =
|
134 |
showError && hasError && getValidationErrorId( errorIdString )
|
assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts
CHANGED
@@ -83,7 +83,6 @@ export const useStoreCartItemQuantity = (
|
|
83 |
},
|
84 |
[ cartItemKey ]
|
85 |
);
|
86 |
-
const previousIsPending = usePrevious( isPending );
|
87 |
|
88 |
const removeItem = () => {
|
89 |
return cartItemKey
|
@@ -112,32 +111,30 @@ export const useStoreCartItemQuantity = (
|
|
112 |
] );
|
113 |
|
114 |
useEffect( () => {
|
115 |
-
if (
|
116 |
-
|
|
|
|
|
117 |
}
|
118 |
-
|
119 |
-
if ( isPending.quantity ) {
|
120 |
-
dispatchActions.incrementCalculating();
|
121 |
-
} else {
|
122 |
-
dispatchActions.decrementCalculating();
|
123 |
-
}
|
124 |
-
}
|
125 |
-
if ( previousIsPending.delete !== isPending.delete ) {
|
126 |
if ( isPending.delete ) {
|
127 |
-
dispatchActions.incrementCalculating();
|
128 |
-
} else {
|
129 |
dispatchActions.decrementCalculating();
|
130 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
132 |
return () => {
|
133 |
-
if ( isPending.quantity ) {
|
134 |
-
dispatchActions.decrementCalculating();
|
135 |
-
}
|
136 |
-
if ( isPending.delete ) {
|
137 |
dispatchActions.decrementCalculating();
|
138 |
}
|
139 |
};
|
140 |
-
}, [ dispatchActions, isPending,
|
141 |
|
142 |
return {
|
143 |
isPendingDelete: isPending.delete,
|
83 |
},
|
84 |
[ cartItemKey ]
|
85 |
);
|
|
|
86 |
|
87 |
const removeItem = () => {
|
88 |
return cartItemKey
|
111 |
] );
|
112 |
|
113 |
useEffect( () => {
|
114 |
+
if ( isPending.delete ) {
|
115 |
+
dispatchActions.incrementCalculating();
|
116 |
+
} else {
|
117 |
+
dispatchActions.decrementCalculating();
|
118 |
}
|
119 |
+
return () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
if ( isPending.delete ) {
|
|
|
|
|
121 |
dispatchActions.decrementCalculating();
|
122 |
}
|
123 |
+
};
|
124 |
+
}, [ dispatchActions, isPending.delete ] );
|
125 |
+
|
126 |
+
useEffect( () => {
|
127 |
+
if ( isPending.quantity || debouncedQuantity !== quantity ) {
|
128 |
+
dispatchActions.incrementCalculating();
|
129 |
+
} else {
|
130 |
+
dispatchActions.decrementCalculating();
|
131 |
}
|
132 |
return () => {
|
133 |
+
if ( isPending.quantity || debouncedQuantity !== quantity ) {
|
|
|
|
|
|
|
134 |
dispatchActions.decrementCalculating();
|
135 |
}
|
136 |
};
|
137 |
+
}, [ dispatchActions, isPending.quantity, debouncedQuantity, quantity ] );
|
138 |
|
139 |
return {
|
140 |
isPendingDelete: isPending.delete,
|
assets/js/base/context/providers/store-notices/components/snackbar-notices-container.js
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
*/
|
4 |
import { SnackbarList } from 'wordpress-components';
|
5 |
import classnames from 'classnames';
|
|
|
6 |
|
7 |
const SnackbarNoticesContainer = ( {
|
8 |
className,
|
@@ -18,6 +19,11 @@ const SnackbarNoticesContainer = ( {
|
|
18 |
( notice ) => notice.type === 'snackbar'
|
19 |
);
|
20 |
|
|
|
|
|
|
|
|
|
|
|
21 |
const wrapperClass = classnames(
|
22 |
className,
|
23 |
'wc-block-components-notices__snackbar'
|
@@ -25,7 +31,7 @@ const SnackbarNoticesContainer = ( {
|
|
25 |
|
26 |
return (
|
27 |
<SnackbarList
|
28 |
-
notices={
|
29 |
className={ wrapperClass }
|
30 |
onRemove={ removeNotice }
|
31 |
/>
|
3 |
*/
|
4 |
import { SnackbarList } from 'wordpress-components';
|
5 |
import classnames from 'classnames';
|
6 |
+
import { __experimentalApplyCheckoutFilter } from '@woocommerce/blocks-checkout';
|
7 |
|
8 |
const SnackbarNoticesContainer = ( {
|
9 |
className,
|
19 |
( notice ) => notice.type === 'snackbar'
|
20 |
);
|
21 |
|
22 |
+
const filteredNotices = __experimentalApplyCheckoutFilter( {
|
23 |
+
filterName: 'snackbarNotices',
|
24 |
+
defaultValue: snackbarNotices,
|
25 |
+
} );
|
26 |
+
|
27 |
const wrapperClass = classnames(
|
28 |
className,
|
29 |
'wc-block-components-notices__snackbar'
|
31 |
|
32 |
return (
|
33 |
<SnackbarList
|
34 |
+
notices={ filteredNotices }
|
35 |
className={ wrapperClass }
|
36 |
onRemove={ removeNotice }
|
37 |
/>
|
assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.tsx
CHANGED
@@ -24,7 +24,6 @@ import {
|
|
24 |
} from '@woocommerce/price-format';
|
25 |
import {
|
26 |
__experimentalApplyCheckoutFilter,
|
27 |
-
mustBeString,
|
28 |
mustContain,
|
29 |
} from '@woocommerce/blocks-checkout';
|
30 |
import Dinero from 'dinero.js';
|
@@ -112,7 +111,7 @@ const CartLineItemRow = ( {
|
|
112 |
const { dispatchStoreEvent } = useStoreEvents();
|
113 |
|
114 |
const productPriceValidation = useCallback(
|
115 |
-
( value ) =>
|
116 |
[]
|
117 |
);
|
118 |
|
@@ -134,7 +133,6 @@ const CartLineItemRow = ( {
|
|
134 |
defaultValue: initialName,
|
135 |
extensions,
|
136 |
arg,
|
137 |
-
validation: mustBeString,
|
138 |
} );
|
139 |
|
140 |
const regularAmountSingle = Dinero( {
|
24 |
} from '@woocommerce/price-format';
|
25 |
import {
|
26 |
__experimentalApplyCheckoutFilter,
|
|
|
27 |
mustContain,
|
28 |
} from '@woocommerce/blocks-checkout';
|
29 |
import Dinero from 'dinero.js';
|
111 |
const { dispatchStoreEvent } = useStoreEvents();
|
112 |
|
113 |
const productPriceValidation = useCallback(
|
114 |
+
( value ) => mustContain( value, '<price/>' ),
|
115 |
[]
|
116 |
);
|
117 |
|
133 |
defaultValue: initialName,
|
134 |
extensions,
|
135 |
arg,
|
|
|
136 |
} );
|
137 |
|
138 |
const regularAmountSingle = Dinero( {
|
assets/js/blocks/cart-checkout/cart/full-cart/index.tsx
CHANGED
@@ -13,8 +13,8 @@ import {
|
|
13 |
TotalsFees,
|
14 |
TotalsTaxes,
|
15 |
ExperimentalOrderMeta,
|
|
|
16 |
} from '@woocommerce/blocks-checkout';
|
17 |
-
|
18 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
19 |
import {
|
20 |
useStoreCartCoupons,
|
@@ -40,7 +40,6 @@ import CheckoutButton from '../checkout-button';
|
|
40 |
import CartLineItemsTitle from './cart-line-items-title';
|
41 |
import CartLineItemsTable from './cart-line-items-table';
|
42 |
import { CartExpressPayment } from '../../payment-methods';
|
43 |
-
|
44 |
import './style.scss';
|
45 |
|
46 |
interface CartAttributes {
|
@@ -114,6 +113,11 @@ const Cart = ( { attributes }: CartProps ) => {
|
|
114 |
cart,
|
115 |
};
|
116 |
|
|
|
|
|
|
|
|
|
|
|
117 |
return (
|
118 |
<>
|
119 |
<CartLineItemsTitle itemCount={ cartItemsCount } />
|
@@ -152,6 +156,10 @@ const Cart = ( { attributes }: CartProps ) => {
|
|
152 |
isLoading={ isApplyingCoupon }
|
153 |
/>
|
154 |
) }
|
|
|
|
|
|
|
|
|
155 |
{ cartNeedsShipping && (
|
156 |
<TotalsShipping
|
157 |
showCalculator={ isShippingCalculatorEnabled }
|
13 |
TotalsFees,
|
14 |
TotalsTaxes,
|
15 |
ExperimentalOrderMeta,
|
16 |
+
ExperimentalDiscountsMeta,
|
17 |
} from '@woocommerce/blocks-checkout';
|
|
|
18 |
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
|
19 |
import {
|
20 |
useStoreCartCoupons,
|
40 |
import CartLineItemsTitle from './cart-line-items-title';
|
41 |
import CartLineItemsTable from './cart-line-items-table';
|
42 |
import { CartExpressPayment } from '../../payment-methods';
|
|
|
43 |
import './style.scss';
|
44 |
|
45 |
interface CartAttributes {
|
113 |
cart,
|
114 |
};
|
115 |
|
116 |
+
const discountsSlotFillProps = {
|
117 |
+
extensions,
|
118 |
+
cart,
|
119 |
+
};
|
120 |
+
|
121 |
return (
|
122 |
<>
|
123 |
<CartLineItemsTitle itemCount={ cartItemsCount } />
|
156 |
isLoading={ isApplyingCoupon }
|
157 |
/>
|
158 |
) }
|
159 |
+
<ExperimentalDiscountsMeta.Slot
|
160 |
+
{ ...discountsSlotFillProps }
|
161 |
+
/>
|
162 |
+
|
163 |
{ cartNeedsShipping && (
|
164 |
<TotalsShipping
|
165 |
showCalculator={ isShippingCalculatorEnabled }
|
assets/js/blocks/cart-checkout/cart/test/__snapshots__/block.js.snap
CHANGED
@@ -455,6 +455,9 @@ exports[`Testing cart Contains a Taxes section if Core options are set to show i
|
|
455 |
</div>
|
456 |
</div>
|
457 |
</div>
|
|
|
|
|
|
|
458 |
<div
|
459 |
class="wc-block-components-totals-shipping"
|
460 |
>
|
@@ -1146,6 +1149,9 @@ exports[`Testing cart Shows individual tax lines if the store is set to do so 1`
|
|
1146 |
</div>
|
1147 |
</div>
|
1148 |
</div>
|
|
|
|
|
|
|
1149 |
<div
|
1150 |
class="wc-block-components-totals-shipping"
|
1151 |
>
|
@@ -1842,6 +1848,9 @@ exports[`Testing cart Shows rate percentages after tax lines if the block is set
|
|
1842 |
</div>
|
1843 |
</div>
|
1844 |
</div>
|
|
|
|
|
|
|
1845 |
<div
|
1846 |
class="wc-block-components-totals-shipping"
|
1847 |
>
|
455 |
</div>
|
456 |
</div>
|
457 |
</div>
|
458 |
+
<div
|
459 |
+
class="wc-block-components-discounts-meta"
|
460 |
+
/>
|
461 |
<div
|
462 |
class="wc-block-components-totals-shipping"
|
463 |
>
|
1149 |
</div>
|
1150 |
</div>
|
1151 |
</div>
|
1152 |
+
<div
|
1153 |
+
class="wc-block-components-discounts-meta"
|
1154 |
+
/>
|
1155 |
<div
|
1156 |
class="wc-block-components-totals-shipping"
|
1157 |
>
|
1848 |
</div>
|
1849 |
</div>
|
1850 |
</div>
|
1851 |
+
<div
|
1852 |
+
class="wc-block-components-discounts-meta"
|
1853 |
+
/>
|
1854 |
<div
|
1855 |
class="wc-block-components-totals-shipping"
|
1856 |
>
|
assets/js/blocks/product-categories/index.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
-
import { registerBlockType } from '@wordpress/blocks';
|
6 |
import { Icon, list } from '@woocommerce/icons';
|
7 |
|
8 |
/**
|
@@ -83,6 +83,26 @@ registerBlockType( 'woocommerce/product-categories', {
|
|
83 |
},
|
84 |
},
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
deprecated: [
|
87 |
{
|
88 |
// Deprecate HTML save method in favor of dynamic rendering.
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
+
import { createBlock, registerBlockType } from '@wordpress/blocks';
|
6 |
import { Icon, list } from '@woocommerce/icons';
|
7 |
|
8 |
/**
|
83 |
},
|
84 |
},
|
85 |
|
86 |
+
transforms: {
|
87 |
+
from: [
|
88 |
+
{
|
89 |
+
type: 'block',
|
90 |
+
blocks: [ 'core/legacy-widget' ],
|
91 |
+
// We can't transform if raw instance isn't shown in the REST API.
|
92 |
+
isMatch: ( { idBase, instance } ) =>
|
93 |
+
idBase === 'woocommerce_product_categories' &&
|
94 |
+
!! instance?.raw,
|
95 |
+
transform: ( { instance } ) =>
|
96 |
+
createBlock( 'woocommerce/product-categories', {
|
97 |
+
hasCount: !! instance.raw.count,
|
98 |
+
hasEmpty: ! instance.raw.hide_empty,
|
99 |
+
isDropdown: !! instance.raw.dropdown,
|
100 |
+
isHierarchical: !! instance.raw.hierarchical,
|
101 |
+
} ),
|
102 |
+
},
|
103 |
+
],
|
104 |
+
},
|
105 |
+
|
106 |
deprecated: [
|
107 |
{
|
108 |
// Deprecate HTML save method in favor of dynamic rendering.
|
assets/js/blocks/product-search/index.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
-
import { registerBlockType } from '@wordpress/blocks';
|
6 |
import { Icon, search } from '@woocommerce/icons';
|
7 |
/**
|
8 |
* Internal dependencies
|
@@ -71,6 +71,25 @@ registerBlockType( 'woocommerce/product-search', {
|
|
71 |
},
|
72 |
},
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
edit,
|
75 |
|
76 |
/**
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
+
import { createBlock, registerBlockType } from '@wordpress/blocks';
|
6 |
import { Icon, search } from '@woocommerce/icons';
|
7 |
/**
|
8 |
* Internal dependencies
|
71 |
},
|
72 |
},
|
73 |
|
74 |
+
transforms: {
|
75 |
+
from: [
|
76 |
+
{
|
77 |
+
type: 'block',
|
78 |
+
blocks: [ 'core/legacy-widget' ],
|
79 |
+
// We can't transform if raw instance isn't shown in the REST API.
|
80 |
+
isMatch: ( { idBase, instance } ) =>
|
81 |
+
idBase === 'woocommerce_product_search' && !! instance?.raw,
|
82 |
+
transform: ( { instance } ) =>
|
83 |
+
createBlock( 'woocommerce/product-search', {
|
84 |
+
label:
|
85 |
+
instance.raw.title === ''
|
86 |
+
? __( 'Search', 'woo-gutenberg-products-block' )
|
87 |
+
: instance.raw.title,
|
88 |
+
} ),
|
89 |
+
},
|
90 |
+
],
|
91 |
+
},
|
92 |
+
|
93 |
edit,
|
94 |
|
95 |
/**
|
assets/js/blocks/reviews/all-reviews/index.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
-
import { registerBlockType } from '@wordpress/blocks';
|
6 |
import { Icon, discussion } from '@woocommerce/icons';
|
7 |
|
8 |
/**
|
@@ -51,6 +51,27 @@ registerBlockType( 'woocommerce/all-reviews', {
|
|
51 |
},
|
52 |
},
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
* Renders and manages the block.
|
56 |
*
|
2 |
* External dependencies
|
3 |
*/
|
4 |
import { __ } from '@wordpress/i18n';
|
5 |
+
import { createBlock, registerBlockType } from '@wordpress/blocks';
|
6 |
import { Icon, discussion } from '@woocommerce/icons';
|
7 |
|
8 |
/**
|
51 |
},
|
52 |
},
|
53 |
|
54 |
+
transforms: {
|
55 |
+
from: [
|
56 |
+
{
|
57 |
+
type: 'block',
|
58 |
+
blocks: [ 'core/legacy-widget' ],
|
59 |
+
// We can't transform if raw instance isn't shown in the REST API.
|
60 |
+
isMatch: ( { idBase, instance } ) =>
|
61 |
+
idBase === 'woocommerce_recent_reviews' && !! instance?.raw,
|
62 |
+
transform: ( { instance } ) =>
|
63 |
+
createBlock( 'woocommerce/all-reviews', {
|
64 |
+
reviewsOnPageLoad: instance.raw.number,
|
65 |
+
imageType: 'product',
|
66 |
+
showLoadMore: false,
|
67 |
+
showOrderby: false,
|
68 |
+
showReviewDate: false,
|
69 |
+
showReviewContent: false,
|
70 |
+
} ),
|
71 |
+
},
|
72 |
+
],
|
73 |
+
},
|
74 |
+
|
75 |
/**
|
76 |
* Renders and manages the block.
|
77 |
*
|
assets/js/data/cart/index.ts
CHANGED
@@ -12,13 +12,14 @@ import * as selectors from './selectors';
|
|
12 |
import * as actions from './actions';
|
13 |
import * as resolvers from './resolvers';
|
14 |
import reducer, { State } from './reducers';
|
15 |
-
import { controls } from '../shared-controls';
|
|
|
16 |
|
17 |
registerStore< State >( STORE_KEY, {
|
18 |
reducer,
|
19 |
actions,
|
20 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
21 |
-
controls: { ...dataControls, ...controls } as any,
|
22 |
selectors,
|
23 |
resolvers,
|
24 |
} );
|
12 |
import * as actions from './actions';
|
13 |
import * as resolvers from './resolvers';
|
14 |
import reducer, { State } from './reducers';
|
15 |
+
import { controls as sharedControls } from '../shared-controls';
|
16 |
+
import { controls } from './controls';
|
17 |
|
18 |
registerStore< State >( STORE_KEY, {
|
19 |
reducer,
|
20 |
actions,
|
21 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
22 |
+
controls: { ...dataControls, ...sharedControls, ...controls } as any,
|
23 |
selectors,
|
24 |
resolvers,
|
25 |
} );
|
build/active-filters-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '610c291d5225d44b5531440378b67e83');
|
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=235)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},11:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(10),o=r.n(n),c=r(7),a=r.n(c),i=r(0),u=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){a()(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 p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){}:n,a=e.getErrorBoundaryProps,s=void 0===a?function(){}:a;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),a=s(e,r),p=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(i.render)(React.createElement(u.a,a,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,a=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),f({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(p.join(","));b(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;r=l(l({},e),{},{wrapper:t}),n=r.Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},12:function(e,t){!function(){e.exports=this.wp.data}()},122:function(e,t){},125:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),o=r(12),c=r(0),a=r(54),i=r(95),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),m=Object(a.a)(p),v=Object(a.a)(s),y=Object(i.a)(),g=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,v],a=o.getCollectionError.apply(o,c);return a&&y(a),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,v,m,b]);return null!==g&&(d.current=g),d.current}},13:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"i",(function(){return a})),r.d(t,"j",(function(){return i})),r.d(t,"f",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return p})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return v})),r.d(t,"l",(function(){return y}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"assets/",i=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=o.STORE_PAGES.privacy.title,b=o.STORE_PAGES.terms.permalink,d=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),v=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),y=(r(41),function(){return u>1})},139:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(16),a=r.n(c),i=r(0);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,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?u(Object(r),!0).forEach((function(t){o()(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},c)):null}},141:function(e,t,r){"use strict";var n=r(0),o=r(15),c=r(12),a=r(13);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(a.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,a=n.hasFinishedResolution,i=t.dispatch(o.SCHEMA_STORE_KEY),u=i.receiveRoutes,s=i.startResolution,l=i.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||a("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(5),o=Object(n.getSetting)("attributes",[]),c=o.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}),[]),a=function(e){if(e)return c.find((function(t){return t.id===e}))},i=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},151:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(8),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})),a=c.length?c[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var i=a.slug.filter((function(e){return e!==o})),u=e.filter((function(e){return e.attribute!==r.taxonomy}));i.length>0&&(a.slug=i.sort(),u.push(a)),t(Object(n.sortBy)(u,"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",a=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(a):(a.push({attribute:r.taxonomy,operator:c,slug:o.map((function(e){return e.slug})).sort()}),t(Object(n.sortBy)(a,"attribute")))}},158:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=(r(3),r(4)),u=r.n(i),s=r(1),l=r(139),p=r(170),f=(r(122),function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,i=void 0===c?"li":c,s=e.className,l=void 0===s?"":s,p=e.radius,f=void 0===p?"small":p,b=e.children,d=void 0===b?null:b,m=a()(e,["text","screenReaderText","element","className","radius","children"]),v=i,y=u()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+f),g=Boolean(n&&n!==t);return React.createElement(v,o()({className:y},m),React.createElement("span",{"aria-hidden":g,className:"wc-block-components-chip__text"},t),g&&React.createElement("span",{className:"screen-reader-text"},n),d)});t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,c=void 0===n?"":n,i=e.disabled,b=void 0!==i&&i,d=e.onRemove,m=void 0===d?function(){}:d,v=e.removeOnAnyClick,y=void 0!==v&&v,g=e.text,_=e.screenReaderText,O=void 0===_?"":_,h=a()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),x=y?"span":"button";if(!r){var E=O&&"string"==typeof O?O:g;r="string"!=typeof E?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var w={"aria-label":r,disabled:b,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},j=y?w:{},R=y?{"aria-hidden":!0}:w;return React.createElement(f,o()({},h,j,{className:u()(c,"is-removable"),element:y?"button":h.element,screenReaderText:O,text:g}),React.createElement(x,o()({className:"wc-block-components-chip__remove"},R),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},16:function(e,t,r){var n=r(71);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},170:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=r(28),u=function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),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"}))},s=React.createElement(u,null);t.a=s},18:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},2:function(e,t){!function(){e.exports=this.React}()},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.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},23: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},e.exports.default=e.exports,e.exports.__esModule=!0},235:function(e,t,r){e.exports=r(284)},236:function(e,t){},25:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},28:function(e,t){!function(){e.exports=this.wp.primitives}()},284:function(e,t,r){"use strict";r.r(t);var n=r(141),o=r(119),c=r(9),a=r.n(c),i=r(1),u=r(94),s=r(0),l=r(4),p=r.n(l),f=(r(3),r(11)),b=(r(236),r(150)),d=r(40),m=r(158),v=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,u=void 0===a||a,s=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},u&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?React.createElement(m.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(f.Label,{screenReaderLabel:p}))))},g=r(125),_=r(18),O=r(151),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=e.displayStyle,p=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(u.b)("attributes",[]),m=a()(d,2),v=m[0],h=m[1];if(b)return null;var x=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},x,":"),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(i.__)("and","woo-gutenberg-products-block"))),y({type:x,name:Object(_.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(O.a)(v,h,r,e)},showLabel:!1,displayStyle:l})}))))},x=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(u.b)("attributes",[]),c=a()(o,2),l=c[0],d=c[1],m=Object(u.b)("min_price"),g=a()(m,2),_=g[0],O=g[1],x=Object(u.b)("max_price"),E=a()(x,2),w=E[0],j=E[1],R=Object(s.useMemo)((function(){return Number.isFinite(_)||Number.isFinite(w)?y({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:v(_,w),removeCallback:function(){O(void 0),j(void 0)},displayStyle:t.displayStyle}):null}),[_,w,t.displayStyle,O,j]),k=Object(s.useMemo)((function(){return l.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(h,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(_)||Number.isFinite(w)||n))return null;var S="h".concat(t.headingLevel),P=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(S,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(React.Fragment,null,y({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),y({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,R,k)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){O(void 0),j(void 0),d([])}},React.createElement(f.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(x),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},3:function(e,t,r){e.exports=r(73)()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},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},e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t,r){var n=r(64);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)},e.exports.default=e.exports,e.exports.__esModule=!0},35:function(e,t,r){var n=r(20).default,o=r(23);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},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 a=o.apply(null,n);a&&e.push(a)}else if("object"===c)for(var i in n)r.call(n,i)&&n[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},40:function(e,t){!function(){e.exports=this.wc.priceFormat}()},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),a=r.n(c),i=r(23),u=r.n(i),s=r(34),l=r.n(s),p=r(35),f=r.n(p),b=r(25),d=r.n(b),m=r(7),v=r.n(m),y=(r(3),r(2)),g=r(1),_=r(13),O=function(e){var t=e.imageUrl,r=void 0===t?"".concat(_.i,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(g.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,a=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,i=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;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),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",i)))};r(75);function h(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 f()(this,r)}}var x=function(e){l()(r,e);var t=h(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),a=0;a<n;a++)c[a]=arguments[a];return e=t.call.apply(t,[this].concat(c)),v()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=this.state,u=i.errorMessage;return i.hasError?"function"==typeof a?a({errorMessage:u}):React.createElement(O,{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(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(y.Component);x.defaultProps={showErrorMessage:!0};t.a=x},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},61: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},64:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},67:function(e,t,r){var n=r(68);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}},e.exports.default=e.exports,e.exports.__esModule=!0},68: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},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},71:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},73:function(e,t,r){"use strict";var n=r(74);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,a){if(a!==n){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 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}},74:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},75:function(e,t){},8:function(e,t){!function(){e.exports=this.lodash}()},83:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},84:function(e,t){e.exports=function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=r){var n,o,c=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},85: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.")},e.exports.default=e.exports,e.exports.__esModule=!0},9:function(e,t,r){var n=r(83),o=r(84),c=r(67),a=r(85);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},
|
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=235)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},11:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(10),o=r.n(n),c=r(7),a=r.n(c),i=r(0),u=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){a()(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 p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){}:n,a=e.getErrorBoundaryProps,s=void 0===a?function(){}:a;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),a=s(e,r),p=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(i.render)(React.createElement(u.a,a,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,a=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),f({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(p.join(","));b(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;r=l(l({},e),{},{wrapper:t}),n=r.Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},12:function(e,t){!function(){e.exports=this.wp.data}()},122:function(e,t){},125:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),o=r(12),c=r(0),a=r(54),i=r(96),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),m=Object(a.a)(p),v=Object(a.a)(s),y=Object(i.a)(),g=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,v],a=o.getCollectionError.apply(o,c);return a&&y(a),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,v,m,b]);return null!==g&&(d.current=g),d.current}},13:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"i",(function(){return a})),r.d(t,"j",(function(){return i})),r.d(t,"f",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return p})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return v})),r.d(t,"l",(function(){return y}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"assets/",i=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=o.STORE_PAGES.privacy.title,b=o.STORE_PAGES.terms.permalink,d=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),v=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),y=(r(41),function(){return u>1})},139:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(16),a=r.n(c),i=r(0),u=["srcElement","size"];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,u);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)):null}},141:function(e,t,r){"use strict";var n=r(0),o=r(15),c=r(12),a=r(13);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(a.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,a=n.hasFinishedResolution,i=t.dispatch(o.SCHEMA_STORE_KEY),u=i.receiveRoutes,s=i.startResolution,l=i.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||a("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(5),o=Object(n.getSetting)("attributes",[]),c=o.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}),[]),a=function(e){if(e)return c.find((function(t){return t.id===e}))},i=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},151:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(8),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})),a=c.length?c[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var i=a.slug.filter((function(e){return e!==o})),u=e.filter((function(e){return e.attribute!==r.taxonomy}));i.length>0&&(a.slug=i.sort(),u.push(a)),t(Object(n.sortBy)(u,"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",a=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(a):(a.push({attribute:r.taxonomy,operator:c,slug:o.map((function(e){return e.slug})).sort()}),t(Object(n.sortBy)(a,"attribute")))}},158:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=(r(3),r(4)),u=r.n(i),s=r(1),l=r(139),p=r(170),f=(r(122),["text","screenReaderText","element","className","radius","children"]),b=function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,i=void 0===c?"li":c,s=e.className,l=void 0===s?"":s,p=e.radius,b=void 0===p?"small":p,d=e.children,m=void 0===d?null:d,v=a()(e,f),y=i,g=u()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+b),_=Boolean(n&&n!==t);return React.createElement(y,o()({className:g},v),React.createElement("span",{"aria-hidden":_,className:"wc-block-components-chip__text"},t),_&&React.createElement("span",{className:"screen-reader-text"},n),m)},d=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,c=void 0===n?"":n,i=e.disabled,f=void 0!==i&&i,m=e.onRemove,v=void 0===m?function(){}:m,y=e.removeOnAnyClick,g=void 0!==y&&y,_=e.text,O=e.screenReaderText,h=void 0===O?"":O,x=a()(e,d),E=g?"span":"button";if(!r){var w=h&&"string"==typeof h?h:_;r="string"!=typeof w?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),w)}var j={"aria-label":r,disabled:f,onClick:v,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||v()}},R=g?j:{},k=g?{"aria-hidden":!0}:j;return React.createElement(b,o()({},x,R,{className:u()(c,"is-removable"),element:g?"button":x.element,screenReaderText:h,text:_}),React.createElement(E,o()({className:"wc-block-components-chip__remove"},k),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},16:function(e,t,r){var n=r(71);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},170:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=r(28),u=["className","size"],s=function(e){var t=e.className,r=e.size,n=a()(e,u);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),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"}))},l=React.createElement(s,null);t.a=l},18:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},2:function(e,t){!function(){e.exports=this.React}()},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.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},23: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},e.exports.default=e.exports,e.exports.__esModule=!0},235:function(e,t,r){e.exports=r(284)},236:function(e,t){},25:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},28:function(e,t){!function(){e.exports=this.wp.primitives}()},284:function(e,t,r){"use strict";r.r(t);var n=r(141),o=r(119),c=r(9),a=r.n(c),i=r(1),u=r(95),s=r(0),l=r(4),p=r.n(l),f=(r(3),r(11)),b=(r(236),r(150)),d=r(40),m=r(158),v=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,u=void 0===a||a,s=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},u&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?React.createElement(m.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(f.Label,{screenReaderLabel:p}))))},g=r(125),_=r(18),O=r(151),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=e.displayStyle,p=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(u.b)("attributes",[]),m=a()(d,2),v=m[0],h=m[1];if(b)return null;var x=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},x,":"),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(i.__)("and","woo-gutenberg-products-block"))),y({type:x,name:Object(_.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(O.a)(v,h,r,e)},showLabel:!1,displayStyle:l})}))))},x=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(u.b)("attributes",[]),c=a()(o,2),l=c[0],d=c[1],m=Object(u.b)("min_price"),g=a()(m,2),_=g[0],O=g[1],x=Object(u.b)("max_price"),E=a()(x,2),w=E[0],j=E[1],R=Object(s.useMemo)((function(){return Number.isFinite(_)||Number.isFinite(w)?y({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:v(_,w),removeCallback:function(){O(void 0),j(void 0)},displayStyle:t.displayStyle}):null}),[_,w,t.displayStyle,O,j]),k=Object(s.useMemo)((function(){return l.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(h,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(_)||Number.isFinite(w)||n))return null;var S="h".concat(t.headingLevel),P=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(S,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(React.Fragment,null,y({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),y({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,R,k)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){O(void 0),j(void 0),d([])}},React.createElement(f.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(x),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},3:function(e,t,r){e.exports=r(73)()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},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},e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t,r){var n=r(64);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)},e.exports.default=e.exports,e.exports.__esModule=!0},35:function(e,t,r){var n=r(20).default,o=r(23);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},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 a=o.apply(null,n);a&&e.push(a)}else if("object"===c)for(var i in n)r.call(n,i)&&n[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},40:function(e,t){!function(){e.exports=this.wc.priceFormat}()},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),a=r.n(c),i=r(23),u=r.n(i),s=r(34),l=r.n(s),p=r(35),f=r.n(p),b=r(25),d=r.n(b),m=r(7),v=r.n(m),y=(r(3),r(2)),g=r(1),_=r(13),O=function(e){var t=e.imageUrl,r=void 0===t?"".concat(_.i,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(g.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,a=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,i=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;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),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",i)))};r(75);function h(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 f()(this,r)}}var x=function(e){l()(r,e);var t=h(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),a=0;a<n;a++)c[a]=arguments[a];return e=t.call.apply(t,[this].concat(c)),v()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=this.state,u=i.errorMessage;return i.hasError?"function"==typeof a?a({errorMessage:u}):React.createElement(O,{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(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(y.Component);x.defaultProps={showErrorMessage:!0};t.a=x},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},61: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},64:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},67:function(e,t,r){var n=r(68);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}},e.exports.default=e.exports,e.exports.__esModule=!0},68: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},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},71:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},73:function(e,t,r){"use strict";var n=r(74);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,a){if(a!==n){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 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}},74:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},75:function(e,t){},8:function(e,t){!function(){e.exports=this.lodash}()},83:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},84:function(e,t){e.exports=function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=r){var n,o,c=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},85: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.")},e.exports.default=e.exports,e.exports.__esModule=!0},9:function(e,t,r){var n=r(83),o=r(84),c=r(67),a=r(85);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},95: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 m}));var n=r(9),o=r.n(n),c=r(15),a=r(12),i=r(0),u=r(22),s=r.n(u),l=r(54),p=r(107),f=r(61),b=function(e){var t=Object(f.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},d=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(a.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(i.useCallback)((function(t){u(r,e,t)}),[r,e,u])]},m=function(e,t){var r=Object(f.a)(),n=b(t=t||r),c=o()(n,2),a=c[0],u=c[1],d=Object(l.a)(a),m=Object(l.a)(e),v=Object(p.a)(m),y=Object(i.useRef)(!1);return Object(i.useEffect)((function(){s()(v,m)||(u(Object.assign({},d,m)),y.current=!0)}),[d,m,v,u]),y.current?[a,u]:[e,u]}},96:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(9),o=r.n(n),c=r(0),a=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}}});
|
build/active-filters.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'ce626323788c67066d61a148d852f45b');
|
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,i,a=t[0],l=t[1],u=t[2],b=0,f=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&f.push(c[i][0]),c[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(s&&s(t);f.length;)f.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,a=1;a<n.length;a++){var l=n[a];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={5:0},o=[];function i(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,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},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||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=l;return o.push([733,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},104:function(e,t){},129:function(e,t,n){"use strict";var r=n(15),c=n.n(r),o=n(16),i=n.n(o),a=n(17),l=n.n(a),u=n(18),s=n.n(u),b=n(9),f=n.n(b),p=n(0),d=n(6),v=n(1),m=n(3);function h(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)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(m.Path,{d:n[t]})):null}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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 g=function(e){l()(n,e);var t=O(n);function n(){return c()(this,n),t.apply(this,arguments)}return i()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(h,{level:e}),title:Object(v.sprintf)(Object(v.__)("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,o=t.maxLevel,i=t.selectedLevel,a=t.onChange;return Object(p.createElement)(m.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(h,{level:i}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,i,a)}))})}}]),n}(p.Component);t.a=g},132: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 v}));var r=n(13),c=n.n(r),o=n(40),i=n(23),a=n(0),l=n(37),u=n.n(l),s=n(76),b=n(149),f=n(83),p=function(e){var t=Object(f.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},d=function(e,t,n){var r=Object(f.a)();n=n||r;var c=Object(i.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},v=function(e,t){var n=Object(f.a)(),r=p(t=t||n),o=c()(r,2),i=o[0],l=o[1],d=Object(s.a)(i),v=Object(s.a)(e),m=Object(b.a)(v),h=Object(a.useRef)(!1);return Object(a.useEffect)((function(){u()(m,v)||(l(Object.assign({},d,v)),h.current=!0)}),[d,v,m,l]),h.current?[i,l]:[e,l]}},133:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(13),c=n.n(r),o=n(0),i=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},149:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},168:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(24)),o=n(7),i=n.n(o);n(225);t.a=function(e){var t=e.className,n=e.headingLevel,o=e.onChange,a=e.heading,l="h".concat(n);return Object(r.createElement)(l,null,Object(r.createElement)(c.PlainText,{className:i()("wc-block-editor-components-title",t),value:a,onChange:o}))}},181:function(e,t){},184:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(40),c=n(23),o=n(0),i=n(76),a=n(133),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,u=void 0===l?[]:l,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(o.useRef)({results:[],isLoading:!0}),v=Object(i.a)(b),m=Object(i.a)(u),h=Object(a.a)(),O=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,v,m],i=c.getCollectionError.apply(c,o);return i&&h(i),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,m,v,p]);return null!==O&&(d.current=O),d.current}},22:function(e,t){!function(){e.exports=this.wp.compose}()},225:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.data}()},231:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(5),c=Object(r.getSetting)("attributes",[]),o=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}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},232:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));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]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),i=o.length?o[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(c)){var a=i.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(i.slug=a.sort(),l.push(i)),t(Object(r.sortBy)(l,"attribute"))}},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,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",i=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(i):(i.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(i,"attribute")))}},239:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=(n(2),n(7)),u=n.n(l),s=n(1),b=n(58),f=n(311),p=(n(181),function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,l=void 0===o?"li":o,s=e.className,b=void 0===s?"":s,f=e.radius,p=void 0===f?"small":f,d=e.children,v=void 0===d?null:d,m=i()(e,["text","screenReaderText","element","className","radius","children"]),h=l,O=u()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+p),g=Boolean(r&&r!==t);return Object(a.createElement)(h,c()({className:O},m),Object(a.createElement)("span",{"aria-hidden":g,className:"wc-block-components-chip__text"},t),g&&Object(a.createElement)("span",{className:"screen-reader-text"},r),v)});t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,l=e.disabled,d=void 0!==l&&l,v=e.onRemove,m=void 0===v?function(){}:v,h=e.removeOnAnyClick,O=void 0!==h&&h,g=e.text,j=e.screenReaderText,y=void 0===j?"":j,w=i()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),_=O?"span":"button";if(!n){var E=y&&"string"==typeof y?y:g;n="string"!=typeof E?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var k={"aria-label":n,disabled:d,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},x=O?k:{},S=O?{"aria-hidden":!0}:k;return Object(a.createElement)(p,c()({},w,x,{className:u()(o,"is-removable"),element:O?"button":w.element,screenReaderText:y,text:g}),Object(a.createElement)(_,c()({className:"wc-block-components-chip__remove"},S),Object(a.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},26:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},311:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=n(33),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=i()(e,["className","size"]);return Object(a.createElement)(l.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(a.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=u},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},58:function(e,t,n){"use strict";var r=n(4),c=n.n(r),o=n(20),i=n.n(o),a=n(0);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}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=i()(e,["srcElement","size"]);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(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}({width:r,height:r},o)):null}},59:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},733:function(e,t,n){e.exports=n(774)},734:function(e,t){},74:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(15),i=n.n(o),a=n(16),l=n.n(a),u=n(12),s=n.n(u),b=n(17),f=n.n(b),p=n(18),d=n.n(p),v=n(9),m=n.n(v),h=n(0),O=n(6),g=n(7),j=n.n(g),y=n(3),w=n(22);n(104);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var c=m()(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 i()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return l()(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,o=n.checked,i=n.instanceId,a=n.className,l=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(i);return l&&(e=Object(O.isFunction)(l)?l(o):l),Object(h.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",a)},Object(h.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(h.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(h.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),n}(h.Component);t.a=Object(w.withInstanceId)(E)},76:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(37),o=n.n(c);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},774:function(e,t,n){"use strict";n.r(t);var r=n(11),c=n.n(r),o=n(0),i=n(1),a=n(26),l=n(58),u=n(33),s=Object(o.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(7),f=n.n(b),p=n(24),d=n(3),v=n(129),m=n(168),h=n(74),O=n(13),g=n.n(O),j=n(132),y=(n(2),n(27)),w=(n(734),n(231)),_=n(59),E=n(239),k=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t))},x=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,l=e.showLabel,u=void 0===l||l,s=e.displayStyle,b=r?Object(o.createElement)(o.Fragment,null,r," ",n):n,f=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),n);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},u&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(o.createElement)(E.a,{element:"span",text:b,onRemove:a,radius:"large",ariaLabel:f}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:a},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(y.Label,{screenReaderLabel:f}))))},S=n(184),C=n(29),N=n(232),R=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,a=e.operator,l=void 0===a?"in":a,u=e.displayStyle,s=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=s.results,f=s.isLoading,p=Object(j.b)("attributes",[]),d=g()(p,2),v=d[0],m=d[1];if(f)return null;var h=n.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},h,":"),Object(o.createElement)("ul",null,c.map((function(e,t){var r=b.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===l&&(c=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),x({type:h,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(N.a)(v,m,n,e)},showLabel:!1,displayStyle:u})}))))},L=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(j.b)("attributes",[]),a=g()(c,2),l=a[0],u=a[1],s=Object(j.b)("min_price"),b=g()(s,2),p=b[0],d=b[1],v=Object(j.b)("max_price"),m=g()(v,2),h=m[0],O=m[1],_=Object(o.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(h)?x({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:k(p,h),removeCallback:function(){d(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[p,h,t.displayStyle,d,O]),E=Object(o.useMemo)((function(){return l.map((function(e){var n=Object(w.b)(e.attribute);return Object(o.createElement)(R,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(p)||Number.isFinite(h)||r))return null;var S="h".concat(t.headingLevel),C=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(S,null,t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:C},r?Object(o.createElement)(o.Fragment,null,x({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),x({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,_,E)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),O(void 0),u([])}},Object(o.createElement)(y.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))},P=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,l=t.headingLevel;return Object(o.createElement)("div",{className:r},Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(i.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(h.a,{label:Object(i.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(i.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(i.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)("p",null,Object(i.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(v.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:l,onChange:function(e){return n({headingLevel:e})}}))),Object(o.createElement)(m.a,{headingLevel:l,heading:a,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(d.Disabled,null,Object(o.createElement)(L,{attributes:t,isEditor:!0})))}));Object(a.registerBlockType)("woocommerce/active-filters",{title:Object(i.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(l.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("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(i.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:P,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(o.createElement)("div",c()({className:f()("is-loading",n)},r),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},8:function(e,t){!function(){e.exports=this.React}()},83:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=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,i,a=t[0],l=t[1],u=t[2],b=0,f=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&f.push(c[i][0]),c[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(s&&s(t);f.length;)f.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,a=1;a<n.length;a++){var l=n[a];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={5:0},o=[];function i(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,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},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||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=l;return o.push([733,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},104:function(e,t){},130:function(e,t,n){"use strict";var r=n(15),c=n.n(r),o=n(16),i=n.n(o),a=n(17),l=n.n(a),u=n(18),s=n.n(u),b=n(9),f=n.n(b),p=n(0),d=n(6),v=n(1),m=n(3);function h(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)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(m.Path,{d:n[t]})):null}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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 g=function(e){l()(n,e);var t=O(n);function n(){return c()(this,n),t.apply(this,arguments)}return i()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(h,{level:e}),title:Object(v.sprintf)(Object(v.__)("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,o=t.maxLevel,i=t.selectedLevel,a=t.onChange;return Object(p.createElement)(m.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(h,{level:i}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,i,a)}))})}}]),n}(p.Component);t.a=g},133: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 v}));var r=n(13),c=n.n(r),o=n(40),i=n(23),a=n(0),l=n(37),u=n.n(l),s=n(76),b=n(149),f=n(83),p=function(e){var t=Object(f.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},d=function(e,t,n){var r=Object(f.a)();n=n||r;var c=Object(i.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},v=function(e,t){var n=Object(f.a)(),r=p(t=t||n),o=c()(r,2),i=o[0],l=o[1],d=Object(s.a)(i),v=Object(s.a)(e),m=Object(b.a)(v),h=Object(a.useRef)(!1);return Object(a.useEffect)((function(){u()(m,v)||(l(Object.assign({},d,v)),h.current=!0)}),[d,v,m,l]),h.current?[i,l]:[e,l]}},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(13),c=n.n(r),o=n(0),i=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},149:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(7);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},167:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(24)),o=n(8),i=n.n(o);n(225);t.a=function(e){var t=e.className,n=e.headingLevel,o=e.onChange,a=e.heading,l="h".concat(n);return Object(r.createElement)(l,null,Object(r.createElement)(c.PlainText,{className:i()("wc-block-editor-components-title",t),value:a,onChange:o}))}},181:function(e,t){},184:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(40),c=n(23),o=n(0),i=n(76),a=n(134),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,u=void 0===l?[]:l,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(o.useRef)({results:[],isLoading:!0}),v=Object(i.a)(b),m=Object(i.a)(u),h=Object(a.a)(),O=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,v,m],i=c.getCollectionError.apply(c,o);return i&&h(i),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,m,v,p]);return null!==O&&(d.current=O),d.current}},22:function(e,t){!function(){e.exports=this.wp.compose}()},225:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.data}()},231:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(5),c=Object(r.getSetting)("attributes",[]),o=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}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},232:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));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]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),i=o.length?o[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(c)){var a=i.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(i.slug=a.sort(),l.push(i)),t(Object(r.sortBy)(l,"attribute"))}},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,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",i=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(i):(i.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(i,"attribute")))}},239:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=(n(2),n(8)),u=n.n(l),s=n(1),b=n(58),f=n(311),p=(n(181),["text","screenReaderText","element","className","radius","children"]),d=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,l=void 0===o?"li":o,s=e.className,b=void 0===s?"":s,f=e.radius,d=void 0===f?"small":f,v=e.children,m=void 0===v?null:v,h=i()(e,p),O=l,g=u()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+d),j=Boolean(r&&r!==t);return Object(a.createElement)(O,c()({className:g},h),Object(a.createElement)("span",{"aria-hidden":j,className:"wc-block-components-chip__text"},t),j&&Object(a.createElement)("span",{className:"screen-reader-text"},r),m)},v=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,l=e.disabled,p=void 0!==l&&l,m=e.onRemove,h=void 0===m?function(){}:m,O=e.removeOnAnyClick,g=void 0!==O&&O,j=e.text,y=e.screenReaderText,w=void 0===y?"":y,_=i()(e,v),E=g?"span":"button";if(!n){var k=w&&"string"==typeof w?w:j;n="string"!=typeof k?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),k)}var x={"aria-label":n,disabled:p,onClick:h,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||h()}},S=g?x:{},C=g?{"aria-hidden":!0}:x;return Object(a.createElement)(d,c()({},_,S,{className:u()(o,"is-removable"),element:g?"button":_.element,screenReaderText:w,text:j}),Object(a.createElement)(E,c()({className:"wc-block-components-chip__remove"},C),Object(a.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},311:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=n(33),u=["className","size"],s=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=i()(e,u);return Object(a.createElement)(l.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(a.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=s},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},58:function(e,t,n){"use strict";var r=n(4),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=["srcElement","size"];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,o=i()(e,l);return Object(a.isValidElement)(t)?Object(a.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){c()(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},o)):null}},59:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},7:function(e,t){!function(){e.exports=this.React}()},733:function(e,t,n){e.exports=n(774)},734:function(e,t){},74:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(15),i=n.n(o),a=n(16),l=n.n(a),u=n(12),s=n.n(u),b=n(17),f=n.n(b),p=n(18),d=n.n(p),v=n(9),m=n.n(v),h=n(0),O=n(6),g=n(8),j=n.n(g),y=n(3),w=n(22);n(104);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var c=m()(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 i()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return l()(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,o=n.checked,i=n.instanceId,a=n.className,l=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(i);return l&&(e=Object(O.isFunction)(l)?l(o):l),Object(h.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",a)},Object(h.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(h.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(h.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),n}(h.Component);t.a=Object(w.withInstanceId)(E)},76:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(37),o=n.n(c);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},774:function(e,t,n){"use strict";n.r(t);var r=n(11),c=n.n(r),o=n(0),i=n(1),a=n(25),l=n(58),u=n(33),s=Object(o.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(8),f=n.n(b),p=n(24),d=n(3),v=n(130),m=n(167),h=n(74),O=n(13),g=n.n(O),j=n(133),y=(n(2),n(27)),w=(n(734),n(231)),_=n(59),E=n(239),k=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t))},x=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,l=e.showLabel,u=void 0===l||l,s=e.displayStyle,b=r?Object(o.createElement)(o.Fragment,null,r," ",n):n,f=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),n);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},u&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(o.createElement)(E.a,{element:"span",text:b,onRemove:a,radius:"large",ariaLabel:f}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:a},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(y.Label,{screenReaderLabel:f}))))},S=n(184),C=n(29),N=n(232),R=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,a=e.operator,l=void 0===a?"in":a,u=e.displayStyle,s=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=s.results,f=s.isLoading,p=Object(j.b)("attributes",[]),d=g()(p,2),v=d[0],m=d[1];if(f)return null;var h=n.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},h,":"),Object(o.createElement)("ul",null,c.map((function(e,t){var r=b.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===l&&(c=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),x({type:h,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(N.a)(v,m,n,e)},showLabel:!1,displayStyle:u})}))))},L=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(j.b)("attributes",[]),a=g()(c,2),l=a[0],u=a[1],s=Object(j.b)("min_price"),b=g()(s,2),p=b[0],d=b[1],v=Object(j.b)("max_price"),m=g()(v,2),h=m[0],O=m[1],_=Object(o.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(h)?x({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:k(p,h),removeCallback:function(){d(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[p,h,t.displayStyle,d,O]),E=Object(o.useMemo)((function(){return l.map((function(e){var n=Object(w.b)(e.attribute);return Object(o.createElement)(R,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(p)||Number.isFinite(h)||r))return null;var S="h".concat(t.headingLevel),C=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(S,null,t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:C},r?Object(o.createElement)(o.Fragment,null,x({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),x({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,_,E)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),O(void 0),u([])}},Object(o.createElement)(y.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))},P=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,l=t.headingLevel;return Object(o.createElement)("div",{className:r},Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(i.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(h.a,{label:Object(i.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(i.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(i.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)("p",null,Object(i.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(v.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:l,onChange:function(e){return n({headingLevel:e})}}))),Object(o.createElement)(m.a,{headingLevel:l,heading:a,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(d.Disabled,null,Object(o.createElement)(L,{attributes:t,isEditor:!0})))}));Object(a.registerBlockType)("woocommerce/active-filters",{title:Object(i.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(l.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("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(i.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:P,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(o.createElement)("div",c()({className:f()("is-loading",n)},r),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},83:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=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', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '874fbd412d38198f59f9373543cf3967');
|
build/all-products-frontend.js
CHANGED
@@ -3,4 +3,4 @@
|
|
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 c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===c)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}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){!function(){e.exports=this.wc.wcSettings}()},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){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(83),o=n(84),c=n(67),i=n(85);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";n.d(t,"k",(function(){return c})),n.d(t,"i",(function(){return i})),n.d(t,"j",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return f})),n.d(t,"d",(function(){return p})),n.d(t,"h",(function(){return d})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return h})),n.d(t,"l",(function(){return v}));var r,o=n(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,d=o.STORE_PAGES.terms.permalink,b=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),v=(n(41),function(){return u>1})},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,n){var r=n(71);e.exports=function(e,t){if(null==e)return{};var n,o,c=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)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(24);function o(e,t){if(null==e)return{};var n,o,c=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)&&(c[n]=e[n])}return c}},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}}(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){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},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){!function(){e.exports=this.wp.isShallowEqual}()},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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(58);var o=n(65);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])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){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(64);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)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20).default,o=n(23);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(9),o=n.n(r),c=n(7),i=n.n(c),a=n(8),u=n(0),s=n(15),l=n(12),f=n(18),p=n(93),d=n(96),b=n(46);function m(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 h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},g=h(h({},v),{},{email:"",phone:""}),y=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),n=t[0],r=t[1];return[n,Object(f.decodeEntities)(r)]})))},O={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:g,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),n=t.isEditor,r=t.previewData,o=(null==r?void 0:r.previewCart)||{},c=e.shouldSelect,i=Object(u.useRef)(),f=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!c)return O;if(n)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:[],cartTotals:o.totals,cartIsLoading:!1,cartErrors:[],billingAddress:g,shippingAddress:v,extensions:{},shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=r(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),h=a.needsShipping?y(a.shippingAddress):m,j=a.fees.map((function(e){return y(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},,function(e,t){!function(){e.exports=this.wc.priceFormat}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.dom}()},,function(e,t,n){"use strict";var r=n(32),o=n.n(r),c=n(33),i=n.n(c),a=n(23),u=n.n(a),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(25),b=n.n(d),m=n(7),h=n.n(m),v=(n(3),n(2)),g=n(1),y=n(13),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.i,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("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),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a)))};n(75);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 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,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),h()(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,c=e.errorMessagePrefix,i=e.renderError,a=this.state,u=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:u}):React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(v.Component);w.defaultProps={showErrorMessage:!0};t.a=w},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(12),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(r.useContext)(o)}},,function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(66),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(89))},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(22),c=n.n(o);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(7),o=n.n(r),c=n(78),i=n(0),a=n(38);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(){var e=Object(a.a)();return{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),s(s({},n),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},function(e,t){!function(){e.exports=this.wp.deprecated}()},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,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){!function(){e.exports=this.wp.apiFetch}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=Object(r.createContext)("page"),c=function(){return Object(r.useContext)(o)};o.Provider},function(e,t){!function(){e.exports=this.wp.keycodes}()},,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(58);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){!function(){e.exports=this.wp.warning}()},function(e,t,n){var r=n(68);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}},e.exports.default=e.exports,e.exports.__esModule=!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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(74);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=n(5),u=n(1);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){o()(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=Object(a.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(Object(u.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(f).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,p(r)]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==d[n]?d[n]:{};return e.map((function(e){var n=a.defaultAddressFields[e]||{},o=r[e]||{},c=t[e]||{};return l(l(l({key:e},n),o),c)})).sort((function(e,t){return e.index-t.index}))}},,function(e,t){!function(){e.exports=this.wp.hooks}()},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(10)),c=r(n(71)),i=n(2),a=r(i),u=r(n(121)),s=r(n(23)),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 b(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 m(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,c(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 c;return l.und(t[r])?o({},n,((c={})[r]=e[r],c)):n}),{});return o({to:t},n)}var h,v,g=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 g&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}return u(t,e),t}(g),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 g&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&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 g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function j(e,t){h={fn:e,transform:t}}function w(e){v=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},_=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function x(e){k=e}var P,R=function(){return Date.now()};function S(e){P=e}var C,T,N=function(e){return e.current};function A(e){C=e}var F=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return v},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return _},injectFrame:function(e,t){E=e,_=t},get interpolation(){return k},injectStringInterpolator:x,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return P},injectDefaultElement:S,get animatedApi(){return N},injectAnimatedApi:function(e){N=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return T},injectManualFrameloop:function(e){T=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:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),M=!1,I=new Set,L=function e(){if(!M)return!1;var t=R(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var c;if(r){if(o>=n.length)break;c=n[o++]}else{if((o=n.next()).done)break;c=o.value}for(var i=c,a=!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 b=s.fromValues[p],m=s.toValues[p],h=d.lastPosition,v=m instanceof g,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(v&&(m=m.getValue()),s.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==s.duration)h=b+s.easing((t-d.startTime)/s.duration)*(m-b),l=t>=d.startTime+s.duration;else if(s.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(m=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-m)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(b<m?h>m:h<m),k=Math.abs(y)<=s.precision,_=0===s.tension||Math.abs(m-h)<=s.precision;l=w||k&&_,d.lastVelocity=y,d.lastTime=t}v&&!s.toValues[p].done&&(l=!1),l?(d.value!==m&&(h=m),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(m),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(I.delete(i),i.stop(!0))}return I.size?T?T():E(e):M=!1,M};function B(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return B({range:e,output:t,extrapolate:n});if(k&&"string"==typeof e.output[0])return k(e);var r=e,o=r.output,c=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=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,c);return function(e,t,n,r,o,c,i,a,u){var s=u?u(e):e;if(s<t){if("identity"===i)return s;"clamp"===i&&(s=t)}if(s>n){if("identity"===a)return s;"clamp"===a&&(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=c(s),r===-1/0?s=-s:o===1/0?s+=r:s=s*(o-r)+r;return s}(e,c[t],c[t+1],o[t],o[t+1],u,i,a,r.map)}}var V=function(e){function t(n,r,o,c){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=B(r,o,c),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=B(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var q=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 V(this,e,t,n)},t}(g),z=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new q(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 V(this,e,t)},t}(y),H=0,W=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=H++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,i=t.to,a=c(t,["delay","to"]);if(l.arr(i)||l.fun(i))this.queue.push(o({},a,{delay:r,to:i}));else if(i){var u={};Object.entries(i).forEach((function(e){var t,n=e[0],c=e[1],i=o({to:(t={},t[n]=c,t),delay:b(r,n)},a),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(a),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,c=e.to,i=void 0===c?{}:c;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 a=t.delay,u=c(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);a?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),a):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,I.has(t)||I.add(t),M||(M=!0,E(T||L));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,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,c(e,["delay"])),i=this.local,a=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,c=o({},r,m(r.to[t]));l.arr(c.config)&&(c.config=c.config[t]),a=a.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(c).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;a=a.then((function(){return r.to((function(e){var t=o({},r,m(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}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,c=void 0===r?{}:r,i=n.to,a=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,m=n.attach,h=n.reset,g=n.immediate;if(f){var y=[a,c];c=y[0],a=y[1]}this.merged=o({},c,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],a=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!v[i],m=l.arr(i),y=!u&&!m&&!f,j=l.und(c[r])?i:c[r],w=u||m||f?i:1,E=b(s,r);O&&(w=O.animations[r].parent);var _,x=a.parent,P=a.interpolation,S=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var T,N=P&&P.getValue(),A=!l.und(x)&&a.animatedValues.some((function(e){return!e.done})),F=!l.equ(C,N),D=!l.equ(C,a.previous),M=!l.equ(E,a.config);if(h||D&&F||M){var I;if(u||f)x=P=a.parent||new q(j);else if(m)x=P=a.parent||new z(j);else if(y){var L=a.interpolation&&a.interpolation.calc(a.parent.value);L=void 0===L||h?j:L,a.parent?(x=a.parent).setValue(0,!1):x=new q(0);var B={output:[L,i]};a.interpolation?(P=a.interpolation,a.interpolation.updateConfig(B)):P=x.interpolate(B)}return S=d(O?w.getPayload():w),_=d(x.getPayload()),h&&!y&&x.setValue(j,!1),t.hasChanged=!0,_.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()})),b(g,r)&&x.setValue(y?w:i,!1),o({},e,((I={})[r]=o({},a,{name:r,parent:x,interpolation:P,animatedValues:_,toValues:S,previous:C,config:E,fromValues:d(x.getValue()),immediate:b(g,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}),I))}return F?e:(y&&(x.setValue(1,!1),P.updateConfig({output:[C,C]})),x.done=!0,t.hasChanged=!0,o({},e,((T={})[r]=o({},e[r],{previous:C}),T)))}),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}(),U=function(e,t){var n=i.useRef(!1),r=i.useRef(),o=l.fun(t),c=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 c=new W,i=o?b(t,r,c):t[r];return 0===r&&(n=i.ref),c.update(i),n||c.start(),c})),n]}),[e]),a=c[0],u=c[1];r.current=a;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?b(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},G=0,K=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=c(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:K(t,r)},i)};function Y(e,t){var n=function(){if(o){if(c>=r.length)return"break";i=r[c++]}else{if((c=r.next()).done)return"break";i=c.value}var n=i.key,a=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},r=e.current.deleted,o=Array.isArray(r),c=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 g||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),J={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},Z="[-+]?\\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(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([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})$/,ae=/^#([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,c=ue(o,r,e+1/3),i=ue(o,r,e),a=ue(o,r,e-1/3);return Math.round(255*c)<<24|Math.round(255*i)<<16|Math.round(255*a)<<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 be(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:J.hasOwnProperty(t)?J[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=ae.exec(t))?parseInt(n[1],16)>>>0:(n=ce.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 me=/[+\-]?(?: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,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={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||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).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}),ge);var je={};A((function(e){return new $(e)})),S("div"),x((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ve,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return B(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(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(J),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,a=c(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 a){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,a[p])}}),(function(e){return e}));var we,ke,Ee=(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 D(e,(function(){var e=!1;p.current&&(e=h.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 N(p,u,r)})),d(t);var b,m=s.current.getValue(),v=(m.scrollTop,m.scrollLeft,c(m,["scrollTop","scrollLeft"])),g=(b=e,!l.fun(b)||b.prototype instanceof a.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 a.createElement(e,o({},v,{ref:g}))}))},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=L,t.animated=_e,t.a=_e,t.interpolate=function(e,t,n){return e&&new V(e,t,n)},t.Globals=F,t.useSpring=function(e){var t=l.fun(e),n=U(1,t?e:[e]),r=n[0],o=n[1],c=n[2];return t?[r[0],o,c]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),c=b(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:b(c.config,e),attach:e>0&&function(){return a.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=a.current[r];return o({},e,{config:b(e.config||c.config,t),attach:i&&function(){return i}})}))}}),[e,c.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),a=Q(r),u=a.lazy,s=void 0!==u&&u,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),h=a.onRest,v=a.onStart,g=a.ref,y=c(a,["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=c(e,["first","prevProps"]),a=Q(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,h=a.trail,v=void 0===h?0:h,g=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=Q(r),k=w.keys,E=w.items,_=o({},i.current),x=[].concat(i.deleted),P=Object.keys(_),R=new Set(P),S=new Set(s),C=s.filter((function(e){return!R.has(e)})),T=i.transitions.filter((function(e){return!e.destroyed&&!S.has(e.originalKey)})).map((function(e){return e.originalKey})),N=s.filter((function(e){return R.has(e)})),A=-v;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){g&&x.find((function(t){return t.originalKey===e}))&&(x=x.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";_[e]={slot:c,originalKey:e,key:g?String(e):G++,item:o,trail:A+=v,config:b(y,o,c),from:b(n&&void 0!==l?l||{}:f,o),to:b(p,o)}}));break;case"leave":T.forEach((function(e){var t=k.indexOf(e),n=E[t];x.unshift(o({},_[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=v,config:b(y,n,"leave"),to:b(d,n)})),delete _[e]}));break;case"update":N.forEach((function(e){var t=s.indexOf(e),n=u[t];_[e]=o({},_[e],{item:n,slot:"update",trail:A+=v,config:b(y,n,"update"),to:b(m,n)})}))}}var F=s.map((function(e){return _[e]}));return x.forEach((function(e){var t,n=e.left,r=(e.right,c(e,["left","right"]));-1!==(t=F.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),F=[].concat(F.slice(0,t),[r],F.slice(t))})),o({},i,{changed:C.length||T.length||N.length,first:n&&0===C.length,transitions:F,current:_,deleted:x,prevProps:t})}(w.current,r),w.current.changed&&w.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,c=e.config,i=e.trail,a=e.key,u=e.item;w.current.instances.has(a)||w.current.instances.set(a,new W);var l=w.current.instances.get(a),f=o({},y,{to:r,from:n,config:c,ref:g,onRest:function(n){w.current.mounted&&(e.destroyed&&(g||s||Y(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(g||s)&&w.current.deleted.length>0&&Y(w),h&&h(u,t,n))},onStart:v&&function(){return v(u,t)},onFrame:m&&function(e){return m(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 c=e.current;if(c){var i=c.controllers;if(i.length){var a=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),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=U},function(e,t,n){"use strict";var r=n(6),o=n(17),c=n(0),i=n(4),a=n.n(i),u=n(8),s=n(57),l=n.n(s);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 b=n(69);function m(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&&Object(b.a)(e,t)}var h=n(20),v=n.n(h),g=n(14);function y(e,t){return!t||"object"!==v()(t)&&"function"!=typeof t?Object(g.a)(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=n(19),w=n(42),k=n(62),E=n(27),_=n(130),x=n(21);function P(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 R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t,n,r,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},h=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)h="center";else if("left"===n&&b.contentWidth===a)h="left";else if("right"===n&&m.contentWidth===a)h="right";else{var g="left"===(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function C(e,t,n,r,o,c,i){var a=t.height;if(o){var u=(Object(w.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,b=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var m="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var T=n(29);function N(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 o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var A=Object(c.createContext)({focusHistory:[]}),F=A.Provider,D=A.Consumer;F.displayName="FocusReturnProvider",D.displayName="FocusReturnConsumer";c.Component;function M(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 o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var I=Object(E.createHigherOrderComponent)((function e(t){if((r=t)instanceof c.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){m(r,t);var n=M(r);function r(){var e;return f(this,r),(e=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 d(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(T.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(T.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),r}(c.Component);return function(e){return Object(c.createElement)(D,null,(function(n){return Object(c.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function L(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 o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var B=Object(E.createHigherOrderComponent)((function(e){return function(t){m(r,t);var n=L(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(g.a)(e)),e}return d(r,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===k.TAB){var t=w.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(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),r}(c.Component)}),"withConstrainedTabbing");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=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var q=["button","submit"];function z(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 o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var H=Object(E.createHigherOrderComponent)((function(e){return function(t){m(o,t);var n=V(o);function o(){var e;return f(this,o),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(Object(g.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(g.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(g.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(g.a)(e)),e}return d(o,[{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(u.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(u.includes)(q,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(c.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),o}(c.Component)}),"withFocusOutside")(function(e){m(n,e);var t=z(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(c.Component));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=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){m(n,e);var t=W(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(c.Component)}();function G(e){e.stopPropagation()}var K=Object(c.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:G}),n)})),Q=n(48);function Y(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 $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e){var t=Object(c.useContext)(Q.a),n=t.slots[e]||{},r=t.fills[e],o=Object(c.useMemo)((function(){return r||[]}),[r]),i=Object(c.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(c.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return $($({},n),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function Z(e,t,n){return(Z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var X=n(59),ee=n(22),te=n.n(ee);function ne(e){var t=function(e,t){if("object"!==Object(X.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(X.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(X.a)(t)?t:String(t)}function re(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 oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t,n,r,i,a,u,s,l,f,p,d,b,m,h=e.children,v=(t=Object(c.useState)({}),n=Object(j.a)(t,2),r=n[0],i=n[1],a=Object(c.useState)({}),u=Object(j.a)(a,2),s=u[0],l=u[1],f=Object(c.useCallback)((function(e,t,n){i((function(r){var o=r[e]||{};return oe(oe({},r),{},Object(x.a)({},e,oe(oe({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),p=Object(c.useCallback)((function(e,t){i((function(n){var r=n[e],c=Object(o.a)(n,[e].map(ne));return(null==r?void 0:r.ref)===t?c:n}))}),[]),d=Object(c.useCallback)((function(e,t){var n=r[e];if(n&&!te()(n.fillProps,t)){n.fillProps=t;var o=s[e];o&&o.map((function(e){return e.current.rerender()}))}}),[r,s]),b=Object(c.useCallback)((function(e,t){l((function(n){return oe(oe({},n),{},Object(x.a)({},e,[].concat(Object(T.a)(n[e]||[]),[t])))}))}),[]),m=Object(c.useCallback)((function(e,t){l((function(n){return n[e]?oe(oe({},n),{},Object(x.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(c.useMemo)((function(){return{slots:r,fills:s,registerSlot:f,updateSlot:d,unregisterSlot:p,registerFill:b,unregisterFill:m}}),[r,s,f,d,p,b,m]));return Object(c.createElement)(Q.a.Provider,{value:v},h)}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 n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var ae=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),ue=ae.Provider,se=ae.Consumer;c.Component;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=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var fe=function(e){m(n,e);var t=le(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(g.a)(e)),e}return d(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(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:"forceUpdate",value:function(){this.isUnmounted||Z(O(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,a=Object(u.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(n,(function(e,n){if(!e||Object(u.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(c.cloneElement)(e,{key:r})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),n}(c.Component),pe=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(fe,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},de=0;function be(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(ae),n=t.getSlot,r=t.subscribe,o=Object(c.useState)(n(e)),i=Object(j.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(n(e)),r((function(){u(n(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++de),Object(c.useLayoutEffect)((function(){return r(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=n,i&&i.forceUpdate()}),[n]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(n)&&(n=n(i.props.fillProps)),Object(c.createPortal)(n,i.node)):null}var me=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(be,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function he(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(Q.a),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(r.a)({ref:f},s))}function ve(e){var t,n,r=e.name,o=e.children,i=J(r),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),n=Object(j.a)(t,2)[1],function(){return n({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ge(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(he,n):Object(c.createElement)(pe,n)}function ye(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(me,e),Object(c.createElement)(ve,e))}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 je(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){Object(x.a)(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}function we(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=r.split(" "),i=Object(j.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(x.a)(o,"is-from-"+l,"center"!==l),Object(x.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):"loading"===t?a()("components-animate__loading"):void 0}function ke(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:we(je({type:t},r))})}var Ee=B(I((function(e){return e.children})));function _e(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,c=r.paddingBottom,i=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function xe(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Pe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Re(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Se=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,h=(e.range,e.focusOnMount),v=void 0===h?"firstElement":h,g=e.anchorRef,y=e.shouldAnchorIncludePadding,O=e.anchorRect,x=e.getAnchorRect,P=e.expandOnMobile,T=e.animate,N=void 0===T||T,A=e.onClickOutside,F=e.onFocusOutside,D=e.__unstableSticky,M=e.__unstableSlotName,I=void 0===M?"Popover":M,L=e.__unstableObserveElement,B=e.__unstableBoundaryParent,V=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),z=Object(c.useRef)(null),W=Object(c.useRef)(),G=Object(E.useViewportMatch)("medium","<"),Q=Object(c.useState)(),Y=Object(j.a)(Q,2),$=Y[0],Z=Y[1],X=J(I),ee=P&&G,te=Object(E.useResizeObserver)(),ne=Object(j.a)(te,2),re=ne[0],oe=ne[1];p=ee||p,Object(c.useLayoutEffect)((function(){if(ee)return Re(W.current,"is-without-arrow",p),Re(W.current,"is-alternate",d),xe(W.current,"data-x-axis"),xe(W.current,"data-y-axis"),Pe(W.current,"top"),Pe(W.current,"left"),Pe(z.current,"maxHeight"),void Pe(z.current,"maxWidth");var e=function(){if(W.current&&z.current){var e=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&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(w.getRectangleFromRange)(r);if(r instanceof window.Element){var c=r.getBoundingClientRect();return o?c:_e(c,r)}var i=r.top,a=r.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:_e(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:_e(p,f)}}(q,O,x,g,y);if(e){var t,n,r=W.current,o=r.offsetParent,c=r.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}if(B)t=null===(n=W.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=Object(j.a)(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=C(e,t,s,p,r,o,c),b=S(e,t,f,p,r,d.yAxis,i);return R(R({},b),d)}(e,oe.height?oe:z.current.getBoundingClientRect(),m,D,W.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,h=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(Pe(W.current,"top",s+"px"),Pe(W.current,"left",l+"px")),Re(W.current,"is-without-arrow",p||"center"===f&&"middle"===b),Re(W.current,"is-alternate",d),xe(W.current,"data-x-axis",f),xe(W.current,"data-y-axis",b),Pe(z.current,"maxHeight","number"==typeof h?h+"px":""),Pe(z.current,"maxWidth","number"==typeof v?v+"px":"");Z(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),L&&(n=new window.MutationObserver(e)).observe(L,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[ee,O,x,g,y,m,oe,D,L,B]),function(e,t){Object(c.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=w.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(v,z);var ce=function(e){e.keyCode===k.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)};var ie=Object(c.createElement)(H,{onFocusOutside:function(e){if(F)F(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}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else n&&n()}},Object(c.createElement)(ke,{type:N&&$?"appear":null,options:{origin:$}},(function(e){var o=e.className;return Object(c.createElement)(K,Object(r.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},V,{onKeyDown:ce,ref:W}),ee&&Object(c.createElement)(U,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Le,{className:"components-popover__close",icon:_.a,onClick:n})),Object(c.createElement)("div",{ref:z,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},re,u)))})));return v&&(ie=Object(c.createElement)(Ee,null,ie)),X.ref&&(ie=Object(c.createElement)(ye,{name:I},ie)),g||O?ie:Object(c.createElement)("span",{ref:q},ie)};Se.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(ge,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Ce=Se;var Te=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(u.isString)(r)&&(t=r),Object(u.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":n},t)):null};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 n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var Ae=function(e){m(n,e);var t=Ne(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return d(n,[{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===c.Children.count(n)){var r=c.Children.only(n);"function"==typeof r.props[e]&&r.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 o=Object(u.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{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,r=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.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(c.concatChildren)(i.props.children,a&&Object(c.createElement)(Ce,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(Te,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),n}(c.Component),Fe=n(86);function De(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw c}}}}function Me(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}var Ie=["onMouseDown","onClick"];var Le=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,w=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,_=e.shortcut,x=e.label,P=e.children,R=e.__experimentalIsFocusable,S=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!j&&!!P,"has-icon":!!j}),T=O&&!R,N=void 0===n||T?"button":"a",A="a"===N?{href:n,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(O&&R){A["aria-disabled"]=!0;var F,D=De(Ie);try{for(D.s();!(F=D.n()).done;){S[F.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){D.e(e)}finally{D.f()}}var M=!T&&(k&&x||_||!!x&&(!P||Object(u.isArray)(P)&&!P.length)&&!1!==k),I=Object(c.createElement)(N,Object(r.a)({},A,S,{className:C,"aria-label":S["aria-label"]||x,ref:t}),j&&Object(c.createElement)(Fe.a,{icon:j,size:w}),P);return M?Object(c.createElement)(Ae,{text:x,shortcut:_,position:E},I):I}))},function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(21),o=n(6),c=n(17),i=n(0),a=n(28);var u=function(e){var t=e.icon,n=e.className,r=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},r))};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){Object(r.a)(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}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(u,Object(o.a)({icon:n},s));if(n&&u===n.type)return Object(i.cloneElement)(n,l({},s));var f=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,l({size:f},s)):n(l({size:f},s));if(n&&("svg"===n.type||n.type===a.SVG)){var p=l(l({width:f,height:f},n.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,l({size:f},s)):n}},function(e,t){!function(){e.exports=this.wp.autop}()},,function(e,t){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new b(e,t)),1!==s.length||l||a(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(36),u=n(1),s=(n(66),n(80));t.a=Object(r.forwardRef)((function(t,n){var c=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,b=void 0===d?"polite":d,m=t.actions,h=void 0===m?[]:m,v=t.onRemove,g=void 0===v?o.noop:v;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(a.speak)(n,t)}),[n,t])}(p,b),Object(r.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=i()(c,"components-snackbar");return h&&h.length>1&&(void 0!==e&&e.env,h=[h[0]]),Object(r.createElement)("div",{ref:n,className:y,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(u.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},l,h.map((function(e,t){var n=e.label,o=e.onClick,c=e.url;return Object(r.createElement)(s.a,{key:t,href:c,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(89))},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),o=n.n(r),c=function(e){return e.reduce((function(e,t){var n=o()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(9),o=n.n(r),c=n(15),i=n(12),a=n(0),u=n(22),s=n.n(u),l=n(54),f=n(107),p=n(61),d=function(e){var t=Object(p.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},b=function(e,t,n){var r=Object(p.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(n,e,t)}),[n,e,u])]},m=function(e,t){var n=Object(p.a)(),r=d(t=t||n),c=o()(r,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(f.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),v.current=!0)}),[b,m,h,u]),v.current?[i,u]:[e,u]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(9),o=n.n(r),c=n(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return u}));var r=n(5),o=n(76),c=n(70),i=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,o=void 0===r?"":r,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:n.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,n=void 0===t?"":t;return Object(c.isEmail)(n)?n.trim():""},u=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(r,e)&&(c[r]="")})),c}},,,,,,,,,function(e,t){!function(){e.exports=this.wp.wordcount}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,,,function(e,t,n){"use strict";var r=n(6),o=n(0),c=n(8);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(c.upperFirst)(Object(c.camelCase)(t)),"(").concat(i,")"),r}},a=new WeakMap;function u(e,t){return Object(o.useMemo)((function(){var n=function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(n):n}),[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";var r=n(10),o=n.n(r),c=n(32),i=n.n(c),a=n(33),u=n.n(a),s=n(23),l=n.n(s),f=n(34),p=n.n(f),d=n(35),b=n.n(d),m=n(25),h=n.n(m),v=n(7),g=n.n(v),y=n(2);n(140);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 b()(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),g()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),g()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),g()(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(React.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,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),o=n.n(r),c=n(7),i=n.n(c),a=n(0),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){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=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},d=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,i=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(f.join(","));d(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),p({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},function(e,t){},function(e,t,n){var r=n(64);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"b",(function(){return A})),n.d(t,"a",(function(){return F}));var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=(n(3),n(0)),u=n(12),s=n(56),l=n(46),f=n(10),p=n.n(f),d=n(4),b=n.n(d),m=n(168),h=(n(120),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""}),v=function(e){var t=e.className,n=e.notices,r=e.removeNotice,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,p()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice","woocommerce-message",h(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))},g=n(6),y=n(26),O=n.n(y);function j(e,t,n,r,o,c,i){try{var a=e[c](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function i(e){j(c,r,o,i,a,"next",e)}function a(e){j(c,r,o,i,a,"throw",e)}i(void 0)}))}}var k=n(19),E=n(8),_=n(79),x=n(27),P=n(90);var R=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?E.noop:o,i=Object(x.useReducedMotion)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(k.a)(u,1)[0],l=Object(_.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=w(O.a.mark((function t(n){return O.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=w(O.a.mark((function e(t){return O.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=b()("components-snackbar-list",n);var f=function(e){return function(){return c(e.id)}};return Object(a.createElement)("div",{className:n},r,l.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(a.createElement)(_.animated.div,{key:n,style:r},Object(a.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&s.set(t,e)}},Object(a.createElement)(P.a,Object(g.a)({},Object(E.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},S=function(e){var t=e.className,n=e.notices,r=e.removeNotice;if(e.isEditor)return null;var o=n.filter((function(e){return"snackbar"===e.type})),c=b()(t,"wc-block-components-notices__snackbar");return React.createElement(R,{notices:o,className:c,onRemove:r})};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 T(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 N=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),A=function(){return Object(a.useContext)(N)},F=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),g=i()(h,2),y=g[0],O=g[1],j=Object(s.a)().dispatchStoreEvent,w=Object(l.a)().isEditor,k=Object(a.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]:{};b(e,t,T(T({},n),{},{context:n.context||p})),j("store-notice-create",{status:e,content:t,options:n})}),[b,j,p]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),_=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k("default",e,T(T({},t),{},{type:"snackbar"}))}),[k]),x={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,createSnackbarNotice:_,removeNotice:E,context:p,setIsSuppressed:O},P=y?null:React.createElement(v,{className:r,notices:x.notices,removeNotice:x.removeNotice,isEditor:w}),R=y?null:React.createElement(S,{notices:x.notices,removeNotice:x.removeNotice,isEditor:w});return React.createElement(N.Provider,{value:x},c&&P,t,R)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(12),c=n(0),i=n(54),a=n(95),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 b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,m,h],i=o.getCollectionError.apply(o,c);return i&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,m,d]);return null!==g&&(b.current=g),b.current}},,,,,function(e,t,n){"use strict";var r=n(0),o=n(28),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,,function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(16),i=n.n(c),a=n(0);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,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 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},c)):null}},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(15),c=n(12),i=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(i.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),c=r.isResolving,i=r.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];c("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(3);var r=n(4),o=n.n(r),c=n(11),i=n(112);n(167);t.a=Object(i.a)((function(e){var t=e.className,n=e.instanceId,r=e.defaultValue,i=e.label,a=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(c.Label,{label:i,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:a,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";n.d(t,"a",(function(){return i}));var r=n(37),o=n(0),c=n(13);n.p=c.j,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([n.e(20),n.e(6)]).then(n.bind(null,307))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,317))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,316))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,308))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,309))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,310))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,294))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,311))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,312))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,313))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,314))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,315))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(1),u=n(36),s=n(130),l=n(80);t.a=function(e){var t=e.className,n=e.status,c=void 0===n?"info":n,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,v=void 0===h||h,g=e.actions,y=void 0===g?[]:g,O=e.politeness,j=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,w=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(u.speak)(n,t)}),[n,t])}(d,j);var k=i()(t,"components-notice","is-"+c,{"is-dismissible":v});return w&&(f=Object(r.createElement)(r.RawHTML,null,f)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var n=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,f=e.url;return Object(r.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",n)},o)}))),v&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.components}()},,,,,,,,,,,,,function(e,t,n){e.exports=n(276)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(141),o=n(123),c=n(119),i=n(32),a=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),b=n(25),m=n.n(b),h=n(2),v=(n(3),n(9)),g=n.n(v),y=n(0),O=n(16),j=n.n(O),w=n(7),k=n.n(w),E=n(1),_=n(8),x=n(4),P=n.n(x),R=n(11),S=(n(226),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=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),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.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 b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(R.Label,{screenReaderLabel:Object(E.__)("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 c(t-1)},title:Object(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(R.Label,{label:"<",screenReaderLabel:Object(E.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return c(1)},disabled:1===t},React.createElement(R.Label,{label:1,screenReaderLabel:Object(E.sprintf)(Object(E.__)("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(E.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return c(e)},disabled:t===e},React.createElement(R.Label,{label:e,screenReaderLabel:Object(E.sprintf)(Object(E.__)("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(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(R.Label,{label:i,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t+1)},title:Object(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(R.Label,{label:">",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});S.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=S,T=n(107),N=n(94),A=n(125),F=n(15),D=n(12),M=n(54);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 L(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){k()(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 B=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(A.a)(L(L({},t),{},{query:e})),r=n.results,o=n.isLoading,c=function(e,t){var n=t.namespace,r=t.resourceName,o=t.resourceValues,c=void 0===o?[]:o,i=t.query,a=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(M.a)(a),s=Object(M.a)(c),l=Object(D.useSelect)((function(t){var o=t(F.COLLECTIONS_STORE_KEY),c=[e,n,r,u,s];return{value:o.getCollectionHeader.apply(o,c),isLoading:o.hasFinishedResolution("getCollectionHeader",c)}}),[e,n,r,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}("x-wp-total",L(L({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},V=n(56),q=n(115),z=n(81),H=n(36),W=n(139),U=n(28),G=React.createElement(U.SVG,{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"})),K=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(W.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Q=React.createElement(U.SVG,{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"})),Y=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(W.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:Q,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},$=n(147),J=(n(225),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement($.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(E.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(E.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(E.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(E.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(E.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(E.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(E.__)("Order products by","woo-gutenberg-products-block"),value:o})}),Z=n(112),X=n(10),ee=n.n(X),te=n(157),ne=Object(Z.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=P()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var c=Object(te.a)(t);return r.map((function(r,i){var a=g()(r,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=c[u];if(!p)return null;var d=n.id||0,b=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,ee()({},l,{children:f,product:n})))}))}}(a,t,o,r))}));n(224);function re(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 oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ce=function(e){var t=e.totalQuery,n=e.totalProducts,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.totalQuery;return!Object(_.isEqual)(t,o)&&Number.isFinite(n)},ie=Object(q.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=e.hideOutOfStockItems,u=void 0!==a&&a,s=Object(N.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=e.hideOutOfStockItems,c=r.columns,i=r.rows;return oe(oe({},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*i,page:n},o&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:c,currentPage:n,hideOutOfStockItems:u})),l=g()(s,1)[0],f=B(l),p=f.products,d=f.totalProducts,b=f.productsLoading,m=Object(z.useInnerBlockLayoutContext)(),h=m.parentClassName,v=m.parentName,O=function(e){e.order,e.orderby,e.page,e.per_page;return j()(e,["order","orderby","page","per_page"])||{}}(l),w=Object(V.a)().dispatchStoreEvent,k=Object(N.b)("attributes",[]),x=g()(k,2),R=x[0],S=x[1],A=Object(N.b)("min_price"),F=g()(A,2),D=F[0],M=F[1],I=Object(N.b)("max_price"),L=g()(I,2),q=L[0],W=L[1],U=Object(T.a)({totalQuery:O,totalProducts:d},ce);Object(y.useEffect)((function(){w("product-list-render",{products:p,listName:v})}),[p,v,w]),Object(y.useEffect)((function(){Object(_.isEqual)(O,null==U?void 0:U.totalQuery)||(r(1),null!=U&&U.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(H.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(H.speak)(Object(E.sprintf)(Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[null==U?void 0:U.totalQuery,d,r,O]);var G,Q,$,Z,X,ee=t.contentVisibility,te=t.columns*t.rows,re=!Number.isFinite(d)&&Number.isFinite(null==U?void 0:U.totalProducts)&&Object(_.isEqual)(O,null==U?void 0:U.totalQuery)?Math.ceil(U.totalProducts/te):Math.ceil(d/te),ie=p.length?p:Array.from({length:te}),ae=0!==p.length||b,ue=R.length>0||Number.isFinite(D)||Number.isFinite(q);return React.createElement("div",{className:(G=t.columns,Q=t.rows,$=t.alignButtons,Z=t.align,X=void 0!==Z?"align"+Z:"",P()(h,X,"has-"+G+"-columns",{"has-multiple-rows":Q>1,"has-aligned-buttons":$}))},ee.orderBy&&ae&&React.createElement(J,{onChange:o,value:c}),!ae&&ue&&React.createElement(Y,{resetCallback:function(){S([]),M(null),W(null)}}),!ae&&!ue&&React.createElement(K,null),ae&&React.createElement("ul",{className:"".concat(h,"__products")},ie.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return React.createElement(ne,{key:e.id||n,attributes:t,product:e})}))),re>1&&React.createElement(C,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:re}))})),ae=function(e){var t=e.attributes,n=e.hideOutOfStockItems,r=void 0!==n&&n,o=Object(y.useState)(1),c=g()(o,2),i=c[0],a=c[1],u=Object(y.useState)(t.orderby),s=g()(u,2),l=s[0],f=s[1];Object(y.useEffect)((function(){f(t.orderby)}),[t.orderby]);return React.createElement(ie,{attributes:t,hideOutOfStockItems:r,currentPage:i,onPageChange:function(e){a(e)},onSortChange:function(e){var t=e.target.value;f(t),a(1)},sortValue:l})},ue=n(13),se=React.createElement("img",{src:ue.i+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}}),le=n(5);function fe(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 d()(this,n)}}var pe=function(e){f()(n,e);var t=fe(n);function n(){return a()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.urlParameterSuffix;if(t.isPreview)return se;var r=Object(le.getSetting)("hideOutOfStockItems",!1);return React.createElement(z.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ae,{attributes:t,urlParameterSuffix:n,hideOutOfStockItems:r}))}}]),n}(h.Component);Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:Object(r.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(pe,e))})),getProps:function(e){return{attributes:JSON.parse(e.dataset.attributes)}}})}]);
|
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 c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===c)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}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){!function(){e.exports=this.wc.wcSettings}()},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){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(83),o=n(84),c=n(67),i=n(85);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";n.d(t,"k",(function(){return c})),n.d(t,"i",(function(){return i})),n.d(t,"j",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return f})),n.d(t,"d",(function(){return p})),n.d(t,"h",(function(){return d})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return h})),n.d(t,"l",(function(){return v}));var r,o=n(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,d=o.STORE_PAGES.terms.permalink,b=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),v=(n(41),function(){return u>1})},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,n){var r=n(71);e.exports=function(e,t){if(null==e)return{};var n,o,c=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)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(24);function o(e,t){if(null==e)return{};var n,o,c=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)&&(c[n]=e[n])}return c}},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}}(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){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},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){!function(){e.exports=this.wp.isShallowEqual}()},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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(58);var o=n(65);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])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){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(64);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)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20).default,o=n(23);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(9),o=n.n(r),c=n(7),i=n.n(c),a=n(8),u=n(0),s=n(15),l=n(12),f=n(18),p=n(94),d=n(97),b=n(46);function m(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 h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},g=h(h({},v),{},{email:"",phone:""}),y=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),n=t[0],r=t[1];return[n,Object(f.decodeEntities)(r)]})))},O={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:g,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),n=t.isEditor,r=t.previewData,o=(null==r?void 0:r.previewCart)||{},c=e.shouldSelect,i=Object(u.useRef)(),f=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!c)return O;if(n)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:[],cartTotals:o.totals,cartIsLoading:!1,cartErrors:[],billingAddress:g,shippingAddress:v,extensions:{},shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=r(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),h=a.needsShipping?y(a.shippingAddress):m,j=a.fees.map((function(e){return y(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},,function(e,t){!function(){e.exports=this.wc.priceFormat}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.dom}()},,function(e,t,n){"use strict";var r=n(32),o=n.n(r),c=n(33),i=n.n(c),a=n(23),u=n.n(a),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(25),b=n.n(d),m=n(7),h=n.n(m),v=(n(3),n(2)),g=n(1),y=n(13),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.i,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("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),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a)))};n(75);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 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,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),h()(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,c=e.errorMessagePrefix,i=e.renderError,a=this.state,u=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:u}):React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(v.Component);w.defaultProps={showErrorMessage:!0};t.a=w},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(12),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(r.useContext)(o)}},,function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(66),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(90))},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(22),c=n.n(o);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(7),o=n.n(r),c=n(78),i=n(0),a=n(38);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(){var e=Object(a.a)();return{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),s(s({},n),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},function(e,t){!function(){e.exports=this.wp.deprecated}()},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,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){!function(){e.exports=this.wp.apiFetch}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=Object(r.createContext)("page"),c=function(){return Object(r.useContext)(o)};o.Provider},function(e,t){!function(){e.exports=this.wp.keycodes}()},,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(58);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){!function(){e.exports=this.wp.warning}()},function(e,t,n){var r=n(68);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}},e.exports.default=e.exports,e.exports.__esModule=!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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(74);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=n(5),u=n(1);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){o()(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=Object(a.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(Object(u.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(f).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,p(r)]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==d[n]?d[n]:{};return e.map((function(e){var n=a.defaultAddressFields[e]||{},o=r[e]||{},c=t[e]||{};return l(l(l({key:e},n),o),c)})).sort((function(e,t){return e.index-t.index}))}},,function(e,t){!function(){e.exports=this.wp.hooks}()},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(10)),c=r(n(71)),i=n(2),a=r(i),u=r(n(121)),s=r(n(23)),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 b(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 m(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,c(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 c;return l.und(t[r])?o({},n,((c={})[r]=e[r],c)):n}),{});return o({to:t},n)}var h,v,g=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 g&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}return u(t,e),t}(g),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 g&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&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 g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function j(e,t){h={fn:e,transform:t}}function w(e){v=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},_=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function x(e){k=e}var P,R=function(){return Date.now()};function S(e){P=e}var C,T,N=function(e){return e.current};function A(e){C=e}var F=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return v},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return _},injectFrame:function(e,t){E=e,_=t},get interpolation(){return k},injectStringInterpolator:x,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return P},injectDefaultElement:S,get animatedApi(){return N},injectAnimatedApi:function(e){N=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return T},injectManualFrameloop:function(e){T=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:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),M=!1,I=new Set,L=function e(){if(!M)return!1;var t=R(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var c;if(r){if(o>=n.length)break;c=n[o++]}else{if((o=n.next()).done)break;c=o.value}for(var i=c,a=!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 b=s.fromValues[p],m=s.toValues[p],h=d.lastPosition,v=m instanceof g,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(v&&(m=m.getValue()),s.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==s.duration)h=b+s.easing((t-d.startTime)/s.duration)*(m-b),l=t>=d.startTime+s.duration;else if(s.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(m=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-m)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(b<m?h>m:h<m),k=Math.abs(y)<=s.precision,_=0===s.tension||Math.abs(m-h)<=s.precision;l=w||k&&_,d.lastVelocity=y,d.lastTime=t}v&&!s.toValues[p].done&&(l=!1),l?(d.value!==m&&(h=m),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(m),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(I.delete(i),i.stop(!0))}return I.size?T?T():E(e):M=!1,M};function B(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return B({range:e,output:t,extrapolate:n});if(k&&"string"==typeof e.output[0])return k(e);var r=e,o=r.output,c=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=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,c);return function(e,t,n,r,o,c,i,a,u){var s=u?u(e):e;if(s<t){if("identity"===i)return s;"clamp"===i&&(s=t)}if(s>n){if("identity"===a)return s;"clamp"===a&&(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=c(s),r===-1/0?s=-s:o===1/0?s+=r:s=s*(o-r)+r;return s}(e,c[t],c[t+1],o[t],o[t+1],u,i,a,r.map)}}var V=function(e){function t(n,r,o,c){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=B(r,o,c),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=B(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var q=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 V(this,e,t,n)},t}(g),z=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new q(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 V(this,e,t)},t}(y),H=0,W=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=H++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,i=t.to,a=c(t,["delay","to"]);if(l.arr(i)||l.fun(i))this.queue.push(o({},a,{delay:r,to:i}));else if(i){var u={};Object.entries(i).forEach((function(e){var t,n=e[0],c=e[1],i=o({to:(t={},t[n]=c,t),delay:b(r,n)},a),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(a),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,c=e.to,i=void 0===c?{}:c;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 a=t.delay,u=c(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);a?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),a):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,I.has(t)||I.add(t),M||(M=!0,E(T||L));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,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,c(e,["delay"])),i=this.local,a=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,c=o({},r,m(r.to[t]));l.arr(c.config)&&(c.config=c.config[t]),a=a.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(c).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;a=a.then((function(){return r.to((function(e){var t=o({},r,m(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}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,c=void 0===r?{}:r,i=n.to,a=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,m=n.attach,h=n.reset,g=n.immediate;if(f){var y=[a,c];c=y[0],a=y[1]}this.merged=o({},c,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],a=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!v[i],m=l.arr(i),y=!u&&!m&&!f,j=l.und(c[r])?i:c[r],w=u||m||f?i:1,E=b(s,r);O&&(w=O.animations[r].parent);var _,x=a.parent,P=a.interpolation,S=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var T,N=P&&P.getValue(),A=!l.und(x)&&a.animatedValues.some((function(e){return!e.done})),F=!l.equ(C,N),D=!l.equ(C,a.previous),M=!l.equ(E,a.config);if(h||D&&F||M){var I;if(u||f)x=P=a.parent||new q(j);else if(m)x=P=a.parent||new z(j);else if(y){var L=a.interpolation&&a.interpolation.calc(a.parent.value);L=void 0===L||h?j:L,a.parent?(x=a.parent).setValue(0,!1):x=new q(0);var B={output:[L,i]};a.interpolation?(P=a.interpolation,a.interpolation.updateConfig(B)):P=x.interpolate(B)}return S=d(O?w.getPayload():w),_=d(x.getPayload()),h&&!y&&x.setValue(j,!1),t.hasChanged=!0,_.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()})),b(g,r)&&x.setValue(y?w:i,!1),o({},e,((I={})[r]=o({},a,{name:r,parent:x,interpolation:P,animatedValues:_,toValues:S,previous:C,config:E,fromValues:d(x.getValue()),immediate:b(g,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}),I))}return F?e:(y&&(x.setValue(1,!1),P.updateConfig({output:[C,C]})),x.done=!0,t.hasChanged=!0,o({},e,((T={})[r]=o({},e[r],{previous:C}),T)))}),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}(),U=function(e,t){var n=i.useRef(!1),r=i.useRef(),o=l.fun(t),c=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 c=new W,i=o?b(t,r,c):t[r];return 0===r&&(n=i.ref),c.update(i),n||c.start(),c})),n]}),[e]),a=c[0],u=c[1];r.current=a;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?b(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},G=0,K=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=c(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:K(t,r)},i)};function Y(e,t){var n=function(){if(o){if(c>=r.length)return"break";i=r[c++]}else{if((c=r.next()).done)return"break";i=c.value}var n=i.key,a=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},r=e.current.deleted,o=Array.isArray(r),c=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 g||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),J={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},Z="[-+]?\\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(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([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})$/,ae=/^#([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,c=ue(o,r,e+1/3),i=ue(o,r,e),a=ue(o,r,e-1/3);return Math.round(255*c)<<24|Math.round(255*i)<<16|Math.round(255*a)<<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 be(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:J.hasOwnProperty(t)?J[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=ae.exec(t))?parseInt(n[1],16)>>>0:(n=ce.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 me=/[+\-]?(?: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,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={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||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).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}),ge);var je={};A((function(e){return new $(e)})),S("div"),x((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ve,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return B(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(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(J),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,a=c(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 a){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,a[p])}}),(function(e){return e}));var we,ke,Ee=(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 D(e,(function(){var e=!1;p.current&&(e=h.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 N(p,u,r)})),d(t);var b,m=s.current.getValue(),v=(m.scrollTop,m.scrollLeft,c(m,["scrollTop","scrollLeft"])),g=(b=e,!l.fun(b)||b.prototype instanceof a.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 a.createElement(e,o({},v,{ref:g}))}))},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=L,t.animated=_e,t.a=_e,t.interpolate=function(e,t,n){return e&&new V(e,t,n)},t.Globals=F,t.useSpring=function(e){var t=l.fun(e),n=U(1,t?e:[e]),r=n[0],o=n[1],c=n[2];return t?[r[0],o,c]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),c=b(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:b(c.config,e),attach:e>0&&function(){return a.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=a.current[r];return o({},e,{config:b(e.config||c.config,t),attach:i&&function(){return i}})}))}}),[e,c.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),a=Q(r),u=a.lazy,s=void 0!==u&&u,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),h=a.onRest,v=a.onStart,g=a.ref,y=c(a,["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=c(e,["first","prevProps"]),a=Q(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,h=a.trail,v=void 0===h?0:h,g=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=Q(r),k=w.keys,E=w.items,_=o({},i.current),x=[].concat(i.deleted),P=Object.keys(_),R=new Set(P),S=new Set(s),C=s.filter((function(e){return!R.has(e)})),T=i.transitions.filter((function(e){return!e.destroyed&&!S.has(e.originalKey)})).map((function(e){return e.originalKey})),N=s.filter((function(e){return R.has(e)})),A=-v;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){g&&x.find((function(t){return t.originalKey===e}))&&(x=x.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";_[e]={slot:c,originalKey:e,key:g?String(e):G++,item:o,trail:A+=v,config:b(y,o,c),from:b(n&&void 0!==l?l||{}:f,o),to:b(p,o)}}));break;case"leave":T.forEach((function(e){var t=k.indexOf(e),n=E[t];x.unshift(o({},_[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=v,config:b(y,n,"leave"),to:b(d,n)})),delete _[e]}));break;case"update":N.forEach((function(e){var t=s.indexOf(e),n=u[t];_[e]=o({},_[e],{item:n,slot:"update",trail:A+=v,config:b(y,n,"update"),to:b(m,n)})}))}}var F=s.map((function(e){return _[e]}));return x.forEach((function(e){var t,n=e.left,r=(e.right,c(e,["left","right"]));-1!==(t=F.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),F=[].concat(F.slice(0,t),[r],F.slice(t))})),o({},i,{changed:C.length||T.length||N.length,first:n&&0===C.length,transitions:F,current:_,deleted:x,prevProps:t})}(w.current,r),w.current.changed&&w.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,c=e.config,i=e.trail,a=e.key,u=e.item;w.current.instances.has(a)||w.current.instances.set(a,new W);var l=w.current.instances.get(a),f=o({},y,{to:r,from:n,config:c,ref:g,onRest:function(n){w.current.mounted&&(e.destroyed&&(g||s||Y(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(g||s)&&w.current.deleted.length>0&&Y(w),h&&h(u,t,n))},onStart:v&&function(){return v(u,t)},onFrame:m&&function(e){return m(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 c=e.current;if(c){var i=c.controllers;if(i.length){var a=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),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=U},function(e,t,n){"use strict";var r=n(6),o=n(17),c=n(0),i=n(4),a=n.n(i),u=n(8),s=n(57),l=n.n(s);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 b=n(69);function m(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&&Object(b.a)(e,t)}var h=n(20),v=n.n(h),g=n(14);function y(e,t){return!t||"object"!==v()(t)&&"function"!=typeof t?Object(g.a)(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=n(19),w=n(42),k=n(62),E=n(27),_=n(130),x=n(21);function P(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 R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t,n,r,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},h=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)h="center";else if("left"===n&&b.contentWidth===a)h="left";else if("right"===n&&m.contentWidth===a)h="right";else{var g="left"===(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function C(e,t,n,r,o,c,i){var a=t.height;if(o){var u=(Object(w.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,b=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var m="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var T=n(29);function N(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 o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var A=Object(c.createContext)({focusHistory:[]}),F=A.Provider,D=A.Consumer;F.displayName="FocusReturnProvider",D.displayName="FocusReturnConsumer";c.Component;function M(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 o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var I=Object(E.createHigherOrderComponent)((function e(t){if((r=t)instanceof c.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){m(r,t);var n=M(r);function r(){var e;return f(this,r),(e=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 d(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(T.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(T.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),r}(c.Component);return function(e){return Object(c.createElement)(D,null,(function(n){return Object(c.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function L(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 o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var B=Object(E.createHigherOrderComponent)((function(e){return function(t){m(r,t);var n=L(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(g.a)(e)),e}return d(r,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===k.TAB){var t=w.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(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),r}(c.Component)}),"withConstrainedTabbing");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=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var q=["button","submit"];function z(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 o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var H=Object(E.createHigherOrderComponent)((function(e){return function(t){m(o,t);var n=V(o);function o(){var e;return f(this,o),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(Object(g.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(g.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(g.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(g.a)(e)),e}return d(o,[{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(u.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(u.includes)(q,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(c.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),o}(c.Component)}),"withFocusOutside")(function(e){m(n,e);var t=z(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(c.Component));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=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){m(n,e);var t=W(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(c.Component)}();function G(e){e.stopPropagation()}var K=Object(c.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:G}),n)})),Q=n(48);function Y(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 $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e){var t=Object(c.useContext)(Q.a),n=t.slots[e]||{},r=t.fills[e],o=Object(c.useMemo)((function(){return r||[]}),[r]),i=Object(c.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(c.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return $($({},n),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function Z(e,t,n){return(Z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var X=n(59),ee=n(22),te=n.n(ee);function ne(e){var t=function(e,t){if("object"!==Object(X.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(X.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(X.a)(t)?t:String(t)}function re(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 oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t,n,r,i,a,u,s,l,f,p,d,b,m,h=e.children,v=(t=Object(c.useState)({}),n=Object(j.a)(t,2),r=n[0],i=n[1],a=Object(c.useState)({}),u=Object(j.a)(a,2),s=u[0],l=u[1],f=Object(c.useCallback)((function(e,t,n){i((function(r){var o=r[e]||{};return oe(oe({},r),{},Object(x.a)({},e,oe(oe({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),p=Object(c.useCallback)((function(e,t){i((function(n){var r=n[e],c=Object(o.a)(n,[e].map(ne));return(null==r?void 0:r.ref)===t?c:n}))}),[]),d=Object(c.useCallback)((function(e,t){var n=r[e];if(n&&!te()(n.fillProps,t)){n.fillProps=t;var o=s[e];o&&o.map((function(e){return e.current.rerender()}))}}),[r,s]),b=Object(c.useCallback)((function(e,t){l((function(n){return oe(oe({},n),{},Object(x.a)({},e,[].concat(Object(T.a)(n[e]||[]),[t])))}))}),[]),m=Object(c.useCallback)((function(e,t){l((function(n){return n[e]?oe(oe({},n),{},Object(x.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(c.useMemo)((function(){return{slots:r,fills:s,registerSlot:f,updateSlot:d,unregisterSlot:p,registerFill:b,unregisterFill:m}}),[r,s,f,d,p,b,m]));return Object(c.createElement)(Q.a.Provider,{value:v},h)}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 n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var ae=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),ue=ae.Provider,se=ae.Consumer;c.Component;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=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var fe=function(e){m(n,e);var t=le(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(g.a)(e)),e}return d(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(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:"forceUpdate",value:function(){this.isUnmounted||Z(O(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,a=Object(u.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(n,(function(e,n){if(!e||Object(u.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(c.cloneElement)(e,{key:r})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),n}(c.Component),pe=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(fe,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},de=0;function be(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(ae),n=t.getSlot,r=t.subscribe,o=Object(c.useState)(n(e)),i=Object(j.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(n(e)),r((function(){u(n(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++de),Object(c.useLayoutEffect)((function(){return r(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=n,i&&i.forceUpdate()}),[n]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(n)&&(n=n(i.props.fillProps)),Object(c.createPortal)(n,i.node)):null}var me=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(be,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function he(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(Q.a),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(r.a)({ref:f},s))}function ve(e){var t,n,r=e.name,o=e.children,i=J(r),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),n=Object(j.a)(t,2)[1],function(){return n({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ge(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(he,n):Object(c.createElement)(pe,n)}function ye(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(me,e),Object(c.createElement)(ve,e))}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 je(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){Object(x.a)(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}function we(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=r.split(" "),i=Object(j.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(x.a)(o,"is-from-"+l,"center"!==l),Object(x.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):"loading"===t?a()("components-animate__loading"):void 0}function ke(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:we(je({type:t},r))})}var Ee=B(I((function(e){return e.children})));function _e(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,c=r.paddingBottom,i=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function xe(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Pe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Re(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Se=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,h=(e.range,e.focusOnMount),v=void 0===h?"firstElement":h,g=e.anchorRef,y=e.shouldAnchorIncludePadding,O=e.anchorRect,x=e.getAnchorRect,P=e.expandOnMobile,T=e.animate,N=void 0===T||T,A=e.onClickOutside,F=e.onFocusOutside,D=e.__unstableSticky,M=e.__unstableSlotName,I=void 0===M?"Popover":M,L=e.__unstableObserveElement,B=e.__unstableBoundaryParent,V=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),z=Object(c.useRef)(null),W=Object(c.useRef)(),G=Object(E.useViewportMatch)("medium","<"),Q=Object(c.useState)(),Y=Object(j.a)(Q,2),$=Y[0],Z=Y[1],X=J(I),ee=P&&G,te=Object(E.useResizeObserver)(),ne=Object(j.a)(te,2),re=ne[0],oe=ne[1];p=ee||p,Object(c.useLayoutEffect)((function(){if(ee)return Re(W.current,"is-without-arrow",p),Re(W.current,"is-alternate",d),xe(W.current,"data-x-axis"),xe(W.current,"data-y-axis"),Pe(W.current,"top"),Pe(W.current,"left"),Pe(z.current,"maxHeight"),void Pe(z.current,"maxWidth");var e=function(){if(W.current&&z.current){var e=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&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(w.getRectangleFromRange)(r);if(r instanceof window.Element){var c=r.getBoundingClientRect();return o?c:_e(c,r)}var i=r.top,a=r.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:_e(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:_e(p,f)}}(q,O,x,g,y);if(e){var t,n,r=W.current,o=r.offsetParent,c=r.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}if(B)t=null===(n=W.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=Object(j.a)(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=C(e,t,s,p,r,o,c),b=S(e,t,f,p,r,d.yAxis,i);return R(R({},b),d)}(e,oe.height?oe:z.current.getBoundingClientRect(),m,D,W.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,h=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(Pe(W.current,"top",s+"px"),Pe(W.current,"left",l+"px")),Re(W.current,"is-without-arrow",p||"center"===f&&"middle"===b),Re(W.current,"is-alternate",d),xe(W.current,"data-x-axis",f),xe(W.current,"data-y-axis",b),Pe(z.current,"maxHeight","number"==typeof h?h+"px":""),Pe(z.current,"maxWidth","number"==typeof v?v+"px":"");Z(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),L&&(n=new window.MutationObserver(e)).observe(L,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[ee,O,x,g,y,m,oe,D,L,B]),function(e,t){Object(c.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=w.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(v,z);var ce=function(e){e.keyCode===k.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)};var ie=Object(c.createElement)(H,{onFocusOutside:function(e){if(F)F(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}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else n&&n()}},Object(c.createElement)(ke,{type:N&&$?"appear":null,options:{origin:$}},(function(e){var o=e.className;return Object(c.createElement)(K,Object(r.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},V,{onKeyDown:ce,ref:W}),ee&&Object(c.createElement)(U,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Le,{className:"components-popover__close",icon:_.a,onClick:n})),Object(c.createElement)("div",{ref:z,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},re,u)))})));return v&&(ie=Object(c.createElement)(Ee,null,ie)),X.ref&&(ie=Object(c.createElement)(ye,{name:I},ie)),g||O?ie:Object(c.createElement)("span",{ref:q},ie)};Se.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(ge,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Ce=Se;var Te=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(u.isString)(r)&&(t=r),Object(u.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":n},t)):null};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 n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var Ae=function(e){m(n,e);var t=Ne(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return d(n,[{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===c.Children.count(n)){var r=c.Children.only(n);"function"==typeof r.props[e]&&r.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 o=Object(u.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{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,r=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.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(c.concatChildren)(i.props.children,a&&Object(c.createElement)(Ce,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(Te,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),n}(c.Component),Fe=n(86);function De(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw c}}}}function Me(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}var Ie=["onMouseDown","onClick"];var Le=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,w=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,_=e.shortcut,x=e.label,P=e.children,R=e.__experimentalIsFocusable,S=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!j&&!!P,"has-icon":!!j}),T=O&&!R,N=void 0===n||T?"button":"a",A="a"===N?{href:n,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(O&&R){A["aria-disabled"]=!0;var F,D=De(Ie);try{for(D.s();!(F=D.n()).done;){S[F.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){D.e(e)}finally{D.f()}}var M=!T&&(k&&x||_||!!x&&(!P||Object(u.isArray)(P)&&!P.length)&&!1!==k),I=Object(c.createElement)(N,Object(r.a)({},A,S,{className:C,"aria-label":S["aria-label"]||x,ref:t}),j&&Object(c.createElement)(Fe.a,{icon:j,size:w}),P);return M?Object(c.createElement)(Ae,{text:x,shortcut:_,position:E},I):I}))},function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},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.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(21),o=n(6),c=n(17),i=n(0),a=n(28);var u=function(e){var t=e.icon,n=e.className,r=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},r))};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){Object(r.a)(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}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(u,Object(o.a)({icon:n},s));if(n&&u===n.type)return Object(i.cloneElement)(n,l({},s));var f=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,l({size:f},s)):n(l({size:f},s));if(n&&("svg"===n.type||n.type===a.SVG)){var p=l(l({width:f,height:f},n.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,l({size:f},s)):n}},function(e,t){!function(){e.exports=this.wp.autop}()},,,function(e,t){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new b(e,t)),1!==s.length||l||a(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(36),u=n(1),s=(n(66),n(80));t.a=Object(r.forwardRef)((function(t,n){var c=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,b=void 0===d?"polite":d,m=t.actions,h=void 0===m?[]:m,v=t.onRemove,g=void 0===v?o.noop:v;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(a.speak)(n,t)}),[n,t])}(p,b),Object(r.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=i()(c,"components-snackbar");return h&&h.length>1&&(void 0!==e&&e.env,h=[h[0]]),Object(r.createElement)("div",{ref:n,className:y,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(u.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},l,h.map((function(e,t){var n=e.label,o=e.onClick,c=e.url;return Object(r.createElement)(s.a,{key:t,href:c,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(90))},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),o=n.n(r),c=function(e){return e.reduce((function(e,t){var n=o()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(9),o=n.n(r),c=n(15),i=n(12),a=n(0),u=n(22),s=n.n(u),l=n(54),f=n(107),p=n(61),d=function(e){var t=Object(p.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},b=function(e,t,n){var r=Object(p.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(n,e,t)}),[n,e,u])]},m=function(e,t){var n=Object(p.a)(),r=d(t=t||n),c=o()(r,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(f.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),v.current=!0)}),[b,m,h,u]),v.current?[i,u]:[e,u]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(9),o=n.n(r),c=n(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return u}));var r=n(5),o=n(76),c=n(70),i=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,o=void 0===r?"":r,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:n.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,n=void 0===t?"":t;return Object(c.isEmail)(n)?n.trim():""},u=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(r,e)&&(c[r]="")})),c}},,,,,,,,function(e,t){!function(){e.exports=this.wp.wordcount}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,,,function(e,t,n){"use strict";var r=n(6),o=n(0),c=n(8);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(c.upperFirst)(Object(c.camelCase)(t)),"(").concat(i,")"),r}},a=new WeakMap;function u(e,t){return Object(o.useMemo)((function(){var n=function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(n):n}),[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";var r=n(10),o=n.n(r),c=n(32),i=n.n(c),a=n(33),u=n.n(a),s=n(23),l=n.n(s),f=n(34),p=n.n(f),d=n(35),b=n.n(d),m=n(25),h=n.n(m),v=n(7),g=n.n(v),y=n(2);n(140);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 b()(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),g()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),g()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),g()(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(React.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,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),o=n.n(r),c=n(7),i=n.n(c),a=n(0),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){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=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},d=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,i=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(f.join(","));d(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),p({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},function(e,t){},function(e,t,n){var r=n(64);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"b",(function(){return F})),n.d(t,"a",(function(){return D}));var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=(n(3),n(0)),u=n(12),s=n(56),l=n(46),f=n(10),p=n.n(f),d=n(4),b=n.n(d),m=n(168),h=(n(120),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""}),v=function(e){var t=e.className,n=e.notices,r=e.removeNotice,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,p()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice","woocommerce-message",h(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))},g=n(6),y=n(26),O=n.n(y);function j(e,t,n,r,o,c,i){try{var a=e[c](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function i(e){j(c,r,o,i,a,"next",e)}function a(e){j(c,r,o,i,a,"throw",e)}i(void 0)}))}}var k=n(19),E=n(8),_=n(79),x=n(27),P=n(91);var R=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?E.noop:o,i=Object(x.useReducedMotion)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(k.a)(u,1)[0],l=Object(_.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=w(O.a.mark((function t(n){return O.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=w(O.a.mark((function e(t){return O.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=b()("components-snackbar-list",n);var f=function(e){return function(){return c(e.id)}};return Object(a.createElement)("div",{className:n},r,l.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(a.createElement)(_.animated.div,{key:n,style:r},Object(a.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&s.set(t,e)}},Object(a.createElement)(P.a,Object(g.a)({},Object(E.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},S=n(11),C=function(e){var t=e.className,n=e.notices,r=e.removeNotice;if(e.isEditor)return null;var o=n.filter((function(e){return"snackbar"===e.type})),c=Object(S.__experimentalApplyCheckoutFilter)({filterName:"snackbarNotices",defaultValue:o}),i=b()(t,"wc-block-components-notices__snackbar");return React.createElement(R,{notices:c,className:i,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 N(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(a.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(a.useContext)(A)},D=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),g=i()(h,2),y=g[0],O=g[1],j=Object(s.a)().dispatchStoreEvent,w=Object(l.a)().isEditor,k=Object(a.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]:{};b(e,t,N(N({},n),{},{context:n.context||p})),j("store-notice-create",{status:e,content:t,options:n})}),[b,j,p]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),_=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k("default",e,N(N({},t),{},{type:"snackbar"}))}),[k]),x={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,createSnackbarNotice:_,removeNotice:E,context:p,setIsSuppressed:O},P=y?null:React.createElement(v,{className:r,notices:x.notices,removeNotice:x.removeNotice,isEditor:w}),R=y?null:React.createElement(C,{notices:x.notices,removeNotice:x.removeNotice,isEditor:w});return React.createElement(A.Provider,{value:x},c&&P,t,R)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(12),c=n(0),i=n(54),a=n(96),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 b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,m,h],i=o.getCollectionError.apply(o,c);return i&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,m,d]);return null!==g&&(b.current=g),b.current}},,,,,function(e,t,n){"use strict";var r=n(0),o=n(28),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,,function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(16),i=n.n(c),a=n(0),u=["srcElement","size"];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}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,c=i()(e,u);return Object(a.isValidElement)(t)?Object(a.cloneElement)(t,function(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){o()(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}({width:r,height:r},c)):null}},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(15),c=n(12),i=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(i.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),c=r.isResolving,i=r.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];c("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(3);var r=n(4),o=n.n(r),c=n(11),i=n(112);n(167);t.a=Object(i.a)((function(e){var t=e.className,n=e.instanceId,r=e.defaultValue,i=e.label,a=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(c.Label,{label:i,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:a,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";n.d(t,"a",(function(){return i}));var r=n(37),o=n(0),c=n(13);n.p=c.j,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([n.e(20),n.e(6)]).then(n.bind(null,307))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,317))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,316))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,308))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,309))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,310))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,294))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,311))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,312))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,313))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,314))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,315))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(1),u=n(36),s=n(130),l=n(80);t.a=function(e){var t=e.className,n=e.status,c=void 0===n?"info":n,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,v=void 0===h||h,g=e.actions,y=void 0===g?[]:g,O=e.politeness,j=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,w=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(u.speak)(n,t)}),[n,t])}(d,j);var k=i()(t,"components-notice","is-"+c,{"is-dismissible":v});return w&&(f=Object(r.createElement)(r.RawHTML,null,f)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var n=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,f=e.url;return Object(r.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",n)},o)}))),v&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.components}()},,,,,,,,,,,,,function(e,t,n){e.exports=n(276)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(141),o=n(123),c=n(119),i=n(32),a=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),b=n(25),m=n.n(b),h=n(2),v=(n(3),n(9)),g=n.n(v),y=n(0),O=n(16),j=n.n(O),w=n(7),k=n.n(w),E=n(1),_=n(8),x=n(4),P=n.n(x),R=n(11),S=(n(226),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=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),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.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 b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(R.Label,{screenReaderLabel:Object(E.__)("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 c(t-1)},title:Object(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(R.Label,{label:"<",screenReaderLabel:Object(E.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return c(1)},disabled:1===t},React.createElement(R.Label,{label:1,screenReaderLabel:Object(E.sprintf)(Object(E.__)("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(E.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return c(e)},disabled:t===e},React.createElement(R.Label,{label:e,screenReaderLabel:Object(E.sprintf)(Object(E.__)("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(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(R.Label,{label:i,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t+1)},title:Object(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(R.Label,{label:">",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});S.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=S,T=n(107),N=n(95),A=n(125),F=n(15),D=n(12),M=n(54);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 L(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){k()(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 B=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(A.a)(L(L({},t),{},{query:e})),r=n.results,o=n.isLoading,c=function(e,t){var n=t.namespace,r=t.resourceName,o=t.resourceValues,c=void 0===o?[]:o,i=t.query,a=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(M.a)(a),s=Object(M.a)(c),l=Object(D.useSelect)((function(t){var o=t(F.COLLECTIONS_STORE_KEY),c=[e,n,r,u,s];return{value:o.getCollectionHeader.apply(o,c),isLoading:o.hasFinishedResolution("getCollectionHeader",c)}}),[e,n,r,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}("x-wp-total",L(L({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},V=n(56),q=n(115),z=n(81),H=n(36),W=n(139),U=n(28),G=React.createElement(U.SVG,{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"})),K=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(W.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Q=React.createElement(U.SVG,{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"})),Y=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(W.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:Q,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},$=n(147),J=(n(225),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement($.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(E.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(E.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(E.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(E.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(E.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(E.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(E.__)("Order products by","woo-gutenberg-products-block"),value:o})}),Z=n(112),X=n(10),ee=n.n(X),te=n(157),ne=Object(Z.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=P()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var c=Object(te.a)(t);return r.map((function(r,i){var a=g()(r,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=c[u];if(!p)return null;var d=n.id||0,b=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,ee()({},l,{children:f,product:n})))}))}}(a,t,o,r))})),re=(n(224),["order","orderby","page","per_page"]);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 ce(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){k()(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=function(e){var t=e.totalQuery,n=e.totalProducts,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.totalQuery;return!Object(_.isEqual)(t,o)&&Number.isFinite(n)},ae=Object(q.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=e.hideOutOfStockItems,u=void 0!==a&&a,s=Object(N.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=e.hideOutOfStockItems,c=r.columns,i=r.rows;return ce(ce({},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*i,page:n},o&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:c,currentPage:n,hideOutOfStockItems:u})),l=g()(s,1)[0],f=B(l),p=f.products,d=f.totalProducts,b=f.productsLoading,m=Object(z.useInnerBlockLayoutContext)(),h=m.parentClassName,v=m.parentName,O=function(e){e.order,e.orderby,e.page,e.per_page;return j()(e,re)||{}}(l),w=Object(V.a)().dispatchStoreEvent,k=Object(N.b)("attributes",[]),x=g()(k,2),R=x[0],S=x[1],A=Object(N.b)("min_price"),F=g()(A,2),D=F[0],M=F[1],I=Object(N.b)("max_price"),L=g()(I,2),q=L[0],W=L[1],U=Object(T.a)({totalQuery:O,totalProducts:d},ie);Object(y.useEffect)((function(){w("product-list-render",{products:p,listName:v})}),[p,v,w]),Object(y.useEffect)((function(){Object(_.isEqual)(O,null==U?void 0:U.totalQuery)||(r(1),null!=U&&U.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(H.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(H.speak)(Object(E.sprintf)(Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[null==U?void 0:U.totalQuery,d,r,O]);var G,Q,$,Z,X,ee=t.contentVisibility,te=t.columns*t.rows,oe=!Number.isFinite(d)&&Number.isFinite(null==U?void 0:U.totalProducts)&&Object(_.isEqual)(O,null==U?void 0:U.totalQuery)?Math.ceil(U.totalProducts/te):Math.ceil(d/te),ae=p.length?p:Array.from({length:te}),ue=0!==p.length||b,se=R.length>0||Number.isFinite(D)||Number.isFinite(q);return React.createElement("div",{className:(G=t.columns,Q=t.rows,$=t.alignButtons,Z=t.align,X=void 0!==Z?"align"+Z:"",P()(h,X,"has-"+G+"-columns",{"has-multiple-rows":Q>1,"has-aligned-buttons":$}))},ee.orderBy&&ue&&React.createElement(J,{onChange:o,value:c}),!ue&&se&&React.createElement(Y,{resetCallback:function(){S([]),M(null),W(null)}}),!ue&&!se&&React.createElement(K,null),ue&&React.createElement("ul",{className:"".concat(h,"__products")},ae.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return React.createElement(ne,{key:e.id||n,attributes:t,product:e})}))),oe>1&&React.createElement(C,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:oe}))})),ue=function(e){var t=e.attributes,n=e.hideOutOfStockItems,r=void 0!==n&&n,o=Object(y.useState)(1),c=g()(o,2),i=c[0],a=c[1],u=Object(y.useState)(t.orderby),s=g()(u,2),l=s[0],f=s[1];Object(y.useEffect)((function(){f(t.orderby)}),[t.orderby]);return React.createElement(ae,{attributes:t,hideOutOfStockItems:r,currentPage:i,onPageChange:function(e){a(e)},onSortChange:function(e){var t=e.target.value;f(t),a(1)},sortValue:l})},se=n(13),le=React.createElement("img",{src:se.i+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}}),fe=n(5);function pe(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 d()(this,n)}}var de=function(e){f()(n,e);var t=pe(n);function n(){return a()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.urlParameterSuffix;if(t.isPreview)return le;var r=Object(fe.getSetting)("hideOutOfStockItems",!1);return React.createElement(z.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ue,{attributes:t,urlParameterSuffix:n,hideOutOfStockItems:r}))}}]),n}(h.Component);Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:Object(r.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(de,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', 'moment', 'react', 'react-dom', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wc-shared-context', 'wc-shared-hocs', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => 'c31bb380425dafcfae7af58f4944b3f1');
|
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],s=t[1],u=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 s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),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 s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17: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.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},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="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([713,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},102:function(e,t){},103:function(e,t){!function(){e.exports=this.wp.coreData}()},104:function(e,t){},108:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=r(44),u=r(3),l=r(7),b=r.n(l);t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,l=e.onSelect,p=e.disabled,d=a()(e,["className","item","isSelected","isLoading","onSelect","disabled"]);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,c()({},d,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:p})),n&&o&&Object(i.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(u.Spinner,null)))}},113:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(58),a=r(148),i=r(5),s=r(24),u=r(43);t.a=function(e){var t=(Object(u.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.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}},119:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(5),s=r(1);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 b=Object(i.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(b).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,p(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==d[r]?d[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return l(l(l({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},120:function(e,t){!function(){e.exports=this.wp.wordcount}()},121:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return h}));var n=r(42),c=r.n(n),o=r(4),a=r.n(o),i=r(20),s=r.n(i),u=r(13),l=r.n(u),b=r(0),p=r(6),d=r(37),f=r.n(d);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 O(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){a()(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}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(b.useContext)(j)},h=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(g))}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),v=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),h=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),y={getValidationError:i,setValidationErrors:v,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!0})}),[h]),showValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!1})}),[h]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},122:function(e,t,r){"use strict";var n=r(32),c=r.n(n),o=r(4),a=r.n(o),i=r(11),s=r.n(i),u=r(0),l=r(1),b=r(6),p=(r(2),r(44)),d=r(22),f=r(15),m=r.n(f),O=r(16),g=r.n(O),j=r(17),v=r.n(j),h=r(18),y=r.n(h),w=r(9),k=r.n(w);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var E=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=_(n);function n(){return m()(this,n),r.apply(this,arguments)}return g()(n,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),n}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),P=r(255),C=r(31),S=r.n(C),N=r(12),x=r.n(N),D=r(10),B=r.n(D),R=r(37),A=r.n(R),L=r(39),T=r(41);function z(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 V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var F=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=I(n);function n(){var e;m()(this,n);for(var t=arguments.length,c=new Array(t),o=0;o<t;o++)c[o]=arguments[o];return e=r.call.apply(r,[this].concat(c)),a()(x()(e),"state",{error:null,loading:!1,variations:{}}),a()(x()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,c=r.variations;if(!n){var o=e.getExpandedProduct();if(o&&!c[o]){var i=t.find((function(e){return e.id===o}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(L.g)(o).then((function(t){var r=t.map((function(e){return V(V({},e),{},{parent:o})}));e.setState({variations:V(V({},e.state.variations),{},a()({},o,r)),loading:!1,error:null})})).catch(function(){var t=S()(B.a.mark((function t(r){var n;return B.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(T.a)(r);case 2:n=t.sent,e.setState({variations:V(V({},e.state.variations),{},a()({},o,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())):e.setState({variations:V(V({},e.state.variations),{},a()({},o,null)),loading:!1,error:null})}}})),e}return g()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!A()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,a=c.loading,i=c.variations;return Object(u.createElement)(e,s()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),n}(u.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),M=r(46),H=r(7),q=r.n(H),G=r(108);r(178);function Q(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?Q(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W={list:Object(l.__)("Products","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(l.__)("Product search results updated.","woo-gutenberg-products-block")},K=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,o=e.isCompact,a=e.isLoading,i=e.onChange,d=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,v=e.variationsLoading,h=function(e){var t=e.item,r=e.search,c=e.depth,o=void 0===c?0:c,i=e.isSelected,d=e.onSelect,f=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=q()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),"has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent,"is-variable":f>0});if(!t.breadcrumbs.length)return Object(u.createElement)(G.a,s()({},e,{className:q()(m,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){d(t)()}},isLoading:a||v,countLabel:t.variations.length>0?Object(l.sprintf)(Object(l.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));var O=Object(b.isEmpty)(t.variation)?e:U(U({},e),{},{item:U(U({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},O,{className:m,name:"variations-".concat(n)}))};if(r)return Object(u.createElement)(M.a,{error:r});var y=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(y));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:w,isCompact:o,isLoading:a,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:i,renderItem:m||(g?h:null),onSearch:d,messages:W,isHierarchical:!0})};K.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1};t.a=E(Object(P.a)(F(Object(d.withInstanceId)(K))))},124:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{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},127:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(27),i=r(173);r(180);t.a=Object(i.a)((function(e){var t=e.className,r=e.instanceId,c=e.defaultValue,i=e.label,s=e.onChange,u=e.options,l=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.Label,{label:i,screenReaderLabel:l,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:s,readOnly:b,value:p},u.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},128:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=r(1),i=r(54),s=r(7),u=r.n(s),l=(r(2),r(135)),b=(r(207),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,a=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:a})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:a}))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,d=e.maxPrice,f=void 0===d?null:d,m=e.minPrice,O=void 0===m?null:m,g=e.price,j=void 0===g?null:g,v=e.priceClassName,h=e.priceStyle,y=e.regularPrice,w=e.regularPriceClassName,k=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var E=y&&j!==y,P=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return E?P=Object(o.createElement)(p,{currency:n,price:j,priceClassName:v,priceStyle:h,regularPrice:y,regularPriceClassName:w,regularPriceStyle:k}):null!==O&&null!==f?P=Object(o.createElement)(b,{currency:n,maxPrice:f,minPrice:O,priceClassName:v,priceStyle:h}):null!==j&&(P=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",v),currency:n,value:j,style:h})),Object(o.createElement)("span",{className:_},Object(l.a)(s,{price:P}))}},129:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(18),l=r.n(u),b=r(9),p=r.n(b),d=r(0),f=r(6),m=r(1),O=r(3);function g(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)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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){s()(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)(g,{level:e}),title:Object(m.sprintf)(Object(m.__)("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)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},130:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(4),o=r.n(c),a=r(6);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 s(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){o()(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}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},132:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(13),c=r.n(n),o=r(40),a=r(23),i=r(0),s=r(37),u=r.n(s),l=r(76),b=r(149),p=r(83),d=function(e){var t=Object(p.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,n])]},f=function(e,t,r){var n=Object(p.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,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(l.a)(a),m=Object(l.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},133:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(13),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return o})),r.d(t,"k",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"h",(function(){return u})),r.d(t,"c",(function(){return l})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return p})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return g})),r.d(t,"e",(function(){return j})),r.d(t,"p",(function(){return h})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return w})),r.d(t,"o",(function(){return k}));var n,c=r(5),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"assets/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=c.STORE_PAGES.privacy.title,f=c.STORE_PAGES.terms.permalink,m=c.STORE_PAGES.terms.title,O=c.STORE_PAGES.cart.id,g=c.STORE_PAGES.cart.permalink,j=c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),v=r(26),h=function(e,t){if(s>2)return Object(v.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(v.registerBlockType)(e,t)},w=function(){return s>2},k=function(){return s>1}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(13),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},148:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{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},149:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(8);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},153:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(42),c=r.n(n),o=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===c()(e)};function s(e,t){return i(e)&&t in e}},160:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(14),o=Object(n.createElement)("img",{src:c.k+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},161:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=(r(2),r(29)),u=r(7),l=r.n(u);r(206);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,b=e.permalink,p=void 0===b?"":b,d=a()(e,["className","disabled","name","permalink"]),f=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:f},d),Object(s.decodeEntities)(u)):Object(i.createElement)("a",c()({className:f,href:p},d),Object(s.decodeEntities)(u))}},162:function(e,t,r){"use strict";r.d(t,"b",(function(){return k})),r.d(t,"a",(function(){return _}));var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(0),s=(r(2),r(23)),u=r(85),l=r(78),b=r(11),p=r.n(b),d=r(7),f=r.n(d),m=r(806),O=(r(208),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=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice","woocommerce-message",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))},j=r(810),v=function(e){var t=e.className,r=e.notices,n=e.removeNotice;if(e.isEditor)return null;var c=r.filter((function(e){return"snackbar"===e.type})),o=f()(t,"wc-block-components-notices__snackbar");return Object(i.createElement)(j.a,{notices:c,className:o,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 y(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 w=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),k=function(){return Object(i.useContext)(w)},_=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),h=j[0],k=j[1],_=Object(u.a)().dispatchStoreEvent,E=Object(l.b)().isEditor,P=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]:{};f(e,t,y(y({},r),{},{context:r.context||p})),_("store-notice-create",{status:e,content:t,options:r})}),[f,_,p]),C=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),S=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]:{};P("default",e,y(y({},t),{},{type:"snackbar"}))}),[P]),N={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:P,createSnackbarNotice:S,removeNotice:C,context:p,setIsSuppressed:k},x=h?null:Object(i.createElement)(g,{className:n,notices:N.notices,removeNotice:N.removeNotice,isEditor:E}),D=h?null:Object(i.createElement)(v,{notices:N.notices,removeNotice:N.removeNotice,isEditor:E});return Object(i.createElement)(w.Provider,{value:N},o&&x,t,D)}},163:function(e,t,r){"use strict";var n=r(0),c=r(120),o=r(94),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,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=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)(s(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)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,b=c.slice(0,t+l);return Object(o.autop)(s(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,b=void 0===s?"words":s,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 s=a(n),b=Object(c.count)(s,r);return b<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},167:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(4),j=r.n(g),v=r(0),h=r(8);r(224);function y(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(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=y(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 s()(n,[{key:"render",value:function(){return Object(v.createElement)(v.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}},171:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(5),c=r(119),o=r(21),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},174:function(e,t){},178:function(e,t){},180:function(e,t){},183:function(e,t){!function(){e.exports=this.wp.warning}()},184:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(40),c=r(23),o=r(0),a=r(76),i=r(133),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,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}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){!function(){e.exports=this.wp.url}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},224:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.data}()},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},255:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(31),a=r.n(o),i=r(15),s=r.n(i),u=r(16),l=r.n(u),b=r(12),p=r.n(b),d=r(17),f=r.n(d),m=r(18),O=r.n(m),g=r(9),j=r.n(g),v=r(0),h=r(10),y=r.n(h),w=r(6),k=r(22),_=(r(2),r(14)),E=r(39),P=r(41);function C(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j()(e);if(t){var c=j()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return O()(this,r)}}var S=Object(k.createHigherOrderComponent)((function(e){var t=function(t){f()(o,t);var r,n=C(o);function o(){var e;return s()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(p()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(p()(e)),400),e}return l()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(E.h)({selected:t}).then((function(t){e.setState({list:t,loading:!1})})).catch(this.setError)}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(E.h)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=a()(y.a.mark((function e(t){var r;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(P.a)(t);case 2:r=e.sent,this.setState({list:[],loading:!1,error:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var t=this,r=this.state,n=r.error,o=r.list,a=r.loading;return Object(v.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:_.m.productCount>100?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(v.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},256:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(27),l=r(43),b=r(71);r(487);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)().product;if(!i.id||!i.on_sale)return null;var b="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(o.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,b,c()({},"".concat(n,"__product-onsale"),n))},Object(o.createElement)(u.Label,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(121)),o=(r(209),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r){var p=l(a)||{};if(!p.message||p.hidden)return null;r=p.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(s)},r))})},26:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},30:function(e,t){!function(){e.exports=this.moment}()},309:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},33:function(e,t){!function(){e.exports=this.wp.primitives}()},34:function(e,t){!function(){e.exports=this.wp.dataControls}()},343:function(e,t){},344:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(14);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 i(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){c()(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 s={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.o)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},345: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"},productId:{type:"number",default:0}}},346:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(13),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(7),p=r.n(b),d=r(5),f=r(43),m=r(71),O=r(85),g=r(256);r(488);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 v(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){a()(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 h=function(){return Object(u.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},y=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=v({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(h,null))};t.a=Object(m.withProductDataContext)((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,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,w=Object(u.useState)(!1),k=s()(w,2),_=k[0],E=k[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(h,null));var C=!!j.images.length,S=C?j.images[0]:null,N=o?"a":u.Fragment,x=Object(l.sprintf)(Object(l.__)("Link to %s","woo-gutenberg-products-block"),j.name),D=v(v({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":x}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(N,o&&D,!!i&&Object(u.createElement)(g.default,{align:d,product:j}),Object(u.createElement)(y,{fallbackAlt:j.name,image:S,onLoad:function(){return E(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},347:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(130),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},348:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},349:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(13),i=r.n(a),s=r(1),u=r(76),l=r(795),b="pristine",p="idle",d="disabled",f="processing",m="before_processing",O="after_processing",g={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},j="set_pristine",v="set_idle",h="set_disabled",y="set_processing",w="set_before_processing",k="set_after_processing",_="set_processing_response",E="set_has_error",P="set_no_error",C="set_quantity",S="set_request_params",N=j,x=v,D=h,B=y,R=w,A=k,L=_,T=E,z=P,V=C,I=S,F=function(){return{type:N}},M=function(){return{type:x}},H=function(){return{type:D}},q=function(){return{type:B}},G=function(){return{type:R}},Q=function(){return{type:A}},U=function(e){return{type:L,data:e}},W=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?T:z;return{type:t}},K=function(e){return{type:V,quantity:e}},Y=function(e){return{type:I,data:e}},$=r(4),J=r.n($);function X(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?X(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=j,te=v,re=h,ne=y,ce=w,oe=k,ae=_,ie=E,se=P,ue=C,le=S,be=b,pe=p,de=d,fe=f,me=m,Oe=O,ge=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ee:e=g;break;case te:e=t.status!==pe?Z(Z({},t),{},{status:pe}):t;break;case re:e=t.status!==de?Z(Z({},t),{},{status:de}):t;break;case ue:e=n!==t.quantity?Z(Z({},t),{},{quantity:n}):t;break;case le:e=Z(Z({},t),{},{requestParams:Z(Z({},t.requestParams),o)});break;case ae:e=Z(Z({},t),{},{processingResponse:o});break;case ne:e=!1===(e=t.status!==fe?Z(Z({},t),{},{status:fe,hasError:!1}):t).hasError?e:Z(Z({},e),{},{hasError:!1});break;case ce:e=t.status!==me?Z(Z({},t),{},{status:me,hasError:!1}):t;break;case oe:e=t.status!==Oe?Z(Z({},t),{},{status:Oe}):t;break;case ie:e=t.hasError?t:Z(Z({},t),{},{hasError:!0}),e=t.status===fe||t.status===me?Z(Z({},e),{},{status:pe}):e;break;case se:e=t.hasError?Z(Z({},t),{},{hasError:!1}):t}return e!==t&&c!==ee&&e.status===be&&(e.status=pe),e},je=r(130),ve=r(347),he="add_to_cart_before_processing",ye="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",ke=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ve.a)(ye,e),onAddToCartProcessingWithError:Object(ve.a)(we,e),onAddToCartBeforeProcessing:Object(ve.a)(he,e)}},_e=r(351),Ee=r(121),Pe=r(63),Ce=r(57),Se=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Ne=function(){return Object(n.useContext)(Se)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ge,g),a=i()(o,2),b=a[0],j=a[1],v=Object(n.useReducer)(je.b,{}),h=i()(v,2),y=h[0],w=h[1],k=Object(u.a)(y),_=Object(Pe.a)(),E=_.addErrorNotice,P=_.removeNotices,C=Object(Ee.b)().setValidationErrors,S=Object(Ce.c)(),N=S.isSuccessResponse,x=S.isErrorResponse,D=S.isFailResponse,B=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:ke(w).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:ke(w).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:ke(w).onAddToCartBeforeProcessing}}),[w]),R=Object(n.useMemo)((function(){return{resetForm:function(){j(F())},submitForm:function(){j(G())},setQuantity:function(e){j(K(e))},setHasError:function(e){j(W(e))},setRequestParams:function(e){j(Y(e))},setAfterProcessing:function(e){j(U(e)),j(Q())}}}),[]);Object(n.useEffect)((function(){var e=b.status,t=!r.id||!Object(l.a)(r);e!==d||t?e!==d&&t&&j(H()):j(M())}),[b.status,r,j]),Object(n.useEffect)((function(){b.status===m&&(P("error"),Object(_e.a)(k,he,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&E(t),r&&C(r)})),j(M())):j(q())})))}),[b.status,C,E,P,j,k]),Object(n.useEffect)((function(){if(b.status===O){var e={processingResponse:b.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(x(e)||D(e))&&r&&(t=!0,E(r,n?{context:n}:void 0))})),t};if(b.hasError)return void Object(_e.b)(k,we,e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");E(c,{id:"add-to-cart"})}j(M())}));Object(_e.b)(k,ye,e).then((function(e){t(e)?j(W(!0)):j(M())}))}}),[b.status,b.hasError,b.processingResponse,R,E,x,D,N,k]);var A=Object(l.b)(r),L={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:A,showFormElements:c&&A,quantity:b.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:b.requestParams,isIdle:b.status===p,isDisabled:b.status===d,isProcessing:b.status===f,isBeforeProcessing:b.status===m,isAfterProcessing:b.status===O,hasError:b.hasError,eventRegistration:B,dispatchActions:R};return Object(n.createElement)(Se.Provider,{value:L},t)},De=r(19),Be=r.n(De),Re=r(29),Ae=r(52);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}var Te=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(Ee.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,f=Object(Pe.a)(),m=f.addErrorNotice,O=f.removeNotice,g=Object(Ae.a)().receiveCart,j=Object(n.useState)(!1),v=i()(j,2),h=v[0],y=v[1],w=!a&&u,k=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var _=Object(n.useCallback)((function(){y(!0),O("add-to-cart");var e=function(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){J()(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}({id:r.id||0,quantity:c},l);Be()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Be.a.setNonce(e.headers),e.json().then((function(r){e.ok?g(r):(r.body&&r.body.message?m(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&g(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,m,O,g,t,c,l]);return Object(n.useEffect)((function(){w&&!h&&_()}),[w,_,h]),null},ze=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Ee.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Te,null)))},Ve=r(43),Ie=r(6),Fe=r(71),Me=(r(343),r(27)),He=r(58),qe=r(497),Ge=r(85),Qe=r(716),Ue=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(Me.Button,{className:t,href:r,onClick:o,rel:"nofollow"},c)},We=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(Me.Button,{className:t,disabled:o,showSpinner:c,onClick:i},a&&r>0?Object(s.sprintf)(Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(He.a,{srcElement:qe.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Ke=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(Ve.useInnerBlockLayoutContext)().parentName,m=Object(Ge.a)().dispatchStoreEvent,O=Object(Qe.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),v=j[0],h=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||h(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(We,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:u,isProcessing:l,isDone:v,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(s.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:f})}})},Ye=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},$e=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},Je=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},Xe=(r(496),r(32)),Ze=r.n(Xe),et=r(3),tt=r(8),rt=r(258),nt={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Ee.b)(),f=d.getValidationError,m=d.setValidationErrors,O=d.clearValidationError,g=t,j=f(g)||{};return Object(tt.useEffect)((function(){i?O(g):m(J()({},g,{message:p,hidden:!0}))}),[i,g,p,O,m]),Object(tt.useEffect)((function(){return function(){O(g)}}),[g,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Re.decodeEntities)(t),value:i||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName:g,elementId:g}))};function ot(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 at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||(null===o||o===c)}))}))},st=function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],i=at(at({},r),{},J()({},c,null)),s=o?it(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=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:Object(Re.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function ut(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 lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),f=i()(d,2),m=f[0],O=f[1],g=Object(n.useMemo)((function(){return st(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return it(e,t,r)[0]||0}(o,a,m)):b>0&&p(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:g[e],value:m[e],onChange:function(t){O(lt(lt({},m),{},J()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Ie.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(bt,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},dt=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(pt,{product:t,dispatchers:a}),Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},ft=function(){return Object(n.createElement)(Ke,null)},mt=function(){return Object(n.createElement)(et.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return Object(n.createElement)(mt,null)},gt=function(){var e=Ne(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(Ot,null):"external"===r?Object(n.createElement)(ft,null):"simple"===r||"variation"===r?Object(n.createElement)(Je,null):null:Object(n.createElement)(Ke,null)};t.a=Object(Fe.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Ve.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Ie.isEmpty)(c)});return Object(n.createElement)(ze,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(gt,null)))}))},350:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(43),u=r(24),l=r(14),b=function(e){var t=e.color,r=e.fontSize;return Object(l.o)()?{color:t,fontSize:r}:{}},p=r(71),d=r(161),f=r(85);r(486),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.productLink,g=void 0===O||O,j=e.align,v=e.color,h=e.customColor,y=e.fontSize,w=e.customFontSize,k=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,E=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(u.getColorClassName)("color",v),S=Object(u.getFontSizeClass)(y),N=i()((t={"has-text-color":v||h,"has-font-size":y||w},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(k,"__product-title"),k),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},N,Object(l.o)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:h,fontSize:w}),onClick:function(){E("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(k,"__product-title"),k),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),c()(n,N,Object(l.o)()),n)),style:b({color:h,fontSize:w})})}))},351:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(42),c=r.n(n),o=r(31),a=r.n(o),i=r(10),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(57);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(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}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(f)&&!Object(l.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return v})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(4),c=r.n(n),o=r(21),a=r(19),i=r.n(a),s=r(6),u=r(5),l=r(14);function b(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 p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s=l.m.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),b}({selected:r,search:c,queryArgs:void 0===a?[]:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},v=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},y=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(31),c=r.n(n),o=r(10),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.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)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},43:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},449:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(128),u=r(59),l=r(43),b=r(24),p=r(14),d=r(71);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,v=e.customFontSize,h=e.saleFontSize,y=e.customSaleFontSize,w=e.color,k=e.customColor,_=e.saleColor,E=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var N=Object(b.getColorClassName)("color",w),x=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(h),R=i()((t={"has-text-color":w||k,"has-font-size":j||v},c()(t,N,N),c()(t,x,x),t)),A=i()((r={"has-text-color":_||E,"has-font-size":h||y},c()(r,D,D),c()(r,B,B),r)),L={color:k,fontSize:v},T={color:E,fontSize:y},z=C.prices,V=Object(u.getCurrencyFromPriceResponse)(z),I=z.price!==z.regular_price,F=I?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,A,Object(p.o)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.o)()),a)),M=I?T:L;return Object(o.createElement)(s.a,{align:g,className:S,currency:V,price:z.price,priceClassName:F,priceStyle:Object(p.o)()?M:{},minPrice:null==z||null===(d=z.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==z||null===(f=z.price_range)||void 0===f?void 0:f.max_amount,regularPrice:z.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.o)()),m)),regularPriceStyle:Object(p.o)()?L:{}})}))},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},450:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(43),l=r(71),b=(r(489),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},451:function(e,t,r){"use strict";r.r(t);var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(1),b=r(85),p=r(716),d=r(29),f=r(43),m=r(71),O=(r(490),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,v=O.addToCart,h=Number.isFinite(g)&&g>0,y=!a&&s&&f,w=Object(d.decodeEntities)((null==o?void 0:o.description)||""),k=h?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=y?"button":"a",E={};return y?E.onClick=function(){v(),m("cart-add-item",{product:t})}:(E.href=n,E.rel="nofollow",E.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},E),k)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},453:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(163),u=r(14),l=r(43),b=r(71);r(491);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:u.m.wordCountType||"words"}):null}))},454:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(71);r(492);t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product.sku;return n?Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-sku",c()({},"".concat(r,"__product-sku"),r))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,n)):null}))},455:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(493);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-category-list",c()({},"".concat(r,"__product-category-list"),r))},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.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))}))))}))},456:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(494);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-tag-list",c()({},"".concat(r,"__product-tag-list"),r))},Object(a.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.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))}))))}))},457:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(71),b=(r(495),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.default=Object(l.withProductDataContext)((function(e){var t,r=e.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;if(!a.id||!a.is_purchasable)return null;var i=!!a.is_in_stock,l=a.low_stock_remaining,d=a.is_on_backorder;return Object(o.createElement)("div",{className:s()(r,"wc-block-components-product-stock-indicator",(t={},c()(t,"".concat(n,"__stock-indicator"),n),c()(t,"wc-block-components-product-stock-indicator--in-stock",i),c()(t,"wc-block-components-product-stock-indicator--out-of-stock",!i),c()(t,"wc-block-components-product-stock-indicator--low-stock",!!l),c()(t,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),t))},l?b(l):p(i,d))}))},46:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(45));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(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},48:function(e,t){!function(){e.exports=this.wp.keycodes}()},486:function(e,t){},487:function(e,t){},488:function(e,t){},489:function(e,t){},490:function(e,t){},491:function(e,t){},492:function(e,t){},493:function(e,t){},494:function(e,t){},495:function(e,t){},496:function(e,t){},497:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},50:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},51:function(e,t){!function(){e.exports=this.wp.hooks}()},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(13),c=r.n(n),o=r(4),a=r.n(o),i=r(6),s=r(0),u=r(40),l=r(23),b=r(29),p=r(147),d=r(171),f=r(78);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 O(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){a()(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 g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},j=O(O({},g),{},{email:"",phone:""}),v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},h={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:j,shippingAddress:g,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},o=e.shouldSelect,a=Object(s.useRef)(),b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:j,shippingAddress:g,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(u.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),O=i.needsShipping?v(i.shippingAddress):m,y=i.fees.map((function(e){return v(e)}));return{cartCoupons:i.coupons,cartItems:i.items||[],cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors||[],cartTotals:l,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(O),extensions:i.extensions||{},shippingRates:i.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements||[],receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},54:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(20),s=r.n(i),u=r(0),l=r(166),b=r(7),p=r.n(b);r(174);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=e.displayType,i=void 0===a?"text":a,b=s()(e,["className","value","currency","onValueChange","displayType"]),d="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(d))return null;var m=d/Math.pow(10,n.minorUnit);if(!Number.isFinite(m))return null;var O=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g=f(f(f({},b),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}),j=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:O,displayType:i},g,{value:m,onValueChange:j}))}},57:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(153);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},58:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(20),a=r.n(o),i=r(0);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,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?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}({width:n,height:n},o)):null}},59:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},61:function(e,t){!function(){e.exports=this.wp.deprecated}()},63:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),c=r.n(n),o=r(0),a=r(162);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 s(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 u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),b=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[r,c]);return s(s(s({notices:t},l),b),{},{setIsSuppressed:i})}},685:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},692:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},700:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},701:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(14),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.k+"img/pennant.jpg",thumbnail:c.k+"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}]},706:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},71:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},713:function(e,t,r){e.exports=r(765)},714:function(e,t){},715:function(e,t){},716:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(13),c=r.n(n),o=r(0),a=r(23),i=r(40),s=r(29),u=r(52),l=r(63),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)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(l.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],v=g[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;return v(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},718:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},719:function(e,t){},72:function(e,t){!function(){e.exports=this.wp.dom}()},720:function(e,t){},721:function(e,t){},722:function(e,t){},73:function(e,t){!function(){e.exports=this.ReactDOM}()},74:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(0),j=r(6),v=r(7),h=r.n(v),y=r(3),w=r(22);r(104);function k(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}var _=function(e){p()(r,e);var t=k(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(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,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(y.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}(g.Component);t.a=Object(w.withInstanceId)(_)},76:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(37),o=r.n(c);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},765:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return qr}));var n=r(4),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(24),l=r(26),b=r(58),p=r(33),d=Object(i.createElement)(p.SVG,{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(14),m=r(7),O=r.n(m),g=function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},j={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.n)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},v=r(344),h=r(3),y=r(22),w=r(129),k=r(350),_=r(13),E=r.n(_),P=r(122),C=r(20),S=r.n(C);r(715);var N=function(e){var t=e.className,r=void 0===t?"":t,n=S()(e,["className"]),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},x=r(43),D=(r(714),function(e){return function(t){return function(r){var n=Object(x.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,l=Object(i.useState)(!a),b=E()(l,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(P.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(N,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),B=Object(i.createElement)(p.SVG,{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 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),R=Object(s.__)("Product Title","woo-gutenberg-products-block"),A=Object(i.createElement)(b.a,{srcElement:B}),L=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),T=function(e){var t=e.color,r=e.fontSize,n=e.setFontSize,c=e.setColor,o=e.attributes,a=e.setAttributes,l=o.headingLevel,b=o.productLink,p=o.align;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:l,onChange:function(e){return a({headingLevel:e})}}),Object(f.o)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({productLink:!b})}})),Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(k.a,o)))},z=Object(f.o)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:A,label:R,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(T):T;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 I(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){c()(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 F={title:R,description:L,icon:{src:A,foreground:"#874FB9"},attributes:v.a,edit:z};Object(l.registerBlockType)("woocommerce/product-title",I(I({},j),F));var M=r(449),H=r(309),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),G=Object(i.createElement)(b.a,{srcElement:H.a}),Q=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),U=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},W=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,l=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.o)()&&Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(u.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(U,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(U,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(M.default,p))},K=Object(f.o)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withFontSizes)("saleFontSize"),Object(u.withFontSizes)("originalFontSize"),Object(u.withColors)("color",{textColor:"color"}),Object(u.withColors)("saleColor",{textColor:"saleColor"}),Object(u.withColors)("originalColor",{textColor:"originalColor"}),D({icon:G,label:q,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(W):W;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 J={productId:{type:"number",default:0}};function X(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?X(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.o)()&&(J=$($({},J),{},{align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}}));var ee={title:q,description:Q,icon:{src:G,foreground:"#874FB9"},attributes:J,edit:K};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},j),ee));var te=r(345),re=r(135),ne=r(74),ce=r(5),oe=r(346),ae=Object(i.createElement)(p.SVG,{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"})),ie=Object(s.__)("Product Image","woo-gutenberg-products-block"),se=Object(i.createElement)(b.a,{srcElement:ae}),ue=Object(s.__)("Display the main product image","woo-gutenberg-products-block"),le=D({icon:se,label:ie,description:Object(s.__)("Choose a product to display its image.","woo-gutenberg-products-block")})((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)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({productLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(s.__)('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)(ne.a,{label:Object(s.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:a,options:[{label:Object(s.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(s.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(s.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}),Object(i.createElement)(ne.a,{label:Object(s.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(re.a)(Object(s.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(i.createElement)("a",{href:"".concat(Object(ce.getAdminLink)("customize.php"),"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images"),target:"_blank",rel:"noopener noreferrer"})}),value:c,options:[{label:Object(s.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(s.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:function(e){return r({imageSizing:e})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(oe.a,t)))}));function be(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 pe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var de={title:ie,description:ue,icon:{src:se,foreground:"#874FB9"},attributes:te.a,edit:le};Object(l.registerBlockType)("woocommerce/product-image",pe(pe({},j),de));var fe={productId:{type:"number",default:0}},me=r(450),Oe=r(700),ge=Object(s.__)("Product Rating","woo-gutenberg-products-block"),je=Object(i.createElement)(b.a,{srcElement:Oe.a});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 he(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 ye={title:ge,description:Object(s.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:je,foreground:"#874FB9"},attributes:fe,edit:D({icon:je,label:ge,description:Object(s.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(me.default,t)}))};Object(l.registerBlockType)("woocommerce/product-rating",he(he({},j),ye));var we={productId:{type:"number",default:0}},ke=r(451),_e=r(718),Ee=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Pe=Object(i.createElement)(b.a,{srcElement:_e.a});function Ce(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?Ce(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ne={title:Ee,description:Object(s.__)("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:Pe,foreground:"#874FB9"},attributes:we,edit:D({icon:Pe,label:Ee,description:Object(s.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ke.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Se(Se({},j),Ne));var xe={productId:{type:"number",default:0}},De=r(453),Be=Object(i.createElement)(p.SVG,{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"})),Re=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Ae=Object(i.createElement)(b.a,{srcElement:Be});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 Te(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 ze={title:Re,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Ae,foreground:"#874FB9"},attributes:xe,edit:D({icon:Ae,label:Re,description:Object(s.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(De.default,t)}))};Object(l.registerBlockType)("woocommerce/product-summary",Te(Te({},j),ze));var Ve={productId:{type:"number",default:0}},Ie=r(256),Fe=r(692),Me=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),He=Object(i.createElement)(b.a,{srcElement:Fe.a});function qe(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?qe(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qe={title:Me,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:He,foreground:"#874FB9"},supports:{html:!1},attributes:Ve,edit:D({icon:He,label:Me,description:Object(s.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Ie.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",Ge(Ge({},j),Qe));var Ue={productId:{type:"number",default:0}},We=r(113),Ke=r(454),Ye=Object(i.createElement)(p.SVG,{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"})),$e=Object(s.__)("Product SKU","woo-gutenberg-products-block"),Je=Object(i.createElement)(b.a,{srcElement:Ye});function Xe(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?Xe(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var et={title:$e,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Je,foreground:"#874FB9"},attributes:Ue,edit:D({icon:Je,label:$e,description:Object(s.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(We.a,null),Object(i.createElement)(Ke.default,t))}))};Object(f.p)("woocommerce/product-sku",Ze(Ze({},j),et));var tt={productId:{type:"number",default:0}},rt=r(455),nt=r(685),ct=Object(s.__)("Product Category List","woo-gutenberg-products-block"),ot=Object(i.createElement)(b.a,{srcElement:nt.a});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 st={title:ct,description:Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:ot,foreground:"#874FB9"},attributes:tt,edit:D({icon:ot,label:ct,description:Object(s.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(We.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.p)("woocommerce/product-category-list",it(it({},j),st));var ut={productId:{type:"number",default:0}},lt=r(456),bt=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),pt=Object(i.createElement)(b.a,{srcElement:Fe.a});function dt(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 ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var mt={title:bt,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:pt,foreground:"#874FB9"},attributes:ut,edit:D({icon:pt,label:bt,description:Object(s.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(We.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(lt.default,t)))}))};Object(f.p)("woocommerce/product-tag-list",ft(ft({},j),mt));var Ot={productId:{type:"number",default:0}},gt=r(457),jt=Object(i.createElement)(p.SVG,{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"}))),vt=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),ht=Object(i.createElement)(b.a,{srcElement:jt});function yt(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 wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var kt={title:vt,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:ht,foreground:"#874FB9"},attributes:Ot,edit:D({icon:ht,label:vt,description:Object(s.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(We.a,null),Object(i.createElement)(gt.default,t))}))};Object(f.p)("woocommerce/product-stock-indicator",wt(wt({},j),kt));var _t=r(795),Et=(r(343),r(349)),Pt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),Ct=Object(i.createElement)(b.a,{srcElement:_e.a});function St(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 Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xt={title:Pt,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:Ct,foreground:"#874FB9"},edit:D({icon:Ct,label:Pt,description:Object(s.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(x.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(We.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(_t.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements","woo-gutenberg-products-block"),help:Object(s.__)("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)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Et.a,t)))})),attributes:r(348).a};Object(f.p)("woocommerce/product-add-to-cart",Nt(Nt({},j),xt));var Dt=r(15),Bt=r.n(Dt),Rt=r(12),At=r.n(Rt),Lt=r(17),Tt=r.n(Lt),zt=r(18),Vt=r.n(zt),It=r(9),Ft=r.n(It),Mt=r(23),Ht=(r(2),r(82)),qt=r(791),Gt=r(701),Qt=r(148),Ut=function(e,t){var r=t.className,n=t.contentVisibility;return O()(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})},Wt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:ce.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:Qt.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more","woo-gutenberg-products-block")))},Kt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};function Yt(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?Yt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Jt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Xt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,$t($t({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function Zt(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 er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tr=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:er(er({},r),{},{orderBy:!r.orderBy})})}})},rr=function(e,t){return Object(i.createElement)(h.SelectControl,{label:Object(s.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(s.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(s.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(s.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(s.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(s.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},nr=r(16),cr=r.n(nr),or=r(8),ar=r(6),ir=r(27),sr=(r(722),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,u=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=u.minIndex,b=u.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 g=[];if(l&&b)for(var j=l;j<=b;j++)g.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(ir.Label,{screenReaderLabel:Object(s.__)("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(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(ir.Label,{label:"<",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:O()("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)(ir.Label,{label:1,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),g.map((function(e){return Object(i.createElement)("button",{key:e,className:O()("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)(ir.Label,{label:e,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:O()("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)(ir.Label,{label:a,screenReaderLabel:Object(s.sprintf)(Object(s.__)("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(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(ir.Label,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});sr.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var ur=sr,lr=r(149),br=r(132),pr=r(184),dr=r(40),fr=r(76);function mr(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 Or(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var gr=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(pr.a)(Or(Or({},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 s=Object(fr.a)(i),u=Object(fr.a)(o),l=Object(Mt.useSelect)((function(t){var c=t(dr.COLLECTIONS_STORE_KEY),o=[e,r,n,s,u];return{value:c.getCollectionHeader.apply(c,o),isLoading:c.hasFinishedResolution("getCollectionHeader",o)}}),[e,r,n,u,s]),b=l.value,p=l.isLoading;return{value:b,isLoading:void 0===p||p}}("x-wp-total",Or(Or({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},jr=r(85),vr=r(167),hr=r(80),yr=r(124),wr=function(){var e=Object(x.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:yr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(s.__)("No products","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},kr=r(706),_r=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(x.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:kr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(i.createElement)("button",{onClick:r},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},Er=r(127),Pr=(r(721),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(Er.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(s.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(s.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(s.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(s.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(s.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(s.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:c})}),Cr=r(173),Sr=Object(Cr.a)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(x.useInnerBlockLayoutContext)(),s=o.parentClassName,u=o.parentName,l=0===Object.keys(t).length,b=O()("".concat(s,"__product"),"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(qt.a)(t);return n.map((function(n,s){var u=E()(n,2),l=u[0],b=u[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 m=r.id||0,O=["layout",l,s,c,m];return Object(i.createElement)(i.Suspense,{key:O.join("_"),fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},Object(i.createElement)(f,a()({},p,{children:d,product:r})))}))}}(u,t,c,n))}));r(720);function Nr(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 xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(ar.isEqual)(t,c)&&Number.isFinite(r)},Br=Object(vr.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=e.hideOutOfStockItems,l=void 0!==u&&u,b=Object(br.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=e.hideOutOfStockItems,o=n.columns,a=n.rows;return xr(xr({},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:r},c&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:o,currentPage:r,hideOutOfStockItems:l})),p=E()(b,1)[0],d=gr(p),f=d.products,m=d.totalProducts,g=d.productsLoading,j=Object(x.useInnerBlockLayoutContext)(),v=j.parentClassName,h=j.parentName,y=function(e){e.order,e.orderby,e.page,e.per_page;return S()(e,["order","orderby","page","per_page"])||{}}(p),w=Object(jr.a)().dispatchStoreEvent,k=Object(br.b)("attributes",[]),_=E()(k,2),P=_[0],C=_[1],N=Object(br.b)("min_price"),D=E()(N,2),B=D[0],R=D[1],A=Object(br.b)("max_price"),L=E()(A,2),T=L[0],z=L[1],V=Object(lr.a)({totalQuery:y,totalProducts:m},Dr);Object(i.useEffect)((function(){w("product-list-render",{products:f,listName:h})}),[f,h,w]),Object(i.useEffect)((function(){Object(ar.isEqual)(y,null==V?void 0:V.totalQuery)||(n(1),null!=V&&V.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(hr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(hr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(m))}),[null==V?void 0:V.totalQuery,m,n,y]);var I,F,M,H,q,G=t.contentVisibility,Q=t.columns*t.rows,U=!Number.isFinite(m)&&Number.isFinite(null==V?void 0:V.totalProducts)&&Object(ar.isEqual)(y,null==V?void 0:V.totalQuery)?Math.ceil(V.totalProducts/Q):Math.ceil(m/Q),W=f.length?f:Array.from({length:Q}),K=0!==f.length||g,Y=P.length>0||Number.isFinite(B)||Number.isFinite(T);return Object(i.createElement)("div",{className:(I=t.columns,F=t.rows,M=t.alignButtons,H=t.align,q=void 0!==H?"align"+H:"",O()(v,q,"has-"+I+"-columns",{"has-multiple-rows":F>1,"has-aligned-buttons":M}))},G.orderBy&&K&&Object(i.createElement)(Pr,{onChange:c,value:o}),!K&&Y&&Object(i.createElement)(_r,{resetCallback:function(){C([]),R(null),z(null)}}),!K&&!Y&&Object(i.createElement)(wr,null),K&&Object(i.createElement)("ul",{className:"".concat(v,"__products")},W.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)(Sr,{key:e.id||r,attributes:t,product:e})}))),U>1&&Object(i.createElement)(ur,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:U}))})),Rr=function(e){var t=e.attributes,r=e.hideOutOfStockItems,n=void 0!==r&&r,c=Object(i.useState)(1),o=E()(c,2),a=o[0],s=o[1],u=Object(i.useState)(t.orderby),l=E()(u,2),b=l[0],p=l[1];Object(i.useEffect)((function(){p(t.orderby)}),[t.orderby]);return Object(i.createElement)(Br,{attributes:t,hideOutOfStockItems:n,currentPage:a,onPageChange:function(e){s(e)},onSortChange:function(e){var t=e.target.value;p(t),s(1)},sortValue:b})},Ar=r(160);function Lr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ft()(e);if(t){var c=Ft()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return Vt()(this,r)}}var Tr=function(e){Tt()(r,e);var t=Lr(r);function r(){return Bt()(this,r),t.apply(this,arguments)}return cr()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;if(t.isPreview)return Ar.a;var n=Object(ce.getSetting)("hideOutOfStockItems",!1);return Object(i.createElement)(x.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Rr,{attributes:t,urlParameterSuffix:r,hideOutOfStockItems:n}))}}]),r}(or.Component);r(719);function zr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ft()(e);if(t){var c=Ft()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return Vt()(this,r)}}var Vr=function(e){Tt()(r,e);var t=zr(r);function r(){var e;Bt()(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()(At()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(At()(e),"blockMap",Object(qt.a)("woocommerce/all-products")),c()(At()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(At()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(At()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(At()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(s.__)("Showing All Products block preview.","woo-gutenberg-products-block"))})),c()(At()(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)(u.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(Ht.a,{columns:c,rows:o,alignButtons:a,setAttributes:n,minColumns:Object(ce.getSetting)("min_columns",1),maxColumns:Object(ce.getSetting)("max_columns",6),minRows:Object(ce.getSetting)("min_rows",1),maxRows:Object(ce.getSetting)("max_rows",6)})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},tr(r,n),rr(r,n)))})),c()(At()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(At()(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)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("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)(h.Tip,null,Object(s.__)("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)(x.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(x.ProductDataContextProvider,{product:Gt.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Xt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(h.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(s.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];Jt.map((function(e){var t=E()(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(s.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(At()(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)(h.Disabled,null,Object(i.createElement)(Tr,{attributes:t})):Kt(c,o)})),c()(At()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===f.m.productCount?Wt(n,c):Object(i.createElement)("div",{className:Ut("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return r}(i.Component),Ir=Object(y.compose)(h.withSpokenMessages,Object(Mt.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Mt.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Vr),Fr={columns:Object(ce.getSetting)("default_columns",3),rows:Object(ce.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Jt,isPreview:!1};function Mr(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 Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qr={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(s.__)("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:Fr,edit:function(e){return Object(i.createElement)(Ir,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:Ut("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Hr(Hr({},qr),{},{deprecated:[{attributes:Object.assign({},qr.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:Ut("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},77:function(e,t){!function(){e.exports=this.wp.viewport}()},78: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(23),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),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,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:b},t)}},791:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(50),c=r(0),o=r(14);r.p=o.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,449))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,812))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,813))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,450))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,451))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,453))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,256))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,454))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,455))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,456))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,457))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,814))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},795:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},8:function(e,t){!function(){e.exports=this.React}()},80:function(e,t){!function(){e.exports=this.wp.a11y}()},82:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(3));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,u=e.minColumns,l=void 0===u?1:u,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;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,l,p);i({columns:Number.isNaN(t)?"":t})},min:l,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),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 i({alignButtons:!s})}}))}},83: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},84:function(e,t){!function(){e.exports=this.wp.date}()},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),c=r.n(n),o=r(51),a=r(0),i=r(52);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 u(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 l=function(){var e=Object(i.a)();return{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},94:function(e,t){!function(){e.exports=this.wp.autop}()}});
|
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],s=t[1],u=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 s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),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 s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17: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.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},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="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([713,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},102:function(e,t){},103:function(e,t){!function(){e.exports=this.wp.coreData}()},104:function(e,t){},108:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=r(44),u=r(3),l=r(8),b=r.n(l),p=["className","item","isSelected","isLoading","onSelect","disabled"];t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,l=e.onSelect,d=e.disabled,f=a()(e,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,c()({},f,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:d})),n&&o&&Object(i.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(u.Spinner,null)))}},113:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(58),a=r(148),i=r(5),s=r(24),u=r(43);t.a=function(e){var t=(Object(u.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.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}},120:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(5),s=r(1);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 b=Object(i.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(b).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,p(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==d[r]?d[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return l(l(l({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},121:function(e,t){!function(){e.exports=this.wp.wordcount}()},122:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return h}));var n=r(42),c=r.n(n),o=r(4),a=r.n(o),i=r(20),s=r.n(i),u=r(13),l=r.n(u),b=r(0),p=r(6),d=r(37),f=r.n(d);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 O(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){a()(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}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(b.useContext)(j)},h=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(g))}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),v=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),h=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),y={getValidationError:i,setValidationErrors:v,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!0})}),[h]),showValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!1})}),[h]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},123:function(e,t,r){"use strict";var n=r(32),c=r.n(n),o=r(4),a=r.n(o),i=r(11),s=r.n(i),u=r(0),l=r(1),b=r(6),p=(r(2),r(44)),d=r(22),f=r(15),m=r.n(f),O=r(16),g=r.n(O),j=r(17),v=r.n(j),h=r(18),y=r.n(h),w=r(9),k=r.n(w);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var E=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=_(n);function n(){return m()(this,n),r.apply(this,arguments)}return g()(n,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),n}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),P=r(255),C=r(31),S=r.n(C),N=r(12),x=r.n(N),D=r(10),B=r.n(D),R=r(37),A=r.n(R),L=r(39),T=r(41);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){a()(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}function I(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var F=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=I(n);function n(){var e;m()(this,n);for(var t=arguments.length,c=new Array(t),o=0;o<t;o++)c[o]=arguments[o];return e=r.call.apply(r,[this].concat(c)),a()(x()(e),"state",{error:null,loading:!1,variations:{}}),a()(x()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,c=r.variations;if(!n){var o=e.getExpandedProduct();if(o&&!c[o]){var i=t.find((function(e){return e.id===o}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(L.g)(o).then((function(t){var r=t.map((function(e){return z(z({},e),{},{parent:o})}));e.setState({variations:z(z({},e.state.variations),{},a()({},o,r)),loading:!1,error:null})})).catch(function(){var t=S()(B.a.mark((function t(r){var n;return B.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(T.a)(r);case 2:n=t.sent,e.setState({variations:z(z({},e.state.variations),{},a()({},o,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())):e.setState({variations:z(z({},e.state.variations),{},a()({},o,null)),loading:!1,error:null})}}})),e}return g()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!A()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,a=c.loading,i=c.variations;return Object(u.createElement)(e,s()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),n}(u.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),M=r(46),H=r(8),q=r.n(H),G=r(108);r(178);function Q(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?Q(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W={list:Object(l.__)("Products","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(l.__)("Product search results updated.","woo-gutenberg-products-block")},K=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,o=e.isCompact,a=e.isLoading,i=e.onChange,d=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,v=e.variationsLoading,h=function(e){var t=e.item,r=e.search,c=e.depth,o=void 0===c?0:c,i=e.isSelected,d=e.onSelect,f=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=q()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),"has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent,"is-variable":f>0});if(!t.breadcrumbs.length)return Object(u.createElement)(G.a,s()({},e,{className:q()(m,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){d(t)()}},isLoading:a||v,countLabel:t.variations.length>0?Object(l.sprintf)(Object(l.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));var O=Object(b.isEmpty)(t.variation)?e:U(U({},e),{},{item:U(U({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},O,{className:m,name:"variations-".concat(n)}))};if(r)return Object(u.createElement)(M.a,{error:r});var y=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(y));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:w,isCompact:o,isLoading:a,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:i,renderItem:m||(g?h:null),onSearch:d,messages:W,isHierarchical:!0})};K.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1};t.a=E(Object(P.a)(F(Object(d.withInstanceId)(K))))},125:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{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},128:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(8)),o=r.n(c),a=r(27),i=r(172);r(180);t.a=Object(i.a)((function(e){var t=e.className,r=e.instanceId,c=e.defaultValue,i=e.label,s=e.onChange,u=e.options,l=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.Label,{label:i,screenReaderLabel:l,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:s,readOnly:b,value:p},u.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},129:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=r(1),i=r(54),s=r(8),u=r.n(s),l=(r(2),r(136)),b=(r(207),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,a=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:a})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:a}))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,d=e.maxPrice,f=void 0===d?null:d,m=e.minPrice,O=void 0===m?null:m,g=e.price,j=void 0===g?null:g,v=e.priceClassName,h=e.priceStyle,y=e.regularPrice,w=e.regularPriceClassName,k=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var E=y&&j!==y,P=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return E?P=Object(o.createElement)(p,{currency:n,price:j,priceClassName:v,priceStyle:h,regularPrice:y,regularPriceClassName:w,regularPriceStyle:k}):null!==O&&null!==f?P=Object(o.createElement)(b,{currency:n,maxPrice:f,minPrice:O,priceClassName:v,priceStyle:h}):null!==j&&(P=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",v),currency:n,value:j,style:h})),Object(o.createElement)("span",{className:_},Object(l.a)(s,{price:P}))}},130:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(18),l=r.n(u),b=r(9),p=r.n(b),d=r(0),f=r(6),m=r(1),O=r(3);function g(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)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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){s()(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)(g,{level:e}),title:Object(m.sprintf)(Object(m.__)("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)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},131:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(4),o=r.n(c),a=r(6);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 s(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){o()(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}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},133:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(13),c=r.n(n),o=r(40),a=r(23),i=r(0),s=r(37),u=r.n(s),l=r(76),b=r(149),p=r(83),d=function(e){var t=Object(p.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,n])]},f=function(e,t,r){var n=Object(p.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,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(l.a)(a),m=Object(l.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(13),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return o})),r.d(t,"k",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"h",(function(){return u})),r.d(t,"c",(function(){return l})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return p})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return g})),r.d(t,"e",(function(){return j})),r.d(t,"p",(function(){return h})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return w})),r.d(t,"o",(function(){return k}));var n,c=r(5),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"assets/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=c.STORE_PAGES.privacy.title,f=c.STORE_PAGES.terms.permalink,m=c.STORE_PAGES.terms.title,O=c.STORE_PAGES.cart.id,g=c.STORE_PAGES.cart.permalink,j=c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),v=r(25),h=function(e,t){if(s>2)return Object(v.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(v.registerBlockType)(e,t)},w=function(){return s>2},k=function(){return s>1}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(13),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},148:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{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},149:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(7);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},153:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(42),c=r.n(n),o=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===c()(e)};function s(e,t){return i(e)&&t in e}},159:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(14),o=Object(n.createElement)("img",{src:c.k+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},160:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=(r(2),r(29)),u=r(8),l=r.n(u),b=(r(206),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,p=e.permalink,d=void 0===p?"":p,f=a()(e,b),m=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:m},f),Object(s.decodeEntities)(u)):Object(i.createElement)("a",c()({className:m,href:d},f),Object(s.decodeEntities)(u))}},161:function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return E}));var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(0),s=(r(2),r(23)),u=r(85),l=r(78),b=r(11),p=r.n(b),d=r(8),f=r.n(d),m=r(806),O=(r(208),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=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice","woocommerce-message",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))},j=r(810),v=r(27),h=function(e){var t=e.className,r=e.notices,n=e.removeNotice;if(e.isEditor)return null;var c=r.filter((function(e){return"snackbar"===e.type})),o=Object(v.__experimentalApplyCheckoutFilter)({filterName:"snackbarNotices",defaultValue:c}),a=f()(t,"wc-block-components-notices__snackbar");return Object(i.createElement)(j.a,{notices:o,className:a,onRemove:n})};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 w(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=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)(k)},E=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),v=j[0],y=j[1],_=Object(u.a)().dispatchStoreEvent,E=Object(l.b)().isEditor,P=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]:{};f(e,t,w(w({},r),{},{context:r.context||p})),_("store-notice-create",{status:e,content:t,options:r})}),[f,_,p]),C=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),S=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]:{};P("default",e,w(w({},t),{},{type:"snackbar"}))}),[P]),N={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:P,createSnackbarNotice:S,removeNotice:C,context:p,setIsSuppressed:y},x=v?null:Object(i.createElement)(g,{className:n,notices:N.notices,removeNotice:N.removeNotice,isEditor:E}),D=v?null:Object(i.createElement)(h,{notices:N.notices,removeNotice:N.removeNotice,isEditor:E});return Object(i.createElement)(k.Provider,{value:N},o&&x,t,D)}},162:function(e,t,r){"use strict";var n=r(0),c=r(121),o=r(94),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,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=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)(s(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)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,b=c.slice(0,t+l);return Object(o.autop)(s(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,b=void 0===s?"words":s,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 s=a(n),b=Object(c.count)(s,r);return b<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},166:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(4),j=r.n(g),v=r(0),h=r(7);r(224);function y(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(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=y(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 s()(n,[{key:"render",value:function(){return Object(v.createElement)(v.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}},170:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(5),c=r(120),o=r(21),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},173:function(e,t){},178:function(e,t){},180:function(e,t){},183:function(e,t){!function(){e.exports=this.wp.warning}()},184:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(40),c=r(23),o=r(0),a=r(76),i=r(134),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,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}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){!function(){e.exports=this.wp.url}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},224:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.data}()},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},255:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(31),a=r.n(o),i=r(15),s=r.n(i),u=r(16),l=r.n(u),b=r(12),p=r.n(b),d=r(17),f=r.n(d),m=r(18),O=r.n(m),g=r(9),j=r.n(g),v=r(0),h=r(10),y=r.n(h),w=r(6),k=r(22),_=(r(2),r(14)),E=r(39),P=r(41);function C(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j()(e);if(t){var c=j()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return O()(this,r)}}var S=Object(k.createHigherOrderComponent)((function(e){var t=function(t){f()(o,t);var r,n=C(o);function o(){var e;return s()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(p()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(p()(e)),400),e}return l()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(E.h)({selected:t}).then((function(t){e.setState({list:t,loading:!1})})).catch(this.setError)}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(E.h)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=a()(y.a.mark((function e(t){var r;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(P.a)(t);case 2:r=e.sent,this.setState({list:[],loading:!1,error:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var t=this,r=this.state,n=r.error,o=r.list,a=r.loading;return Object(v.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:_.m.productCount>100?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(v.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},256:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(8),s=r.n(i),u=r(27),l=r(43),b=r(71);r(487);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)().product;if(!i.id||!i.on_sale)return null;var b="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(o.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,b,c()({},"".concat(n,"__product-onsale"),n))},Object(o.createElement)(u.Label,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(122)),o=(r(209),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r){var p=l(a)||{};if(!p.message||p.hidden)return null;r=p.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(s)},r))})},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},30:function(e,t){!function(){e.exports=this.moment}()},309:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},33:function(e,t){!function(){e.exports=this.wp.primitives}()},34:function(e,t){!function(){e.exports=this.wp.dataControls}()},343:function(e,t){},344:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(14);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 i(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){c()(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 s={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.o)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},345: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"},productId:{type:"number",default:0}}},346:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(13),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(8),p=r.n(b),d=r(5),f=r(43),m=r(71),O=r(85),g=r(256);r(488);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 v(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){a()(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 h=function(){return Object(u.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},y=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=v({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(h,null))};t.a=Object(m.withProductDataContext)((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,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,w=Object(u.useState)(!1),k=s()(w,2),_=k[0],E=k[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(h,null));var C=!!j.images.length,S=C?j.images[0]:null,N=o?"a":u.Fragment,x=Object(l.sprintf)(Object(l.__)("Link to %s","woo-gutenberg-products-block"),j.name),D=v(v({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":x}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(N,o&&D,!!i&&Object(u.createElement)(g.default,{align:d,product:j}),Object(u.createElement)(y,{fallbackAlt:j.name,image:S,onLoad:function(){return E(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},347:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(131),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},348:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},349:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(8)),o=r.n(c),a=r(13),i=r.n(a),s=r(1),u=r(76),l=r(795),b="pristine",p="idle",d="disabled",f="processing",m="before_processing",O="after_processing",g={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},j="set_pristine",v="set_idle",h="set_disabled",y="set_processing",w="set_before_processing",k="set_after_processing",_="set_processing_response",E="set_has_error",P="set_no_error",C="set_quantity",S="set_request_params",N=j,x=v,D=h,B=y,R=w,A=k,L=_,T=E,V=P,z=C,I=S,F=function(){return{type:N}},M=function(){return{type:x}},H=function(){return{type:D}},q=function(){return{type:B}},G=function(){return{type:R}},Q=function(){return{type:A}},U=function(e){return{type:L,data:e}},W=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?T:V;return{type:t}},K=function(e){return{type:z,quantity:e}},Y=function(e){return{type:I,data:e}},$=r(4),J=r.n($);function X(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?X(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=j,te=v,re=h,ne=y,ce=w,oe=k,ae=_,ie=E,se=P,ue=C,le=S,be=b,pe=p,de=d,fe=f,me=m,Oe=O,ge=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ee:e=g;break;case te:e=t.status!==pe?Z(Z({},t),{},{status:pe}):t;break;case re:e=t.status!==de?Z(Z({},t),{},{status:de}):t;break;case ue:e=n!==t.quantity?Z(Z({},t),{},{quantity:n}):t;break;case le:e=Z(Z({},t),{},{requestParams:Z(Z({},t.requestParams),o)});break;case ae:e=Z(Z({},t),{},{processingResponse:o});break;case ne:e=!1===(e=t.status!==fe?Z(Z({},t),{},{status:fe,hasError:!1}):t).hasError?e:Z(Z({},e),{},{hasError:!1});break;case ce:e=t.status!==me?Z(Z({},t),{},{status:me,hasError:!1}):t;break;case oe:e=t.status!==Oe?Z(Z({},t),{},{status:Oe}):t;break;case ie:e=t.hasError?t:Z(Z({},t),{},{hasError:!0}),e=t.status===fe||t.status===me?Z(Z({},e),{},{status:pe}):e;break;case se:e=t.hasError?Z(Z({},t),{},{hasError:!1}):t}return e!==t&&c!==ee&&e.status===be&&(e.status=pe),e},je=r(131),ve=r(347),he="add_to_cart_before_processing",ye="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",ke=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ve.a)(ye,e),onAddToCartProcessingWithError:Object(ve.a)(we,e),onAddToCartBeforeProcessing:Object(ve.a)(he,e)}},_e=r(351),Ee=r(122),Pe=r(63),Ce=r(57),Se=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Ne=function(){return Object(n.useContext)(Se)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ge,g),a=i()(o,2),b=a[0],j=a[1],v=Object(n.useReducer)(je.b,{}),h=i()(v,2),y=h[0],w=h[1],k=Object(u.a)(y),_=Object(Pe.a)(),E=_.addErrorNotice,P=_.removeNotices,C=Object(Ee.b)().setValidationErrors,S=Object(Ce.c)(),N=S.isSuccessResponse,x=S.isErrorResponse,D=S.isFailResponse,B=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:ke(w).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:ke(w).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:ke(w).onAddToCartBeforeProcessing}}),[w]),R=Object(n.useMemo)((function(){return{resetForm:function(){j(F())},submitForm:function(){j(G())},setQuantity:function(e){j(K(e))},setHasError:function(e){j(W(e))},setRequestParams:function(e){j(Y(e))},setAfterProcessing:function(e){j(U(e)),j(Q())}}}),[]);Object(n.useEffect)((function(){var e=b.status,t=!r.id||!Object(l.a)(r);e!==d||t?e!==d&&t&&j(H()):j(M())}),[b.status,r,j]),Object(n.useEffect)((function(){b.status===m&&(P("error"),Object(_e.a)(k,he,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&E(t),r&&C(r)})),j(M())):j(q())})))}),[b.status,C,E,P,j,k]),Object(n.useEffect)((function(){if(b.status===O){var e={processingResponse:b.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(x(e)||D(e))&&r&&(t=!0,E(r,n?{context:n}:void 0))})),t};if(b.hasError)return void Object(_e.b)(k,we,e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");E(c,{id:"add-to-cart"})}j(M())}));Object(_e.b)(k,ye,e).then((function(e){t(e)?j(W(!0)):j(M())}))}}),[b.status,b.hasError,b.processingResponse,R,E,x,D,N,k]);var A=Object(l.b)(r),L={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:A,showFormElements:c&&A,quantity:b.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:b.requestParams,isIdle:b.status===p,isDisabled:b.status===d,isProcessing:b.status===f,isBeforeProcessing:b.status===m,isAfterProcessing:b.status===O,hasError:b.hasError,eventRegistration:B,dispatchActions:R};return Object(n.createElement)(Se.Provider,{value:L},t)},De=r(19),Be=r.n(De),Re=r(29),Ae=r(52);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}var Te=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(Ee.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,f=Object(Pe.a)(),m=f.addErrorNotice,O=f.removeNotice,g=Object(Ae.a)().receiveCart,j=Object(n.useState)(!1),v=i()(j,2),h=v[0],y=v[1],w=!a&&u,k=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var _=Object(n.useCallback)((function(){y(!0),O("add-to-cart");var e=function(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){J()(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}({id:r.id||0,quantity:c},l);Be()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Be.a.setNonce(e.headers),e.json().then((function(r){e.ok?g(r):(r.body&&r.body.message?m(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&g(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,m,O,g,t,c,l]);return Object(n.useEffect)((function(){w&&!h&&_()}),[w,_,h]),null},Ve=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Ee.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Te,null)))},ze=r(43),Ie=r(6),Fe=r(71),Me=(r(343),r(27)),He=r(58),qe=r(497),Ge=r(85),Qe=r(716),Ue=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(Me.Button,{className:t,href:r,onClick:o,rel:"nofollow"},c)},We=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(Me.Button,{className:t,disabled:o,showSpinner:c,onClick:i},a&&r>0?Object(s.sprintf)(Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(He.a,{srcElement:qe.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Ke=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(ze.useInnerBlockLayoutContext)().parentName,m=Object(Ge.a)().dispatchStoreEvent,O=Object(Qe.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),v=j[0],h=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||h(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(We,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:u,isProcessing:l,isDone:v,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(s.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:f})}})},Ye=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},$e=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},Je=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},Xe=(r(496),r(32)),Ze=r.n(Xe),et=r(3),tt=r(7),rt=r(258),nt={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Ee.b)(),f=d.getValidationError,m=d.setValidationErrors,O=d.clearValidationError,g=t,j=f(g)||{};return Object(tt.useEffect)((function(){i?O(g):m(J()({},g,{message:p,hidden:!0}))}),[i,g,p,O,m]),Object(tt.useEffect)((function(){return function(){O(g)}}),[g,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Re.decodeEntities)(t),value:i||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName:g,elementId:g}))};function ot(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 at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||(null===o||o===c)}))}))},st=function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],i=at(at({},r),{},J()({},c,null)),s=o?it(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=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:Object(Re.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function ut(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 lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),f=i()(d,2),m=f[0],O=f[1],g=Object(n.useMemo)((function(){return st(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return it(e,t,r)[0]||0}(o,a,m)):b>0&&p(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:g[e],value:m[e],onChange:function(t){O(lt(lt({},m),{},J()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Ie.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(bt,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},dt=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(pt,{product:t,dispatchers:a}),Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},ft=function(){return Object(n.createElement)(Ke,null)},mt=function(){return Object(n.createElement)(et.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return Object(n.createElement)(mt,null)},gt=function(){var e=Ne(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(Ot,null):"external"===r?Object(n.createElement)(ft,null):"simple"===r||"variation"===r?Object(n.createElement)(Je,null):null:Object(n.createElement)(Ke,null)};t.a=Object(Fe.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(ze.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Ie.isEmpty)(c)});return Object(n.createElement)(Ve,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(gt,null)))}))},350:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(43),u=r(24),l=r(14),b=function(e){var t=e.color,r=e.fontSize;return Object(l.o)()?{color:t,fontSize:r}:{}},p=r(71),d=r(160),f=r(85);r(486),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.productLink,g=void 0===O||O,j=e.align,v=e.color,h=e.customColor,y=e.fontSize,w=e.customFontSize,k=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,E=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(u.getColorClassName)("color",v),S=Object(u.getFontSizeClass)(y),N=i()((t={"has-text-color":v||h,"has-font-size":y||w},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(k,"__product-title"),k),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},N,Object(l.o)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:h,fontSize:w}),onClick:function(){E("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(k,"__product-title"),k),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),c()(n,N,Object(l.o)()),n)),style:b({color:h,fontSize:w})})}))},351:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(42),c=r.n(n),o=r(31),a=r.n(o),i=r(10),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(57);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(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}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(f)&&!Object(l.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return v})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(4),c=r.n(n),o=r(21),a=r(19),i=r.n(a),s=r(6),u=r(5),l=r(14);function b(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 p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s=l.m.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),b}({selected:r,search:c,queryArgs:void 0===a?[]:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},v=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},y=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(31),c=r.n(n),o=r(10),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.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)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},43:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},449:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(129),u=r(59),l=r(43),b=r(24),p=r(14),d=r(71);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,v=e.customFontSize,h=e.saleFontSize,y=e.customSaleFontSize,w=e.color,k=e.customColor,_=e.saleColor,E=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var N=Object(b.getColorClassName)("color",w),x=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(h),R=i()((t={"has-text-color":w||k,"has-font-size":j||v},c()(t,N,N),c()(t,x,x),t)),A=i()((r={"has-text-color":_||E,"has-font-size":h||y},c()(r,D,D),c()(r,B,B),r)),L={color:k,fontSize:v},T={color:E,fontSize:y},V=C.prices,z=Object(u.getCurrencyFromPriceResponse)(V),I=V.price!==V.regular_price,F=I?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,A,Object(p.o)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.o)()),a)),M=I?T:L;return Object(o.createElement)(s.a,{align:g,className:S,currency:z,price:V.price,priceClassName:F,priceStyle:Object(p.o)()?M:{},minPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==V||null===(f=V.price_range)||void 0===f?void 0:f.max_amount,regularPrice:V.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.o)()),m)),regularPriceStyle:Object(p.o)()?L:{}})}))},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},450:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(8),s=r.n(i),u=r(43),l=r(71),b=(r(489),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},451:function(e,t,r){"use strict";r.r(t);var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(0),s=(r(2),r(8)),u=r.n(s),l=r(1),b=r(85),p=r(716),d=r(29),f=r(43),m=r(71),O=(r(490),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,v=O.addToCart,h=Number.isFinite(g)&&g>0,y=!a&&s&&f,w=Object(d.decodeEntities)((null==o?void 0:o.description)||""),k=h?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=y?"button":"a",E={};return y?E.onClick=function(){v(),m("cart-add-item",{product:t})}:(E.href=n,E.rel="nofollow",E.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},E),k)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},453:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(8)),i=r.n(a),s=r(162),u=r(14),l=r(43),b=r(71);r(491);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:u.m.wordCountType||"words"}):null}))},454:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(43),l=r(71);r(492);t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product.sku;return n?Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-sku",c()({},"".concat(r,"__product-sku"),r))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,n)):null}))},455:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(493);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-category-list",c()({},"".concat(r,"__product-category-list"),r))},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.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))}))))}))},456:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(494);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-tag-list",c()({},"".concat(r,"__product-tag-list"),r))},Object(a.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.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))}))))}))},457:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(8)),s=r.n(i),u=r(43),l=r(71),b=(r(495),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.default=Object(l.withProductDataContext)((function(e){var t,r=e.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;if(!a.id||!a.is_purchasable)return null;var i=!!a.is_in_stock,l=a.low_stock_remaining,d=a.is_on_backorder;return Object(o.createElement)("div",{className:s()(r,"wc-block-components-product-stock-indicator",(t={},c()(t,"".concat(n,"__stock-indicator"),n),c()(t,"wc-block-components-product-stock-indicator--in-stock",i),c()(t,"wc-block-components-product-stock-indicator--out-of-stock",!i),c()(t,"wc-block-components-product-stock-indicator--low-stock",!!l),c()(t,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),t))},l?b(l):p(i,d))}))},46:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(45));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(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},48:function(e,t){!function(){e.exports=this.wp.keycodes}()},486:function(e,t){},487:function(e,t){},488:function(e,t){},489:function(e,t){},490:function(e,t){},491:function(e,t){},492:function(e,t){},493:function(e,t){},494:function(e,t){},495:function(e,t){},496:function(e,t){},497:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},50:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},51:function(e,t){!function(){e.exports=this.wp.hooks}()},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(13),c=r.n(n),o=r(4),a=r.n(o),i=r(6),s=r(0),u=r(40),l=r(23),b=r(29),p=r(147),d=r(170),f=r(78);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 O(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){a()(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 g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},j=O(O({},g),{},{email:"",phone:""}),v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},h={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:j,shippingAddress:g,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},o=e.shouldSelect,a=Object(s.useRef)(),b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:j,shippingAddress:g,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(u.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),O=i.needsShipping?v(i.shippingAddress):m,y=i.fees.map((function(e){return v(e)}));return{cartCoupons:i.coupons,cartItems:i.items||[],cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors||[],cartTotals:l,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(O),extensions:i.extensions||{},shippingRates:i.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements||[],receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},54:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(20),s=r.n(i),u=r(0),l=r(165),b=r(8),p=r.n(b),d=(r(173),["className","value","currency","onValueChange","displayType"]);function f(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?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(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=e.displayType,i=void 0===a?"text":a,b=s()(e,d),f="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(f))return null;var O=f/Math.pow(10,n.minorUnit);if(!Number.isFinite(O))return null;var g=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),j=m(m(m({},b),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}),v=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:g,displayType:i},j,{value:O,onValueChange:v}))}},57:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(153);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},58:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=["srcElement","size"];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,s);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)):null}},59:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},61:function(e,t){!function(){e.exports=this.wp.deprecated}()},63:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),c=r.n(n),o=r(0),a=r(161);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 s(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 u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),b=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[r,c]);return s(s(s({notices:t},l),b),{},{setIsSuppressed:i})}},685:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},692:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},7:function(e,t){!function(){e.exports=this.React}()},700:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},701:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(14),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.k+"img/pennant.jpg",thumbnail:c.k+"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}]},706:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},71:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},713:function(e,t,r){e.exports=r(765)},714:function(e,t){},715:function(e,t){},716:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(13),c=r.n(n),o=r(0),a=r(23),i=r(40),s=r(29),u=r(52),l=r(63),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)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(l.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],v=g[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;return v(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},718:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"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},719:function(e,t){},72:function(e,t){!function(){e.exports=this.wp.dom}()},720:function(e,t){},721:function(e,t){},722:function(e,t){},73:function(e,t){!function(){e.exports=this.ReactDOM}()},74:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(0),j=r(6),v=r(8),h=r.n(v),y=r(3),w=r(22);r(104);function k(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}var _=function(e){p()(r,e);var t=k(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(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,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(y.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}(g.Component);t.a=Object(w.withInstanceId)(_)},76:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(37),o=r.n(c);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},765:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return Qr}));var n=r(4),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(24),l=r(25),b=r(58),p=r(33),d=Object(i.createElement)(p.SVG,{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(14),m=r(8),O=r.n(m),g=function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},j={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.n)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},v=r(344),h=r(3),y=r(22),w=r(130),k=r(350),_=r(13),E=r.n(_),P=r(123),C=r(20),S=r.n(C),N=(r(715),["className"]);var x=function(e){var t=e.className,r=void 0===t?"":t,n=S()(e,N),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},D=r(43),B=(r(714),function(e){return function(t){return function(r){var n=Object(D.useProductDataContext)(),c=r.attributes,o=r.setAttributes,a=c.productId,l=Object(i.useState)(!a),b=E()(l,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(P.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(x,{onClick:function(){return d(!0)}},Object(s.__)("Switch product…","woo-gutenberg-products-block")))),Object(i.createElement)(t,r)))}}}),R=Object(i.createElement)(p.SVG,{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 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"})),A=Object(s.__)("Product Title","woo-gutenberg-products-block"),L=Object(i.createElement)(b.a,{srcElement:R}),T=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),V=function(e){var t=e.color,r=e.fontSize,n=e.setFontSize,c=e.setColor,o=e.attributes,a=e.setAttributes,l=o.headingLevel,b=o.productLink,p=o.align;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:l,onChange:function(e){return a({headingLevel:e})}}),Object(f.o)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({productLink:!b})}})),Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(k.a,o)))},z=Object(f.o)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),B({icon:L,label:A,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(V):V;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 F(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 M={title:A,description:T,icon:{src:L,foreground:"#874FB9"},attributes:v.a,edit:z};Object(l.registerBlockType)("woocommerce/product-title",F(F({},j),M));var H=r(449),q=r(309),G=Object(s.__)("Product Price","woo-gutenberg-products-block"),Q=Object(i.createElement)(b.a,{srcElement:q.a}),U=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),W=function(e){var t=e.fontSize,r=e.setFontSize,n=e.color,c=e.setColor,o=e.colorLabel;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.FontSizePicker,{value:t.size,onChange:r}),Object(i.createElement)(h.BaseControl,{label:o},Object(i.createElement)(u.ColorPalette,{value:n.color,onChange:c,label:Object(s.__)("Color")})))},K=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,l=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.o)()&&Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(u.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(W,{color:o,setColor:l,fontSize:t,setFontSize:n,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Sale price","woo-gutenberg-products-block")},Object(i.createElement)(W,{color:a,setColor:b,fontSize:r,setFontSize:c,colorLabel:Object(s.__)("Color","woo-gutenberg-products-block")})))),Object(i.createElement)(H.default,p))},Y=Object(f.o)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withFontSizes)("saleFontSize"),Object(u.withFontSizes)("originalFontSize"),Object(u.withColors)("color",{textColor:"color"}),Object(u.withColors)("saleColor",{textColor:"saleColor"}),Object(u.withColors)("originalColor",{textColor:"originalColor"}),B({icon:Q,label:G,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(K):K;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 J(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 X={productId:{type:"number",default:0}};function Z(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 ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(f.o)()&&(X=J(J({},X),{},{align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}}));var te={title:G,description:U,icon:{src:Q,foreground:"#874FB9"},attributes:X,edit:Y};Object(l.registerBlockType)("woocommerce/product-price",ee(ee({},j),te));var re=r(345),ne=r(136),ce=r(74),oe=r(5),ae=r(346),ie=Object(i.createElement)(p.SVG,{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"})),se=Object(s.__)("Product Image","woo-gutenberg-products-block"),ue=Object(i.createElement)(b.a,{srcElement:ie}),le=Object(s.__)("Display the main product image","woo-gutenberg-products-block"),be=B({icon:ue,label:se,description:Object(s.__)("Choose a product to display its image.","woo-gutenberg-products-block")})((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)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:n,onChange:function(){return r({productLink:!n})}}),Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(s.__)('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)(ce.a,{label:Object(s.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:a,options:[{label:Object(s.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(s.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(s.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:function(e){return r({saleBadgeAlign:e})}}),Object(i.createElement)(ce.a,{label:Object(s.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(ne.a)(Object(s.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(i.createElement)("a",{href:"".concat(Object(oe.getAdminLink)("customize.php"),"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images"),target:"_blank",rel:"noopener noreferrer"})}),value:c,options:[{label:Object(s.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(s.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:function(e){return r({imageSizing:e})}}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(ae.a,t)))}));function pe(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 de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fe={title:se,description:le,icon:{src:ue,foreground:"#874FB9"},attributes:re.a,edit:be};Object(l.registerBlockType)("woocommerce/product-image",de(de({},j),fe));var me={productId:{type:"number",default:0}},Oe=r(450),ge=r(700),je=Object(s.__)("Product Rating","woo-gutenberg-products-block"),ve=Object(i.createElement)(b.a,{srcElement:ge.a});function he(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 ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var we={title:je,description:Object(s.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:ve,foreground:"#874FB9"},attributes:me,edit:B({icon:ve,label:je,description:Object(s.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Oe.default,t)}))};Object(l.registerBlockType)("woocommerce/product-rating",ye(ye({},j),we));var ke={productId:{type:"number",default:0}},_e=r(451),Ee=r(718),Pe=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Ce=Object(i.createElement)(b.a,{srcElement:Ee.a});function Se(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?Se(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xe={title:Pe,description:Object(s.__)("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:Ce,foreground:"#874FB9"},attributes:ke,edit:B({icon:Ce,label:Pe,description:Object(s.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(_e.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Ne(Ne({},j),xe));var De={productId:{type:"number",default:0}},Be=r(453),Re=Object(i.createElement)(p.SVG,{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"})),Ae=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Le=Object(i.createElement)(b.a,{srcElement:Re});function Te(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?Te(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ze={title:Ae,description:Object(s.__)("Display a short description about a product.","woo-gutenberg-products-block"),icon:{src:Le,foreground:"#874FB9"},attributes:De,edit:B({icon:Le,label:Ae,description:Object(s.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Be.default,t)}))};Object(l.registerBlockType)("woocommerce/product-summary",Ve(Ve({},j),ze));var Ie={productId:{type:"number",default:0}},Fe=r(256),Me=r(692),He=Object(s.__)("On-Sale Badge","woo-gutenberg-products-block"),qe=Object(i.createElement)(b.a,{srcElement:Me.a});function Ge(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 Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ue={title:He,description:Object(s.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:qe,foreground:"#874FB9"},supports:{html:!1},attributes:Ie,edit:B({icon:qe,label:He,description:Object(s.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(Fe.default,t)}))};Object(l.registerBlockType)("woocommerce/product-sale-badge",Qe(Qe({},j),Ue));var We={productId:{type:"number",default:0}},Ke=r(113),Ye=r(454),$e=Object(i.createElement)(p.SVG,{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"})),Je=Object(s.__)("Product SKU","woo-gutenberg-products-block"),Xe=Object(i.createElement)(b.a,{srcElement:$e});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={title:Je,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Xe,foreground:"#874FB9"},attributes:We,edit:B({icon:Xe,label:Je,description:Object(s.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(Ye.default,t))}))};Object(f.p)("woocommerce/product-sku",et(et({},j),tt));var rt={productId:{type:"number",default:0}},nt=r(455),ct=r(685),ot=Object(s.__)("Product Category List","woo-gutenberg-products-block"),at=Object(i.createElement)(b.a,{srcElement:ct.a});function it(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?it(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ut={title:ot,description:Object(s.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block"),icon:{src:at,foreground:"#874FB9"},attributes:rt,edit:B({icon:at,label:ot,description:Object(s.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(nt.default,t)))}))};Object(f.p)("woocommerce/product-category-list",st(st({},j),ut));var lt={productId:{type:"number",default:0}},bt=r(456),pt=Object(s.__)("Product Tag List","woo-gutenberg-products-block"),dt=Object(i.createElement)(b.a,{srcElement:Me.a});function ft(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 mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ot={title:pt,description:Object(s.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:dt,foreground:"#874FB9"},attributes:lt,edit:B({icon:dt,label:pt,description:Object(s.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(bt.default,t)))}))};Object(f.p)("woocommerce/product-tag-list",mt(mt({},j),Ot));var gt={productId:{type:"number",default:0}},jt=r(457),vt=Object(i.createElement)(p.SVG,{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"}))),ht=Object(s.__)("Product Stock Indicator","woo-gutenberg-products-block"),yt=Object(i.createElement)(b.a,{srcElement:vt});function wt(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?wt(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _t={title:ht,description:Object(s.__)("Display product stock status.","woo-gutenberg-products-block"),icon:{src:yt,foreground:"#874FB9"},attributes:gt,edit:B({icon:yt,label:ht,description:Object(s.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Ke.a,null),Object(i.createElement)(jt.default,t))}))};Object(f.p)("woocommerce/product-stock-indicator",kt(kt({},j),_t));var Et=r(795),Pt=(r(343),r(349)),Ct=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),St=Object(i.createElement)(b.a,{srcElement:Ee.a});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 xt(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 Dt={title:Ct,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:St,foreground:"#874FB9"},edit:B({icon:St,label:Ct,description:Object(s.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(D.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(Ke.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(Et.b)(n)?Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Display form elements","woo-gutenberg-products-block"),help:Object(s.__)("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)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(s.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Pt.a,t)))})),attributes:r(348).a};Object(f.p)("woocommerce/product-add-to-cart",xt(xt({},j),Dt));var Bt=r(15),Rt=r.n(Bt),At=r(12),Lt=r.n(At),Tt=r(17),Vt=r.n(Tt),zt=r(18),It=r.n(zt),Ft=r(9),Mt=r.n(Ft),Ht=r(23),qt=(r(2),r(82)),Gt=r(791),Qt=r(701),Ut=r(148),Wt=function(e,t){var r=t.className,n=t.contentVisibility;return O()(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})},Kt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(i.createElement)("p",null,Object(s.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:oe.ADMIN_URL+"post-new.php?post_type=product"},Object(s.__)("Add new product","woo-gutenberg-products-block")+" ",Object(i.createElement)(b.a,{srcElement:Ut.a})),Object(i.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(s.__)("Learn more","woo-gutenberg-products-block")))},Yt=function(e,t){return Object(i.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(s.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))};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 Jt(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 Xt=[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],Zt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,Jt(Jt({},t.attributes),{},{product:void 0,children:t.innerBlocks.length>0?e(t.innerBlocks):[]})]})):[]};function er(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 tr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?er(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):er(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rr=function(e,t){var r=e.contentVisibility;return Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:r.orderBy,onChange:function(){return t({contentVisibility:tr(tr({},r),{},{orderBy:!r.orderBy})})}})},nr=function(e,t){return Object(i.createElement)(h.SelectControl,{label:Object(s.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(s.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(s.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(s.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(s.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(s.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(s.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:function(e){return t({orderby:e})}})},cr=r(16),or=r.n(cr),ar=r(7),ir=r(6),sr=r(27),ur=(r(722),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,u=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=u.minIndex,b=u.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 g=[];if(l&&b)for(var j=l;j<=b;j++)g.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(sr.Label,{screenReaderLabel:Object(s.__)("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(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(sr.Label,{label:"<",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:O()("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)(sr.Label,{label:1,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),g.map((function(e){return Object(i.createElement)("button",{key:e,className:O()("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)(sr.Label,{label:e,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:O()("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)(sr.Label,{label:a,screenReaderLabel:Object(s.sprintf)(Object(s.__)("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(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(sr.Label,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});ur.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var lr=ur,br=r(149),pr=r(133),dr=r(184),fr=r(40),mr=r(76);function Or(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 gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Or(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jr=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(dr.a)(gr(gr({},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 s=Object(mr.a)(i),u=Object(mr.a)(o),l=Object(Ht.useSelect)((function(t){var c=t(fr.COLLECTIONS_STORE_KEY),o=[e,r,n,s,u];return{value:c.getCollectionHeader.apply(c,o),isLoading:c.hasFinishedResolution("getCollectionHeader",o)}}),[e,r,n,u,s]),b=l.value,p=l.isLoading;return{value:b,isLoading:void 0===p||p}}("x-wp-total",gr(gr({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},vr=r(85),hr=r(166),yr=r(80),wr=r(125),kr=function(){var e=Object(D.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:wr.a,size:100}),Object(i.createElement)("strong",{className:"".concat(e,"__no-products-title")},Object(s.__)("No products","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(e,"__no-products-description")},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},_r=r(706),Er=function(e){var t=e.resetCallback,r=void 0===t?function(){}:t,n=Object(D.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:_r.a,size:100}),Object(i.createElement)("strong",{className:"".concat(n,"__no-products-title")},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(i.createElement)("p",{className:"".concat(n,"__no-products-description")},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(i.createElement)("button",{onClick:r},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},Pr=r(128),Cr=(r(721),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(Pr.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(s.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(s.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(s.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(s.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(s.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(s.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:c})}),Sr=r(172),Nr=Object(Sr.a)((function(e){var t=e.product,r=e.attributes,n=e.instanceId,c=r.layoutConfig,o=Object(D.useInnerBlockLayoutContext)(),s=o.parentClassName,u=o.parentName,l=0===Object.keys(t).length,b=O()("".concat(s,"__product"),"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(Gt.a)(t);return n.map((function(n,s){var u=E()(n,2),l=u[0],b=u[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 m=r.id||0,O=["layout",l,s,c,m];return Object(i.createElement)(i.Suspense,{key:O.join("_"),fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},Object(i.createElement)(f,a()({},p,{children:d,product:r})))}))}}(u,t,c,n))})),xr=(r(720),["order","orderby","page","per_page"]);function Dr(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 Br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Rr=function(e){var t=e.totalQuery,r=e.totalProducts,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=n.totalQuery;return!Object(ir.isEqual)(t,c)&&Number.isFinite(r)},Ar=Object(hr.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=e.hideOutOfStockItems,l=void 0!==u&&u,b=Object(pr.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=e.hideOutOfStockItems,o=n.columns,a=n.rows;return Br(Br({},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:r},c&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:o,currentPage:r,hideOutOfStockItems:l})),p=E()(b,1)[0],d=jr(p),f=d.products,m=d.totalProducts,g=d.productsLoading,j=Object(D.useInnerBlockLayoutContext)(),v=j.parentClassName,h=j.parentName,y=function(e){e.order,e.orderby,e.page,e.per_page;return S()(e,xr)||{}}(p),w=Object(vr.a)().dispatchStoreEvent,k=Object(pr.b)("attributes",[]),_=E()(k,2),P=_[0],C=_[1],N=Object(pr.b)("min_price"),x=E()(N,2),B=x[0],R=x[1],A=Object(pr.b)("max_price"),L=E()(A,2),T=L[0],V=L[1],z=Object(br.a)({totalQuery:y,totalProducts:m},Rr);Object(i.useEffect)((function(){w("product-list-render",{products:f,listName:h})}),[f,h,w]),Object(i.useEffect)((function(){Object(ir.isEqual)(y,null==z?void 0:z.totalQuery)||(n(1),null!=z&&z.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(yr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(yr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(m))}),[null==z?void 0:z.totalQuery,m,n,y]);var I,F,M,H,q,G=t.contentVisibility,Q=t.columns*t.rows,U=!Number.isFinite(m)&&Number.isFinite(null==z?void 0:z.totalProducts)&&Object(ir.isEqual)(y,null==z?void 0:z.totalQuery)?Math.ceil(z.totalProducts/Q):Math.ceil(m/Q),W=f.length?f:Array.from({length:Q}),K=0!==f.length||g,Y=P.length>0||Number.isFinite(B)||Number.isFinite(T);return Object(i.createElement)("div",{className:(I=t.columns,F=t.rows,M=t.alignButtons,H=t.align,q=void 0!==H?"align"+H:"",O()(v,q,"has-"+I+"-columns",{"has-multiple-rows":F>1,"has-aligned-buttons":M}))},G.orderBy&&K&&Object(i.createElement)(Cr,{onChange:c,value:o}),!K&&Y&&Object(i.createElement)(Er,{resetCallback:function(){C([]),R(null),V(null)}}),!K&&!Y&&Object(i.createElement)(kr,null),K&&Object(i.createElement)("ul",{className:"".concat(v,"__products")},W.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)(Nr,{key:e.id||r,attributes:t,product:e})}))),U>1&&Object(i.createElement)(lr,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:U}))})),Lr=function(e){var t=e.attributes,r=e.hideOutOfStockItems,n=void 0!==r&&r,c=Object(i.useState)(1),o=E()(c,2),a=o[0],s=o[1],u=Object(i.useState)(t.orderby),l=E()(u,2),b=l[0],p=l[1];Object(i.useEffect)((function(){p(t.orderby)}),[t.orderby]);return Object(i.createElement)(Ar,{attributes:t,hideOutOfStockItems:n,currentPage:a,onPageChange:function(e){s(e)},onSortChange:function(e){var t=e.target.value;p(t),s(1)},sortValue:b})},Tr=r(159);function Vr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mt()(e);if(t){var c=Mt()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return It()(this,r)}}var zr=function(e){Vt()(r,e);var t=Vr(r);function r(){return Rt()(this,r),t.apply(this,arguments)}return or()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;if(t.isPreview)return Tr.a;var n=Object(oe.getSetting)("hideOutOfStockItems",!1);return Object(i.createElement)(D.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Lr,{attributes:t,urlParameterSuffix:r,hideOutOfStockItems:n}))}}]),r}(ar.Component);r(719);function Ir(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mt()(e);if(t){var c=Mt()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return It()(this,r)}}var Fr=function(e){Vt()(r,e);var t=Ir(r);function r(){var e;Rt()(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()(Lt()(e),"state",{isEditing:!1,innerBlocks:[]}),c()(Lt()(e),"blockMap",Object(Gt.a)("woocommerce/all-products")),c()(Lt()(e),"componentDidMount",(function(){var t=e.props.block;e.setState({innerBlocks:t.innerBlocks})})),c()(Lt()(e),"getTitle",(function(){return Object(s.__)("All Products","woo-gutenberg-products-block")})),c()(Lt()(e),"getIcon",(function(){return Object(i.createElement)(b.a,{srcElement:d})})),c()(Lt()(e),"togglePreview",(function(){var t=e.props.debouncedSpeak;e.setState({isEditing:!e.state.isEditing}),e.state.isEditing||t(Object(s.__)("Showing All Products block preview.","woo-gutenberg-products-block"))})),c()(Lt()(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)(u.InspectorControls,{key:"inspector"},Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(i.createElement)(qt.a,{columns:c,rows:o,alignButtons:a,setAttributes:n,minColumns:Object(oe.getSetting)("min_columns",1),maxColumns:Object(oe.getSetting)("max_columns",6),minRows:Object(oe.getSetting)("min_rows",1),maxRows:Object(oe.getSetting)("max_rows",6)})),Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content Settings","woo-gutenberg-products-block")},rr(r,n),nr(r,n)))})),c()(Lt()(e),"getBlockControls",(function(){var t=e.state.isEditing;return Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(s.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return e.togglePreview()},isActive:t}]}))})),c()(Lt()(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)(h.Placeholder,{icon:e.getIcon(),label:e.getTitle()},Object(s.__)("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)(h.Tip,null,Object(s.__)("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)(D.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(i.createElement)("ul",{className:"wc-block-grid__products"},Object(i.createElement)("li",{className:"wc-block-grid__product"},Object(i.createElement)(D.ProductDataContextProvider,{product:Qt.a[0]},Object(i.createElement)(u.InnerBlocks,t)))))),Object(i.createElement)("div",{className:"wc-block-all-products__actions"},Object(i.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:function(){var t=e.props,r=t.block;(0,t.setAttributes)({layoutConfig:Zt(r.innerBlocks)}),e.setState({innerBlocks:r.innerBlocks}),e.togglePreview()}},Object(s.__)("Done","woo-gutenberg-products-block")),Object(i.createElement)(h.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(s.__)("Cancel","woo-gutenberg-products-block")),Object(i.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(i.createElement)(b.a,{srcElement:d}),label:Object(s.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:function(){var t=e.props,r=t.block,n=t.replaceInnerBlocks,c=[];Xt.map((function(e){var t=E()(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(s.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(Lt()(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)(h.Disabled,null,Object(i.createElement)(zr,{attributes:t})):Yt(c,o)})),c()(Lt()(e),"render",(function(){var t=e.props.attributes,r=e.state.isEditing,n=e.getTitle(),c=e.getIcon();return 0===f.m.productCount?Kt(n,c):Object(i.createElement)("div",{className:Wt("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return r}(i.Component),Mr=Object(y.compose)(h.withSpokenMessages,Object(Ht.withSelect)((function(e,t){var r=t.clientId;return{block:(0,e("core/block-editor").getBlock)(r)}})),Object(Ht.withDispatch)((function(e){return{replaceInnerBlocks:e("core/block-editor").replaceInnerBlocks}})))(Fr),Hr={columns:Object(oe.getSetting)("default_columns",3),rows:Object(oe.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Xt,isPreview:!1};function qr(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 Gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qr={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(s.__)("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:Hr,edit:function(e){return Object(i.createElement)(Mr,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:Wt("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Gr(Gr({},Qr),{},{deprecated:[{attributes:Object.assign({},Qr.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:Wt("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},77:function(e,t){!function(){e.exports=this.wp.viewport}()},78: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(23),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),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,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:b},t)}},791:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(50),c=r(0),o=r(14);r.p=o.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,449))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,812))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,813))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,450))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,451))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,453))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,256))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,454))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,455))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,456))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,457))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,814))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},795:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},80:function(e,t){!function(){e.exports=this.wp.a11y}()},82:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(3));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,u=e.minColumns,l=void 0===u?1:u,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;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,l,p);i({columns:Number.isNaN(t)?"":t})},min:l,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),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 i({alignButtons:!s})}}))}},83: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},84:function(e,t){!function(){e.exports=this.wp.date}()},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),c=r.n(n),o=r(51),a=r(0),i=r(52);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 u(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 l=function(){var e=Object(i.a)();return{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},94:function(e,t){!function(){e.exports=this.wp.autop}()}});
|
build/all-reviews.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'a198f01b64b991c61c4a4e5779824947');
|
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={7: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([702,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},104:function(e,t){},114:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return d}));var n=r(0),o=r(1),c=r(135),i=r(3),a=r(24),s=r(5),l=r(74),u=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){var r=Object(s.getSetting)("showAvatars",!0),a=Object(s.getSetting)("reviewRatingsEnabled",!0);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&&!a&&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)(l.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&&!r&&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"})}))))},d=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}))}},124:function(e,t,r){"use strict";var n=r(0),o=r(33),c=Object(n.createElement)(o.SVG,{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},126:function(e,t){},127:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),i=r(27),a=r(173);r(180);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.Label,{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)}))))}))},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(14),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.k+"img/avatar.jpg",96:o.k+"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.k+"img/avatar.jpg",96:o.k+"img/avatar.jpg"},rating:null,verified:!1}]}}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return c})),r.d(t,"k",(function(){return i})),r.d(t,"l",(function(){return a})),r.d(t,"h",(function(){return l})),r.d(t,"c",(function(){return u})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return w})),r.d(t,"i",(function(){return v})),r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"e",(function(){return g})),r.d(t,"p",(function(){return O})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return j})),r.d(t,"o",(function(){return _}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,w=o.STORE_PAGES.terms.permalink,v=o.STORE_PAGES.terms.title,f=o.STORE_PAGES.cart.id,m=o.STORE_PAGES.cart.permalink,g=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=r(26),O=function(e,t){if(s>2)return Object(h.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(h.registerBlockType)(e,t)},j=function(){return s>2},_=function(){return s>1}},164: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}}},165:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),i=(r(179),r(70));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(i.a)(t)},Object(i.b)(t)))}},169:function(e,t,r){"use strict";var n=r(15),o=r.n(n),c=r(16),i=r.n(c),a=r(17),s=r.n(a),l=r(18),u=r.n(l),b=r(9),d=r.n(b),p=r(0),w=r(1),v=r(8),f=(r(2),r(6)),m=r(3),g=r(5),h=r(92),O=r(27),y=(r(223),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.Label,{label:r,screenReaderLabel:n})))});y.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var j=y,_=r(127),k=(r(220),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(4),E=r.n(R),P=r(7),C=r.n(P),S=r(12),T=r.n(S),N=r(197),x=r.n(N),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=x()(e,{suffix:r,limit:t});return n.html},A=function(e,t,r,n){var o=I(e,t,r);return L(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=L(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 D(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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=D(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(v.createRef)(),n.reviewContent=Object(v.createRef)(),n.getButton=n.getButton.bind(T()(n)),n.onClick=n.onClick.bind(T()(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:A(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}(v.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(222);var G=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,v=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:C()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||v)&&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||v||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},v&&function(e){var t=e.rating,r={width:t/5*100+"%"},n=Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);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","aria-label":n},Object(p.createElement)("span",{style:r},n)))}(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(221);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 F(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 z=function(e){var t=e.attributes,r=e.reviews,n=Object(g.getSetting)("showAvatars",!0),o=Object(g.getSetting)("reviewRatingsEnabled",!0),c=(n||"product"===t.imageType)&&t.showReviewImage,i=o&&t.showReviewRating,a=F(F({},t),{},{showReviewImage:c,showReviewRating:i});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(G,{attributes:a}):r.map((function(e,t){return Object(p.createElement)(G,{key:e.id||t,attributes:a,review:e})})))},W=r(11),U=r.n(W),J=r(31),q=r.n(J),Y=r(10),K=r.n(Y),Q=r(37),X=r.n(Q),Z=r(70),$=r(41);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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()(T()(e),"isPreview",!!e.props.attributes.previewReviews),E()(T()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(T()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(T()(e),"setError",function(){var t=q()(K.a.mark((function t(r){var n,o;return K.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.c)(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,U()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(v.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;if(r)return Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n});if(0===c.length&&!n)return Object(p.createElement)(o,{attributes:t});var a=Object(g.getSetting)("reviewRatingsEnabled",!0);return Object(p.createElement)(m.Disabled,null,t.showOrderby&&a&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(z,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(j,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")}))}}]),r}(v.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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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.noReviewsPlaceholder,n=t.categoryIds,o=t.productId,c=t.reviewsOnPageLoad,i=t.showProductName,a=t.showReviewDate,s=t.showReviewerName,l=t.showReviewContent,u=t.showReviewImage,b=t.showReviewRating,d=Object(Z.d)(t.orderby),w=d.order,v=d.orderby;return!(l||b||a||s||u||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(Z.a)(t)},Object(p.createElement)(re,{attributes:t,categoryIds:n,delayFunction:function(e){return Object(f.debounce)(e,400)},noReviewsPlaceholder:r,orderby:v,order:w,productId:o,reviewsToDisplay:c}))}}]),r}(v.Component);t.a=oe},179:function(e,t){},180:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},26:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},3:function(e,t){!function(){e.exports=this.wp.components}()},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(31),o=r.n(n),c=r(10),i=r.n(c),a=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.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)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},46:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(45));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){!function(){e.exports=this.wc.wcSettings}()},58:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(20),i=r.n(c),a=r(0);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)):null}},6:function(e,t){!function(){e.exports=this.lodash}()},70:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(19),o=r.n(n),c=r(7),i=r.n(c),a=r(5),s=function(e){if(Object(a.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=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){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,a=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,b="wc-block-all-reviews";return n&&(b="wc-block-reviews-by-product"),Array.isArray(r)&&(b="wc-block-reviews-by-category"),i()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":a,"has-product-name":s})},b=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},702:function(e,t,r){e.exports=r(779)},74:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(15),i=r.n(c),a=r(16),s=r.n(a),l=r(12),u=r.n(l),b=r(17),d=r.n(b),p=r(18),w=r.n(p),v=r(9),f=r.n(v),m=r(0),g=r(6),h=r(7),O=r.n(h),y=r(3),j=r(22);r(104);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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(g.isFunction)(s)?s(c):s),Object(m.createElement)(y.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)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(m.createElement)(y.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(j.withInstanceId)(k)},779:function(e,t,r){"use strict";r.r(t);var n=r(4),o=r.n(n),c=r(0),i=r(1),a=r(26),s=r(58),l=r(33),u=Object(c.createElement)(l.SVG,{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(179),r(24)),d=r(3),p=(r(2),r(169)),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"))},v=r(114),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(v.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(v.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,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(164),g=r(165),h=r(134);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 y(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:y(y({},h.a),{},{attributes:y(y({},h.a.attributes),{},{showProductName:!0})}),attributes:y(y({},m.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(f,e)},save:g.a})},8:function(e,t){!function(){e.exports=this.React}()},92:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(58)),i=r(124),a=r(7),s=r.n(a),l=r(3),u=r(46);r(126);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,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}}});
|
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={7: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([702,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},104:function(e,t){},114:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return d}));var n=r(0),o=r(1),c=r(136),i=r(3),a=r(24),s=r(5),l=r(74),u=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){var r=Object(s.getSetting)("showAvatars",!0),a=Object(s.getSetting)("reviewRatingsEnabled",!0);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&&!a&&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)(l.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&&!r&&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"})}))))},d=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}))}},125:function(e,t,r){"use strict";var n=r(0),o=r(33),c=Object(n.createElement)(o.SVG,{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},127:function(e,t){},128:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(8)),c=r.n(o),i=r(27),a=r(172);r(180);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.Label,{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)}))))}))},135:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(14),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.k+"img/avatar.jpg",96:o.k+"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.k+"img/avatar.jpg",96:o.k+"img/avatar.jpg"},rating:null,verified:!1}]}}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return c})),r.d(t,"k",(function(){return i})),r.d(t,"l",(function(){return a})),r.d(t,"h",(function(){return l})),r.d(t,"c",(function(){return u})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return w})),r.d(t,"i",(function(){return v})),r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"e",(function(){return g})),r.d(t,"p",(function(){return O})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return j})),r.d(t,"o",(function(){return _}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,w=o.STORE_PAGES.terms.permalink,v=o.STORE_PAGES.terms.title,f=o.STORE_PAGES.cart.id,m=o.STORE_PAGES.cart.permalink,g=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=r(25),O=function(e,t){if(s>2)return Object(h.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(h.registerBlockType)(e,t)},j=function(){return s>2},_=function(){return s>1}},163: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}}},164:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),i=(r(179),r(70));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(i.a)(t)},Object(i.b)(t)))}},168:function(e,t,r){"use strict";var n=r(15),o=r.n(n),c=r(16),i=r.n(c),a=r(17),s=r.n(a),l=r(18),u=r.n(l),b=r(9),d=r.n(b),p=r(0),w=r(1),v=r(7),f=(r(2),r(6)),m=r(3),g=r(5),h=r(92),O=r(27),y=(r(223),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.Label,{label:r,screenReaderLabel:n})))});y.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var j=y,_=r(128),k=(r(220),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(4),E=r.n(R),P=r(8),C=r.n(P),S=r(12),T=r.n(S),N=r(197),x=r.n(N),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=x()(e,{suffix:r,limit:t});return n.html},A=function(e,t,r,n){var o=M(e,t,r);return L(e,o-n.length,n)},M=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=L(e,n.middle),n=I(n,t.clientHeight,r);return n.middle},I=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function D(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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=D(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(v.createRef)(),n.reviewContent=Object(v.createRef)(),n.getButton=n.getButton.bind(T()(n)),n.onClick=n.onClick.bind(T()(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:A(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}(v.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(222);var G=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,v=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:C()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||v)&&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||v||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},v&&function(e){var t=e.rating,r={width:t/5*100+"%"},n=Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);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","aria-label":n},Object(p.createElement)("span",{style:r},n)))}(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(221);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 F(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 z=function(e){var t=e.attributes,r=e.reviews,n=Object(g.getSetting)("showAvatars",!0),o=Object(g.getSetting)("reviewRatingsEnabled",!0),c=(n||"product"===t.imageType)&&t.showReviewImage,i=o&&t.showReviewRating,a=F(F({},t),{},{showReviewImage:c,showReviewRating:i});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(G,{attributes:a}):r.map((function(e,t){return Object(p.createElement)(G,{key:e.id||t,attributes:a,review:e})})))},W=r(11),U=r.n(W),J=r(31),q=r.n(J),Y=r(10),K=r.n(Y),Q=r(37),X=r.n(Q),Z=r(70),$=r(41);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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()(T()(e),"isPreview",!!e.props.attributes.previewReviews),E()(T()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(T()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(T()(e),"setError",function(){var t=q()(K.a.mark((function t(r){var n,o;return K.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.c)(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,U()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(v.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;if(r)return Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n});if(0===c.length&&!n)return Object(p.createElement)(o,{attributes:t});var a=Object(g.getSetting)("reviewRatingsEnabled",!0);return Object(p.createElement)(m.Disabled,null,t.showOrderby&&a&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(z,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(j,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")}))}}]),r}(v.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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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.noReviewsPlaceholder,n=t.categoryIds,o=t.productId,c=t.reviewsOnPageLoad,i=t.showProductName,a=t.showReviewDate,s=t.showReviewerName,l=t.showReviewContent,u=t.showReviewImage,b=t.showReviewRating,d=Object(Z.d)(t.orderby),w=d.order,v=d.orderby;return!(l||b||a||s||u||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(Z.a)(t)},Object(p.createElement)(re,{attributes:t,categoryIds:n,delayFunction:function(e){return Object(f.debounce)(e,400)},noReviewsPlaceholder:r,orderby:v,order:w,productId:o,reviewsToDisplay:c}))}}]),r}(v.Component);t.a=oe},179:function(e,t){},180:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},25:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},3:function(e,t){!function(){e.exports=this.wp.components}()},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(31),o=r.n(n),c=r(10),i=r.n(c),a=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.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)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},46:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(45));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){!function(){e.exports=this.wc.wcSettings}()},58:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(20),i=r.n(c),a=r(0),s=["srcElement","size"];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}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,s);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?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}({width:n,height:n},c)):null}},6:function(e,t){!function(){e.exports=this.lodash}()},7:function(e,t){!function(){e.exports=this.React}()},70:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(19),o=r.n(n),c=r(8),i=r.n(c),a=r(5),s=function(e){if(Object(a.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=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){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,a=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,b="wc-block-all-reviews";return n&&(b="wc-block-reviews-by-product"),Array.isArray(r)&&(b="wc-block-reviews-by-category"),i()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":a,"has-product-name":s})},b=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},702:function(e,t,r){e.exports=r(779)},74:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(15),i=r.n(c),a=r(16),s=r.n(a),l=r(12),u=r.n(l),b=r(17),d=r.n(b),p=r(18),w=r.n(p),v=r(9),f=r.n(v),m=r(0),g=r(6),h=r(8),O=r.n(h),y=r(3),j=r(22);r(104);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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(g.isFunction)(s)?s(c):s),Object(m.createElement)(y.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)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(m.createElement)(y.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(j.withInstanceId)(k)},779:function(e,t,r){"use strict";r.r(t);var n=r(4),o=r.n(n),c=r(0),i=r(1),a=r(25),s=r(58),l=r(33),u=Object(c.createElement)(l.SVG,{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(179),r(24)),d=r(3),p=(r(2),r(168)),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"))},v=r(114),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(v.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(v.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,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(163),g=r(164),h=r(135);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 y(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:y(y({},h.a),{},{attributes:y(y({},h.a.attributes),{},{showProductName:!0})}),attributes:y(y({},m.a),{},{showProductName:{type:"boolean",default:!0}}),transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:function(e){var t=e.idBase,r=e.instance;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:function(e){var t=e.instance;return Object(a.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:function(e){return Object(c.createElement)(f,e)},save:g.a})},92:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(58)),i=r(125),a=r(8),s=r.n(a),l=r(3),u=r(46);r(127);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,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}}});
|
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{120:function(e,t,r){"use strict";var n=r(4),i=r.n(n),c=r(13),o=r.n(c),a=r(5),s=r(1);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 p(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){i()(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 d=Object(a.getSetting)("countryLocale",{}),l=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},f=Object.entries(d).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,l(n)]})).reduce((function(e,t){var r=o()(t,2),n=r[0],i=r[1];return e[n]=i,e}),{})]})).reduce((function(e,t){var r=o()(t,2),n=r[0],i=r[1];return e[n]=i,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==f[r]?f[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},i=n[e]||{},c=t[e]||{};return p(p(p({key:e},r),i),c)})).sort((function(e,t){return e.index-t.index}))}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(13),i=r.n(n),c=function(e){return e.reduce((function(e,t){var r=i()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})}},170:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(5),i=r(120),c=r(21),o=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,i=void 0===n?"":n,c=e.city,o=void 0===c?"":c,a=e.postcode,s=void 0===a?"":a;return{country:r.trim(),state:i.trim(),city:o.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,r=void 0===t?"":t;return Object(c.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(i.a)(t,{},e.country),c=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,i=t.hidden;void 0!==i&&i&&function(e,t){return e in t}(n,e)&&(c[n]="")})),c}},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(13),i=r.n(n),c=r(4),o=r.n(c),a=r(6),s=r(0),u=r(40),p=r(23),d=r(29),l=r(147),f=r(170),b=r(78);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 g(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}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},m=g(g({},v),{},{email:"",phone:""}),h=function(e){return Object(l.a)(Object.entries(e).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,Object(d.decodeEntities)(n)]})))},y={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:m,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.b)(),r=t.isEditor,n=t.previewData,i=(null==n?void 0:n.previewCart)||{},c=e.shouldSelect,o=Object(s.useRef)(),d=Object(p.useSelect)((function(e,t){var n=t.dispatch;if(!c)return y;if(r)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:[],cartTotals:i.totals,cartIsLoading:!1,cartErrors:[],billingAddress:m,shippingAddress:v,extensions:{},shippingRates:i.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:function(){}};var o=e(u.CART_STORE_KEY),a=o.getCartData(),s=o.getCartErrors(),p=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),l=o.isCustomerDataUpdating(),b=n(u.CART_STORE_KEY).receiveCart,O=h(a.billingAddress),g=a.needsShipping?h(a.shippingAddress):O,j=a.fees.map((function(e){return h(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:p,cartIsLoading:d,cartErrors:s,billingAddress:Object(f.a)(O),shippingAddress:Object(f.a)(g),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:l,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return o.current&&Object(a.isEqual)(o.current,d)||(o.current=d),o.current}},78:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(0),i=r(23),c=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),o=function(){return Object(n.useContext)(c)},a=function(e){var t=e.children,r=e.currentPostId,o=void 0===r?0:r,a=e.previewData,s=void 0===a?{}:a,u=Object(i.useSelect)((function(e){return o||e("core/editor").getCurrentPostId()}),[o]),p=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),d={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:p};return Object(n.createElement)(c.Provider,{value:d},t)}},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(4),i=r.n(n),c=r(51),o=r(0),a=r(52);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 u(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 p=function(){var e=Object(a.a)();return{dispatchStoreEvent:Object(o.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}}}]);
|
build/atomic-block-components/add-to-cart--atomic-block-components/button.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{161:function(e,t,n){"use strict";n.d(t,"b",(function(){return k})),n.d(t,"a",(function(){return E}));var c=n(4),r=n.n(c),o=n(13),i=n.n(o),a=n(0),s=(n(2),n(23)),u=n(85),f=n(78),l=n(11),b=n.n(l),d=n(8),v=n.n(d),O=n(806),p=(n(208),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""}),m=function(e){var t=e.className,n=e.notices,c=e.removeNotice,r=n.filter((function(e){return"snackbar"!==e.type}));if(!r.length)return null;var o=v()(t,"wc-block-components-notices");return Object(a.createElement)("div",{className:o},r.map((function(e){return Object(a.createElement)(O.a,b()({key:"store-notice-"+e.id},e,{className:v()("wc-block-components-notices__notice","woocommerce-message",p(e)),onRemove:function(){e.isDismissible&&c(e.id)}}),e.content)})))},j=n(810),N=n(27),g=function(e){var t=e.className,n=e.notices,c=e.removeNotice;if(e.isEditor)return null;var r=n.filter((function(e){return"snackbar"===e.type})),o=Object(N.__experimentalApplyCheckoutFilter)({filterName:"snackbarNotices",defaultValue:r}),i=v()(t,"wc-block-components-notices__snackbar");return Object(a.createElement)(j.a,{notices:o,className:i,onRemove:c})};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),k=function(){return Object(a.useContext)(w)},E=function(e){var t=e.children,n=e.className,c=void 0===n?"":n,r=e.createNoticeContainer,o=void 0===r||r,l=e.context,b=void 0===l?"wc/core":l,d=Object(s.useDispatch)("core/notices"),v=d.createNotice,O=d.removeNotice,p=Object(a.useState)(!1),j=i()(p,2),N=j[0],h=j[1],k=Object(u.a)().dispatchStoreEvent,E=Object(f.b)().isEditor,S=Object(a.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]:{};v(e,t,y(y({},n),{},{context:n.context||b})),k("store-notice-create",{status:e,content:t,options:n})}),[v,k,b]),P=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;O(e,t)}),[O,b]),D=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S("default",e,y(y({},t),{},{type:"snackbar"}))}),[S]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(b)}}),[b]).notices,createNotice:S,createSnackbarNotice:D,removeNotice:P,context:b,setIsSuppressed:h},x=N?null:Object(a.createElement)(m,{className:c,notices:C.notices,removeNotice:C.removeNotice,isEditor:E}),I=N?null:Object(a.createElement)(g,{notices:C.notices,removeNotice:C.removeNotice,isEditor:E});return Object(a.createElement)(w.Provider,{value:C},o&&x,t,I)}},208:function(e,t){},63:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var c=n(4),r=n.n(c),o=n(0),i=n(161);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}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){r()(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 u=function(){var e=Object(i.b)(),t=e.notices,n=e.createNotice,c=e.removeNotice,r=e.createSnackbarNotice,a=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var f=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||c(t.id)}))},removeNotice:c}}),[c]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(e,t)}}}),[n,r]);return s(s(s({notices:t},f),l),{},{setIsSuppressed:a})}},716:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var c=n(13),r=n.n(c),o=n(0),i=n(23),a=n(40),s=n(29),u=n(52),f=n(63),l=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},b=function(e){var t=Object(i.useDispatch)(a.CART_STORE_KEY).addItemToCart,n=Object(u.a)(),c=n.cartItems,b=n.cartIsLoading,d=Object(f.a)(),v=d.addErrorNotice,O=d.removeNotice,p=Object(o.useState)(!1),m=r()(p,2),j=m[0],N=m[1],g=Object(o.useRef)(l(c,e));return Object(o.useEffect)((function(){var t=l(c,e);t!==g.current&&(g.current=t)}),[c,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:j,cartIsLoading:b,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return N(!0),t(e,n).then((function(){O("add-to-cart")})).catch((function(e){v(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){N(!1)}))}}}}}]);
|
build/atomic-block-components/add-to-cart-frontend.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{100: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.")},e.exports.default=e.exports,e.exports.__esModule=!0},108:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(20),o=r.n(n),c=r(7),a=r.n(c),i=r(16),s=r.n(i),u=r(9),l=r.n(u),f=r(0),d=r(8),b=r(22),p=r.n(b);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 m(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){a()(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}function O(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o()(t)?t:String(t)}var y=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(f.useContext)(y)},g=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],c=n[1],i=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),b=Object(f.useCallback)((function(e){c((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(O))}))}),[]),v=Object(f.useCallback)((function(){c({})}),[]),h=Object(f.useCallback)((function(e){e&&c((function(t){return e=Object(d.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),g=Object(f.useCallback)((function(e,t){c((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),j={getValidationError:i,setValidationErrors:h,clearValidationError:b,clearAllValidationErrors:v,hideValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(f.useCallback)((function(){c((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(y.Provider,{value:j},t)}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,o=r(7),c=r.n(o),a=r(8);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 s(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}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,a=t.id,i=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:i}),s(s({},e),{},c()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),s(s({},e),{},c()({},o,f))}}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(20),o=r.n(n),c=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===o()(e)};function s(e,t){return i(e)&&t in e}},163:function(e,t){},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r(3);var n=r(108),o=(r(163),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,c=void 0===o?"":o,a=e.elementId,i=void 0===a?"":a,s=Object(n.b)(),u=s.getValidationError,l=s.getValidationErrorId;if(!r){var f=u(c)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(i)},r))})},199:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=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}},211:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(127),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,o);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},212:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(20),o=r.n(n),c=r(52),a=r.n(c),i=r(26),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(45);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,c=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw c}}}}function d(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}var b=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,l,d,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=u(t,r),a=[],i=f(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===o()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),p=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,d,b,p;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=[],a=u(t,r),i=f(a),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===o()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return c.push(p),e.abrupt("return",c);case 18:c.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),c.push({type:"error"}),e.abrupt("return",c);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",c);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},287:function(e,t,r){"use strict";var n=r(28),o=React.createElement(n.SVG,{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},292:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(199);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,o()({},r,n))}}}},299:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(9),o=r.n(n),c=r(0),a=r(12),i=r(15),s=r(18),u=r(38),l=r(51),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,v=b.removeNotice,m=Object(c.useState)(!1),O=o()(m,2),y=O[0],h=O[1],g=Object(c.useRef)(f(n,e));return Object(c.useEffect)((function(){var t=f(n,e);t!==g.current&&(g.current=t)}),[n,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:y,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return h(!0),t(e,r).then((function(){v("add-to-cart")})).catch((function(e){p(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},305:function(e,t){},306:function(e,t){},315:function(e,t,r){"use strict";r.r(t);var n=r(292),o=(r(3),r(4)),c=r.n(o),a=r(9),i=r.n(a),s=r(0),u=r(1),l=r(54),f=function(e){return e.is_purchasable||!1},d="pristine",b="idle",p="disabled",v="processing",m="before_processing",O="after_processing",y={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},h="set_pristine",g="set_idle",j="set_disabled",E="set_processing",w="set_before_processing",P="set_after_processing",k="set_processing_response",_="set_has_error",R="set_no_error",C="set_quantity",A="set_request_params",S=h,x=g,N=j,D=E,T=w,V=P,q=k,I=_,F=R,B=C,M=A,L=function(){return{type:S}},Q=function(){return{type:x}},W=function(){return{type:N}},H=function(){return{type:D}},K=function(){return{type:T}},J=function(){return{type:V}},U=function(e){return{type:q,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?I:F;return{type:t}},z=function(e){return{type:B,quantity:e}},G=function(e){return{type:M,data:e}},X=r(7),$=r.n(X);function Z(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 ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var te=h,re=g,ne=j,oe=E,ce=w,ae=P,ie=k,se=_,ue=R,le=C,fe=A,de=d,be=b,pe=p,ve=v,me=m,Oe=O,ye=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,o=r.type,c=r.data;switch(o){case te:e=y;break;case re:e=t.status!==be?ee(ee({},t),{},{status:be}):t;break;case ne:e=t.status!==pe?ee(ee({},t),{},{status:pe}):t;break;case le:e=n!==t.quantity?ee(ee({},t),{},{quantity:n}):t;break;case fe:e=ee(ee({},t),{},{requestParams:ee(ee({},t.requestParams),c)});break;case ie:e=ee(ee({},t),{},{processingResponse:c});break;case oe:e=!1===(e=t.status!==ve?ee(ee({},t),{},{status:ve,hasError:!1}):t).hasError?e:ee(ee({},e),{},{hasError:!1});break;case ce:e=t.status!==me?ee(ee({},t),{},{status:me,hasError:!1}):t;break;case ae:e=t.status!==Oe?ee(ee({},t),{},{status:Oe}):t;break;case se:e=t.hasError?t:ee(ee({},t),{},{hasError:!0}),e=t.status===ve||t.status===me?ee(ee({},e),{},{status:be}):e;break;case ue:e=t.hasError?ee(ee({},t),{},{hasError:!1}):t}return e!==t&&o!==te&&e.status===de&&(e.status=be),e},he=r(127),ge=r(211),je="add_to_cart_before_processing",Ee="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",Pe=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ge.a)(Ee,e),onAddToCartProcessingWithError:Object(ge.a)(we,e),onAddToCartBeforeProcessing:Object(ge.a)(je,e)}},ke=r(212),_e=r(108),Re=r(51),Ce=r(45),Ae=Object(s.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Se=function(){return Object(s.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,n=e.showFormElements,o=Object(s.useReducer)(ye,y),c=i()(o,2),a=c[0],d=c[1],h=Object(s.useReducer)(he.b,{}),g=i()(h,2),j=g[0],E=g[1],w=Object(l.a)(j),P=Object(Re.a)(),k=P.addErrorNotice,_=P.removeNotices,R=Object(_e.b)().setValidationErrors,C=Object(Ce.c)(),A=C.isSuccessResponse,S=C.isErrorResponse,x=C.isFailResponse,N=Object(s.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Pe(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Pe(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Pe(E).onAddToCartBeforeProcessing}}),[E]),D=Object(s.useMemo)((function(){return{resetForm:function(){d(L())},submitForm:function(){d(K())},setQuantity:function(e){d(z(e))},setHasError:function(e){d(Y(e))},setRequestParams:function(e){d(G(e))},setAfterProcessing:function(e){d(U(e)),d(J())}}}),[]);Object(s.useEffect)((function(){var e=a.status,t=!r.id||!f(r);e!==p||t?e!==p&&t&&d(W()):d(Q())}),[a.status,r,d]),Object(s.useEffect)((function(){a.status===m&&(_("error"),Object(ke.a)(w,je,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&R(r)})),d(Q())):d(H())})))}),[a.status,R,k,_,d,w]),Object(s.useEffect)((function(){if(a.status===O){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(S(e)||x(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(ke.b)(w,we,e).then((function(r){if(!t(r)){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(o,{id:"add-to-cart"})}d(Q())}));Object(ke.b)(w,Ee,e).then((function(e){t(e)?d(Y(!0)):d(Q())}))}}),[a.status,a.hasError,a.processingResponse,D,k,S,x,A,w]);var T=function(e){return["simple","variable"].includes(e.type||"simple")}(r),V={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:T,showFormElements:n&&T,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:a.status===b,isDisabled:a.status===p,isProcessing:a.status===v,isBeforeProcessing:a.status===m,isAfterProcessing:a.status===O,hasError:a.hasError,eventRegistration:N,dispatchActions:D};return React.createElement(Ae.Provider,{value:V},t)},Ne=r(60),De=r.n(Ne),Te=r(18),Ve=r(38);function qe(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 Ie=function(){var e=Se(),t=e.dispatchActions,r=e.product,n=e.quantity,o=e.eventRegistration,c=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_e.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(Re.a)(),v=p.addErrorNotice,m=p.removeNotice,O=Object(Ve.a)().receiveCart,y=Object(s.useState)(!1),h=i()(y,2),g=h[0],j=h[1],E=!c&&a,w=Object(s.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(s.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(w,0);return function(){e()}}),[o,w]);var P=Object(s.useCallback)((function(){j(!0),m("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);De()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){De.a.setNonce(e.headers),e.json().then((function(r){e.ok?O(r):(r.body&&r.body.message?v(Object(Te.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),j(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&O(e.data.cart),t.setHasError(),t.setAfterProcessing(e),j(!1)}))}))}),[r,v,m,O,t,n,l]);return Object(s.useEffect)((function(){E&&!g&&P()}),[E,P,g]),null},Fe=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_e.a,null,React.createElement(xe,{product:r,showFormElements:n},t,React.createElement(Ie,null)))},Be=r(81),Me=r(8),Le=r(208),Qe=(r(305),r(11)),We=r(139),He=r(287),Ke=r(56),Je=r(299),Ue=function(e){var t=e.className,r=e.href,n=e.text,o=e.onClick;return React.createElement(Qe.Button,{className:t,href:r,onClick:o,rel:"nofollow"},n)},Ye=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,o=e.isDisabled,c=e.isDone,a=e.onClick;return React.createElement(Qe.Button,{className:t,disabled:o,showSpinner:n,onClick:a},c&&r>0?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(We.a,{srcElement:He.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},ze=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,o=e.product,c=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(Be.useInnerBlockLayoutContext)().parentName,v=Object(Ke.a)().dispatchStoreEvent,m=Object(Je.a)(o.id||0).cartQuantity,O=Object(s.useState)(!1),y=i()(O,2),h=y[0],g=y[1],j=o.add_to_cart||{url:"",text:""};return Object(s.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||g(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===c)&&r?React.createElement(Ye,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:a,isProcessing:l,isDone:h,onClick:function(){b.submitForm(),v("cart-add-item",{product:o,listName:p})}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product","woo-gutenberg-products-block"),onClick:function(){v("product-view-link",{product:o,listName:p})}})},Ge=function(e){var t=e.disabled,r=e.min,n=e.max,o=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},Ze=(r(306),r(49)),et=r.n(Ze),tt=r(210),rt=r(2),nt=r(192),ot={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,o=e.value,a=void 0===o?"":o,i=e.onChange,s=void 0===i?function(){}:i,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,d=Object(_e.b)(),b=d.getValidationError,p=d.setValidationErrors,v=d.clearValidationError,m=t,O=b(m)||{};return Object(rt.useEffect)((function(){a?v(m):p($()({},m,{message:f,hidden:!0}))}),[a,m,f,v,p]),Object(rt.useEffect)((function(){return function(){v(m)}}),[m,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(tt.SelectControl,{label:Object(Te.decodeEntities)(t),value:a||"",options:[ot].concat(et()(n)),onChange:s,required:!0,className:c()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":O.message&&!O.hidden})}),React.createElement(nt.a,{propertyName:m,elementId:m}))};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){$()(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 st=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var o=Object.keys(e);return n.filter((function(e){return o.every((function(n){var o=r[n]||"",c=t["id:"+e].attributes[n];return""===o||(null===c||c===o)}))}))},ut=function(e,t,r){var n={},o=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return o.forEach((function(o){var a=e[o],i=it(it({},r),{},$()({},o,null)),s=c?st(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[o]})):null;n[o]=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:Object(Te.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function lt(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 ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var dt=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,o=Object(l.a)(t),c=Object(l.a)(r),a=Object(s.useState)(0),u=i()(a,2),f=u[0],d=u[1],b=Object(s.useState)({}),p=i()(b,2),v=p[0],m=p[1],O=Object(s.useMemo)((function(){return ut(o,c,v)}),[v,o,c]);return Object(s.useEffect)((function(){Object.values(v).filter((function(e){return""!==e})).length===Object.keys(o).length?d(function(e,t,r){return st(e,t,r)[0]||0}(o,c,v)):f>0&&d(0)}),[v,f,o,c]),Object(s.useEffect)((function(){n({id:f,variation:Object.keys(v).map((function(e){return{attribute:e,value:v[e]}}))})}),[n,f,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return React.createElement(ct,{key:e,attributeName:e,options:O[e],value:v[e],onChange:function(t){m(ft(ft({},v),{},$()({},e,t)))}})})))},bt=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(Me.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===o.length?null:React.createElement(dt,{attributes:n,variationAttributes:o,setRequestParams:r.setRequestParams})},pt=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(bt,{product:t,dispatchers:c}),React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},vt=function(){return React.createElement(ze,null)},mt=function(){return React.createElement(tt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return React.createElement(mt,null)},yt=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(pt,null):"grouped"===r?React.createElement(Ot,null):"external"===r?React.createElement(vt,null):"simple"===r||"variation"===r?React.createElement($e,null):null:React.createElement(ze,null)},ht=Object(Le.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Be.useProductDataContext)().product,o=c()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Me.isEmpty)(n)});return React.createElement(Fe,{product:n,showFormElements:r},React.createElement("div",{className:o},React.createElement(yt,null)))})),gt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.a)(gt)(ht)},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,o,c=r(134);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var a=function(e,t){return Object(c.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(c.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:o,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},49:function(e,t,r){var n=r(98),o=r(99),c=r(67),a=r(100);e.exports=function(e){return n(e)||o(e)||c(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(7),o=r.n(n),c=r(0),a=r(123);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 s(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){o()(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 u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,o=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(c.useRef)(t);Object(c.useEffect)((function(){u.current=t}),[t]);var l=Object(c.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),f=Object(c.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,t)}}}),[r,o]);return s(s(s({notices:t},l),f),{},{setIsSuppressed:i})}},52:function(e,t){function r(e,t,r,n,o,c,a){try{var i=e[c](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var a=e.apply(t,n);function i(e){r(a,o,c,i,s,"next",e)}function s(e){r(a,o,c,i,s,"throw",e)}i(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},98:function(e,t,r){var n=r(68);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},99:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0}}]);
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{100:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},101: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.")},e.exports.default=e.exports,e.exports.__esModule=!0},108:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(20),o=r.n(n),c=r(7),a=r.n(c),i=r(16),s=r.n(i),u=r(9),l=r.n(u),f=r(0),d=r(8),b=r(22),p=r.n(b);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 m(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){a()(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}function O(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o()(t)?t:String(t)}var y=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(f.useContext)(y)},g=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],c=n[1],i=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),b=Object(f.useCallback)((function(e){c((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(O))}))}),[]),v=Object(f.useCallback)((function(){c({})}),[]),h=Object(f.useCallback)((function(e){e&&c((function(t){return e=Object(d.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),g=Object(f.useCallback)((function(e,t){c((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),j={getValidationError:i,setValidationErrors:h,clearValidationError:b,clearAllValidationErrors:v,hideValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(f.useCallback)((function(){c((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(y.Provider,{value:j},t)}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,o=r(7),c=r.n(o),a=r(8);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 s(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}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,a=t.id,i=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:i}),s(s({},e),{},c()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),s(s({},e),{},c()({},o,f))}}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(20),o=r.n(n),c=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===o()(e)};function s(e,t){return i(e)&&t in e}},163:function(e,t){},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r(3);var n=r(108),o=(r(163),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,c=void 0===o?"":o,a=e.elementId,i=void 0===a?"":a,s=Object(n.b)(),u=s.getValidationError,l=s.getValidationErrorId;if(!r){var f=u(c)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(i)},r))})},199:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=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}},211:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(127),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,o);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},212:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(20),o=r.n(n),c=r(52),a=r.n(c),i=r(26),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(45);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,c=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw c}}}}function d(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}var b=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,l,d,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=u(t,r),a=[],i=f(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===o()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),p=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,d,b,p;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=[],a=u(t,r),i=f(a),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===o()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return c.push(p),e.abrupt("return",c);case 18:c.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),c.push({type:"error"}),e.abrupt("return",c);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",c);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},287:function(e,t,r){"use strict";var n=r(28),o=React.createElement(n.SVG,{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},292:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(199);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,o()({},r,n))}}}},299:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(9),o=r.n(n),c=r(0),a=r(12),i=r(15),s=r(18),u=r(38),l=r(51),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,v=b.removeNotice,m=Object(c.useState)(!1),O=o()(m,2),y=O[0],h=O[1],g=Object(c.useRef)(f(n,e));return Object(c.useEffect)((function(){var t=f(n,e);t!==g.current&&(g.current=t)}),[n,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:y,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return h(!0),t(e,r).then((function(){v("add-to-cart")})).catch((function(e){p(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},305:function(e,t){},306:function(e,t){},315:function(e,t,r){"use strict";r.r(t);var n=r(292),o=(r(3),r(4)),c=r.n(o),a=r(9),i=r.n(a),s=r(0),u=r(1),l=r(54),f=function(e){return e.is_purchasable||!1},d="pristine",b="idle",p="disabled",v="processing",m="before_processing",O="after_processing",y={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},h="set_pristine",g="set_idle",j="set_disabled",E="set_processing",w="set_before_processing",P="set_after_processing",k="set_processing_response",_="set_has_error",R="set_no_error",C="set_quantity",A="set_request_params",S=h,x=g,N=j,D=E,T=w,V=P,q=k,I=_,F=R,B=C,M=A,L=function(){return{type:S}},Q=function(){return{type:x}},W=function(){return{type:N}},H=function(){return{type:D}},K=function(){return{type:T}},J=function(){return{type:V}},U=function(e){return{type:q,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?I:F;return{type:t}},z=function(e){return{type:B,quantity:e}},G=function(e){return{type:M,data:e}},X=r(7),$=r.n(X);function Z(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 ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var te=h,re=g,ne=j,oe=E,ce=w,ae=P,ie=k,se=_,ue=R,le=C,fe=A,de=d,be=b,pe=p,ve=v,me=m,Oe=O,ye=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,o=r.type,c=r.data;switch(o){case te:e=y;break;case re:e=t.status!==be?ee(ee({},t),{},{status:be}):t;break;case ne:e=t.status!==pe?ee(ee({},t),{},{status:pe}):t;break;case le:e=n!==t.quantity?ee(ee({},t),{},{quantity:n}):t;break;case fe:e=ee(ee({},t),{},{requestParams:ee(ee({},t.requestParams),c)});break;case ie:e=ee(ee({},t),{},{processingResponse:c});break;case oe:e=!1===(e=t.status!==ve?ee(ee({},t),{},{status:ve,hasError:!1}):t).hasError?e:ee(ee({},e),{},{hasError:!1});break;case ce:e=t.status!==me?ee(ee({},t),{},{status:me,hasError:!1}):t;break;case ae:e=t.status!==Oe?ee(ee({},t),{},{status:Oe}):t;break;case se:e=t.hasError?t:ee(ee({},t),{},{hasError:!0}),e=t.status===ve||t.status===me?ee(ee({},e),{},{status:be}):e;break;case ue:e=t.hasError?ee(ee({},t),{},{hasError:!1}):t}return e!==t&&o!==te&&e.status===de&&(e.status=be),e},he=r(127),ge=r(211),je="add_to_cart_before_processing",Ee="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",Pe=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ge.a)(Ee,e),onAddToCartProcessingWithError:Object(ge.a)(we,e),onAddToCartBeforeProcessing:Object(ge.a)(je,e)}},ke=r(212),_e=r(108),Re=r(51),Ce=r(45),Ae=Object(s.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Se=function(){return Object(s.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,n=e.showFormElements,o=Object(s.useReducer)(ye,y),c=i()(o,2),a=c[0],d=c[1],h=Object(s.useReducer)(he.b,{}),g=i()(h,2),j=g[0],E=g[1],w=Object(l.a)(j),P=Object(Re.a)(),k=P.addErrorNotice,_=P.removeNotices,R=Object(_e.b)().setValidationErrors,C=Object(Ce.c)(),A=C.isSuccessResponse,S=C.isErrorResponse,x=C.isFailResponse,N=Object(s.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Pe(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Pe(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Pe(E).onAddToCartBeforeProcessing}}),[E]),D=Object(s.useMemo)((function(){return{resetForm:function(){d(L())},submitForm:function(){d(K())},setQuantity:function(e){d(z(e))},setHasError:function(e){d(Y(e))},setRequestParams:function(e){d(G(e))},setAfterProcessing:function(e){d(U(e)),d(J())}}}),[]);Object(s.useEffect)((function(){var e=a.status,t=!r.id||!f(r);e!==p||t?e!==p&&t&&d(W()):d(Q())}),[a.status,r,d]),Object(s.useEffect)((function(){a.status===m&&(_("error"),Object(ke.a)(w,je,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&R(r)})),d(Q())):d(H())})))}),[a.status,R,k,_,d,w]),Object(s.useEffect)((function(){if(a.status===O){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(S(e)||x(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(ke.b)(w,we,e).then((function(r){if(!t(r)){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(o,{id:"add-to-cart"})}d(Q())}));Object(ke.b)(w,Ee,e).then((function(e){t(e)?d(Y(!0)):d(Q())}))}}),[a.status,a.hasError,a.processingResponse,D,k,S,x,A,w]);var T=function(e){return["simple","variable"].includes(e.type||"simple")}(r),V={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:T,showFormElements:n&&T,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:a.status===b,isDisabled:a.status===p,isProcessing:a.status===v,isBeforeProcessing:a.status===m,isAfterProcessing:a.status===O,hasError:a.hasError,eventRegistration:N,dispatchActions:D};return React.createElement(Ae.Provider,{value:V},t)},Ne=r(60),De=r.n(Ne),Te=r(18),Ve=r(38);function qe(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 Ie=function(){var e=Se(),t=e.dispatchActions,r=e.product,n=e.quantity,o=e.eventRegistration,c=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_e.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(Re.a)(),v=p.addErrorNotice,m=p.removeNotice,O=Object(Ve.a)().receiveCart,y=Object(s.useState)(!1),h=i()(y,2),g=h[0],j=h[1],E=!c&&a,w=Object(s.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(s.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(w,0);return function(){e()}}),[o,w]);var P=Object(s.useCallback)((function(){j(!0),m("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);De()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){De.a.setNonce(e.headers),e.json().then((function(r){e.ok?O(r):(r.body&&r.body.message?v(Object(Te.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),j(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&O(e.data.cart),t.setHasError(),t.setAfterProcessing(e),j(!1)}))}))}),[r,v,m,O,t,n,l]);return Object(s.useEffect)((function(){E&&!g&&P()}),[E,P,g]),null},Fe=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_e.a,null,React.createElement(xe,{product:r,showFormElements:n},t,React.createElement(Ie,null)))},Be=r(81),Me=r(8),Le=r(208),Qe=(r(305),r(11)),We=r(139),He=r(287),Ke=r(56),Je=r(299),Ue=function(e){var t=e.className,r=e.href,n=e.text,o=e.onClick;return React.createElement(Qe.Button,{className:t,href:r,onClick:o,rel:"nofollow"},n)},Ye=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,o=e.isDisabled,c=e.isDone,a=e.onClick;return React.createElement(Qe.Button,{className:t,disabled:o,showSpinner:n,onClick:a},c&&r>0?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(We.a,{srcElement:He.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},ze=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,o=e.product,c=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(Be.useInnerBlockLayoutContext)().parentName,v=Object(Ke.a)().dispatchStoreEvent,m=Object(Je.a)(o.id||0).cartQuantity,O=Object(s.useState)(!1),y=i()(O,2),h=y[0],g=y[1],j=o.add_to_cart||{url:"",text:""};return Object(s.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||g(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===c)&&r?React.createElement(Ye,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:a,isProcessing:l,isDone:h,onClick:function(){b.submitForm(),v("cart-add-item",{product:o,listName:p})}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product","woo-gutenberg-products-block"),onClick:function(){v("product-view-link",{product:o,listName:p})}})},Ge=function(e){var t=e.disabled,r=e.min,n=e.max,o=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},Ze=(r(306),r(49)),et=r.n(Ze),tt=r(210),rt=r(2),nt=r(192),ot={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,o=e.value,a=void 0===o?"":o,i=e.onChange,s=void 0===i?function(){}:i,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,d=Object(_e.b)(),b=d.getValidationError,p=d.setValidationErrors,v=d.clearValidationError,m=t,O=b(m)||{};return Object(rt.useEffect)((function(){a?v(m):p($()({},m,{message:f,hidden:!0}))}),[a,m,f,v,p]),Object(rt.useEffect)((function(){return function(){v(m)}}),[m,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(tt.SelectControl,{label:Object(Te.decodeEntities)(t),value:a||"",options:[ot].concat(et()(n)),onChange:s,required:!0,className:c()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":O.message&&!O.hidden})}),React.createElement(nt.a,{propertyName:m,elementId:m}))};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){$()(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 st=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var o=Object.keys(e);return n.filter((function(e){return o.every((function(n){var o=r[n]||"",c=t["id:"+e].attributes[n];return""===o||(null===c||c===o)}))}))},ut=function(e,t,r){var n={},o=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return o.forEach((function(o){var a=e[o],i=it(it({},r),{},$()({},o,null)),s=c?st(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[o]})):null;n[o]=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:Object(Te.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function lt(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 ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var dt=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,o=Object(l.a)(t),c=Object(l.a)(r),a=Object(s.useState)(0),u=i()(a,2),f=u[0],d=u[1],b=Object(s.useState)({}),p=i()(b,2),v=p[0],m=p[1],O=Object(s.useMemo)((function(){return ut(o,c,v)}),[v,o,c]);return Object(s.useEffect)((function(){Object.values(v).filter((function(e){return""!==e})).length===Object.keys(o).length?d(function(e,t,r){return st(e,t,r)[0]||0}(o,c,v)):f>0&&d(0)}),[v,f,o,c]),Object(s.useEffect)((function(){n({id:f,variation:Object.keys(v).map((function(e){return{attribute:e,value:v[e]}}))})}),[n,f,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return React.createElement(ct,{key:e,attributeName:e,options:O[e],value:v[e],onChange:function(t){m(ft(ft({},v),{},$()({},e,t)))}})})))},bt=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(Me.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===o.length?null:React.createElement(dt,{attributes:n,variationAttributes:o,setRequestParams:r.setRequestParams})},pt=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(bt,{product:t,dispatchers:c}),React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},vt=function(){return React.createElement(ze,null)},mt=function(){return React.createElement(tt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return React.createElement(mt,null)},yt=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(pt,null):"grouped"===r?React.createElement(Ot,null):"external"===r?React.createElement(vt,null):"simple"===r||"variation"===r?React.createElement($e,null):null:React.createElement(ze,null)},ht=Object(Le.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Be.useProductDataContext)().product,o=c()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Me.isEmpty)(n)});return React.createElement(Fe,{product:n,showFormElements:r},React.createElement("div",{className:o},React.createElement(yt,null)))})),gt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.a)(gt)(ht)},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,o,c=r(134);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var a=function(e,t){return Object(c.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(c.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:o,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},49:function(e,t,r){var n=r(99),o=r(100),c=r(67),a=r(101);e.exports=function(e){return n(e)||o(e)||c(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(7),o=r.n(n),c=r(0),a=r(123);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 s(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){o()(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 u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,o=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(c.useRef)(t);Object(c.useEffect)((function(){u.current=t}),[t]);var l=Object(c.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),f=Object(c.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,t)}}}),[r,o]);return s(s(s({notices:t},l),f),{},{setIsSuppressed:i})}},52:function(e,t){function r(e,t,r,n,o,c,a){try{var i=e[c](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var a=e.apply(t,n);function i(e){r(a,o,c,i,s,"next",e)}function s(e){r(a,o,c,i,s,"throw",e)}i(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},99:function(e,t,r){var n=r(68);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0}}]);
|
build/atomic-block-components/add-to-cart.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{121:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(42),c=r.n(n),o=r(4),a=r.n(o),s=r(20),i=r.n(s),u=r(13),l=r.n(u),b=r(0),f=r(6),d=r(37),p=r.n(d);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 m(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){a()(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}function j(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var v=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(v)},y=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return i()(t,[e].map(j))}))}),[]),O=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(f.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),y=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),g={getValidationError:s,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:O,hideValidationError:Object(b.useCallback)((function(e){y(e,{hidden:!0})}),[y]),showValidationError:Object(b.useCallback)((function(e){y(e,{hidden:!1})}),[y]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(v.Provider,{value:g},t)}},130:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(4),o=r.n(c),a=r(6);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 i(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}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),i(i({},e),{},o()({},c,b))}}},153:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return i}));var n=r(42),c=r.n(n),o=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},s=function(e){return!function(e){return null===e}(e)&&"object"===c()(e)};function i(e,t){return s(e)&&t in e}},209:function(e,t){},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(121)),o=(r(209),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r){var f=l(a)||{};if(!f.message||f.hidden)return null;r=f.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(i)},r))})},343:function(e,t){},347:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(130),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},348:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},349:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(13),s=r.n(a),i=r(1),u=r(76),l=r(795),b="pristine",f="idle",d="disabled",p="processing",O="before_processing",m="after_processing",j={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},v="set_pristine",h="set_idle",y="set_disabled",g="set_processing",E="set_before_processing",w="set_after_processing",P="set_processing_response",k="set_has_error",_="set_no_error",C="set_quantity",A="set_request_params",S=v,x=h,D=y,V=g,N=E,R=w,T=P,q=k,B=_,F=C,I=A,L=function(){return{type:S}},M=function(){return{type:x}},Q=function(){return{type:D}},W=function(){return{type:V}},H=function(){return{type:N}},K=function(){return{type:R}},U=function(e){return{type:T,data:e}},z=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?q:B;return{type:t}},G=function(e){return{type:F,quantity:e}},J=function(e){return{type:I,data:e}},Y=r(4),X=r.n(Y);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 Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){X()(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 ee=v,te=h,re=y,ne=g,ce=E,oe=w,ae=P,se=k,ie=_,ue=C,le=A,be=b,fe=f,de=d,pe=p,Oe=O,me=m,je=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ee:e=j;break;case te:e=t.status!==fe?Z(Z({},t),{},{status:fe}):t;break;case re:e=t.status!==de?Z(Z({},t),{},{status:de}):t;break;case ue:e=n!==t.quantity?Z(Z({},t),{},{quantity:n}):t;break;case le:e=Z(Z({},t),{},{requestParams:Z(Z({},t.requestParams),o)});break;case ae:e=Z(Z({},t),{},{processingResponse:o});break;case ne:e=!1===(e=t.status!==pe?Z(Z({},t),{},{status:pe,hasError:!1}):t).hasError?e:Z(Z({},e),{},{hasError:!1});break;case ce:e=t.status!==Oe?Z(Z({},t),{},{status:Oe,hasError:!1}):t;break;case oe:e=t.status!==me?Z(Z({},t),{},{status:me}):t;break;case se:e=t.hasError?t:Z(Z({},t),{},{hasError:!0}),e=t.status===pe||t.status===Oe?Z(Z({},e),{},{status:fe}):e;break;case ie:e=t.hasError?Z(Z({},t),{},{hasError:!1}):t}return e!==t&&c!==ee&&e.status===be&&(e.status=fe),e},ve=r(130),he=r(347),ye="add_to_cart_before_processing",ge="add_to_cart_after_processing_with_success",Ee="add_to_cart_after_processing_with_error",we=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(he.a)(ge,e),onAddToCartProcessingWithError:Object(he.a)(Ee,e),onAddToCartBeforeProcessing:Object(he.a)(ye,e)}},Pe=r(351),ke=r(121),_e=r(63),Ce=r(57),Ae=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Se=function(){return Object(n.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(je,j),a=s()(o,2),b=a[0],v=a[1],h=Object(n.useReducer)(ve.b,{}),y=s()(h,2),g=y[0],E=y[1],w=Object(u.a)(g),P=Object(_e.a)(),k=P.addErrorNotice,_=P.removeNotices,C=Object(ke.b)().setValidationErrors,A=Object(Ce.c)(),S=A.isSuccessResponse,x=A.isErrorResponse,D=A.isFailResponse,V=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:we(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:we(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:we(E).onAddToCartBeforeProcessing}}),[E]),N=Object(n.useMemo)((function(){return{resetForm:function(){v(L())},submitForm:function(){v(H())},setQuantity:function(e){v(G(e))},setHasError:function(e){v(z(e))},setRequestParams:function(e){v(J(e))},setAfterProcessing:function(e){v(U(e)),v(K())}}}),[]);Object(n.useEffect)((function(){var e=b.status,t=!r.id||!Object(l.a)(r);e!==d||t?e!==d&&t&&v(Q()):v(M())}),[b.status,r,v]),Object(n.useEffect)((function(){b.status===O&&(_("error"),Object(Pe.a)(w,ye,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&C(r)})),v(M())):v(W())})))}),[b.status,C,k,_,v,w]),Object(n.useEffect)((function(){if(b.status===m){var e={processingResponse:b.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(x(e)||D(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(b.hasError)return void Object(Pe.b)(w,Ee,e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(c,{id:"add-to-cart"})}v(M())}));Object(Pe.b)(w,ge,e).then((function(e){t(e)?v(z(!0)):v(M())}))}}),[b.status,b.hasError,b.processingResponse,N,k,x,D,S,w]);var R=Object(l.b)(r),T={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:R,showFormElements:c&&R,quantity:b.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:b.requestParams,isIdle:b.status===f,isDisabled:b.status===d,isProcessing:b.status===p,isBeforeProcessing:b.status===O,isAfterProcessing:b.status===m,hasError:b.hasError,eventRegistration:V,dispatchActions:N};return Object(n.createElement)(Ae.Provider,{value:T},t)},De=r(19),Ve=r.n(De),Ne=r(29),Re=r(52);function Te(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 qe=function(){var e=Se(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(ke.b)(),f=b.hasValidationErrors,d=b.showAllValidationErrors,p=Object(_e.a)(),O=p.addErrorNotice,m=p.removeNotice,j=Object(Re.a)().receiveCart,v=Object(n.useState)(!1),h=s()(v,2),y=h[0],g=h[1],E=!a&&u,w=Object(n.useCallback)((function(){return!f||(d(),{type:"error"})}),[f,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(w,0);return function(){e()}}),[o,w]);var P=Object(n.useCallback)((function(){g(!0),m("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);Ve()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Ve.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?O(Object(Ne.decodeEntities)(r.body.message),{id:"add-to-cart"}):O(Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),g(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),g(!1)}))}))}),[r,O,m,j,t,c,l]);return Object(n.useEffect)((function(){E&&!y&&P()}),[E,P,y]),null},Be=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(ke.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(qe,null)))},Fe=r(43),Ie=r(6),Le=r(71),Me=(r(343),r(27)),Qe=r(58),We=r(497),He=r(85),Ke=r(716),Ue=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(Me.Button,{className:t,href:r,onClick:o,rel:"nofollow"},c)},ze=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,s=e.onClick;return Object(n.createElement)(Me.Button,{className:t,disabled:o,showSpinner:c,onClick:s},a&&r>0?Object(i.sprintf)(Object(i._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(i.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(Qe.a,{srcElement:We.a,alt:Object(i.__)("Done","woo-gutenberg-products-block")}))},Ge=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,f=e.hasError,d=e.dispatchActions,p=Object(Fe.useInnerBlockLayoutContext)().parentName,O=Object(He.a)().dispatchStoreEvent,m=Object(Ke.a)(o.id||0).cartQuantity,j=Object(n.useState)(!1),v=s()(j,2),h=v[0],y=v[1],g=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return f||y(!0),!0}),0);return function(){e()}}),[b,f]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(ze,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:u,isProcessing:l,isDone:h,onClick:function(){d.submitForm(),O("cart-add-item",{product:o,listName:p})}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:g.url,text:g.text||Object(i.__)("View Product","woo-gutenberg-products-block"),onClick:function(){O("product-view-link",{product:o,listName:p})}})},Je=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},Ye=function(e){var t=e.reason,r=void 0===t?Object(i.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},Xe=function(){var e=Se(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Ye,null):t.id&&!t.is_in_stock?Object(n.createElement)(Ye,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Je,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},$e=(r(496),r(32)),Ze=r.n($e),et=r(3),tt=r(8),rt=r(258),nt={value:"",label:Object(i.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,s=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,f=void 0===b?Object(i.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(ke.b)(),p=d.getValidationError,O=d.setValidationErrors,m=d.clearValidationError,j=t,v=p(j)||{};return Object(tt.useEffect)((function(){s?m(j):O(X()({},j,{message:f,hidden:!0}))}),[s,j,f,m,O]),Object(tt.useEffect)((function(){return function(){m(j)}}),[j,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Ne.decodeEntities)(t),value:s||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":v.message&&!v.hidden})}),Object(n.createElement)(rt.a,{propertyName:j,elementId:j}))};function ot(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 at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var st=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||(null===o||o===c)}))}))},it=function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],s=at(at({},r),{},X()({},c,null)),i=o?st(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=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:Object(Ne.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function ut(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 lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),i=Object(n.useState)(0),l=s()(i,2),b=l[0],f=l[1],d=Object(n.useState)({}),p=s()(d,2),O=p[0],m=p[1],j=Object(n.useMemo)((function(){return it(o,a,O)}),[O,o,a]);return Object(n.useEffect)((function(){Object.values(O).filter((function(e){return""!==e})).length===Object.keys(o).length?f(function(e,t,r){return st(e,t,r)[0]||0}(o,a,O)):b>0&&f(0)}),[O,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(O).map((function(e){return{attribute:e,value:O[e]}}))})}),[c,b,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:j[e],value:O[e],onChange:function(t){m(lt(lt({},O),{},X()({},e,t)))}})})))},ft=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Ie.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(bt,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},dt=function(){var e=Se(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Ye,null):t.id&&!t.is_in_stock?Object(n.createElement)(Ye,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(ft,{product:t,dispatchers:a}),Object(n.createElement)(Je,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},pt=function(){return Object(n.createElement)(Ge,null)},Ot=function(){return Object(n.createElement)(et.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},mt=function(){return Object(n.createElement)(Ot,null)},jt=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(mt,null):"external"===r?Object(n.createElement)(pt,null):"simple"===r||"variation"===r?Object(n.createElement)(Xe,null):null:Object(n.createElement)(Ge,null)};t.a=Object(Le.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Fe.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Ie.isEmpty)(c)});return Object(n.createElement)(Be,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(jt,null)))}))},351:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p}));var n=r(42),c=r.n(n),o=r(31),a=r.n(o),s=r(10),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(57);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(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}var d=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,f,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=b(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,f,d,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),s=b(a),e.prev=3,s.s();case 5:if((f=s.n()).done){e.next=28;break}return d=f.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return o.push(p),e.abrupt("return",o);case 18:o.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},496:function(e,t){},497:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},57:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(153);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,n.SUCCESS)},i=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:s,isErrorResponse:i,isFailResponse:u}}},76:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(37),o=r.n(c);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},795:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},814:function(e,t,r){"use strict";r.r(t);var n=r(811),c=r(349),o=r(348);t.default=Object(n.a)(o.a)(c.a)}}]);
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{122:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(42),c=r.n(n),o=r(4),a=r.n(o),s=r(20),i=r.n(s),u=r(13),l=r.n(u),b=r(0),f=r(6),d=r(37),p=r.n(d);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 m(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){a()(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}function j(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var v=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(b.useContext)(v)},y=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],s=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return i()(t,[e].map(j))}))}),[]),O=Object(b.useCallback)((function(){o({})}),[]),h=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(f.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),y=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),g={getValidationError:s,setValidationErrors:h,clearValidationError:d,clearAllValidationErrors:O,hideValidationError:Object(b.useCallback)((function(e){y(e,{hidden:!0})}),[y]),showValidationError:Object(b.useCallback)((function(e){y(e,{hidden:!1})}),[y]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(v.Provider,{value:g},t)}},131:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(4),o=r.n(c),a=r(6);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 i(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}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,s=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:s}),i(i({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),i(i({},e),{},o()({},c,b))}}},153:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return i}));var n=r(42),c=r.n(n),o=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},s=function(e){return!function(e){return null===e}(e)&&"object"===c()(e)};function i(e,t){return s(e)&&t in e}},209:function(e,t){},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(122)),o=(r(209),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r){var f=l(a)||{};if(!f.message||f.hidden)return null;r=f.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(i)},r))})},343:function(e,t){},347:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(131),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},348:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},349:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(8)),o=r.n(c),a=r(13),s=r.n(a),i=r(1),u=r(76),l=r(795),b="pristine",f="idle",d="disabled",p="processing",O="before_processing",m="after_processing",j={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},v="set_pristine",h="set_idle",y="set_disabled",g="set_processing",E="set_before_processing",w="set_after_processing",P="set_processing_response",k="set_has_error",_="set_no_error",C="set_quantity",A="set_request_params",S=v,x=h,D=y,V=g,N=E,R=w,T=P,q=k,B=_,F=C,I=A,L=function(){return{type:S}},M=function(){return{type:x}},Q=function(){return{type:D}},W=function(){return{type:V}},H=function(){return{type:N}},K=function(){return{type:R}},U=function(e){return{type:T,data:e}},z=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?q:B;return{type:t}},G=function(e){return{type:F,quantity:e}},J=function(e){return{type:I,data:e}},Y=r(4),X=r.n(Y);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 Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){X()(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 ee=v,te=h,re=y,ne=g,ce=E,oe=w,ae=P,se=k,ie=_,ue=C,le=A,be=b,fe=f,de=d,pe=p,Oe=O,me=m,je=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ee:e=j;break;case te:e=t.status!==fe?Z(Z({},t),{},{status:fe}):t;break;case re:e=t.status!==de?Z(Z({},t),{},{status:de}):t;break;case ue:e=n!==t.quantity?Z(Z({},t),{},{quantity:n}):t;break;case le:e=Z(Z({},t),{},{requestParams:Z(Z({},t.requestParams),o)});break;case ae:e=Z(Z({},t),{},{processingResponse:o});break;case ne:e=!1===(e=t.status!==pe?Z(Z({},t),{},{status:pe,hasError:!1}):t).hasError?e:Z(Z({},e),{},{hasError:!1});break;case ce:e=t.status!==Oe?Z(Z({},t),{},{status:Oe,hasError:!1}):t;break;case oe:e=t.status!==me?Z(Z({},t),{},{status:me}):t;break;case se:e=t.hasError?t:Z(Z({},t),{},{hasError:!0}),e=t.status===pe||t.status===Oe?Z(Z({},e),{},{status:fe}):e;break;case ie:e=t.hasError?Z(Z({},t),{},{hasError:!1}):t}return e!==t&&c!==ee&&e.status===be&&(e.status=fe),e},ve=r(131),he=r(347),ye="add_to_cart_before_processing",ge="add_to_cart_after_processing_with_success",Ee="add_to_cart_after_processing_with_error",we=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(he.a)(ge,e),onAddToCartProcessingWithError:Object(he.a)(Ee,e),onAddToCartBeforeProcessing:Object(he.a)(ye,e)}},Pe=r(351),ke=r(122),_e=r(63),Ce=r(57),Ae=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Se=function(){return Object(n.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(je,j),a=s()(o,2),b=a[0],v=a[1],h=Object(n.useReducer)(ve.b,{}),y=s()(h,2),g=y[0],E=y[1],w=Object(u.a)(g),P=Object(_e.a)(),k=P.addErrorNotice,_=P.removeNotices,C=Object(ke.b)().setValidationErrors,A=Object(Ce.c)(),S=A.isSuccessResponse,x=A.isErrorResponse,D=A.isFailResponse,V=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:we(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:we(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:we(E).onAddToCartBeforeProcessing}}),[E]),N=Object(n.useMemo)((function(){return{resetForm:function(){v(L())},submitForm:function(){v(H())},setQuantity:function(e){v(G(e))},setHasError:function(e){v(z(e))},setRequestParams:function(e){v(J(e))},setAfterProcessing:function(e){v(U(e)),v(K())}}}),[]);Object(n.useEffect)((function(){var e=b.status,t=!r.id||!Object(l.a)(r);e!==d||t?e!==d&&t&&v(Q()):v(M())}),[b.status,r,v]),Object(n.useEffect)((function(){b.status===O&&(_("error"),Object(Pe.a)(w,ye,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&C(r)})),v(M())):v(W())})))}),[b.status,C,k,_,v,w]),Object(n.useEffect)((function(){if(b.status===m){var e={processingResponse:b.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(x(e)||D(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(b.hasError)return void Object(Pe.b)(w,Ee,e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(c,{id:"add-to-cart"})}v(M())}));Object(Pe.b)(w,ge,e).then((function(e){t(e)?v(z(!0)):v(M())}))}}),[b.status,b.hasError,b.processingResponse,N,k,x,D,S,w]);var R=Object(l.b)(r),T={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:R,showFormElements:c&&R,quantity:b.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:b.requestParams,isIdle:b.status===f,isDisabled:b.status===d,isProcessing:b.status===p,isBeforeProcessing:b.status===O,isAfterProcessing:b.status===m,hasError:b.hasError,eventRegistration:V,dispatchActions:N};return Object(n.createElement)(Ae.Provider,{value:T},t)},De=r(19),Ve=r.n(De),Ne=r(29),Re=r(52);function Te(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 qe=function(){var e=Se(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(ke.b)(),f=b.hasValidationErrors,d=b.showAllValidationErrors,p=Object(_e.a)(),O=p.addErrorNotice,m=p.removeNotice,j=Object(Re.a)().receiveCart,v=Object(n.useState)(!1),h=s()(v,2),y=h[0],g=h[1],E=!a&&u,w=Object(n.useCallback)((function(){return!f||(d(),{type:"error"})}),[f,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(w,0);return function(){e()}}),[o,w]);var P=Object(n.useCallback)((function(){g(!0),m("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);Ve()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Ve.a.setNonce(e.headers),e.json().then((function(r){e.ok?j(r):(r.body&&r.body.message?O(Object(Ne.decodeEntities)(r.body.message),{id:"add-to-cart"}):O(Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),g(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&j(e.data.cart),t.setHasError(),t.setAfterProcessing(e),g(!1)}))}))}),[r,O,m,j,t,c,l]);return Object(n.useEffect)((function(){E&&!y&&P()}),[E,P,y]),null},Be=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(ke.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(qe,null)))},Fe=r(43),Ie=r(6),Le=r(71),Me=(r(343),r(27)),Qe=r(58),We=r(497),He=r(85),Ke=r(716),Ue=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(Me.Button,{className:t,href:r,onClick:o,rel:"nofollow"},c)},ze=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,s=e.onClick;return Object(n.createElement)(Me.Button,{className:t,disabled:o,showSpinner:c,onClick:s},a&&r>0?Object(i.sprintf)(Object(i._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(i.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(Qe.a,{srcElement:We.a,alt:Object(i.__)("Done","woo-gutenberg-products-block")}))},Ge=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,f=e.hasError,d=e.dispatchActions,p=Object(Fe.useInnerBlockLayoutContext)().parentName,O=Object(He.a)().dispatchStoreEvent,m=Object(Ke.a)(o.id||0).cartQuantity,j=Object(n.useState)(!1),v=s()(j,2),h=v[0],y=v[1],g=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return f||y(!0),!0}),0);return function(){e()}}),[b,f]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(ze,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:u,isProcessing:l,isDone:h,onClick:function(){d.submitForm(),O("cart-add-item",{product:o,listName:p})}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:g.url,text:g.text||Object(i.__)("View Product","woo-gutenberg-products-block"),onClick:function(){O("product-view-link",{product:o,listName:p})}})},Je=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},Ye=function(e){var t=e.reason,r=void 0===t?Object(i.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},Xe=function(){var e=Se(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Ye,null):t.id&&!t.is_in_stock?Object(n.createElement)(Ye,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Je,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},$e=(r(496),r(32)),Ze=r.n($e),et=r(3),tt=r(7),rt=r(258),nt={value:"",label:Object(i.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,s=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,f=void 0===b?Object(i.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(ke.b)(),p=d.getValidationError,O=d.setValidationErrors,m=d.clearValidationError,j=t,v=p(j)||{};return Object(tt.useEffect)((function(){s?m(j):O(X()({},j,{message:f,hidden:!0}))}),[s,j,f,m,O]),Object(tt.useEffect)((function(){return function(){m(j)}}),[j,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Ne.decodeEntities)(t),value:s||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":v.message&&!v.hidden})}),Object(n.createElement)(rt.a,{propertyName:j,elementId:j}))};function ot(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 at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var st=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||(null===o||o===c)}))}))},it=function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],s=at(at({},r),{},X()({},c,null)),i=o?st(e,t,s):null,u=null!==i?i.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=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:Object(Ne.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function ut(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 lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){X()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),i=Object(n.useState)(0),l=s()(i,2),b=l[0],f=l[1],d=Object(n.useState)({}),p=s()(d,2),O=p[0],m=p[1],j=Object(n.useMemo)((function(){return it(o,a,O)}),[O,o,a]);return Object(n.useEffect)((function(){Object.values(O).filter((function(e){return""!==e})).length===Object.keys(o).length?f(function(e,t,r){return st(e,t,r)[0]||0}(o,a,O)):b>0&&f(0)}),[O,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(O).map((function(e){return{attribute:e,value:O[e]}}))})}),[c,b,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:j[e],value:O[e],onChange:function(t){m(lt(lt({},O),{},X()({},e,t)))}})})))},ft=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Ie.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(bt,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},dt=function(){var e=Se(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,s=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(Ye,null):t.id&&!t.is_in_stock?Object(n.createElement)(Ye,{reason:Object(i.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(ft,{product:t,dispatchers:a}),Object(n.createElement)(Je,{value:r,min:c,max:o,disabled:s,onChange:a.setQuantity}),Object(n.createElement)(Ge,null))},pt=function(){return Object(n.createElement)(Ge,null)},Ot=function(){return Object(n.createElement)(et.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},mt=function(){return Object(n.createElement)(Ot,null)},jt=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(mt,null):"external"===r?Object(n.createElement)(pt,null):"simple"===r||"variation"===r?Object(n.createElement)(Xe,null):null:Object(n.createElement)(Ge,null)};t.a=Object(Le.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Fe.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Ie.isEmpty)(c)});return Object(n.createElement)(Be,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(jt,null)))}))},351:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p}));var n=r(42),c=r.n(n),o=r(31),a=r.n(o),s=r(10),i=r.n(s),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(57);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(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}var d=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,l,f,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],s=b(o),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return f=l.value,e.prev=7,e.next=10,Promise.resolve(f.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),s.e(e.t1);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),p=function(){var e=a()(i.a.mark((function e(t,r,n){var o,a,s,f,d,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),s=b(a),e.prev=3,s.s();case 5:if((f=s.n()).done){e.next=28;break}return d=f.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(p=e.sent,"object"===c()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return o.push(p),e.abrupt("return",o);case 18:o.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},496:function(e,t){},497:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},57:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(153);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},s=function(e){return a(e,n.SUCCESS)},i=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:s,isErrorResponse:i,isFailResponse:u}}},76:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(37),o=r.n(c);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},795:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},814:function(e,t,r){"use strict";r.r(t);var n=r(811),c=r(349),o=r(348);t.default=Object(n.a)(o.a)(c.a)}}]);
|
build/atomic-block-components/button.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{451:function(t,o,c){"use strict";c.r(o);var e=c(11),n=c.n(e),a=c(4),d=c.n(a),r=c(0),u=(c(2),c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{451:function(t,o,c){"use strict";c.r(o);var e=c(11),n=c.n(e),a=c(4),d=c.n(a),r=c(0),u=(c(2),c(8)),b=c.n(u),i=c(1),l=c(85),s=c(716),p=c(29),_=c(43),k=c(71),w=(c(490),function(t){var o=t.product,c=o.id,e=o.permalink,a=o.add_to_cart,d=o.has_options,u=o.is_purchasable,_=o.is_in_stock,k=Object(l.a)().dispatchStoreEvent,w=Object(s.a)(c),m=w.cartQuantity,j=w.addingToCart,O=w.addToCart,f=Number.isFinite(m)&&m>0,v=!d&&u&&_,C=Object(p.decodeEntities)((null==a?void 0:a.description)||""),E=f?Object(i.sprintf)(Object(i._n)("%d in cart","%d in cart",m,"woo-gutenberg-products-block"),m):Object(p.decodeEntities)((null==a?void 0:a.text)||Object(i.__)("Add to cart","woo-gutenberg-products-block")),h=v?"button":"a",g={};return v?g.onClick=function(){O(),k("cart-add-item",{product:o})}:(g.href=e,g.rel="nofollow",g.onClick=function(){k("product-view-link",{product:o})}),Object(r.createElement)(h,n()({"aria-label":C,className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:f}),disabled:j},g),E)}),m=function(){return Object(r.createElement)("button",{className:b()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};o.default=Object(k.withProductDataContext)((function(t){var o=t.className,c=Object(_.useInnerBlockLayoutContext)().parentClassName,e=Object(_.useProductDataContext)().product;return Object(r.createElement)("div",{className:b()(o,"wp-block-button","wc-block-components-product-button",d()({},"".concat(c,"__product-add-to-cart"),c))},e.id?Object(r.createElement)(w,{product:e}):Object(r.createElement)(m,null))}))},490:function(t,o){}}]);
|
build/atomic-block-components/category-list.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{455:function(e,t,c){"use strict";c.r(t);var n=c(4),o=c.n(n),a=c(0),r=c(1),s=(c(2),c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{455:function(e,t,c){"use strict";c.r(t);var n=c(4),o=c.n(n),a=c(0),r=c(1),s=(c(2),c(8)),l=c.n(s),u=c(43),i=c(6),b=c(71);c(493);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,c=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(i.isEmpty)(n.categories)?null:Object(a.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",o()({},"".concat(c,"__product-category-list"),c))},Object(r.__)("Categories:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,c=e.link,n=e.slug;return Object(a.createElement)("li",{key:"category-list-item-".concat(n)},Object(a.createElement)("a",{href:c},t))}))))}))},493:function(e,t){}}]);
|
build/atomic-block-components/image.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{345:function(e,t,c){"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"},productId:{type:"number",default:0}}},346:function(e,t,c){"use strict";var n=c(11),r=c.n(n),a=c(4),o=c.n(a),l=c(13),i=c.n(l),u=c(0),s=(c(2),c(1)),d=c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{345:function(e,t,c){"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"},productId:{type:"number",default:0}}},346:function(e,t,c){"use strict";var n=c(11),r=c.n(n),a=c(4),o=c.n(a),l=c(13),i=c.n(l),u=c(0),s=(c(2),c(1)),d=c(8),p=c.n(d),b=c(5),m=c(43),g=c(71),f=c(85),O=c(256);c(488);function j(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function w(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?j(Object(c),!0).forEach((function(t){o()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):j(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}var h=function(){return Object(u.createElement)("img",{src:b.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},k=function(e){var t=e.image,c=e.onLoad,n=e.loaded,a=e.showFullSize,o=e.fallbackAlt,l=t||{},i=l.thumbnail,s=l.src,d=l.srcset,p=l.sizes,b=w({alt:l.alt||o,onLoad:c,hidden:!n,src:i},a&&{src:s,srcSet:d,sizes:p});return Object(u.createElement)(u.Fragment,null,b.src&&Object(u.createElement)("img",r()({"data-testid":"product-image"},b)),!n&&Object(u.createElement)(h,null))};t.a=Object(g.withProductDataContext)((function(e){var t=e.className,c=e.imageSizing,n=void 0===c?"full-size":c,r=e.productLink,a=void 0===r||r,l=e.showSaleBadge,d=e.saleBadgeAlign,b=void 0===d?"right":d,g=Object(m.useInnerBlockLayoutContext)().parentClassName,j=Object(m.useProductDataContext)().product,v=Object(u.useState)(!1),y=i()(v,2),E=y[0],S=y[1],P=Object(f.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",o()({},"".concat(g,"__product-image"),g))},Object(u.createElement)(h,null));var L=!!j.images.length,z=L?j.images[0]:null,_=a?"a":u.Fragment,B=Object(s.sprintf)(Object(s.__)("Link to %s","woo-gutenberg-products-block"),j.name),C=w(w({href:j.permalink,rel:"nofollow"},!L&&{"aria-label":B}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",o()({},"".concat(g,"__product-image"),g))},Object(u.createElement)(_,a&&C,!!l&&Object(u.createElement)(O.default,{align:b,product:j}),Object(u.createElement)(k,{fallbackAlt:j.name,image:z,onLoad:function(){return S(!0)},loaded:E,showFullSize:"cropped"!==n})))}))},488:function(e,t){},812:function(e,t,c){"use strict";c.r(t);var n=c(811),r=c(346),a=c(345);t.default=Object(n.a)(a.a)(r.a)}}]);
|
build/atomic-block-components/price-frontend.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[6],{126:function(e,r,c){"use strict";var t=c(7),a=c.n(t),n=c(1),l=c(43),o=c(4),i=c.n(o),u=(c(3),c(159)),s=(c(162),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,n=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement(l.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:t,style:n})," — ",React.createElement(l.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:c,style:n}))}),p=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,o=e.priceClassName,u=e.priceStyle,s=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),React.createElement(l.a,{currency:r,renderText:function(e){return React.createElement("del",{className:i()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),React.createElement(l.a,{currency:r,renderText:function(e){return React.createElement("ins",{className:i()("wc-block-components-product-price__value","is-discounted",o),style:u},e)},value:s}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,n=e.format,o=void 0===n?"<price/>":n,m=e.maxPrice,d=void 0===m?null:m,y=e.minPrice,b=void 0===y?null:y,f=e.price,g=void 0===f?null:f,v=e.priceClassName,_=e.priceStyle,O=e.regularPrice,P=e.regularPriceClassName,N=e.regularPriceStyle,S=i()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));o.includes("<price/>")||(o="<price/>",console.error("Price formats need to include the `<price/>` tag."));var C=O&&g!==O,j=React.createElement("span",{className:i()("wc-block-components-product-price__value",v)});return C?j=React.createElement(p,{currency:t,price:g,priceClassName:v,priceStyle:_,regularPrice:O,regularPriceClassName:P,regularPriceStyle:N}):null!==b&&null!==d?j=React.createElement(s,{currency:t,maxPrice:d,minPrice:b,priceClassName:v,priceStyle:_}):null!==g&&(j=React.createElement(l.a,{className:i()("wc-block-components-product-price__value",v),currency:t,value:g,style:_})),React.createElement("span",{className:S},Object(u.a)(o,{price:j}))}},137:function(e,r){},162:function(e,r){},307:function(e,r,c){"use strict";c.r(r);var t=c(7),a=c.n(t),n=(c(3),c(4)),l=c.n(n),o=c(126),i=c(40),u=c(81),s=c(209),p=c(13),m=c(208);r.default=Object(m.withProductDataContext)((function(e){var r,c,t,n,m,d,y,b=e.className,f=e.align,g=e.fontSize,v=e.customFontSize,_=e.saleFontSize,O=e.customSaleFontSize,P=e.color,N=e.customColor,S=e.saleColor,C=e.customSaleColor,j=Object(u.useInnerBlockLayoutContext)().parentClassName,w=Object(u.useProductDataContext)().product,R=l()(b,a()({},"".concat(j,"__product-price"),j));if(!w.id)return React.createElement(o.a,{align:f,className:R});var x=Object(s.getColorClassName)("color",P),E=Object(s.getFontSizeClass)(g),h=Object(s.getColorClassName)("color",S),k=Object(s.getFontSizeClass)(_),z=l()((r={"has-text-color":P||N,"has-font-size":g||v},a()(r,x,x),a()(r,E,E),r)),F=l()((c={"has-text-color":S||C,"has-font-size":_||O},a()(c,h,h),a()(c,k,k),c)),D={color:N,fontSize:v},T={color:C,fontSize:O},V=w.prices,B=Object(i.getCurrencyFromPriceResponse)(V),U=V.price!==V.regular_price,I=U?l()((t={},a()(t,"".concat(j,"__product-price__value"),j),a()(t,F,Object(p.l)()),t)):l()((n={},a()(n,"".concat(j,"__product-price__value"),j),a()(n,z,Object(p.l)()),n)),J=U?T:D;return React.createElement(o.a,{align:f,className:R,currency:B,price:V.price,priceClassName:I,priceStyle:Object(p.l)()?J:{},minPrice:null==V||null===(m=V.price_range)||void 0===m?void 0:m.min_amount,maxPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.max_amount,regularPrice:V.regular_price,regularPriceClassName:l()((y={},a()(y,"".concat(j,"__product-price__regular"),j),a()(y,z,Object(p.l)()),y)),regularPriceStyle:Object(p.l)()?D:{}})}))},43:function(e,r,c){"use strict";var t=c(10),a=c.n(t),n=c(7),l=c.n(n),o=c(16),i=c.n(o),u=c(114),s=c(4),p=c.n(s)
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[6],{126:function(e,r,c){"use strict";var t=c(7),a=c.n(t),n=c(1),l=c(43),o=c(4),i=c.n(o),u=(c(3),c(159)),s=(c(162),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,n=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement(l.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:t,style:n})," — ",React.createElement(l.a,{className:i()("wc-block-components-product-price__value",a),currency:r,value:c,style:n}))}),p=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,o=e.priceClassName,u=e.priceStyle,s=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woo-gutenberg-products-block")),React.createElement(l.a,{currency:r,renderText:function(e){return React.createElement("del",{className:i()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),React.createElement("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woo-gutenberg-products-block")),React.createElement(l.a,{currency:r,renderText:function(e){return React.createElement("ins",{className:i()("wc-block-components-product-price__value","is-discounted",o),style:u},e)},value:s}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,n=e.format,o=void 0===n?"<price/>":n,m=e.maxPrice,d=void 0===m?null:m,y=e.minPrice,b=void 0===y?null:y,f=e.price,g=void 0===f?null:f,v=e.priceClassName,_=e.priceStyle,O=e.regularPrice,P=e.regularPriceClassName,N=e.regularPriceStyle,S=i()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));o.includes("<price/>")||(o="<price/>",console.error("Price formats need to include the `<price/>` tag."));var C=O&&g!==O,j=React.createElement("span",{className:i()("wc-block-components-product-price__value",v)});return C?j=React.createElement(p,{currency:t,price:g,priceClassName:v,priceStyle:_,regularPrice:O,regularPriceClassName:P,regularPriceStyle:N}):null!==b&&null!==d?j=React.createElement(s,{currency:t,maxPrice:d,minPrice:b,priceClassName:v,priceStyle:_}):null!==g&&(j=React.createElement(l.a,{className:i()("wc-block-components-product-price__value",v),currency:t,value:g,style:_})),React.createElement("span",{className:S},Object(u.a)(o,{price:j}))}},137:function(e,r){},162:function(e,r){},307:function(e,r,c){"use strict";c.r(r);var t=c(7),a=c.n(t),n=(c(3),c(4)),l=c.n(n),o=c(126),i=c(40),u=c(81),s=c(209),p=c(13),m=c(208);r.default=Object(m.withProductDataContext)((function(e){var r,c,t,n,m,d,y,b=e.className,f=e.align,g=e.fontSize,v=e.customFontSize,_=e.saleFontSize,O=e.customSaleFontSize,P=e.color,N=e.customColor,S=e.saleColor,C=e.customSaleColor,j=Object(u.useInnerBlockLayoutContext)().parentClassName,w=Object(u.useProductDataContext)().product,R=l()(b,a()({},"".concat(j,"__product-price"),j));if(!w.id)return React.createElement(o.a,{align:f,className:R});var x=Object(s.getColorClassName)("color",P),E=Object(s.getFontSizeClass)(g),h=Object(s.getColorClassName)("color",S),k=Object(s.getFontSizeClass)(_),z=l()((r={"has-text-color":P||N,"has-font-size":g||v},a()(r,x,x),a()(r,E,E),r)),F=l()((c={"has-text-color":S||C,"has-font-size":_||O},a()(c,h,h),a()(c,k,k),c)),D={color:N,fontSize:v},T={color:C,fontSize:O},V=w.prices,B=Object(i.getCurrencyFromPriceResponse)(V),U=V.price!==V.regular_price,I=U?l()((t={},a()(t,"".concat(j,"__product-price__value"),j),a()(t,F,Object(p.l)()),t)):l()((n={},a()(n,"".concat(j,"__product-price__value"),j),a()(n,z,Object(p.l)()),n)),J=U?T:D;return React.createElement(o.a,{align:f,className:R,currency:B,price:V.price,priceClassName:I,priceStyle:Object(p.l)()?J:{},minPrice:null==V||null===(m=V.price_range)||void 0===m?void 0:m.min_amount,maxPrice:null==V||null===(d=V.price_range)||void 0===d?void 0:d.max_amount,regularPrice:V.regular_price,regularPriceClassName:l()((y={},a()(y,"".concat(j,"__product-price__regular"),j),a()(y,z,Object(p.l)()),y)),regularPriceStyle:Object(p.l)()?D:{}})}))},43:function(e,r,c){"use strict";var t=c(10),a=c.n(t),n=c(7),l=c.n(n),o=c(16),i=c.n(o),u=c(114),s=c(4),p=c.n(s),m=(c(137),["className","value","currency","onValueChange","displayType"]);function d(e,r){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),c.push.apply(c,t)}return c}function y(e){for(var r=1;r<arguments.length;r++){var c=null!=arguments[r]?arguments[r]:{};r%2?d(Object(c),!0).forEach((function(r){l()(e,r,c[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(c,r))}))}return e}r.a=function(e){var r=e.className,c=e.value,t=e.currency,n=e.onValueChange,l=e.displayType,o=void 0===l?"text":l,s=i()(e,m),d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;var b=d/Math.pow(10,t.minorUnit);if(!Number.isFinite(b))return null;var f=p()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),g=y(y(y({},s),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(t)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=n?function(e){var r=e.value*Math.pow(10,t.minorUnit);n(r)}:function(){};return React.createElement(u.a,a()({className:f,displayType:o},g,{value:b,onValueChange:v}))}}}]);
|
build/atomic-block-components/price.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{129:function(e,r,c){"use strict";var t=c(4),a=c.n(t),n=c(0),o=c(1),l=c(54),i=c(8),u=c.n(i),s=(c(2),c(136)),p=(c(207),function(e){var r=e.currency,c=e.maxPrice,t=e.minPrice,a=e.priceClassName,o=e.priceStyle;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{className:u()("wc-block-components-product-price__value",a),currency:r,value:t,style:o})," — ",Object(n.createElement)(l.a,{className:u()("wc-block-components-product-price__value",a),currency:r,value:c,style:o}))}),m=function(e){var r=e.currency,c=e.regularPriceClassName,t=e.regularPriceStyle,a=e.regularPrice,i=e.priceClassName,s=e.priceStyle,p=e.price;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woo-gutenberg-products-block")),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("del",{className:u()("wc-block-components-product-price__regular",c),style:t},e)},value:a}),Object(n.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woo-gutenberg-products-block")),Object(n.createElement)(l.a,{currency:r,renderText:function(e){return Object(n.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",i),style:s},e)},value:p}))};r.a=function(e){var r=e.align,c=e.className,t=e.currency,o=e.format,i=void 0===o?"<price/>":o,b=e.maxPrice,d=void 0===b?null:b,y=e.minPrice,O=void 0===y?null:y,f=e.price,g=void 0===f?null:f,v=e.priceClassName,j=e.priceStyle,_=e.regularPrice,P=e.regularPriceClassName,N=e.regularPriceStyle,S=u()(c,"price","wc-block-components-product-price",a()({},"wc-block-components-product-price--align-".concat(r),r));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var C=_&&g!==_,w=Object(n.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return C?w=Object(n.createElement)(m,{currency:t,price:g,priceClassName:v,priceStyle:j,regularPrice:_,regularPriceClassName:P,regularPriceStyle:N}):null!==O&&null!==d?w=Object(n.createElement)(p,{currency:t,maxPrice:d,minPrice:O,priceClassName:v,priceStyle:j}):null!==g&&(w=Object(n.createElement)(l.a,{className:u()("wc-block-components-product-price__value",v),currency:t,value:g,style:j})),Object(n.createElement)("span",{className:S},Object(s.a)(i,{price:w}))}},173:function(e,r){},207:function(e,r){},449:function(e,r,c){"use strict";c.r(r);var t=c(4),a=c.n(t),n=c(0),o=(c(2),c(8)),l=c.n(o),i=c(129),u=c(59),s=c(43),p=c(24),m=c(14),b=c(71);r.default=Object(b.withProductDataContext)((function(e){var r,c,t,o,b,d,y,O=e.className,f=e.align,g=e.fontSize,v=e.customFontSize,j=e.saleFontSize,_=e.customSaleFontSize,P=e.color,N=e.customColor,S=e.saleColor,C=e.customSaleColor,w=Object(s.useInnerBlockLayoutContext)().parentClassName,x=Object(s.useProductDataContext)().product,E=l()(O,a()({},"".concat(w,"__product-price"),w));if(!x.id)return Object(n.createElement)(i.a,{align:f,className:E});var h=Object(p.getColorClassName)("color",P),k=Object(p.getFontSizeClass)(g),z=Object(p.getColorClassName)("color",S),F=Object(p.getFontSizeClass)(j),D=l()((r={"has-text-color":P||N,"has-font-size":g||v},a()(r,h,h),a()(r,k,k),r)),T=l()((c={"has-text-color":S||C,"has-font-size":j||_},a()(c,z,z),a()(c,F,F),c)),V={color:N,fontSize:v},B={color:C,fontSize:_},U=x.prices,I=Object(u.getCurrencyFromPriceResponse)(U),J=U.price!==U.regular_price,M=J?l()((t={},a()(t,"".concat(w,"__product-price__value"),w),a()(t,T,Object(m.o)()),t)):l()((o={},a()(o,"".concat(w,"__product-price__value"),w),a()(o,D,Object(m.o)()),o)),W=J?B:V;return Object(n.createElement)(i.a,{align:f,className:E,currency:I,price:U.price,priceClassName:M,priceStyle:Object(m.o)()?W:{},minPrice:null==U||null===(b=U.price_range)||void 0===b?void 0:b.min_amount,maxPrice:null==U||null===(d=U.price_range)||void 0===d?void 0:d.max_amount,regularPrice:U.regular_price,regularPriceClassName:l()((y={},a()(y,"".concat(w,"__product-price__regular"),w),a()(y,D,Object(m.o)()),y)),regularPriceStyle:Object(m.o)()?V:{}})}))},54:function(e,r,c){"use strict";var t=c(11),a=c.n(t),n=c(4),o=c.n(n),l=c(20),i=c.n(l),u=c(0),s=c(165),p=c(8),m=c.n(p),b=(c(173),["className","value","currency","onValueChange","displayType"]);function d(e,r){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),c.push.apply(c,t)}return c}function y(e){for(var r=1;r<arguments.length;r++){var c=null!=arguments[r]?arguments[r]:{};r%2?d(Object(c),!0).forEach((function(r){o()(e,r,c[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(c,r))}))}return e}r.a=function(e){var r=e.className,c=e.value,t=e.currency,n=e.onValueChange,o=e.displayType,l=void 0===o?"text":o,p=i()(e,b),d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;var O=d/Math.pow(10,t.minorUnit);if(!Number.isFinite(O))return null;var f=m()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",r),g=y(y(y({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(t)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=n?function(e){var r=e.value*Math.pow(10,t.minorUnit);n(r)}:function(){};return Object(u.createElement)(s.a,a()({className:f,displayType:l},g,{value:O,onValueChange:v}))}}}]);
|
build/atomic-block-components/rating.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{450:function(t,e,c){"use strict";c.r(e);var a=c(4),n=c.n(a),r=c(0),o=(c(2),c(1)),s=c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{450:function(t,e,c){"use strict";c.r(e);var a=c(4),n=c.n(a),r=c(0),o=(c(2),c(1)),s=c(8),u=c.n(s),i=c(43),l=c(71),p=(c(489),function(t){var e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0});e.default=Object(l.withProductDataContext)((function(t){var e=t.className,c=Object(i.useInnerBlockLayoutContext)().parentClassName,a=Object(i.useProductDataContext)().product,s=p(a);if(!s)return null;var l={width:s/5*100+"%"},b=Object(o.sprintf)(Object(o.__)("Rated %f out of 5","woo-gutenberg-products-block"),s);return Object(r.createElement)("div",{className:u()(e,"wc-block-components-product-rating",n()({},"".concat(c,"__product-rating"),c))},Object(r.createElement)("div",{className:u()("wc-block-components-product-rating__stars","".concat(c,"__product-rating__stars")),role:"img","aria-label":b},Object(r.createElement)("span",{style:l},b)))}))},489:function(t,e){}}]);
|
build/atomic-block-components/sale-badge.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{256:function(e,t,c){"use strict";c.r(t);var o=c(4),n=c.n(o),a=c(0),l=(c(2),c(1)),r=c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{256:function(e,t,c){"use strict";c.r(t);var o=c(4),n=c.n(o),a=c(0),l=(c(2),c(1)),r=c(8),s=c.n(r),u=c(27),b=c(43),d=c(71);c(487);t.default=Object(d.withProductDataContext)((function(e){var t=e.className,c=e.align,o=Object(b.useInnerBlockLayoutContext)().parentClassName,r=Object(b.useProductDataContext)().product;if(!r.id||!r.on_sale)return null;var d="string"==typeof c?"wc-block-components-product-sale-badge--align-".concat(c):"";return Object(a.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,d,n()({},"".concat(o,"__product-onsale"),o))},Object(a.createElement)(u.Label,{label:Object(l.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(l.__)("Product on sale","woo-gutenberg-products-block")}))}))},487:function(e,t){}}]);
|
build/atomic-block-components/sku.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{454:function(t,c,e){"use strict";e.r(c);var n=e(4),o=e.n(n),u=e(0),s=e(1),a=(e(2),e(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{454:function(t,c,e){"use strict";e.r(c);var n=e(4),o=e.n(n),u=e(0),s=e(1),a=(e(2),e(8)),r=e.n(a),l=e(43),b=e(71);e(492);c.default=Object(b.withProductDataContext)((function(t){var c=t.className,e=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product.sku;return n?Object(u.createElement)("div",{className:r()(c,"wc-block-components-product-sku",o()({},"".concat(e,"__product-sku"),e))},Object(s.__)("SKU:","woo-gutenberg-products-block")," ",Object(u.createElement)("strong",null,n)):null}))},492:function(t,c){}}]);
|
build/atomic-block-components/stock-indicator.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{457:function(o,c,t){"use strict";t.r(c);var n=t(4),e=t.n(n),r=t(0),s=t(1),a=(t(2),t(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{457:function(o,c,t){"use strict";t.r(c);var n=t(4),e=t.n(n),r=t(0),s=t(1),a=(t(2),t(8)),i=t.n(a),u=t(43),k=t(71),b=(t(495),function(o){return Object(s.sprintf)(Object(s.__)("%d left in stock","woo-gutenberg-products-block"),o)}),d=function(o,c){return c?Object(s.__)("Available on backorder","woo-gutenberg-products-block"):o?Object(s.__)("In Stock","woo-gutenberg-products-block"):Object(s.__)("Out of Stock","woo-gutenberg-products-block")};c.default=Object(k.withProductDataContext)((function(o){var c,t=o.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,s=Object(u.useProductDataContext)().product;if(!s.id||!s.is_purchasable)return null;var a=!!s.is_in_stock,k=s.low_stock_remaining,l=s.is_on_backorder;return Object(r.createElement)("div",{className:i()(t,"wc-block-components-product-stock-indicator",(c={},e()(c,"".concat(n,"__stock-indicator"),n),e()(c,"wc-block-components-product-stock-indicator--in-stock",a),e()(c,"wc-block-components-product-stock-indicator--out-of-stock",!a),e()(c,"wc-block-components-product-stock-indicator--low-stock",!!k),e()(c,"wc-block-components-product-stock-indicator--available-on-backorder",!!l),c))},k?b(k):d(a,l))}))},495:function(o,c){}}]);
|
build/atomic-block-components/summary.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{162:function(t,e,c){"use strict";var n=c(0),r=c(121),o=c(94),a=function(t){var e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},u=function(t){return t.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(t,e){return t.replace(/[\s|\.\,]+$/i,"")+e},i=function(t,e){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",n=u(t),r=n.split(" ").splice(0,e).join(" ");return Object(o.autop)(s(r,c))},l=function(t,e){var c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",r=u(t),a=r.slice(0,e);if(c)return Object(o.autop)(s(a,n));var i=a.match(/([\s]+)/g),l=i?i.length:0,p=r.slice(0,e+l);return Object(o.autop)(s(p,n))};e.a=function(t){var e=t.source,c=t.maxLength,u=void 0===c?15:c,s=t.countType,p=void 0===s?"words":s,d=t.className,m=void 0===d?"":d,v=Object(n.useMemo)((function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(t),u=Object(r.count)(n,c);if(u<=e)return n;var s=a(n),p=Object(r.count)(s,c);return p<=e?s:"words"===c?i(s,e):l(s,e,"characters_including_spaces"===c)}(e,u,p)}),[e,u,p]);return Object(n.createElement)(n.RawHTML,{className:m},v)}},453:function(t,e,c){"use strict";c.r(e);var n=c(4),r=c.n(n),o=c(0),a=(c(2),c(8)),u=c.n(a),s=c(162),i=c(14),l=c(43),p=c(71);c(491);e.default=Object(p.withProductDataContext)((function(t){var e=t.className,c=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-summary",r()({},"".concat(c,"__product-summary"),c))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:u()(e,"wc-block-components-product-summary",r()({},"".concat(c,"__product-summary"),c)),source:a,maxLength:150,countType:i.m.wordCountType||"words"}):null}))},491:function(t,e){}}]);
|
build/atomic-block-components/tag-list.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{456:function(t,e,c){"use strict";c.r(e);var n=c(4),a=c.n(n),o=c(0),s=c(1),l=(c(2),c(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{456:function(t,e,c){"use strict";c.r(e);var n=c(4),a=c.n(n),o=c(0),s=c(1),l=(c(2),c(8)),u=c.n(l),r=c(43),i=c(6),b=c(71);c(494);e.default=Object(b.withProductDataContext)((function(t){var e=t.className,c=Object(r.useInnerBlockLayoutContext)().parentClassName,n=Object(r.useProductDataContext)().product;return Object(i.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-tag-list",a()({},"".concat(c,"__product-tag-list"),c))},Object(s.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(t){var e=t.name,c=t.link,n=t.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:c},e))}))))}))},494:function(t,e){}}]);
|
build/atomic-block-components/title-frontend.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{142:function(e,t,c){"use strict";var n=c(10),o=c.n(n),r=c(16),a=c.n(r),i=(c(3),c(18)),l=c(4),s=c.n(l)
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{142:function(e,t,c){"use strict";var n=c(10),o=c.n(n),r=c(16),a=c.n(r),i=(c(3),c(18)),l=c(4),s=c.n(l),u=(c(161),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,c=void 0===t?"":t,n=e.disabled,r=void 0!==n&&n,l=e.name,p=e.permalink,b=void 0===p?"":p,d=a()(e,u),f=s()("wc-block-components-product-name",c);return r?React.createElement("span",o()({className:f},d),Object(i.decodeEntities)(l)):React.createElement("a",o()({className:f,href:b},d),Object(i.decodeEntities)(l))}},161:function(e,t){},199:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var n=function(e,t){var c=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":c[n]="false"!==t[n]&&!1!==t[n];break;case"number":c[n]=parseInt(t[n],10);break;case"array":case"object":c[n]=JSON.parse(t[n]);break;default:c[n]=t[n]}else c[n]=e[n].default})),c}},292:function(e,t,c){"use strict";var n=c(10),o=c.n(n),r=c(199);t.a=function(e){return function(t){return function(c){var n=Object(r.a)(e,c);return React.createElement(t,o()({},c,n))}}}},296:function(e,t){},316:function(e,t,c){"use strict";c.r(t);var n=c(292),o=c(7),r=c.n(o),a=(c(3),c(4)),i=c.n(a),l=c(81),s=c(209),u=c(13),p=function(e){var t=e.color,c=e.fontSize;return Object(u.l)()?{color:t,fontSize:c}:{}},b=c(208),d=c(142),f=c(56),m=(c(296),Object(b.withProductDataContext)((function(e){var t,c,n,o=e.className,a=e.headingLevel,b=void 0===a?2:a,m=e.productLink,O=void 0===m||m,j=e.align,v=e.color,y=e.customColor,k=e.fontSize,w=e.customFontSize,g=Object(l.useInnerBlockLayoutContext)().parentClassName,h=Object(l.useProductDataContext)().product,S=Object(f.a)().dispatchStoreEvent,E="h".concat(b),N=Object(s.getColorClassName)("color",v),z=Object(s.getFontSizeClass)(k),C=i()((t={"has-text-color":v||y,"has-font-size":k||w},r()(t,N,N),r()(t,z,z),t));return h.id?React.createElement(E,{className:i()(o,"wc-block-components-product-title",(c={},r()(c,"".concat(g,"__product-title"),g),r()(c,"wc-block-components-product-title--align-".concat(j),j&&Object(u.l)()),c))},React.createElement(d.a,{className:i()(r()({},C,Object(u.l)())),disabled:!O,name:h.name,permalink:h.permalink,rel:O?"nofollow":null,style:p({color:y,fontSize:w}),onClick:function(){S("product-view-link",{product:h})}})):React.createElement(E,{className:i()(o,"wc-block-components-product-title",(n={},r()(n,"".concat(g,"__product-title"),g),r()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(u.l)()),r()(n,C,Object(u.l)()),n)),style:p({color:y,fontSize:w})})})));function O(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function j(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?O(Object(c),!0).forEach((function(t){r()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):O(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}var v={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(u.l)()&&(v=j(j({},v),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}}));var y=v;t.default=Object(n.a)(y)(m)}}]);
|
build/atomic-block-components/title.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{160:function(t,e,o){"use strict";var c=o(11),n=o.n(c),r=o(20),a=o.n(r),i=o(0),l=(o(2),o(29)),s=o(8),u=o.n(s),p=(o(206),["className","disabled","name","permalink"]);e.a=function(t){var e=t.className,o=void 0===e?"":e,c=t.disabled,r=void 0!==c&&c,s=t.name,b=t.permalink,d=void 0===b?"":b,m=a()(t,p),O=u()("wc-block-components-product-name",o);return r?Object(i.createElement)("span",n()({className:O},m),Object(l.decodeEntities)(s)):Object(i.createElement)("a",n()({className:O,href:d},m),Object(l.decodeEntities)(s))}},206:function(t,e){},344:function(t,e,o){"use strict";var c=o(4),n=o.n(c),r=o(14);function a(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);e&&(c=c.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,c)}return o}function i(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?a(Object(o),!0).forEach((function(e){n()(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var l={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(r.o)()&&(l=i(i({},l),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),e.a=l},350:function(t,e,o){"use strict";var c=o(4),n=o.n(c),r=o(0),a=(o(2),o(8)),i=o.n(a),l=o(43),s=o(24),u=o(14),p=function(t){var e=t.color,o=t.fontSize;return Object(u.o)()?{color:e,fontSize:o}:{}},b=o(71),d=o(160),m=o(85);o(486),e.a=Object(b.withProductDataContext)((function(t){var e,o,c,a=t.className,b=t.headingLevel,O=void 0===b?2:b,f=t.productLink,j=void 0===f||f,y=t.align,v=t.color,w=t.customColor,g=t.fontSize,k=t.customFontSize,h=Object(l.useInnerBlockLayoutContext)().parentClassName,S=Object(l.useProductDataContext)().product,z=Object(m.a)().dispatchStoreEvent,C="h".concat(O),E=Object(s.getColorClassName)("color",v),N=Object(s.getFontSizeClass)(g),P=i()((e={"has-text-color":v||w,"has-font-size":g||k},n()(e,E,E),n()(e,N,N),e));return S.id?Object(r.createElement)(C,{className:i()(a,"wc-block-components-product-title",(o={},n()(o,"".concat(h,"__product-title"),h),n()(o,"wc-block-components-product-title--align-".concat(y),y&&Object(u.o)()),o))},Object(r.createElement)(d.a,{className:i()(n()({},P,Object(u.o)())),disabled:!j,name:S.name,permalink:S.permalink,rel:j?"nofollow":null,style:p({color:w,fontSize:k}),onClick:function(){z("product-view-link",{product:S})}})):Object(r.createElement)(C,{className:i()(a,"wc-block-components-product-title",(c={},n()(c,"".concat(h,"__product-title"),h),n()(c,"wc-block-components-product-title--align-".concat(y),y&&Object(u.o)()),n()(c,P,Object(u.o)()),c)),style:p({color:w,fontSize:k})})}))},486:function(t,e){},813:function(t,e,o){"use strict";o.r(e);var c=o(811),n=o(350),r=o(344);e.default=Object(c.a)(r.a)(n.a)}}]);
|
build/attribute-filter-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', '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', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', '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', 'wp-primitives'), 'version' => '2a0b35c6e9a6358ce5ae6ec64d4461ed');
|
build/attribute-filter-frontend.js
CHANGED
@@ -3,7 +3,7 @@
|
|
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){!function(){e.exports=this.wc.wcSettings}()},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){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(83),o=n(84),i=n(67),u=n(85);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||u()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";n.d(t,"k",(function(){return i})),n.d(t,"i",(function(){return u})),n.d(t,"j",(function(){return c})),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return d})),n.d(t,"h",(function(){return f})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return h})),n.d(t,"l",(function(){return g}));var r,o=n(5),i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),u=i.pluginUrl+"assets/",c=i.pluginUrl+"build/",a=i.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,d=o.STORE_PAGES.privacy.title,f=o.STORE_PAGES.terms.permalink,b=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),g=(n(41),function(){return a>1})},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,n){var r=n(71);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o<u.length;o++)n=u[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){!function(){e.exports=this.wp.htmlEntities}()},,function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},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},e.exports.default=e.exports,e.exports.__esModule=!0},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){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){!function(){e.exports=this.wp.primitives}()},,,,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(64);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)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20).default,o=n(23);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},,,,,function(e,t){!function(){e.exports=this.wp.blocks}()},,,function(e,t,n){"use strict";var r=n(32),o=n.n(r),i=n(33),u=n.n(i),c=n(23),a=n.n(c),s=n(34),l=n.n(s),p=n(35),d=n.n(p),f=n(25),b=n.n(f),m=n(7),h=n.n(m),g=(n(3),n(2)),v=n(1),y=n(13),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.i,"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 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),u&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},u),c&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",c)))};n(75);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 x=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)),h()(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=e.renderError,c=this.state,a=c.errorMessage;return c.hasError?"function"==typeof u?u({errorMessage:a}):React.createElement(O,{errorMessage:r?a: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(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(g.Component);x.defaultProps={showErrorMessage:!0};t.a=x},,,,,function(e,t,n){var r=n(98),o=n(99),i=n(67),u=n(100);e.exports=function(e){return r(e)||o(e)||i(e)||u()},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(0),o=n(22),i=n.n(o);function u(e){var t=Object(r.useRef)();return void 0!==t.current&&i()(e,t.current)||(t.current=e),t.current}},,,,,,,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},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t,n){var r=n(68);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}},e.exports.default=e.exports,e.exports.__esModule=!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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},,function(e,t){e.exports=function(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},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(74);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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,i=[],u=!0,c=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{u||null==n.return||n.return()}finally{if(c)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},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.")},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);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),d=Object(r.useRef)(e);d.current=e;var f=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 p.current=!1,function(){p.current=!0}}),[]);var b=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||(d.current.apply(d,e),s.current=!0),l.current=setTimeout((function(){var t=!0;c&&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=u.current;f(),p.current||d.current.apply(null,e)}),o))}),[o,t,f,c,a]),m=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,u.current),f())}),[f]);return[b,f,m]}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(9),o=n.n(r),i=n(15),u=n(12),c=n(0),a=n(22),s=n.n(a),l=n(54),p=n(107),d=n(61),f=function(e){var t=Object(d.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,r])]},b=function(e,t,n){var r=Object(d.a)();n=n||r;var o=Object(u.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),a=Object(u.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(c.useCallback)((function(t){a(n,e,t)}),[n,e,a])]},m=function(e,t){var n=Object(d.a)(),r=f(t=t||n),i=o()(r,2),u=i[0],a=i[1],b=Object(l.a)(u),m=Object(l.a)(e),h=Object(p.a)(m),g=Object(c.useRef)(!1);return Object(c.useEffect)((function(){s()(h,m)||(a(Object.assign({},b,m)),g.current=!0)}),[b,m,h,a]),g.current?[u,a]:[e,a]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),o=n.n(r),i=n(0),u=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return Object(i.useCallback)((function(e){t((function(){throw e}))}),[])}},,,function(e,t,n){var r=n(68);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},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.")},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(69);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}},function(e,t,n){"use strict";function r(e){return"object"==typeof e&&null!=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=window,o=t.scrollMode,c=t.block,a=t.inline,s=t.boundary,l=t.skipOverflowHiddenElements,p="function"==typeof s?s:function(e){return e!==s};if(!r(e))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,f=[],b=e;r(b)&&p(b);){if((b=b.parentElement)===d){f.push(b);break}null!=b&&b===document.body&&i(b)&&!i(document.documentElement)||null!=b&&i(b,l)&&f.push(b)}for(var m=n.visualViewport?n.visualViewport.width:innerWidth,h=n.visualViewport?n.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),O=y.height,w=y.width,x=y.top,j=y.right,_=y.bottom,E=y.left,I="start"===c||"nearest"===c?x:"end"===c?_:x+O/2,S="center"===a?E+w/2:"end"===a?j:E,k=[],R=0;R<f.length;R++){var P=f[R],C=P.getBoundingClientRect(),M=C.height,T=C.width,A=C.top,D=C.right,H=C.bottom,N=C.left;if("if-needed"===o&&x>=0&&E>=0&&_<=h&&j<=m&&x>=A&&_<=H&&E>=N&&j<=D)return k;var L=getComputedStyle(P),B=parseInt(L.borderLeftWidth,10),V=parseInt(L.borderTopWidth,10),K=parseInt(L.borderRightWidth,10),F=parseInt(L.borderBottomWidth,10),U=0,q=0,$="offsetWidth"in P?P.offsetWidth-P.clientWidth-B-K:0,W="offsetHeight"in P?P.offsetHeight-P.clientHeight-V-F:0;if(d===P)U="start"===c?I:"end"===c?I-h:"nearest"===c?u(v,v+h,h,V,F,v+I,v+I+O,O):I-h/2,q="start"===a?S:"center"===a?S-m/2:"end"===a?S-m:u(g,g+m,m,B,K,g+S,g+S+w,w),U=Math.max(0,U+v),q=Math.max(0,q+g);else{U="start"===c?I-A-V:"end"===c?I-H+F+W:"nearest"===c?u(A,H,M,V,F+W,I,I+O,O):I-(A+M/2)+W/2,q="start"===a?S-N-B:"center"===a?S-(N+T/2)+$/2:"end"===a?S-D+K+$:u(N,D,T,B,K+$,S,S+w,w);var G=P.scrollLeft,Y=P.scrollTop;I+=Y-(U=Math.max(0,Math.min(Y+U,P.scrollHeight-M+W))),S+=G-(q=Math.max(0,Math.min(G+q,P.scrollWidth-T+$)))}k.push({el:P,top:U,left:q})}return k}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),o=n.n(r),i=n(7),u=n.n(i),c=n(0),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){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=[".wp-block-woocommerce-cart"],d=function(e){var t=e.Block,n=e.containers,r=e.getProps,i=void 0===r?function(){}:r,u=e.getErrorBoundaryProps,s=void 0===u?function(){}:u;0!==n.length&&Array.prototype.forEach.call(n,(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(c.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:p})))),e)}))},f=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,i=e.wrappers,u=document.body.querySelectorAll(o);i.length>0&&Array.prototype.filter.call(u,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),d({Block:t,containers:u,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(p.join(","));f(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,i,u,c;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,i=n.getErrorBoundaryProps,u=n.selector,c=n.wrapper.querySelectorAll(u),d({Block:r,containers:c,getProps:o,getErrorBoundaryProps:i})}))}))}},,,function(e,t){},,,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(54),c=n(95),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}),m=Object(u.a)(p),h=Object(u.a)(s),g=Object(c.a)(),v=Object(o.useSelect)((function(e){if(!f)return null;var o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,m,h],u=o.getCollectionError.apply(o,i);return u&&g(u),{results:o.getCollection.apply(o,i),isLoading:!o.hasFinishedResolution("getCollection",i)}}),[t,n,h,m,f]);return null!==v&&(b.current=v),b.current}},,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(7),o=n.n(r),i=n(16),u=n.n(i),c=n(0);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=u()(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?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}({width:r,height:r},i)):null}},,function(e,t,n){"use strict";var r=n(0),o=n(15),i=n(12),u=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(u.k.restApiRoutes||{}),Object(i.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),i=r.isResolving,u=r.hasFinishedResolution,c=t.dispatch(o.SCHEMA_STORE_KEY),a=c.receiveRoutes,s=c.startResolution,l=c.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];i("getRoutes",[e])||u("getRoutes",[e])||(s("getRoutes",[e]),a(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(2),o=n(91);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],d=l[1],f=l[2],b=Object(r.useRef)(e);return Object(r.useEffect)((function(){u(b.current,e)||(p(e),b.current=e)}),[e,p,u]),[a,d,f]}},function(e,t,n){"use strict";var r=n(1),o=(n(3),n(4)),i=n.n(o),u=n(11),c=(n(169),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","wc-block-components-filter-submit-button",t),disabled:n,onClick:a},React.createElement(u.Label,{label:c,screenReaderLabel:l}))});c.defaultProps={disabled:!1},t.a=c},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(5),o=Object(r.getSetting)("attributes",[]),i=o.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}),[]),u=function(e){if(e)return i.find((function(t){return t.id===e}))},c=function(e){if(e)return i.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(8),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:o.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(u,"attribute")))}},,,,,,,function(e,t,n){"use strict";var r=n(10),o=n.n(r),i=n(16),u=n.n(i),c=(n(3),n(4)),a=n.n(c),s=n(1),l=n(139),p=n(170),d=(n(122),function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,i=e.element,c=void 0===i?"li":i,s=e.className,l=void 0===s?"":s,p=e.radius,d=void 0===p?"small":p,f=e.children,b=void 0===f?null:f,m=u()(e,["text","screenReaderText","element","className","radius","children"]),h=c,g=a()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+d),v=Boolean(r&&r!==t);return React.createElement(h,o()({className:g},m),React.createElement("span",{"aria-hidden":v,className:"wc-block-components-chip__text"},t),v&&React.createElement("span",{className:"screen-reader-text"},r),b)});t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,i=void 0===r?"":r,c=e.disabled,f=void 0!==c&&c,b=e.onRemove,m=void 0===b?function(){}:b,h=e.removeOnAnyClick,g=void 0!==h&&h,v=e.text,y=e.screenReaderText,O=void 0===y?"":y,w=u()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),x=g?"span":"button";if(!n){var j=O&&"string"==typeof O?O:v;n="string"!=typeof j?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),j)}var _={"aria-label":n,disabled:f,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},E=g?_:{},I=g?{"aria-hidden":!0}:_;return React.createElement(d,o()({},w,E,{className:a()(i,"is-removable"),element:g?"button":w.element,screenReaderText:O,text:v}),React.createElement(x,o()({className:"wc-block-components-chip__remove"},I),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(10),o=n.n(r),i=n(16),u=n.n(i),c=n(28),a=function(e){var t=e.className,n=e.size,r=u()(e,["className","size"]);return React.createElement(c.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,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"}))},s=React.createElement(a,null);t.a=s},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";e.exports=n(233)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(7),o=n.n(r),i=n(49),u=n.n(i),c=n(20),a=n.n(c),s=n(9),l=n.n(s),p=n(0),d=n(148),f=n(8),b=n(54),m=n(94),h=n(125),g=n(61);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(m.a)(o),c=l()(i,1)[0],s=Object(m.b)("calculate_attribute_counts",[],o),v=l()(s,2),O=v[0],w=v[1],x=Object(m.b)("calculate_price_range",null,o),j=l()(x,2),_=j[0],E=j[1],I=Object(b.a)(t||{}),S=Object(b.a)(n);Object(p.useEffect)((function(){"object"===a()(I)&&Object.keys(I).length&&(O.find((function(e){return e.taxonomy===I.taxonomy}))||w([].concat(u()(O),[I])))}),[I,O,w]),Object(p.useEffect)((function(){_!==S&&void 0!==S&&E(S)}),[S,E,_]);var k=Object(p.useState)(!1),R=l()(k,2),P=R[0],C=R[1],M=Object(d.a)(P,200),T=l()(M,1)[0];P||C(!0);var A=Object(p.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(f.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(c)}),[c]);return Object(h.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},A),shouldSelect:T})}},,function(e,t,n){e.exports=n(279)},function(e,t){},function(e,t){},function(e,t,n){"use strict";
|
7 |
/** @license React v17.0.2
|
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=60103,o=60106,i=60107,u=60108,c=60114,a=60109,s=60110,l=60112,p=60113,d=60120,f=60115,b=60116,m=60121,h=60122,g=60117,v=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var O=Symbol.for;r=O("react.element"),o=O("react.portal"),i=O("react.fragment"),u=O("react.strict_mode"),c=O("react.profiler"),a=O("react.provider"),s=O("react.context"),l=O("react.forward_ref"),p=O("react.suspense"),d=O("react.suspense_list"),f=O("react.memo"),b=O("react.lazy"),m=O("react.block"),h=O("react.server.block"),g=O("react.fundamental"),v=O("react.debug_trace_mode"),y=O("react.legacy_hidden")}function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case c:case u:case p:case d:return e;default:switch(e=e&&e.$$typeof){case s:case l:case b:case f:case a:return e;default:return t}}case o:return t}}}var x=a,j=r,_=l,E=i,I=b,S=f,k=o,R=c,P=u,C=p;t.ContextConsumer=s,t.ContextProvider=x,t.Element=j,t.ForwardRef=_,t.Fragment=E,t.Lazy=I,t.Memo=S,t.Portal=k,t.Profiler=R,t.StrictMode=P,t.Suspense=C,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return w(e)===s},t.isContextProvider=function(e){return w(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===l},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===b},t.isMemo=function(e){return w(e)===f},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===c},t.isStrictMode=function(e){return w(e)===u},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===c||e===v||e===u||e===p||e===d||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===f||e.$$typeof===a||e.$$typeof===s||e.$$typeof===l||e.$$typeof===g||e.$$typeof===m||e[0]===h)},t.typeOf=w},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(141),o=n(119),i=n(7),u=n.n(i),c=n(9),a=n.n(c),s=n(1),l=n(36),p=n(54),d=n(107),f=n(94),b=n(125),m=n(228),h=n(0),g=n(49),v=n.n(g),y=n(3),O=n.n(y),w=n(4),x=n.n(w),j=(n(234),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,d=e.isDisabled,f=void 0!==d&&d,b=e.limit,m=void 0===b?10:b,g=Object(h.useState)(!1),y=a()(g,2),O=y[0],w=y[1],j=Object(h.useMemo)((function(){return v()(Array(5)).map((function(e,t){return React.createElement("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),_=Object(h.useMemo)((function(){var e=i.length-m;return!O&&React.createElement("li",{key:"show-more",className:"show-more"},React.createElement("button",{onClick:function(){w(!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(h.useMemo)((function(){return O&&React.createElement("li",{key:"show-less",className:"show-less"},React.createElement("button",{onClick:function(){w(!1)},"aria-expanded":!0,"aria-label":Object(s.__)("Show less options","woo-gutenberg-products-block")},Object(s.__)("Show less","woo-gutenberg-products-block")))}),[O]),I=Object(h.useMemo)((function(){var e=i.length>m+5;return React.createElement(React.Fragment,null,i.map((function(t,n){return React.createElement(h.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:f}),React.createElement("label",{htmlFor:t.value},t.label)),e&&n===m-1&&_)})),e&&E)}),[i,r,c,O,m,E,_,f]),S=x()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":p},t);return React.createElement("ul",{className:S},p?j:I)}),_=n(24),E=n(6),I=n(14),S=n(116),k=n(2),R=(n(195),n(117)),P=0;function C(e){return"function"==typeof e?e:M}function M(){}function T(e,t){e&&Object(R.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 A(e,t){return e===t||t instanceof Node&&e.contains&&e.contains(t)}function D(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 H(){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 N(){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 L(){return String(P++)}function B(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function V(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function K(e){return"string"==typeof e.type}function F(e){return e.props}var U=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function q(e){void 0===e&&(e={});var t={};return U.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function $(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=W(t,r)?t[r]:e[r],n}),{})}function W(e,t){return void 0!==e[t]}function G(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function Y(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;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=z(e,u,n,r,o);return-1===c?t>=n?-1:t:c}function z(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?z(1,0,n,r,!1):z(-1,n-1,n,r,!1):-1}function Q(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(A(t,e)||r&&A(t,n.activeElement))}))}var X=D((function(e){Z(e).textContent=""}),500);function J(e,t){var n=Z(t);e&&(n.textContent=e,X(t))}function Z(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 ee=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}),te=function(){var e=function(e){function t(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+L(),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=q(t),n.internalSetState(Object(E.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=q(t),n.internalSetState(Object(E.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(E.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={};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&&(c[e],W(n.props,e)||(a[e]=c[e]))})),u&&c.hasOwnProperty("inputValue")&&n.props.onInputValueChange(c.inputValue,Object(E.a)({},n.getStateAndHelpers(),c)),a}),(function(){C(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(_.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(E.a)(((r={})[u]=N(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=Y(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=Y(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){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(Object(E.a)({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=Object(E.a)({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=Object(E.a)({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=z(1,0,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=z(-1,r-1,r,(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(_.a)(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),a=n.getState().isOpen,s={onClick:H(r,n.buttonHandleClick),onKeyDown:H(o,n.buttonHandleKeyDown),onKeyUp:H(i,n.buttonHandleKeyUp),onBlur:H(u,n.buttonHandleBlur)},l=c.disabled?{}:s;return Object(E.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=G(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(Object(I.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(E.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(_.a)(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),a={};var s,l=n.getState(),p=l.inputValue,d=l.isOpen,f=l.highlightedIndex;c.disabled||((s={}).onChange=H(i,u,n.inputHandleChange),s.onKeyDown=H(r,n.inputHandleKeyDown),s.onBlur=H(o,n.inputHandleBlur),a=s);return Object(E.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,c)},n.inputHandleKeyDown=function(e){var t=G(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(Object(I.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(_.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(E.a)(((r={})[u]=N(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(_.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,d=((t={onMouseMove:H(o,(function(){c!==n.getState().highlightedIndex&&(n.setHighlightedIndex(c,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:H(i,(function(e){e.preventDefault()}))}).onClick=H(p,(function(){n.selectItemAtIndex(c,{type:9})})),t),f=l.disabled?{onMouseDown:d.onMouseDown}:d;return Object(E.a)({id:n.getItemId(c),role:"option","aria-selected":n.getState().highlightedIndex===c},f,l)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=q(e),n.internalSetState((function(t){var r=t.selectedItem;return Object(E.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=q(e),n.internalSetState((function(t){var r=t.isOpen;return Object(E.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),C(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=D((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(Object(E.a)({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,J(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,d=r.initialSelectedItem,f=void 0===d?null:d,b=n.getState({highlightedIndex:u,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(S.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),$(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=Y(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,d=this.getItemProps,f=this.openMenu,b=this.closeMenu,m=this.toggleMenu,h=this.selectItem,g=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:d,reset:this.reset,openMenu:f,closeMenu:b,toggleMenu:m,selectItem:h,selectItemAtIndex:g,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){W(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=V(this.props.children,M);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=V(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:K(t)?Object(k.cloneElement)(t,this.getRootProps(F(t))):void 0:null},t}(k.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:B,itemToString:function(e){return null==e?"":String(e)},onStateChange:M,onInputValueChange:M,onUserAction:M,onChange:M,onSelect:M,onOuterClick:M,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:T},e.stateChangeTypes=ee,e}();D((function(e,t){J(e(),t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?k.useLayoutEffect:k.useEffect;var ne={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:T,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};O.a.array.isRequired,O.a.func,O.a.func,O.a.func,O.a.bool,O.a.number,O.a.number,O.a.number,O.a.bool,O.a.bool,O.a.bool,O.a.any,O.a.any,O.a.any,O.a.string,O.a.string,O.a.string,O.a.func,O.a.string,O.a.func,O.a.func,O.a.func,O.a.func,O.a.func,O.a.shape({addEventListener:O.a.func,removeEventListener:O.a.func,document:O.a.shape({getElementById:O.a.func,activeElement:O.a.any,body:O.a.any})});Object(E.a)({},ne,{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}});O.a.array.isRequired,O.a.func,O.a.func,O.a.func,O.a.bool,O.a.number,O.a.number,O.a.number,O.a.bool,O.a.bool,O.a.bool,O.a.any,O.a.any,O.a.any,O.a.string,O.a.string,O.a.string,O.a.string,O.a.string,O.a.string,O.a.func,O.a.string,O.a.string,O.a.func,O.a.func,O.a.func,O.a.func,O.a.func,O.a.func,O.a.shape({addEventListener:O.a.func,removeEventListener:O.a.func,document:O.a.shape({getElementById:O.a.func,activeElement:O.a.any,body:O.a.any})});Object(E.a)({},ne,{getA11yStatusMessage:B,circularNavigation:!0});O.a.array,O.a.array,O.a.array,O.a.func,O.a.func,O.a.func,O.a.number,O.a.number,O.a.number,O.a.func,O.a.func,O.a.string,O.a.string,O.a.shape({addEventListener:O.a.func,removeEventListener:O.a.func,document:O.a.shape({getElementById:O.a.func,activeElement:O.a.any,body:O.a.any})});var re=te,oe=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 wc-block-components-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}))},ie=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)},ue=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:x()("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)})))},ce=n(158),ae=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement(ce.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(s.sprintf)(Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),n.name),text:n.label,radius:"large"})},se=n(139),le=n(170),pe=function(e){var t=e.onClick,n=e.onRemoveItem,r=e.option,o=Object(h.useRef)(null);return Object(h.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)},React.createElement(se.a,{srcElement:le.a,size:16})))};n(232);function de(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 fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?de(Object(n),!0).forEach((function(t){u()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var be=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,d=void 0!==p&&p,f=e.multiple,b=void 0!==f&&f,m=e.onChange,g=void 0===m?function(){}:m,v=e.options,y=void 0===v?[]:v,O=Object(h.useRef)(null),w=x()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":l,"is-loading":d}),j=Object(h.useCallback)((function(e,t){switch(t.type){case re.stateChangeTypes.keyDownEnter:case re.stateChangeTypes.clickItem:return fe(fe({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:b,inputValue:""});case re.stateChangeTypes.blurInput:case re.stateChangeTypes.mouseUp:return fe(fe({},t),{},{inputValue:e.inputValue});default:return t}}),[b]);return React.createElement(re,{onChange:g,selectedItem:null,stateReducer:j},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,u=e.getMenuProps,a=e.highlightedIndex,p=e.inputValue,d=e.isOpen,f=e.openMenu;return React.createElement("div",{className:x()(w,{"is-multiple":b,"is-single":!b,"has-checked":i.length>0,"is-open":d})},React.createElement("label",o({className:"screen-reader-text"}),c),React.createElement(ie,{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){g(e),O.current.focus()};return b?React.createElement(ae,{key:e,onRemoveItem:n,option:t}):React.createElement(pe,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(oe,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:f,onRemoveItem:function(e){g(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(ue,{checked:i,getItemProps:r,getMenuProps:u,highlightedIndex:a,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},me=n(149),he=n(22),ge=n.n(he),ve=n(18),ye=n(150),Oe=n(151),we=n(11),xe=function(e){var t=e.name,n=e.count;return React.createElement(React.Fragment,null,t,Number.isFinite(n)&&React.createElement(we.Label,{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"}}))},je=[{value:"preview-1",name:"Blue",label:React.createElement(xe,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(xe,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(xe,{name:"Red",count:2})}],_e={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(231);function Ee(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 Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(n),!0).forEach((function(t){u()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Se=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,o=t.isPreview&&!t.attributeId?_e:Object(ye.a)(t.attributeId),i=Object(h.useState)([]),u=a()(i,2),c=u[0],g=u[1],v=Object(h.useState)(t.isPreview&&!t.attributeId?je:[]),y=a()(v,2),O=y[0],w=y[1],x=Object(f.a)(),_=a()(x,1)[0],E=Object(f.b)("attributes",[]),I=a()(E,2),S=I[0],k=I[1],R=Object(b.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[o.id],shouldSelect:t.attributeId>0}),P=R.results,C=R.isLoading,M="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(m.a)({queryAttribute:{taxonomy:o.taxonomy,queryType:t.queryType},queryState:Ie(Ie({},_),{},{attributes:M?_.attributes:null})}),A=T.results,D=T.isLoading,H=Object(h.useCallback)((function(e){return A.attribute_counts?A.attribute_counts.find((function(t){return t.term===e})):null}),[A]);Object(h.useEffect)((function(){if(!C&&!D){var e=P.map((function(e){var n,r=H(e.id);if(!(r||c.includes(e.slug)||(n=e.slug,null!=_&&_.attributes&&_.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(ve.decodeEntities)(e.name),label:React.createElement(xe,{name:Object(ve.decodeEntities)(e.name),count:t.showCounts?i:null})}})).filter(Boolean);w(e)}}),[o.taxonomy,P,C,t.showCounts,D,H,c,_.attributes]),Object(h.useEffect)((function(){t.showFilterButton||K(c)}),[t.showFilterButton,c,K]);var N=Object(h.useMemo)((function(){return S.filter((function(e){return e.attribute===o.taxonomy})).flatMap((function(e){return e.slug}))}),[S,o.taxonomy]),L=Object(p.a)(N),B=Object(d.a)(L);Object(h.useEffect)((function(){ge()(B,L)||ge()(c,L)||g(L)}),[c,L,B]);var V=Object(h.useCallback)((function(e){return P.reduce((function(t,n){return e.includes(n.slug)&&t.push(n),t}),[])}),[P]),K=Object(h.useCallback)((function(e){r||Object(Oe.b)(S,k,o,V(e),"or"===t.queryType?"in":"and")}),[r,S,k,o,V,t.queryType]),F="dropdown"!==t.displayStyle||"or"===t.queryType,U=Object(h.useCallback)((function(e){var t,n=function(e){return O.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.__)("%1$s filter replaced with %2$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);F?(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}));g(t)}),[c,O,F]);if(0===O.length&&!C)return null;var q="h".concat(t.headingLevel),$=!t.isPreview&&C,W=!t.isPreview&&D;return React.createElement(React.Fragment,null,!r&&t.heading&&React.createElement(q,null,t.heading),React.createElement("div",{className:"wc-block-attribute-filter"},"dropdown"===t.displayStyle?React.createElement(be,{attributeLabel:o.label,checked:c,className:"wc-block-attribute-filter-dropdown",inputLabel:t.heading,isLoading:$,multiple:F,onChange:U,options:O}):React.createElement(j,{className:"wc-block-attribute-filter-list",options:O,checked:c,onChange:U,isLoading:$,isDisabled:W}),t.showFilterButton&&React.createElement(me.a,{className:"wc-block-attribute-filter__button",disabled:$||W,onClick:function(){return K(c)}})))};Object(o.a)({selector:".wp-block-woocommerce-attribute-filter",Block:Object(r.a)(Se),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}}}})}]);
|
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){!function(){e.exports=this.wc.wcSettings}()},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){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(83),o=n(84),i=n(67),u=n(85);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||u()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";n.d(t,"k",(function(){return i})),n.d(t,"i",(function(){return u})),n.d(t,"j",(function(){return c})),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return d})),n.d(t,"h",(function(){return f})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return h})),n.d(t,"l",(function(){return g}));var r,o=n(5),i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),u=i.pluginUrl+"assets/",c=i.pluginUrl+"build/",a=i.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,d=o.STORE_PAGES.privacy.title,f=o.STORE_PAGES.terms.permalink,b=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),g=(n(41),function(){return a>1})},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,n){var r=n(71);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o<u.length;o++)n=u[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){!function(){e.exports=this.wp.htmlEntities}()},,function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},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},e.exports.default=e.exports,e.exports.__esModule=!0},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){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){!function(){e.exports=this.wp.primitives}()},,,,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(64);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)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20).default,o=n(23);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},,,,,function(e,t){!function(){e.exports=this.wp.blocks}()},,,function(e,t,n){"use strict";var r=n(32),o=n.n(r),i=n(33),u=n.n(i),c=n(23),a=n.n(c),s=n(34),l=n.n(s),p=n(35),d=n.n(p),f=n(25),b=n.n(f),m=n(7),h=n.n(m),g=(n(3),n(2)),v=n(1),y=n(13),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.i,"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 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),u&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},u),c&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",c)))};n(75);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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 x=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)),h()(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=e.renderError,c=this.state,a=c.errorMessage;return c.hasError?"function"==typeof u?u({errorMessage:a}):React.createElement(O,{errorMessage:r?a: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(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(g.Component);x.defaultProps={showErrorMessage:!0};t.a=x},,,,,function(e,t,n){var r=n(99),o=n(100),i=n(67),u=n(101);e.exports=function(e){return r(e)||o(e)||i(e)||u()},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(0),o=n(22),i=n.n(o);function u(e){var t=Object(r.useRef)();return void 0!==t.current&&i()(e,t.current)||(t.current=e),t.current}},,,,,,,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},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t,n){var r=n(68);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}},e.exports.default=e.exports,e.exports.__esModule=!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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},,function(e,t){e.exports=function(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},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(74);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},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,i=[],u=!0,c=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{u||null==n.return||n.return()}finally{if(c)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},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.")},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);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),d=Object(r.useRef)(e);d.current=e;var f=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 p.current=!1,function(){p.current=!0}}),[]);var b=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||(d.current.apply(d,e),s.current=!0),l.current=setTimeout((function(){var t=!0;c&&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=u.current;f(),p.current||d.current.apply(null,e)}),o))}),[o,t,f,c,a]),m=Object(r.useCallback)((function(){l.current&&(d.current.apply(null,u.current),f())}),[f]);return[b,f,m]}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(9),o=n.n(r),i=n(15),u=n(12),c=n(0),a=n(22),s=n.n(a),l=n(54),p=n(107),d=n(61),f=function(e){var t=Object(d.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,r])]},b=function(e,t,n){var r=Object(d.a)();n=n||r;var o=Object(u.useSelect)((function(r){return r(i.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),a=Object(u.useDispatch)(i.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(c.useCallback)((function(t){a(n,e,t)}),[n,e,a])]},m=function(e,t){var n=Object(d.a)(),r=f(t=t||n),i=o()(r,2),u=i[0],a=i[1],b=Object(l.a)(u),m=Object(l.a)(e),h=Object(p.a)(m),g=Object(c.useRef)(!1);return Object(c.useEffect)((function(){s()(h,m)||(a(Object.assign({},b,m)),g.current=!0)}),[b,m,h,a]),g.current?[u,a]:[e,a]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),o=n.n(r),i=n(0),u=function(){var e=Object(i.useState)(),t=o()(e,2)[1];return Object(i.useCallback)((function(e){t((function(){throw e}))}),[])}},,,function(e,t,n){var r=n(68);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},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.")},e.exports.default=e.exports,e.exports.__esModule=!0},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(69);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}},function(e,t,n){"use strict";function r(e){return"object"==typeof e&&null!=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=window,o=t.scrollMode,c=t.block,a=t.inline,s=t.boundary,l=t.skipOverflowHiddenElements,p="function"==typeof s?s:function(e){return e!==s};if(!r(e))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,f=[],b=e;r(b)&&p(b);){if((b=b.parentElement)===d){f.push(b);break}null!=b&&b===document.body&&i(b)&&!i(document.documentElement)||null!=b&&i(b,l)&&f.push(b)}for(var m=n.visualViewport?n.visualViewport.width:innerWidth,h=n.visualViewport?n.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),O=y.height,w=y.width,x=y.top,j=y.right,_=y.bottom,E=y.left,I="start"===c||"nearest"===c?x:"end"===c?_:x+O/2,S="center"===a?E+w/2:"end"===a?j:E,k=[],R=0;R<f.length;R++){var P=f[R],C=P.getBoundingClientRect(),M=C.height,T=C.width,A=C.top,D=C.right,H=C.bottom,N=C.left;if("if-needed"===o&&x>=0&&E>=0&&_<=h&&j<=m&&x>=A&&_<=H&&E>=N&&j<=D)return k;var L=getComputedStyle(P),B=parseInt(L.borderLeftWidth,10),V=parseInt(L.borderTopWidth,10),K=parseInt(L.borderRightWidth,10),F=parseInt(L.borderBottomWidth,10),U=0,q=0,$="offsetWidth"in P?P.offsetWidth-P.clientWidth-B-K:0,W="offsetHeight"in P?P.offsetHeight-P.clientHeight-V-F:0;if(d===P)U="start"===c?I:"end"===c?I-h:"nearest"===c?u(v,v+h,h,V,F,v+I,v+I+O,O):I-h/2,q="start"===a?S:"center"===a?S-m/2:"end"===a?S-m:u(g,g+m,m,B,K,g+S,g+S+w,w),U=Math.max(0,U+v),q=Math.max(0,q+g);else{U="start"===c?I-A-V:"end"===c?I-H+F+W:"nearest"===c?u(A,H,M,V,F+W,I,I+O,O):I-(A+M/2)+W/2,q="start"===a?S-N-B:"center"===a?S-(N+T/2)+$/2:"end"===a?S-D+K+$:u(N,D,T,B,K+$,S,S+w,w);var G=P.scrollLeft,Y=P.scrollTop;I+=Y-(U=Math.max(0,Math.min(Y+U,P.scrollHeight-M+W))),S+=G-(q=Math.max(0,Math.min(G+q,P.scrollWidth-T+$)))}k.push({el:P,top:U,left:q})}return k}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),o=n.n(r),i=n(7),u=n.n(i),c=n(0),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){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=[".wp-block-woocommerce-cart"],d=function(e){var t=e.Block,n=e.containers,r=e.getProps,i=void 0===r?function(){}:r,u=e.getErrorBoundaryProps,s=void 0===u?function(){}:u;0!==n.length&&Array.prototype.forEach.call(n,(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(c.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:p})))),e)}))},f=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,i=e.wrappers,u=document.body.querySelectorAll(o);i.length>0&&Array.prototype.filter.call(u,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,i)})),d({Block:t,containers:u,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(p.join(","));f(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,i,u,c;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,i=n.getErrorBoundaryProps,u=n.selector,c=n.wrapper.querySelectorAll(u),d({Block:r,containers:c,getProps:o,getErrorBoundaryProps:i})}))}))}},,,function(e,t){},,,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(54),c=n(96),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}),m=Object(u.a)(p),h=Object(u.a)(s),g=Object(c.a)(),v=Object(o.useSelect)((function(e){if(!f)return null;var o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,m,h],u=o.getCollectionError.apply(o,i);return u&&g(u),{results:o.getCollection.apply(o,i),isLoading:!o.hasFinishedResolution("getCollection",i)}}),[t,n,h,m,f]);return null!==v&&(b.current=v),b.current}},,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(7),o=n.n(r),i=n(16),u=n.n(i),c=n(0),a=["srcElement","size"];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}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,i=u()(e,a);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?s(Object(n),!0).forEach((function(t){o()(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}({width:r,height:r},i)):null}},,function(e,t,n){"use strict";var r=n(0),o=n(15),i=n(12),u=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(u.k.restApiRoutes||{}),Object(i.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),i=r.isResolving,u=r.hasFinishedResolution,c=t.dispatch(o.SCHEMA_STORE_KEY),a=c.receiveRoutes,s=c.startResolution,l=c.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];i("getRoutes",[e])||u("getRoutes",[e])||(s("getRoutes",[e]),a(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(2),o=n(92);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],d=l[1],f=l[2],b=Object(r.useRef)(e);return Object(r.useEffect)((function(){u(b.current,e)||(p(e),b.current=e)}),[e,p,u]),[a,d,f]}},function(e,t,n){"use strict";var r=n(1),o=(n(3),n(4)),i=n.n(o),u=n(11),c=(n(169),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","wc-block-components-filter-submit-button",t),disabled:n,onClick:a},React.createElement(u.Label,{label:c,screenReaderLabel:l}))});c.defaultProps={disabled:!1},t.a=c},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(5),o=Object(r.getSetting)("attributes",[]),i=o.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}),[]),u=function(e){if(e)return i.find((function(t){return t.id===e}))},c=function(e){if(e)return i.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(8),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:o.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(u,"attribute")))}},,,,,,,function(e,t,n){"use strict";var r=n(10),o=n.n(r),i=n(16),u=n.n(i),c=(n(3),n(4)),a=n.n(c),s=n(1),l=n(139),p=n(170),d=(n(122),["text","screenReaderText","element","className","radius","children"]),f=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,i=e.element,c=void 0===i?"li":i,s=e.className,l=void 0===s?"":s,p=e.radius,f=void 0===p?"small":p,b=e.children,m=void 0===b?null:b,h=u()(e,d),g=c,v=a()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+f),y=Boolean(r&&r!==t);return React.createElement(g,o()({className:v},h),React.createElement("span",{"aria-hidden":y,className:"wc-block-components-chip__text"},t),y&&React.createElement("span",{className:"screen-reader-text"},r),m)},b=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,i=void 0===r?"":r,c=e.disabled,d=void 0!==c&&c,m=e.onRemove,h=void 0===m?function(){}:m,g=e.removeOnAnyClick,v=void 0!==g&&g,y=e.text,O=e.screenReaderText,w=void 0===O?"":O,x=u()(e,b),j=v?"span":"button";if(!n){var _=w&&"string"==typeof w?w:y;n="string"!=typeof _?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),_)}var E={"aria-label":n,disabled:d,onClick:h,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||h()}},I=v?E:{},S=v?{"aria-hidden":!0}:E;return React.createElement(f,o()({},x,I,{className:a()(i,"is-removable"),element:v?"button":x.element,screenReaderText:w,text:y}),React.createElement(j,o()({className:"wc-block-components-chip__remove"},S),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(10),o=n.n(r),i=n(16),u=n.n(i),c=n(28),a=["className","size"],s=function(e){var t=e.className,n=e.size,r=u()(e,a);return React.createElement(c.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,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"}))},l=React.createElement(s,null);t.a=l},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";e.exports=n(233)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(7),o=n.n(r),i=n(49),u=n.n(i),c=n(20),a=n.n(c),s=n(9),l=n.n(s),p=n(0),d=n(148),f=n(8),b=n(54),m=n(95),h=n(125),g=n(61);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(m.a)(o),c=l()(i,1)[0],s=Object(m.b)("calculate_attribute_counts",[],o),v=l()(s,2),O=v[0],w=v[1],x=Object(m.b)("calculate_price_range",null,o),j=l()(x,2),_=j[0],E=j[1],I=Object(b.a)(t||{}),S=Object(b.a)(n);Object(p.useEffect)((function(){"object"===a()(I)&&Object.keys(I).length&&(O.find((function(e){return e.taxonomy===I.taxonomy}))||w([].concat(u()(O),[I])))}),[I,O,w]),Object(p.useEffect)((function(){_!==S&&void 0!==S&&E(S)}),[S,E,_]);var k=Object(p.useState)(!1),R=l()(k,2),P=R[0],C=R[1],M=Object(d.a)(P,200),T=l()(M,1)[0];P||C(!0);var A=Object(p.useMemo)((function(){return function(e){var t=e;return e.calculate_attribute_counts&&(t.calculate_attribute_counts=Object(f.sortBy)(e.calculate_attribute_counts.map((function(e){return{taxonomy:e.taxonomy,query_type:e.queryType}})),["taxonomy","query_type"])),t}(c)}),[c]);return Object(h.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},A),shouldSelect:T})}},,function(e,t,n){e.exports=n(279)},function(e,t){},function(e,t){},function(e,t,n){"use strict";
|
7 |
/** @license React v17.0.2
|
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=60103,o=60106,i=60107,u=60108,c=60114,a=60109,s=60110,l=60112,p=60113,d=60120,f=60115,b=60116,m=60121,h=60122,g=60117,v=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var O=Symbol.for;r=O("react.element"),o=O("react.portal"),i=O("react.fragment"),u=O("react.strict_mode"),c=O("react.profiler"),a=O("react.provider"),s=O("react.context"),l=O("react.forward_ref"),p=O("react.suspense"),d=O("react.suspense_list"),f=O("react.memo"),b=O("react.lazy"),m=O("react.block"),h=O("react.server.block"),g=O("react.fundamental"),v=O("react.debug_trace_mode"),y=O("react.legacy_hidden")}function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case c:case u:case p:case d:return e;default:switch(e=e&&e.$$typeof){case s:case l:case b:case f:case a:return e;default:return t}}case o:return t}}}var x=a,j=r,_=l,E=i,I=b,S=f,k=o,R=c,P=u,C=p;t.ContextConsumer=s,t.ContextProvider=x,t.Element=j,t.ForwardRef=_,t.Fragment=E,t.Lazy=I,t.Memo=S,t.Portal=k,t.Profiler=R,t.StrictMode=P,t.Suspense=C,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return w(e)===s},t.isContextProvider=function(e){return w(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===l},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===b},t.isMemo=function(e){return w(e)===f},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===c},t.isStrictMode=function(e){return w(e)===u},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===c||e===v||e===u||e===p||e===d||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===f||e.$$typeof===a||e.$$typeof===s||e.$$typeof===l||e.$$typeof===g||e.$$typeof===m||e[0]===h)},t.typeOf=w},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(141),o=n(119),i=n(7),u=n.n(i),c=n(9),a=n.n(c),s=n(1),l=n(36),p=n(54),d=n(107),f=n(95),b=n(125),m=n(228),h=n(0),g=n(49),v=n.n(g),y=n(3),O=n.n(y),w=n(4),x=n.n(w),j=(n(234),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,d=e.isDisabled,f=void 0!==d&&d,b=e.limit,m=void 0===b?10:b,g=Object(h.useState)(!1),y=a()(g,2),O=y[0],w=y[1],j=Object(h.useMemo)((function(){return v()(Array(5)).map((function(e,t){return React.createElement("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})}))}),[]),_=Object(h.useMemo)((function(){var e=i.length-m;return!O&&React.createElement("li",{key:"show-more",className:"show-more"},React.createElement("button",{onClick:function(){w(!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(h.useMemo)((function(){return O&&React.createElement("li",{key:"show-less",className:"show-less"},React.createElement("button",{onClick:function(){w(!1)},"aria-expanded":!0,"aria-label":Object(s.__)("Show less options","woo-gutenberg-products-block")},Object(s.__)("Show less","woo-gutenberg-products-block")))}),[O]),I=Object(h.useMemo)((function(){var e=i.length>m+5;return React.createElement(React.Fragment,null,i.map((function(t,n){return React.createElement(h.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:f}),React.createElement("label",{htmlFor:t.value},t.label)),e&&n===m-1&&_)})),e&&E)}),[i,r,c,O,m,E,_,f]),S=x()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":p},t);return React.createElement("ul",{className:S},p?j:I)}),_=n(24),E=n(6),I=n(14),S=n(116),k=n(2),R=(n(195),n(117)),P=0;function C(e){return"function"==typeof e?e:M}function M(){}function T(e,t){e&&Object(R.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 A(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function D(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 H(){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 N(){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 L(){return String(P++)}function B(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function V(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function K(e){return"string"==typeof e.type}function F(e){return e.props}var U=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function q(e){void 0===e&&(e={});var t={};return U.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function $(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=W(t,r)?t[r]:e[r],n}),{})}function W(e,t){return void 0!==e[t]}function G(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function Y(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;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=z(e,u,n,r,o);return-1===c?t>=n?-1:t:c}function z(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?z(1,0,n,r,!1):z(-1,n-1,n,r,!1):-1}function Q(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(A(t,e,n)||r&&A(t,n.document.activeElement,n))}))}var X=D((function(e){Z(e).textContent=""}),500);function J(e,t){var n=Z(t);e&&(n.textContent=e,X(t))}function Z(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 ee=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}),te=function(){var e=function(e){function t(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+L(),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=q(t),n.internalSetState(Object(E.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=q(t),n.internalSetState(Object(E.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(E.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={};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&&(c[e],W(n.props,e)||(a[e]=c[e]))})),u&&c.hasOwnProperty("inputValue")&&n.props.onInputValueChange(c.inputValue,Object(E.a)({},n.getStateAndHelpers(),c)),a}),(function(){C(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(_.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(E.a)(((r={})[u]=N(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=Y(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=Y(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){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(Object(E.a)({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=Object(E.a)({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=Object(E.a)({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=z(1,0,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=z(-1,r-1,r,(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;t.onPress;var o=t.onKeyDown,i=t.onKeyUp,u=t.onBlur,c=Object(_.a)(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),a=n.getState().isOpen,s={onClick:H(r,n.buttonHandleClick),onKeyDown:H(o,n.buttonHandleKeyDown),onKeyUp:H(i,n.buttonHandleKeyUp),onBlur:H(u,n.buttonHandleBlur)},l=c.disabled?{}:s;return Object(E.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=G(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(Object(I.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(E.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;t.onChangeText;var c=Object(_.a)(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"]),a={};var s,l=n.getState(),p=l.inputValue,d=l.isOpen,f=l.highlightedIndex;c.disabled||((s={}).onChange=H(i,u,n.inputHandleChange),s.onKeyDown=H(r,n.inputHandleKeyDown),s.onBlur=H(o,n.inputHandleBlur),a=s);return Object(E.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,c)},n.inputHandleKeyDown=function(e){var t=G(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(Object(I.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(_.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(E.a)(((r={})[u]=N(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;r.onPress;var c=r.index,a=r.item,s=void 0===a?void 0:a,l=Object(_.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,d=((t={onMouseMove:H(o,(function(){c!==n.getState().highlightedIndex&&(n.setHighlightedIndex(c,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:H(i,(function(e){e.preventDefault()}))}).onClick=H(p,(function(){n.selectItemAtIndex(c,{type:9})})),t),f=l.disabled?{onMouseDown:d.onMouseDown}:d;return Object(E.a)({id:n.getItemId(c),role:"option","aria-selected":n.getState().highlightedIndex===c},f,l)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=q(e),n.internalSetState((function(t){var r=t.selectedItem;return Object(E.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=q(e),n.internalSetState((function(t){var r=t.isOpen;return Object(E.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),C(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=D((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(Object(E.a)({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,J(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,d=r.initialSelectedItem,f=void 0===d?null:d,b=n.getState({highlightedIndex:u,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(S.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),$(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=Y(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,d=this.getItemProps,f=this.openMenu,b=this.closeMenu,m=this.toggleMenu,h=this.selectItem,g=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:d,reset:this.reset,openMenu:f,closeMenu:b,toggleMenu:m,selectItem:h,selectItemAtIndex:g,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)&&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,!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){W(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=V(this.props.children,M);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=V(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:K(t)?Object(k.cloneElement)(t,this.getRootProps(F(t))):void 0:null},t}(k.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:B,itemToString:function(e){return null==e?"":String(e)},onStateChange:M,onInputValueChange:M,onUserAction:M,onChange:M,onSelect:M,onOuterClick:M,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:T},e.stateChangeTypes=ee,e}();D((function(e,t){J(e(),t)}),200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?k.useLayoutEffect:k.useEffect;var ne={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:T,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};O.a.array.isRequired,O.a.func,O.a.func,O.a.func,O.a.bool,O.a.number,O.a.number,O.a.number,O.a.bool,O.a.bool,O.a.bool,O.a.any,O.a.any,O.a.any,O.a.string,O.a.string,O.a.string,O.a.func,O.a.string,O.a.func,O.a.func,O.a.func,O.a.func,O.a.func,O.a.shape({addEventListener:O.a.func,removeEventListener:O.a.func,document:O.a.shape({getElementById:O.a.func,activeElement:O.a.any,body:O.a.any})});Object(E.a)({},ne,{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}});O.a.array.isRequired,O.a.func,O.a.func,O.a.func,O.a.bool,O.a.number,O.a.number,O.a.number,O.a.bool,O.a.bool,O.a.bool,O.a.any,O.a.any,O.a.any,O.a.string,O.a.string,O.a.string,O.a.string,O.a.string,O.a.string,O.a.func,O.a.string,O.a.string,O.a.func,O.a.func,O.a.func,O.a.func,O.a.func,O.a.func,O.a.shape({addEventListener:O.a.func,removeEventListener:O.a.func,document:O.a.shape({getElementById:O.a.func,activeElement:O.a.any,body:O.a.any})});Object(E.a)({},ne,{getA11yStatusMessage:B,circularNavigation:!0});O.a.array,O.a.array,O.a.array,O.a.func,O.a.func,O.a.func,O.a.number,O.a.number,O.a.number,O.a.func,O.a.func,O.a.string,O.a.string,O.a.shape({addEventListener:O.a.func,removeEventListener:O.a.func,document:O.a.shape({getElementById:O.a.func,activeElement:O.a.any,body:O.a.any})});var re=te,oe=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 wc-block-components-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}))},ie=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)},ue=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:x()("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)})))},ce=n(158),ae=function(e){var t=e.onRemoveItem,n=e.option;return React.createElement(ce.a,{className:"wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip",removeOnAnyClick:!0,onRemove:function(){t(n.value)},ariaLabel:Object(s.sprintf)(Object(s.__)("Remove %s filter","woo-gutenberg-products-block"),n.name),text:n.label,radius:"large"})},se=n(139),le=n(170),pe=function(e){var t=e.onClick,n=e.onRemoveItem,r=e.option,o=Object(h.useRef)(null);return Object(h.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)},React.createElement(se.a,{srcElement:le.a,size:16})))};n(232);function de(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 fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?de(Object(n),!0).forEach((function(t){u()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var be=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,d=void 0!==p&&p,f=e.multiple,b=void 0!==f&&f,m=e.onChange,g=void 0===m?function(){}:m,v=e.options,y=void 0===v?[]:v,O=Object(h.useRef)(null),w=x()(r,"wc-block-dropdown-selector","wc-block-components-dropdown-selector",{"is-disabled":l,"is-loading":d}),j=Object(h.useCallback)((function(e,t){switch(t.type){case re.stateChangeTypes.keyDownEnter:case re.stateChangeTypes.clickItem:return fe(fe({},t),{},{highlightedIndex:e.highlightedIndex,isOpen:b,inputValue:""});case re.stateChangeTypes.blurInput:case re.stateChangeTypes.mouseUp:return fe(fe({},t),{},{inputValue:e.inputValue});default:return t}}),[b]);return React.createElement(re,{onChange:g,selectedItem:null,stateReducer:j},(function(e){var t=e.getInputProps,r=e.getItemProps,o=e.getLabelProps,u=e.getMenuProps,a=e.highlightedIndex,p=e.inputValue,d=e.isOpen,f=e.openMenu;return React.createElement("div",{className:x()(w,{"is-multiple":b,"is-single":!b,"has-checked":i.length>0,"is-open":d})},React.createElement("label",o({className:"screen-reader-text"}),c),React.createElement(ie,{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){g(e),O.current.focus()};return b?React.createElement(ae,{key:e,onRemoveItem:n,option:t}):React.createElement(pe,{key:e,onClick:function(){return O.current.focus()},onRemoveItem:n,option:t})})),React.createElement(oe,{checked:i,getInputProps:t,inputRef:O,isDisabled:l,onFocus:f,onRemoveItem:function(e){g(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(ue,{checked:i,getItemProps:r,getMenuProps:u,highlightedIndex:a,options:y.filter((function(e){return!p||e.value.startsWith(p)}))}))}))},me=n(149),he=n(22),ge=n.n(he),ve=n(18),ye=n(150),Oe=n(151),we=n(11),xe=function(e){var t=e.name,n=e.count;return React.createElement(React.Fragment,null,t,Number.isFinite(n)&&React.createElement(we.Label,{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"}}))},je=[{value:"preview-1",name:"Blue",label:React.createElement(xe,{name:"Blue",count:3})},{value:"preview-2",name:"Green",label:React.createElement(xe,{name:"Green",count:3})},{value:"preview-3",name:"Red",label:React.createElement(xe,{name:"Red",count:2})}],_e={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(231);function Ee(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 Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(n),!0).forEach((function(t){u()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Se=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,o=t.isPreview&&!t.attributeId?_e:Object(ye.a)(t.attributeId),i=Object(h.useState)([]),u=a()(i,2),c=u[0],g=u[1],v=Object(h.useState)(t.isPreview&&!t.attributeId?je:[]),y=a()(v,2),O=y[0],w=y[1],x=Object(f.a)(),_=a()(x,1)[0],E=Object(f.b)("attributes",[]),I=a()(E,2),S=I[0],k=I[1],R=Object(b.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[o.id],shouldSelect:t.attributeId>0}),P=R.results,C=R.isLoading,M="dropdown"!==t.displayStyle&&"and"===t.queryType,T=Object(m.a)({queryAttribute:{taxonomy:o.taxonomy,queryType:t.queryType},queryState:Ie(Ie({},_),{},{attributes:M?_.attributes:null})}),A=T.results,D=T.isLoading,H=Object(h.useCallback)((function(e){return A.attribute_counts?A.attribute_counts.find((function(t){return t.term===e})):null}),[A]);Object(h.useEffect)((function(){if(!C&&!D){var e=P.map((function(e){var n,r=H(e.id);if(!(r||c.includes(e.slug)||(n=e.slug,null!=_&&_.attributes&&_.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(ve.decodeEntities)(e.name),label:React.createElement(xe,{name:Object(ve.decodeEntities)(e.name),count:t
|