active-filters
2 years ago
add-to-cart-form
2 years ago
all-products
2 years ago
attribute-filter
2 years ago
base-components-mini-cart-contents-block
2 years ago
base-components-product-price~mini-cart-contents-block
2 years ago
breadcrumbs
2 years ago
cart-blocks
2 years ago
catalog-sorting
2 years ago
checkout
2 years ago
checkout-blocks
2 years ago
classic-shortcode
2 years ago
collection-active-filters
2 years ago
collection-attribute-filter
2 years ago
collection-filters
2 years ago
collection-price-filter
2 years ago
collection-rating-filter
2 years ago
collection-stock-filter
2 years ago
customer-account
2 years ago
featured-category
2 years ago
featured-product
2 years ago
filter-wrapper
2 years ago
handpicked-products
2 years ago
inner-blocks
2 years ago
mini-cart
2 years ago
mini-cart-contents-block
2 years ago
order-confirmation-additional-information
2 years ago
order-confirmation-billing-address
2 years ago
order-confirmation-billing-wrapper
2 years ago
order-confirmation-downloads
2 years ago
order-confirmation-downloads-wrapper
2 years ago
order-confirmation-shipping-address
2 years ago
order-confirmation-shipping-wrapper
2 years ago
order-confirmation-status
2 years ago
order-confirmation-summary
2 years ago
order-confirmation-totals
2 years ago
order-confirmation-totals-wrapper
2 years ago
page-content-wrapper
2 years ago
price-filter
2 years ago
product-average-rating
2 years ago
product-best-sellers
2 years ago
product-button
2 years ago
product-categories
2 years ago
product-category
2 years ago
product-collection
2 years ago
product-collection-no-results
2 years ago
product-details
2 years ago
product-gallery
2 years ago
product-gallery-large-image
2 years ago
product-gallery-large-image-next-previous
2 years ago
product-gallery-pager
2 years ago
product-gallery-thumbnails
2 years ago
product-image-gallery
2 years ago
product-meta
2 years ago
product-new
2 years ago
product-rating
2 years ago
product-rating-counter
2 years ago
product-rating-stars
2 years ago
product-results-count
2 years ago
product-reviews
2 years ago
product-tag
2 years ago
product-template
2 years ago
product-top-rated
2 years ago
products-by-attribute
2 years ago
rating-filter
2 years ago
related-products
2 years ago
single-product
2 years ago
stock-filter
2 years ago
store-notices
2 years ago
active-filters-frontend.asset.php
2 years ago
active-filters-frontend.js
2 years ago
active-filters-frontend.js.map
2 years ago
active-filters-rtl.css
2 years ago
active-filters-style.asset.php
2 years ago
active-filters-style.js.map
2 years ago
active-filters-wrapper-frontend.js
2 years ago
active-filters-wrapper-frontend.js.map
2 years ago
active-filters-wrapper-rtl.css
2 years ago
active-filters-wrapper-style.js.map
2 years ago
active-filters-wrapper.css
2 years ago
active-filters-wrapper.css.map
2 years ago
active-filters.asset.php
2 years ago
active-filters.css
2 years ago
active-filters.css.map
2 years ago
active-filters.js
2 years ago
active-filters.js.map
2 years ago
add-to-cart-form-rtl.css
2 years ago
add-to-cart-form-style.asset.php
2 years ago
add-to-cart-form-style.js.map
2 years ago
add-to-cart-form.css
2 years ago
add-to-cart-form.css.map
2 years ago
all-products-frontend.asset.php
2 years ago
all-products-frontend.js
2 years ago
all-products-frontend.js.map
2 years ago
all-products-rtl.css
2 years ago
all-products-style.asset.php
2 years ago
all-products-style.js.map
2 years ago
all-products.asset.php
2 years ago
all-products.css
2 years ago
all-products.css.map
2 years ago
all-products.js
2 years ago
all-products.js.map
2 years ago
all-reviews-rtl.css
2 years ago
all-reviews-style.asset.php
2 years ago
all-reviews-style.js.map
2 years ago
all-reviews.asset.php
2 years ago
all-reviews.css
2 years ago
all-reviews.css.map
2 years ago
all-reviews.js
2 years ago
all-reviews.js.map
2 years ago
assets_js_base_context_hooks_collections_use-collection_ts-assets_js_base_context_hooks_use-q-fdf7ba-style.js.map
2 years ago
assets_js_base_context_hooks_use-store-add-to-cart_ts-assets_js_base_context_hooks_use-store--e30f56-style.js.map
2 years ago
attribute-filter-frontend.asset.php
2 years ago
attribute-filter-frontend.js
2 years ago
attribute-filter-frontend.js.map
2 years ago
attribute-filter-rtl.css
2 years ago
attribute-filter-style.asset.php
2 years ago
attribute-filter-style.js.map
2 years ago
attribute-filter-wrapper-frontend.js
2 years ago
attribute-filter-wrapper-frontend.js.map
2 years ago
attribute-filter-wrapper-rtl.css
2 years ago
attribute-filter-wrapper-style.js.map
2 years ago
attribute-filter-wrapper.css
2 years ago
attribute-filter-wrapper.css.map
2 years ago
attribute-filter.asset.php
2 years ago
attribute-filter.css
2 years ago
attribute-filter.css.map
2 years ago
attribute-filter.js
2 years ago
attribute-filter.js.map
2 years ago
base-components-attribute-filter-wrapper-index.tsx-style.js.map
2 years ago
base-components-price-filter-wrapper-index.tsx-style.js.map
2 years ago
base-components-price-filter-wrapper-style.scss-rtl.css
2 years ago
base-components-price-filter-wrapper-style.scss.css
2 years ago
base-components-price-filter-wrapper-style.scss.css.map
2 years ago
base-components-rating-filter-wrapper-index.tsx-style.js.map
2 years ago
base-components-rating-filter-wrapper-style.scss-rtl.css
2 years ago
base-components-rating-filter-wrapper-style.scss.css
2 years ago
base-components-rating-filter-wrapper-style.scss.css.map
2 years ago
base-components-stock-filter-wrapper-index.tsx-style.js.map
2 years ago
base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss-rtl.css
2 years ago
base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss.css
2 years ago
base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss.css.map
2 years ago
base-context-product-add-to-cart-index.js-style.js.map
2 years ago
blocks-checkout.asset.php
2 years ago
blocks-checkout.js
2 years ago
blocks-checkout.js.map
2 years ago
blocks-components.asset.php
2 years ago
blocks-components.js
2 years ago
blocks-components.js.map
2 years ago
breadcrumbs-rtl.css
2 years ago
breadcrumbs-style.asset.php
2 years ago
breadcrumbs-style.js.map
2 years ago
breadcrumbs.asset.php
2 years ago
breadcrumbs.css
2 years ago
breadcrumbs.css.map
2 years ago
breadcrumbs.js
2 years ago
breadcrumbs.js.map
2 years ago
cart-frontend.asset.php
2 years ago
cart-frontend.js
2 years ago
cart-frontend.js.map
2 years ago
cart-rtl.css
2 years ago
cart-style.asset.php
2 years ago
cart-style.js.map
2 years ago
cart.asset.php
2 years ago
cart.css
2 years ago
cart.css.map
2 years ago
cart.js
2 years ago
cart.js.map
2 years ago
catalog-sorting-rtl.css
2 years ago
catalog-sorting-style.asset.php
2 years ago
catalog-sorting-style.js.map
2 years ago
catalog-sorting.asset.php
2 years ago
catalog-sorting.css
2 years ago
catalog-sorting.css.map
2 years ago
catalog-sorting.js
2 years ago
catalog-sorting.js.map
2 years ago
checkout-frontend.asset.php
2 years ago
checkout-frontend.js
2 years ago
checkout-frontend.js.map
2 years ago
checkout-rtl.css
2 years ago
checkout-style.asset.php
2 years ago
checkout-style.js.map
2 years ago
checkout.asset.php
2 years ago
checkout.css
2 years ago
checkout.css.map
2 years ago
checkout.js
2 years ago
checkout.js.map
2 years ago
classic-shortcode-rtl.css
2 years ago
classic-shortcode-style.asset.php
2 years ago
classic-shortcode-style.js.map
2 years ago
classic-shortcode.asset.php
2 years ago
classic-shortcode.css
2 years ago
classic-shortcode.css.map
2 years ago
classic-shortcode.js
2 years ago
classic-shortcode.js.map
2 years ago
collection-active-filters-frontend.asset.php
2 years ago
collection-active-filters-frontend.js
2 years ago
collection-active-filters-frontend.js.map
2 years ago
collection-active-filters-rtl.css
2 years ago
collection-active-filters-style.asset.php
2 years ago
collection-active-filters-style.js.map
2 years ago
collection-active-filters.asset.php
2 years ago
collection-active-filters.css
2 years ago
collection-active-filters.css.map
2 years ago
collection-active-filters.js
2 years ago
collection-active-filters.js.map
2 years ago
collection-attribute-filter-frontend.asset.php
2 years ago
collection-attribute-filter-frontend.js
2 years ago
collection-attribute-filter-frontend.js.map
2 years ago
collection-attribute-filter-rtl.css
2 years ago
collection-attribute-filter-style.asset.php
2 years ago
collection-attribute-filter-style.js.map
2 years ago
collection-attribute-filter.asset.php
2 years ago
collection-attribute-filter.css
2 years ago
collection-attribute-filter.css.map
2 years ago
collection-attribute-filter.js
2 years ago
collection-attribute-filter.js.map
2 years ago
collection-filters-style.asset.php
2 years ago
collection-filters-style.js.map
2 years ago
collection-filters.asset.php
2 years ago
collection-filters.js
2 years ago
collection-filters.js.map
2 years ago
collection-price-filter-frontend.asset.php
2 years ago
collection-price-filter-frontend.js
2 years ago
collection-price-filter-frontend.js.map
2 years ago
collection-price-filter-rtl.css
2 years ago
collection-price-filter-style.asset.php
2 years ago
collection-price-filter-style.js.map
2 years ago
collection-price-filter.asset.php
2 years ago
collection-price-filter.css
2 years ago
collection-price-filter.css.map
2 years ago
collection-price-filter.js
2 years ago
collection-price-filter.js.map
2 years ago
collection-rating-filter-frontend.asset.php
2 years ago
collection-rating-filter-frontend.js
2 years ago
collection-rating-filter-frontend.js.map
2 years ago
collection-rating-filter-rtl.css
2 years ago
collection-rating-filter-style.asset.php
2 years ago
collection-rating-filter-style.js.map
2 years ago
collection-rating-filter.asset.php
2 years ago
collection-rating-filter.css
2 years ago
collection-rating-filter.css.map
2 years ago
collection-rating-filter.js
2 years ago
collection-rating-filter.js.map
2 years ago
collection-stock-filter-frontend.asset.php
2 years ago
collection-stock-filter-frontend.js
2 years ago
collection-stock-filter-frontend.js.map
2 years ago
collection-stock-filter-rtl.css
2 years ago
collection-stock-filter-style.asset.php
2 years ago
collection-stock-filter-style.js.map
2 years ago
collection-stock-filter.asset.php
2 years ago
collection-stock-filter.css
2 years ago
collection-stock-filter.css.map
2 years ago
collection-stock-filter.js
2 years ago
collection-stock-filter.js.map
2 years ago
customer-account-rtl.css
2 years ago
customer-account-style.asset.php
2 years ago
customer-account-style.js.map
2 years ago
customer-account.asset.php
2 years ago
customer-account.css
2 years ago
customer-account.css.map
2 years ago
customer-account.js
2 years ago
customer-account.js.map
2 years ago
featured-category-rtl.css
2 years ago
featured-category-style.asset.php
2 years ago
featured-category-style.js.map
2 years ago
featured-category.asset.php
2 years ago
featured-category.css
2 years ago
featured-category.css.map
2 years ago
featured-category.js
2 years ago
featured-category.js.map
2 years ago
featured-product-rtl.css
2 years ago
featured-product-style.asset.php
2 years ago
featured-product-style.js.map
2 years ago
featured-product.asset.php
2 years ago
featured-product.css
2 years ago
featured-product.css.map
2 years ago
featured-product.js
2 years ago
featured-product.js.map
2 years ago
filter-wrapper-frontend.asset.php
2 years ago
filter-wrapper-frontend.js
2 years ago
filter-wrapper-frontend.js.map
2 years ago
filter-wrapper-rtl.css
2 years ago
filter-wrapper-style.asset.php
2 years ago
filter-wrapper-style.js.map
2 years ago
filter-wrapper.asset.php
2 years ago
filter-wrapper.css
2 years ago
filter-wrapper.css.map
2 years ago
filter-wrapper.js
2 years ago
filter-wrapper.js.map
2 years ago
handpicked-products-style.asset.php
2 years ago
handpicked-products-style.js.map
2 years ago
handpicked-products.asset.php
2 years ago
handpicked-products.js
2 years ago
handpicked-products.js.map
2 years ago
legacy-template-rtl.css
2 years ago
legacy-template-style.asset.php
2 years ago
legacy-template-style.js.map
2 years ago
legacy-template.asset.php
2 years ago
legacy-template.css
2 years ago
legacy-template.css.map
2 years ago
legacy-template.js
2 years ago
legacy-template.js.map
2 years ago
mini-cart-component-frontend.asset.php
2 years ago
mini-cart-component-frontend.js
2 years ago
mini-cart-component-frontend.js.map
2 years ago
mini-cart-contents-rtl.css
2 years ago
mini-cart-contents-style.asset.php
2 years ago
mini-cart-contents-style.js.map
2 years ago
mini-cart-contents.asset.php
2 years ago
mini-cart-contents.css
2 years ago
mini-cart-contents.css.map
2 years ago
mini-cart-contents.js
2 years ago
mini-cart-contents.js.map
2 years ago
mini-cart-frontend.asset.php
2 years ago
mini-cart-frontend.js
2 years ago
mini-cart-frontend.js.map
2 years ago
mini-cart-rtl.css
2 years ago
mini-cart-style.asset.php
2 years ago
mini-cart-style.js.map
2 years ago
mini-cart.asset.php
2 years ago
mini-cart.css
2 years ago
mini-cart.css.map
2 years ago
mini-cart.js
2 years ago
mini-cart.js.map
2 years ago
order-confirmation-additional-information-rtl.css
2 years ago
order-confirmation-additional-information-style.asset.php
2 years ago
order-confirmation-additional-information-style.js.map
2 years ago
order-confirmation-additional-information.asset.php
2 years ago
order-confirmation-additional-information.css
2 years ago
order-confirmation-additional-information.css.map
2 years ago
order-confirmation-additional-information.js
2 years ago
order-confirmation-additional-information.js.map
2 years ago
order-confirmation-billing-address-rtl.css
2 years ago
order-confirmation-billing-address-style.asset.php
2 years ago
order-confirmation-billing-address-style.js.map
2 years ago
order-confirmation-billing-address.asset.php
2 years ago
order-confirmation-billing-address.css
2 years ago
order-confirmation-billing-address.css.map
2 years ago
order-confirmation-billing-address.js
2 years ago
order-confirmation-billing-address.js.map
2 years ago
order-confirmation-billing-wrapper-style.asset.php
2 years ago
order-confirmation-billing-wrapper-style.js.map
2 years ago
order-confirmation-billing-wrapper.asset.php
2 years ago
order-confirmation-billing-wrapper.js
2 years ago
order-confirmation-billing-wrapper.js.map
2 years ago
order-confirmation-downloads-rtl.css
2 years ago
order-confirmation-downloads-style.asset.php
2 years ago
order-confirmation-downloads-style.js.map
2 years ago
order-confirmation-downloads-wrapper-style.asset.php
2 years ago
order-confirmation-downloads-wrapper-style.js.map
2 years ago
order-confirmation-downloads-wrapper.asset.php
2 years ago
order-confirmation-downloads-wrapper.js
2 years ago
order-confirmation-downloads-wrapper.js.map
2 years ago
order-confirmation-downloads.asset.php
2 years ago
order-confirmation-downloads.css
2 years ago
order-confirmation-downloads.css.map
2 years ago
order-confirmation-downloads.js
2 years ago
order-confirmation-downloads.js.map
2 years ago
order-confirmation-shipping-address-rtl.css
2 years ago
order-confirmation-shipping-address-style.asset.php
2 years ago
order-confirmation-shipping-address-style.js.map
2 years ago
order-confirmation-shipping-address.asset.php
2 years ago
order-confirmation-shipping-address.css
2 years ago
order-confirmation-shipping-address.css.map
2 years ago
order-confirmation-shipping-address.js
2 years ago
order-confirmation-shipping-address.js.map
2 years ago
order-confirmation-shipping-wrapper-style.asset.php
2 years ago
order-confirmation-shipping-wrapper-style.js.map
2 years ago
order-confirmation-shipping-wrapper.asset.php
2 years ago
order-confirmation-shipping-wrapper.js
2 years ago
order-confirmation-shipping-wrapper.js.map
2 years ago
order-confirmation-status-rtl.css
2 years ago
order-confirmation-status-style.asset.php
2 years ago
order-confirmation-status-style.js.map
2 years ago
order-confirmation-status.asset.php
2 years ago
order-confirmation-status.css
2 years ago
order-confirmation-status.css.map
2 years ago
order-confirmation-status.js
2 years ago
order-confirmation-status.js.map
2 years ago
order-confirmation-summary-rtl.css
2 years ago
order-confirmation-summary-style.asset.php
2 years ago
order-confirmation-summary-style.js.map
2 years ago
order-confirmation-summary.asset.php
2 years ago
order-confirmation-summary.css
2 years ago
order-confirmation-summary.css.map
2 years ago
order-confirmation-summary.js
2 years ago
order-confirmation-summary.js.map
2 years ago
order-confirmation-totals-rtl.css
2 years ago
order-confirmation-totals-style.asset.php
2 years ago
order-confirmation-totals-style.js.map
2 years ago
order-confirmation-totals-wrapper-style.asset.php
2 years ago
order-confirmation-totals-wrapper-style.js.map
2 years ago
order-confirmation-totals-wrapper.asset.php
2 years ago
order-confirmation-totals-wrapper.js
2 years ago
order-confirmation-totals-wrapper.js.map
2 years ago
order-confirmation-totals.asset.php
2 years ago
order-confirmation-totals.css
2 years ago
order-confirmation-totals.css.map
2 years ago
order-confirmation-totals.js
2 years ago
order-confirmation-totals.js.map
2 years ago
packages-style-rtl.css
2 years ago
packages-style-style.asset.php
2 years ago
packages-style-style.js.map
2 years ago
packages-style.css
2 years ago
packages-style.css.map
2 years ago
page-content-wrapper-style.asset.php
2 years ago
page-content-wrapper-style.js.map
2 years ago
page-content-wrapper.asset.php
2 years ago
page-content-wrapper.js
2 years ago
page-content-wrapper.js.map
2 years ago
price-filter-frontend.asset.php
2 years ago
price-filter-frontend.js
2 years ago
price-filter-frontend.js.map
2 years ago
price-filter-rtl.css
2 years ago
price-filter-style.asset.php
2 years ago
price-filter-style.js.map
2 years ago
price-filter-wrapper-frontend.js
2 years ago
price-filter-wrapper-frontend.js.map
2 years ago
price-filter-wrapper-rtl.css
2 years ago
price-filter-wrapper-style.js.map
2 years ago
price-filter-wrapper.css
2 years ago
price-filter-wrapper.css.map
2 years ago
price-filter.asset.php
2 years ago
price-filter.css
2 years ago
price-filter.css.map
2 years ago
price-filter.js
2 years ago
price-filter.js.map
2 years ago
price-format.asset.php
2 years ago
price-format.js
2 years ago
price-format.js.map
2 years ago
product-add-to-cart-frontend.js
2 years ago
product-add-to-cart-frontend.js.map
2 years ago
product-add-to-cart-rtl.css
2 years ago
product-add-to-cart-style.js.map
2 years ago
product-add-to-cart.css
2 years ago
product-add-to-cart.css.map
2 years ago
product-add-to-cart.js
2 years ago
product-add-to-cart.js.map
2 years ago
product-average-rating-frontend.js
2 years ago
product-average-rating-frontend.js.map
2 years ago
product-average-rating-style.js.map
2 years ago
product-average-rating.js
2 years ago
product-average-rating.js.map
2 years ago
product-best-sellers-style.asset.php
2 years ago
product-best-sellers-style.js.map
2 years ago
product-best-sellers.asset.php
2 years ago
product-best-sellers.js
2 years ago
product-best-sellers.js.map
2 years ago
product-button-frontend.js
2 years ago
product-button-frontend.js.map
2 years ago
product-button-interactivity-frontend.asset.php
2 years ago
product-button-interactivity-frontend.js
2 years ago
product-button-interactivity-frontend.js.map
2 years ago
product-button-rtl.css
2 years ago
product-button-style.js.map
2 years ago
product-button.css
2 years ago
product-button.css.map
2 years ago
product-button.js
2 years ago
product-button.js.map
2 years ago
product-categories-rtl.css
2 years ago
product-categories-style.asset.php
2 years ago
product-categories-style.js.map
2 years ago
product-categories.asset.php
2 years ago
product-categories.css
2 years ago
product-categories.css.map
2 years ago
product-categories.js
2 years ago
product-categories.js.map
2 years ago
product-category-style.asset.php
2 years ago
product-category-style.js.map
2 years ago
product-category.asset.php
2 years ago
product-category.js
2 years ago
product-category.js.map
2 years ago
product-collection-no-results-style.asset.php
2 years ago
product-collection-no-results-style.js.map
2 years ago
product-collection-no-results.asset.php
2 years ago
product-collection-no-results.js
2 years ago
product-collection-no-results.js.map
2 years ago
product-collection-style.asset.php
2 years ago
product-collection-style.js.map
2 years ago
product-collection.asset.php
2 years ago
product-collection.js
2 years ago
product-collection.js.map
2 years ago
product-details-rtl.css
2 years ago
product-details-style.asset.php
2 years ago
product-details-style.js.map
2 years ago
product-details.css
2 years ago
product-details.css.map
2 years ago
product-gallery-frontend.asset.php
2 years ago
product-gallery-frontend.js
2 years ago
product-gallery-frontend.js.map
2 years ago
product-gallery-large-image-frontend.asset.php
2 years ago
product-gallery-large-image-frontend.js
2 years ago
product-gallery-large-image-frontend.js.map
2 years ago
product-gallery-large-image-next-previous-style.asset.php
2 years ago
product-gallery-large-image-next-previous-style.js.map
2 years ago
product-gallery-large-image-next-previous.asset.php
2 years ago
product-gallery-large-image-next-previous.js
2 years ago
product-gallery-large-image-next-previous.js.map
2 years ago
product-gallery-large-image-style.asset.php
2 years ago
product-gallery-large-image-style.js.map
2 years ago
product-gallery-large-image.asset.php
2 years ago
product-gallery-large-image.js
2 years ago
product-gallery-large-image.js.map
2 years ago
product-gallery-pager-style.asset.php
2 years ago
product-gallery-pager-style.js.map
2 years ago
product-gallery-pager.asset.php
2 years ago
product-gallery-pager.js
2 years ago
product-gallery-pager.js.map
2 years ago
product-gallery-rtl.css
2 years ago
product-gallery-style.asset.php
2 years ago
product-gallery-style.js.map
2 years ago
product-gallery-thumbnails-style.asset.php
2 years ago
product-gallery-thumbnails-style.js.map
2 years ago
product-gallery-thumbnails.asset.php
2 years ago
product-gallery-thumbnails.js
2 years ago
product-gallery-thumbnails.js.map
2 years ago
product-gallery.asset.php
2 years ago
product-gallery.css
2 years ago
product-gallery.css.map
2 years ago
product-gallery.js
2 years ago
product-gallery.js.map
2 years ago
product-image-frontend.js
2 years ago
product-image-frontend.js.map
2 years ago
product-image-gallery-rtl.css
2 years ago
product-image-gallery-style.asset.php
2 years ago
product-image-gallery-style.js.map
2 years ago
product-image-gallery.css
2 years ago
product-image-gallery.css.map
2 years ago
product-image-rtl.css
2 years ago
product-image-style.js.map
2 years ago
product-image.css
2 years ago
product-image.css.map
2 years ago
product-image.js
2 years ago
product-image.js.map
2 years ago
product-new-style.asset.php
2 years ago
product-new-style.js.map
2 years ago
product-new.asset.php
2 years ago
product-new.js
2 years ago
product-new.js.map
2 years ago
product-on-sale-style.asset.php
2 years ago
product-on-sale-style.js.map
2 years ago
product-on-sale.asset.php
2 years ago
product-on-sale.js
2 years ago
product-on-sale.js.map
2 years ago
product-price-frontend.js
2 years ago
product-price-frontend.js.map
2 years ago
product-price-rtl.css
2 years ago
product-price-style.js.map
2 years ago
product-price.css
2 years ago
product-price.css.map
2 years ago
product-price.js
2 years ago
product-price.js.map
2 years ago
product-query-rtl.css
2 years ago
product-query-style.asset.php
2 years ago
product-query-style.js.map
2 years ago
product-query.asset.php
2 years ago
product-query.css
2 years ago
product-query.css.map
2 years ago
product-query.js
2 years ago
product-query.js.map
2 years ago
product-rating-counter-frontend.js
2 years ago
product-rating-counter-frontend.js.map
2 years ago
product-rating-counter-style.js.map
2 years ago
product-rating-counter.js
2 years ago
product-rating-counter.js.map
2 years ago
product-rating-frontend.js
2 years ago
product-rating-frontend.js.map
2 years ago
product-rating-rtl.css
2 years ago
product-rating-stars-frontend.js
2 years ago
product-rating-stars-frontend.js.map
2 years ago
product-rating-stars-rtl.css
2 years ago
product-rating-stars-style.js.map
2 years ago
product-rating-stars.css
2 years ago
product-rating-stars.css.map
2 years ago
product-rating-stars.js
2 years ago
product-rating-stars.js.map
2 years ago
product-rating-style.js.map
2 years ago
product-rating.css
2 years ago
product-rating.css.map
2 years ago
product-rating.js
2 years ago
product-rating.js.map
2 years ago
product-results-count-rtl.css
2 years ago
product-results-count-style.asset.php
2 years ago
product-results-count-style.js.map
2 years ago
product-results-count.asset.php
2 years ago
product-results-count.css
2 years ago
product-results-count.css.map
2 years ago
product-results-count.js
2 years ago
product-results-count.js.map
2 years ago
product-reviews-rtl.css
2 years ago
product-reviews-style.asset.php
2 years ago
product-reviews-style.js.map
2 years ago
product-reviews.css
2 years ago
product-reviews.css.map
2 years ago
product-sale-badge-frontend.js
2 years ago
product-sale-badge-frontend.js.map
2 years ago
product-sale-badge-rtl.css
2 years ago
product-sale-badge-style.js.map
2 years ago
product-sale-badge.css
2 years ago
product-sale-badge.css.map
2 years ago
product-sale-badge.js
2 years ago
product-sale-badge.js.map
2 years ago
product-search-rtl.css
2 years ago
product-search-style.asset.php
2 years ago
product-search-style.js.map
2 years ago
product-search.asset.php
2 years ago
product-search.css
2 years ago
product-search.css.map
2 years ago
product-search.js
2 years ago
product-search.js.map
2 years ago
product-sku-frontend.js
2 years ago
product-sku-frontend.js.map
2 years ago
product-sku-rtl.css
2 years ago
product-sku-style.js.map
2 years ago
product-sku.css
2 years ago
product-sku.css.map
2 years ago
product-sku.js
2 years ago
product-sku.js.map
2 years ago
product-stock-indicator-frontend.js
2 years ago
product-stock-indicator-frontend.js.map
2 years ago
product-stock-indicator-rtl.css
2 years ago
product-stock-indicator-style.js.map
2 years ago
product-stock-indicator.css
2 years ago
product-stock-indicator.css.map
2 years ago
product-stock-indicator.js
2 years ago
product-stock-indicator.js.map
2 years ago
product-summary-frontend.js
2 years ago
product-summary-frontend.js.map
2 years ago
product-summary-rtl.css
2 years ago
product-summary-style.js.map
2 years ago
product-summary.css
2 years ago
product-summary.css.map
2 years ago
product-summary.js
2 years ago
product-summary.js.map
2 years ago
product-tag-style.asset.php
2 years ago
product-tag-style.js.map
2 years ago
product-tag.asset.php
2 years ago
product-tag.js
2 years ago
product-tag.js.map
2 years ago
product-template-rtl.css
2 years ago
product-template-style.asset.php
2 years ago
product-template-style.js.map
2 years ago
product-template.asset.php
2 years ago
product-template.css
2 years ago
product-template.css.map
2 years ago
product-template.js
2 years ago
product-template.js.map
2 years ago
product-title-frontend.js
2 years ago
product-title-frontend.js.map
2 years ago
product-title-rtl.css
2 years ago
product-title-style.js.map
2 years ago
product-title.css
2 years ago
product-title.css.map
2 years ago
product-title.js
2 years ago
product-title.js.map
2 years ago
product-top-rated-style.asset.php
2 years ago
product-top-rated-style.js.map
2 years ago
product-top-rated.asset.php
2 years ago
product-top-rated.js
2 years ago
product-top-rated.js.map
2 years ago
products-by-attribute-style.asset.php
2 years ago
products-by-attribute-style.js.map
2 years ago
products-by-attribute.asset.php
2 years ago
products-by-attribute.js
2 years ago
products-by-attribute.js.map
2 years ago
rating-filter-frontend.asset.php
2 years ago
rating-filter-frontend.js
2 years ago
rating-filter-frontend.js.map
2 years ago
rating-filter-rtl.css
2 years ago
rating-filter-style.asset.php
2 years ago
rating-filter-style.js.map
2 years ago
rating-filter-wrapper-frontend.js
2 years ago
rating-filter-wrapper-frontend.js.map
2 years ago
rating-filter-wrapper-rtl.css
2 years ago
rating-filter-wrapper-style.js.map
2 years ago
rating-filter-wrapper.css
2 years ago
rating-filter-wrapper.css.map
2 years ago
rating-filter.asset.php
2 years ago
rating-filter.css
2 years ago
rating-filter.css.map
2 years ago
rating-filter.js
2 years ago
rating-filter.js.map
2 years ago
reviews-by-category-rtl.css
2 years ago
reviews-by-category-style.asset.php
2 years ago
reviews-by-category-style.js.map
2 years ago
reviews-by-category.asset.php
2 years ago
reviews-by-category.css
2 years ago
reviews-by-category.css.map
2 years ago
reviews-by-category.js
2 years ago
reviews-by-category.js.map
2 years ago
reviews-by-product-rtl.css
2 years ago
reviews-by-product-style.asset.php
2 years ago
reviews-by-product-style.js.map
2 years ago
reviews-by-product.asset.php
2 years ago
reviews-by-product.css
2 years ago
reviews-by-product.css.map
2 years ago
reviews-by-product.js
2 years ago
reviews-by-product.js.map
2 years ago
reviews-frontend.asset.php
2 years ago
reviews-frontend.js
2 years ago
reviews-frontend.js.map
2 years ago
single-product-rtl.css
2 years ago
single-product-style.asset.php
2 years ago
single-product-style.js.map
2 years ago
single-product.asset.php
2 years ago
single-product.css
2 years ago
single-product.css.map
2 years ago
single-product.js
2 years ago
single-product.js.map
2 years ago
stock-filter-frontend.asset.php
2 years ago
stock-filter-frontend.js
2 years ago
stock-filter-frontend.js.map
2 years ago
stock-filter-rtl.css
2 years ago
stock-filter-style.asset.php
2 years ago
stock-filter-style.js.map
2 years ago
stock-filter-wrapper-frontend.js
2 years ago
stock-filter-wrapper-frontend.js.map
2 years ago
stock-filter-wrapper-rtl.css
2 years ago
stock-filter-wrapper-style.js.map
2 years ago
stock-filter-wrapper.css
2 years ago
stock-filter-wrapper.css.map
2 years ago
stock-filter.asset.php
2 years ago
stock-filter.css
2 years ago
stock-filter.css.map
2 years ago
stock-filter.js
2 years ago
stock-filter.js.map
2 years ago
store-notices-rtl.css
2 years ago
store-notices-style.asset.php
2 years ago
store-notices-style.js.map
2 years ago
store-notices.asset.php
2 years ago
store-notices.css
2 years ago
store-notices.css.map
2 years ago
store-notices.js
2 years ago
store-notices.js.map
2 years ago
vendors-node_modules_pnpm_dinero_js_1_9_1_node_modules_dinero_js_build_esm_dinero_js-style.js.map
2 years ago
vendors-node_modules_pnpm_param-case_3_0_4_node_modules_param-case_dist_es2015_index_js-style.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-019903-style.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-37238e-frontend.js
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-37238e-frontend.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-68c184-style.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-70a73f-frontend.js
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-70a73f-frontend.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-849324-frontend.js
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-849324-frontend.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-bab841-style.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-c6918e-style.js.map
2 years ago
wc-blocks-classic-template-revert-button-style-rtl.css
2 years ago
wc-blocks-classic-template-revert-button-style-style.asset.php
2 years ago
wc-blocks-classic-template-revert-button-style-style.js.map
2 years ago
wc-blocks-classic-template-revert-button-style.css
2 years ago
wc-blocks-classic-template-revert-button-style.css.map
2 years ago
wc-blocks-classic-template-revert-button.asset.php
2 years ago
wc-blocks-classic-template-revert-button.js
2 years ago
wc-blocks-classic-template-revert-button.js.map
2 years ago
wc-blocks-data.asset.php
2 years ago
wc-blocks-data.js
2 years ago
wc-blocks-data.js.map
2 years ago
wc-blocks-editor-style-rtl.css
2 years ago
wc-blocks-editor-style.css
2 years ago
wc-blocks-editor-style.css.map
2 years ago
wc-blocks-google-analytics.asset.php
2 years ago
wc-blocks-google-analytics.js
2 years ago
wc-blocks-google-analytics.js.map
2 years ago
wc-blocks-middleware.asset.php
2 years ago
wc-blocks-middleware.js
2 years ago
wc-blocks-middleware.js.map
2 years ago
wc-blocks-registry.asset.php
2 years ago
wc-blocks-registry.js
2 years ago
wc-blocks-registry.js.map
2 years ago
wc-blocks-rtl.css
2 years ago
wc-blocks-shared-context.asset.php
2 years ago
wc-blocks-shared-context.js
2 years ago
wc-blocks-shared-context.js.map
2 years ago
wc-blocks-shared-hocs.asset.php
2 years ago
wc-blocks-shared-hocs.js
2 years ago
wc-blocks-shared-hocs.js.map
2 years ago
wc-blocks-style.asset.php
2 years ago
wc-blocks-style.js.map
2 years ago
wc-blocks-vendors.asset.php
2 years ago
wc-blocks-vendors.js
2 years ago
wc-blocks-vendors.js.map
2 years ago
wc-blocks.asset.php
2 years ago
wc-blocks.css
2 years ago
wc-blocks.css.map
2 years ago
wc-blocks.js
2 years ago
wc-blocks.js.map
2 years ago
wc-interactivity-checkbox-list-rtl.css
2 years ago
wc-interactivity-checkbox-list-style.asset.php
2 years ago
wc-interactivity-checkbox-list-style.js.map
2 years ago
wc-interactivity-checkbox-list.asset.php
2 years ago
wc-interactivity-checkbox-list.css
2 years ago
wc-interactivity-checkbox-list.css.map
2 years ago
wc-interactivity-checkbox-list.js
2 years ago
wc-interactivity-checkbox-list.js.map
2 years ago
wc-interactivity-dropdown-rtl.css
2 years ago
wc-interactivity-dropdown-style.asset.php
2 years ago
wc-interactivity-dropdown-style.js.map
2 years ago
wc-interactivity-dropdown.asset.php
2 years ago
wc-interactivity-dropdown.css
2 years ago
wc-interactivity-dropdown.css.map
2 years ago
wc-interactivity-dropdown.js
2 years ago
wc-interactivity-dropdown.js.map
2 years ago
wc-interactivity.asset.php
2 years ago
wc-interactivity.js
2 years ago
wc-interactivity.js.map
2 years ago
wc-payment-method-bacs.asset.php
2 years ago
wc-payment-method-bacs.js
2 years ago
wc-payment-method-bacs.js.map
2 years ago
wc-payment-method-cheque.asset.php
2 years ago
wc-payment-method-cheque.js
2 years ago
wc-payment-method-cheque.js.map
2 years ago
wc-payment-method-cod.asset.php
2 years ago
wc-payment-method-cod.js
2 years ago
wc-payment-method-cod.js.map
2 years ago
wc-payment-method-paypal.asset.php
2 years ago
wc-payment-method-paypal.js
2 years ago
wc-payment-method-paypal.js.map
2 years ago
wc-settings.asset.php
2 years ago
wc-settings.js
2 years ago
wc-settings.js.map
2 years ago
wc-shipping-method-pickup-location.asset.php
2 years ago
wc-shipping-method-pickup-location.js
2 years ago
wc-shipping-method-pickup-location.js.map
2 years ago
price-filter-wrapper-frontend.js
3201 lines
| 1 | (self["webpackChunkwebpackWcBlocksJsonp"] = self["webpackChunkwebpackWcBlocksJsonp"] || []).push([["price-filter-wrapper"],{ |
| 2 | |
| 3 | /***/ "./assets/js/base/components/filter-placeholder/index.tsx": |
| 4 | /*!****************************************************************!*\ |
| 5 | !*** ./assets/js/base/components/filter-placeholder/index.tsx ***! |
| 6 | \****************************************************************/ |
| 7 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 8 | |
| 9 | "use strict"; |
| 10 | __webpack_require__.r(__webpack_exports__); |
| 11 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 12 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 13 | /* harmony export */ }); |
| 14 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 15 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 16 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/filter-placeholder/style.scss"); |
| 17 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_1__); |
| 18 | |
| 19 | /** |
| 20 | * Internal dependencies |
| 21 | */ |
| 22 | |
| 23 | const FilterTitlePlaceholder = ({ |
| 24 | children |
| 25 | }) => { |
| 26 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 27 | className: "wc-block-filter-title-placeholder" |
| 28 | }, children); |
| 29 | }; |
| 30 | FilterTitlePlaceholder.__docgenInfo = { |
| 31 | "description": "", |
| 32 | "methods": [], |
| 33 | "displayName": "FilterTitlePlaceholder", |
| 34 | "props": { |
| 35 | "children": { |
| 36 | "required": false, |
| 37 | "tsType": { |
| 38 | "name": "ReactReactNode", |
| 39 | "raw": "React.ReactNode" |
| 40 | }, |
| 41 | "description": "" |
| 42 | } |
| 43 | } |
| 44 | }; |
| 45 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FilterTitlePlaceholder); |
| 46 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 47 | STORYBOOK_REACT_CLASSES["assets/js/base/components/filter-placeholder/index.tsx"] = { |
| 48 | name: "FilterTitlePlaceholder", |
| 49 | docgenInfo: FilterTitlePlaceholder.__docgenInfo, |
| 50 | path: "assets/js/base/components/filter-placeholder/index.tsx" |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | /***/ }), |
| 55 | |
| 56 | /***/ "./assets/js/base/components/filter-reset-button/index.tsx": |
| 57 | /*!*****************************************************************!*\ |
| 58 | !*** ./assets/js/base/components/filter-reset-button/index.tsx ***! |
| 59 | \*****************************************************************/ |
| 60 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 61 | |
| 62 | "use strict"; |
| 63 | __webpack_require__.r(__webpack_exports__); |
| 64 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 65 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 66 | /* harmony export */ }); |
| 67 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 68 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 69 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 70 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 71 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 72 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); |
| 73 | /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components"); |
| 74 | /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__); |
| 75 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/filter-reset-button/style.scss"); |
| 76 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_4__); |
| 77 | |
| 78 | /** |
| 79 | * External dependencies |
| 80 | */ |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | /** |
| 86 | * Internal dependencies |
| 87 | */ |
| 88 | |
| 89 | const FilterResetButton = ({ |
| 90 | className, |
| 91 | /* translators: Reset button text for filters. */ |
| 92 | label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reset', 'woocommerce'), |
| 93 | onClick, |
| 94 | screenReaderLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reset filter', 'woocommerce') |
| 95 | }) => { |
| 96 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { |
| 97 | className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('wc-block-components-filter-reset-button', className), |
| 98 | onClick: onClick |
| 99 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__.Label, { |
| 100 | label: label, |
| 101 | screenReaderLabel: screenReaderLabel |
| 102 | })); |
| 103 | }; |
| 104 | FilterResetButton.__docgenInfo = { |
| 105 | "description": "", |
| 106 | "methods": [], |
| 107 | "displayName": "FilterResetButton", |
| 108 | "props": { |
| 109 | "label": { |
| 110 | "defaultValue": { |
| 111 | "value": "__( 'Reset', 'woocommerce' )", |
| 112 | "computed": true |
| 113 | }, |
| 114 | "required": false, |
| 115 | "tsType": { |
| 116 | "name": "string" |
| 117 | }, |
| 118 | "description": "" |
| 119 | }, |
| 120 | "screenReaderLabel": { |
| 121 | "defaultValue": { |
| 122 | "value": "__( 'Reset filter', 'woocommerce' )", |
| 123 | "computed": true |
| 124 | }, |
| 125 | "required": false, |
| 126 | "tsType": { |
| 127 | "name": "string" |
| 128 | }, |
| 129 | "description": "" |
| 130 | }, |
| 131 | "className": { |
| 132 | "required": false, |
| 133 | "tsType": { |
| 134 | "name": "string" |
| 135 | }, |
| 136 | "description": "" |
| 137 | }, |
| 138 | "onClick": { |
| 139 | "required": true, |
| 140 | "tsType": { |
| 141 | "name": "signature", |
| 142 | "type": "function", |
| 143 | "raw": "() => void", |
| 144 | "signature": { |
| 145 | "arguments": [], |
| 146 | "return": { |
| 147 | "name": "void" |
| 148 | } |
| 149 | } |
| 150 | }, |
| 151 | "description": "" |
| 152 | } |
| 153 | } |
| 154 | }; |
| 155 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FilterResetButton); |
| 156 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 157 | STORYBOOK_REACT_CLASSES["assets/js/base/components/filter-reset-button/index.tsx"] = { |
| 158 | name: "FilterResetButton", |
| 159 | docgenInfo: FilterResetButton.__docgenInfo, |
| 160 | path: "assets/js/base/components/filter-reset-button/index.tsx" |
| 161 | }; |
| 162 | } |
| 163 | |
| 164 | /***/ }), |
| 165 | |
| 166 | /***/ "./assets/js/base/components/filter-submit-button/index.tsx": |
| 167 | /*!******************************************************************!*\ |
| 168 | !*** ./assets/js/base/components/filter-submit-button/index.tsx ***! |
| 169 | \******************************************************************/ |
| 170 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 171 | |
| 172 | "use strict"; |
| 173 | __webpack_require__.r(__webpack_exports__); |
| 174 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 175 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 176 | /* harmony export */ }); |
| 177 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 178 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 179 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 180 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 181 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 182 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); |
| 183 | /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components"); |
| 184 | /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__); |
| 185 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/filter-submit-button/style.scss"); |
| 186 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_4__); |
| 187 | |
| 188 | /** |
| 189 | * External dependencies |
| 190 | */ |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | /** |
| 196 | * Internal dependencies |
| 197 | */ |
| 198 | |
| 199 | const FilterSubmitButton = ({ |
| 200 | className, |
| 201 | isLoading, |
| 202 | disabled, |
| 203 | /* translators: Submit button text for filters. */ |
| 204 | label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Apply', 'woocommerce'), |
| 205 | onClick, |
| 206 | screenReaderLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Apply filter', 'woocommerce') |
| 207 | }) => { |
| 208 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { |
| 209 | type: "submit", |
| 210 | className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('wp-block-button__link', 'wc-block-filter-submit-button', 'wc-block-components-filter-submit-button', { |
| 211 | 'is-loading': isLoading |
| 212 | }, className), |
| 213 | disabled: disabled, |
| 214 | onClick: onClick |
| 215 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__.Label, { |
| 216 | label: label, |
| 217 | screenReaderLabel: screenReaderLabel |
| 218 | })); |
| 219 | }; |
| 220 | FilterSubmitButton.__docgenInfo = { |
| 221 | "description": "", |
| 222 | "methods": [], |
| 223 | "displayName": "FilterSubmitButton", |
| 224 | "props": { |
| 225 | "label": { |
| 226 | "defaultValue": { |
| 227 | "value": "__( 'Apply', 'woocommerce' )", |
| 228 | "computed": true |
| 229 | }, |
| 230 | "required": false, |
| 231 | "tsType": { |
| 232 | "name": "string" |
| 233 | }, |
| 234 | "description": "" |
| 235 | }, |
| 236 | "screenReaderLabel": { |
| 237 | "defaultValue": { |
| 238 | "value": "__( 'Apply filter', 'woocommerce' )", |
| 239 | "computed": true |
| 240 | }, |
| 241 | "required": false, |
| 242 | "tsType": { |
| 243 | "name": "string" |
| 244 | }, |
| 245 | "description": "" |
| 246 | }, |
| 247 | "className": { |
| 248 | "required": false, |
| 249 | "tsType": { |
| 250 | "name": "string" |
| 251 | }, |
| 252 | "description": "" |
| 253 | }, |
| 254 | "isLoading": { |
| 255 | "required": false, |
| 256 | "tsType": { |
| 257 | "name": "boolean" |
| 258 | }, |
| 259 | "description": "" |
| 260 | }, |
| 261 | "disabled": { |
| 262 | "required": false, |
| 263 | "tsType": { |
| 264 | "name": "boolean" |
| 265 | }, |
| 266 | "description": "" |
| 267 | }, |
| 268 | "onClick": { |
| 269 | "required": true, |
| 270 | "tsType": { |
| 271 | "name": "signature", |
| 272 | "type": "function", |
| 273 | "raw": "() => void", |
| 274 | "signature": { |
| 275 | "arguments": [], |
| 276 | "return": { |
| 277 | "name": "void" |
| 278 | } |
| 279 | } |
| 280 | }, |
| 281 | "description": "" |
| 282 | } |
| 283 | } |
| 284 | }; |
| 285 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FilterSubmitButton); |
| 286 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 287 | STORYBOOK_REACT_CLASSES["assets/js/base/components/filter-submit-button/index.tsx"] = { |
| 288 | name: "FilterSubmitButton", |
| 289 | docgenInfo: FilterSubmitButton.__docgenInfo, |
| 290 | path: "assets/js/base/components/filter-submit-button/index.tsx" |
| 291 | }; |
| 292 | } |
| 293 | |
| 294 | /***/ }), |
| 295 | |
| 296 | /***/ "./assets/js/base/components/price-slider/constrain-range-slider-values.ts": |
| 297 | /*!*********************************************************************************!*\ |
| 298 | !*** ./assets/js/base/components/price-slider/constrain-range-slider-values.ts ***! |
| 299 | \*********************************************************************************/ |
| 300 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 301 | |
| 302 | "use strict"; |
| 303 | __webpack_require__.r(__webpack_exports__); |
| 304 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 305 | /* harmony export */ constrainRangeSliderValues: () => (/* binding */ constrainRangeSliderValues) |
| 306 | /* harmony export */ }); |
| 307 | /** |
| 308 | * Validate a min and max value for a range slider against defined constraints (min, max, step). |
| 309 | * |
| 310 | * @return {[number, number]} Validated and updated min/max values that fit within the range slider constraints. |
| 311 | */ |
| 312 | const constrainRangeSliderValues = (values, min, max, |
| 313 | /** |
| 314 | * Step value for the sliders. |
| 315 | */ |
| 316 | step = 1, |
| 317 | /** |
| 318 | * Whether we're currently interacting with the min range slider or not, so we update the correct values. |
| 319 | */ |
| 320 | isMin = false) => { |
| 321 | let [minValue, maxValue] = values; |
| 322 | const isFinite = n => Number.isFinite(n); |
| 323 | if (!isFinite(minValue)) { |
| 324 | minValue = min || 0; |
| 325 | } |
| 326 | if (!isFinite(maxValue)) { |
| 327 | maxValue = max || step; |
| 328 | } |
| 329 | if (isFinite(min) && min > minValue) { |
| 330 | minValue = min; |
| 331 | } |
| 332 | if (isFinite(max) && max <= minValue) { |
| 333 | minValue = max - step; |
| 334 | } |
| 335 | if (isFinite(min) && min >= maxValue) { |
| 336 | maxValue = min + step; |
| 337 | } |
| 338 | if (isFinite(max) && max < maxValue) { |
| 339 | maxValue = max; |
| 340 | } |
| 341 | if (!isMin && minValue >= maxValue) { |
| 342 | minValue = maxValue - step; |
| 343 | } |
| 344 | if (isMin && maxValue <= minValue) { |
| 345 | maxValue = minValue + step; |
| 346 | } |
| 347 | return [minValue, maxValue]; |
| 348 | }; |
| 349 | |
| 350 | /***/ }), |
| 351 | |
| 352 | /***/ "./assets/js/base/components/price-slider/index.tsx": |
| 353 | /*!**********************************************************!*\ |
| 354 | !*** ./assets/js/base/components/price-slider/index.tsx ***! |
| 355 | \**********************************************************/ |
| 356 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 357 | |
| 358 | "use strict"; |
| 359 | __webpack_require__.r(__webpack_exports__); |
| 360 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 361 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 362 | /* harmony export */ }); |
| 363 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 364 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 365 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 366 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 367 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 368 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); |
| 369 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 370 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); |
| 371 | /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components"); |
| 372 | /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_4__); |
| 373 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts"); |
| 374 | /* harmony import */ var use_debounce__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! use-debounce */ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js"); |
| 375 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/price-slider/style.scss"); |
| 376 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_5__); |
| 377 | /* harmony import */ var _constrain_range_slider_values__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constrain-range-slider-values */ "./assets/js/base/components/price-slider/constrain-range-slider-values.ts"); |
| 378 | /* harmony import */ var _filter_submit_button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../filter-submit-button */ "./assets/js/base/components/filter-submit-button/index.tsx"); |
| 379 | /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./assets/js/base/components/price-slider/utils.ts"); |
| 380 | /* harmony import */ var _filter_reset_button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../filter-reset-button */ "./assets/js/base/components/filter-reset-button/index.tsx"); |
| 381 | |
| 382 | /** |
| 383 | * External dependencies |
| 384 | */ |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | /** |
| 393 | * Internal dependencies |
| 394 | */ |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | const PriceSlider = ({ |
| 401 | minPrice, |
| 402 | maxPrice, |
| 403 | minConstraint, |
| 404 | maxConstraint, |
| 405 | onChange, |
| 406 | step, |
| 407 | currency, |
| 408 | showInputFields = true, |
| 409 | showFilterButton = false, |
| 410 | inlineInput = true, |
| 411 | isLoading = false, |
| 412 | isUpdating = false, |
| 413 | isEditor = false, |
| 414 | onSubmit = () => void 0 |
| 415 | }) => { |
| 416 | const minRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null); |
| 417 | const maxRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null); |
| 418 | |
| 419 | // We want step to default to 1 major unit, e.g. $1. |
| 420 | const stepValue = step ? step : 10 ** currency.minorUnit; |
| 421 | const [minPriceInput, setMinPriceInput] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(minPrice); |
| 422 | const [maxPriceInput, setMaxPriceInput] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(maxPrice); |
| 423 | const wrapper = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null); |
| 424 | const [wrapperWidth, setWrapperWidth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(0); |
| 425 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { |
| 426 | setMinPriceInput(minPrice); |
| 427 | }, [minPrice]); |
| 428 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { |
| 429 | setMaxPriceInput(maxPrice); |
| 430 | }, [maxPrice]); |
| 431 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useLayoutEffect)(() => { |
| 432 | if (inlineInput && wrapper.current) { |
| 433 | var _wrapper$current; |
| 434 | setWrapperWidth((_wrapper$current = wrapper.current) === null || _wrapper$current === void 0 ? void 0 : _wrapper$current.offsetWidth); |
| 435 | } |
| 436 | }, [inlineInput, setWrapperWidth]); |
| 437 | |
| 438 | /** |
| 439 | * Checks if the min and max constraints are valid. |
| 440 | */ |
| 441 | const hasValidConstraints = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => { |
| 442 | return isFinite(minConstraint) && isFinite(maxConstraint); |
| 443 | }, [minConstraint, maxConstraint]); |
| 444 | |
| 445 | /** |
| 446 | * Handles styles for the shaded area of the range slider. |
| 447 | */ |
| 448 | const progressStyles = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => { |
| 449 | if (!isFinite(minPrice) || !isFinite(maxPrice) || !hasValidConstraints) { |
| 450 | return { |
| 451 | '--low': '0%', |
| 452 | '--high': '100%' |
| 453 | }; |
| 454 | } |
| 455 | const low = 100 * ((minPrice - minConstraint) / (maxConstraint - minConstraint)); |
| 456 | const high = 100 * ((maxPrice - minConstraint) / (maxConstraint - minConstraint)); |
| 457 | return { |
| 458 | '--low': low + '%', |
| 459 | '--high': high + '%' |
| 460 | }; |
| 461 | }, [minPrice, maxPrice, minConstraint, maxConstraint, hasValidConstraints]); |
| 462 | |
| 463 | /** |
| 464 | * Works around an IE issue where only one range selector is visible by changing the display order |
| 465 | * based on the mouse position. |
| 466 | * |
| 467 | * @param {Object} event event data. |
| 468 | */ |
| 469 | const findClosestRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(event => { |
| 470 | if (isLoading || !hasValidConstraints || !minRange.current || !maxRange.current) { |
| 471 | return; |
| 472 | } |
| 473 | const bounds = event.target.getBoundingClientRect(); |
| 474 | const x = event.clientX - bounds.left; |
| 475 | const minWidth = minRange.current.offsetWidth; |
| 476 | const minValue = +minRange.current.value; |
| 477 | const maxWidth = maxRange.current.offsetWidth; |
| 478 | const maxValue = +maxRange.current.value; |
| 479 | const minX = minWidth * (minValue / maxConstraint); |
| 480 | const maxX = maxWidth * (maxValue / maxConstraint); |
| 481 | const minXDiff = Math.abs(x - minX); |
| 482 | const maxXDiff = Math.abs(x - maxX); |
| 483 | |
| 484 | /** |
| 485 | * The default z-index in the stylesheet as 20. 20 vs 21 is just for determining which range |
| 486 | * slider should be at the front and has no meaning beyond |
| 487 | */ |
| 488 | if (minXDiff > maxXDiff) { |
| 489 | minRange.current.style.zIndex = '20'; |
| 490 | maxRange.current.style.zIndex = '21'; |
| 491 | } else { |
| 492 | minRange.current.style.zIndex = '21'; |
| 493 | maxRange.current.style.zIndex = '20'; |
| 494 | } |
| 495 | }, [isLoading, maxConstraint, hasValidConstraints]); |
| 496 | |
| 497 | /** |
| 498 | * Called when the slider is dragged. |
| 499 | */ |
| 500 | const rangeInputOnChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(event => { |
| 501 | const isMin = event.target.classList.contains('wc-block-price-filter__range-input--min'); |
| 502 | const targetValue = +event.target.value; |
| 503 | const currentValues = isMin ? [Math.round(targetValue / stepValue) * stepValue, maxPrice] : [minPrice, Math.round(targetValue / stepValue) * stepValue]; |
| 504 | const values = (0,_constrain_range_slider_values__WEBPACK_IMPORTED_MODULE_6__.constrainRangeSliderValues)(currentValues, minConstraint, maxConstraint, stepValue, isMin); |
| 505 | onChange(values); |
| 506 | }, [onChange, minPrice, maxPrice, minConstraint, maxConstraint, stepValue]); |
| 507 | |
| 508 | /** |
| 509 | * Called when a price input loses focus - commit changes to slider. |
| 510 | */ |
| 511 | const priceInputOnBlur = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(event => { |
| 512 | // Only refresh when finished editing the min and max fields. |
| 513 | if (event.relatedTarget && event.relatedTarget.classList && event.relatedTarget.classList.contains('wc-block-price-filter__amount')) { |
| 514 | return; |
| 515 | } |
| 516 | const isMin = event.target.classList.contains('wc-block-price-filter__amount--min'); |
| 517 | |
| 518 | // When the user inserts in the max price input a value less or equal than the current minimum price, |
| 519 | // we set to 0 the minimum price. |
| 520 | if (minPriceInput >= maxPriceInput) { |
| 521 | const values = (0,_constrain_range_slider_values__WEBPACK_IMPORTED_MODULE_6__.constrainRangeSliderValues)([0, maxPriceInput], null, null, stepValue, isMin); |
| 522 | return onChange([parseInt(values[0], 10), parseInt(values[1], 10)]); |
| 523 | } |
| 524 | const values = (0,_constrain_range_slider_values__WEBPACK_IMPORTED_MODULE_6__.constrainRangeSliderValues)([minPriceInput, maxPriceInput], null, null, stepValue, isMin); |
| 525 | onChange(values); |
| 526 | }, [onChange, stepValue, minPriceInput, maxPriceInput]); |
| 527 | const debouncedUpdateQuery = (0,use_debounce__WEBPACK_IMPORTED_MODULE_10__.useDebouncedCallback)(onSubmit, 600); |
| 528 | const classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-price-filter', 'wc-block-components-price-slider', showInputFields && 'wc-block-price-filter--has-input-fields', showInputFields && 'wc-block-components-price-slider--has-input-fields', showFilterButton && 'wc-block-price-filter--has-filter-button', showFilterButton && 'wc-block-components-price-slider--has-filter-button', !hasValidConstraints && 'is-disabled', (inlineInput || wrapperWidth <= 300) && 'wc-block-components-price-slider--is-input-inline'); |
| 529 | const activeElement = (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_11__.isObject)(minRange.current) ? minRange.current.ownerDocument.activeElement : undefined; |
| 530 | const minRangeStep = activeElement && activeElement === minRange.current ? stepValue : 1; |
| 531 | const maxRangeStep = activeElement && activeElement === maxRange.current ? stepValue : 1; |
| 532 | const ariaReadableMinPrice = String(minPriceInput / 10 ** currency.minorUnit); |
| 533 | const ariaReadableMaxPrice = String(maxPriceInput / 10 ** currency.minorUnit); |
| 534 | const inlineInputAvailable = inlineInput && wrapperWidth > 300; |
| 535 | const slider = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 536 | className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-price-filter__range-input-wrapper', 'wc-block-components-price-slider__range-input-wrapper', { |
| 537 | 'is-loading': isLoading && isUpdating |
| 538 | }), |
| 539 | onMouseMove: findClosestRange, |
| 540 | onFocus: findClosestRange |
| 541 | }, hasValidConstraints && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 542 | "aria-hidden": showInputFields |
| 543 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 544 | className: "wc-block-price-filter__range-input-progress wc-block-components-price-slider__range-input-progress", |
| 545 | style: progressStyles |
| 546 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { |
| 547 | type: "range", |
| 548 | className: "wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min", |
| 549 | "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter products by minimum price', 'woocommerce'), |
| 550 | "aria-valuetext": ariaReadableMinPrice, |
| 551 | value: Number.isFinite(minPrice) ? minPrice : minConstraint, |
| 552 | onChange: rangeInputOnChange, |
| 553 | step: minRangeStep, |
| 554 | min: minConstraint, |
| 555 | max: maxConstraint, |
| 556 | ref: minRange, |
| 557 | disabled: isLoading && !hasValidConstraints, |
| 558 | tabIndex: showInputFields ? -1 : 0 |
| 559 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { |
| 560 | type: "range", |
| 561 | className: "wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max", |
| 562 | "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter products by maximum price', 'woocommerce'), |
| 563 | "aria-valuetext": ariaReadableMaxPrice, |
| 564 | value: Number.isFinite(maxPrice) ? maxPrice : maxConstraint, |
| 565 | onChange: rangeInputOnChange, |
| 566 | step: maxRangeStep, |
| 567 | min: minConstraint, |
| 568 | max: maxConstraint, |
| 569 | ref: maxRange, |
| 570 | disabled: isLoading, |
| 571 | tabIndex: showInputFields ? -1 : 0 |
| 572 | }))); |
| 573 | const getInputClassName = type => `wc-block-price-filter__amount wc-block-price-filter__amount--${type} wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--${type}`; |
| 574 | const commonFormattedMonetaryAmountProps = { |
| 575 | currency, |
| 576 | decimalScale: 0 |
| 577 | }; |
| 578 | const commonFormattedMonetaryAmountInputProps = { |
| 579 | ...commonFormattedMonetaryAmountProps, |
| 580 | displayType: 'input', |
| 581 | allowNegative: false, |
| 582 | disabled: isLoading || !hasValidConstraints, |
| 583 | onBlur: priceInputOnBlur |
| 584 | }; |
| 585 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 586 | className: classes, |
| 587 | ref: wrapper |
| 588 | }, (!inlineInputAvailable || !showInputFields) && slider, showInputFields && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 589 | className: "wc-block-price-filter__controls wc-block-components-price-slider__controls" |
| 590 | }, !isUpdating ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_4__.FormattedMonetaryAmount, { |
| 591 | ...commonFormattedMonetaryAmountInputProps, |
| 592 | className: getInputClassName('min'), |
| 593 | "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter products by minimum price', 'woocommerce'), |
| 594 | isAllowed: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.isValidMinValue)({ |
| 595 | minConstraint, |
| 596 | minorUnit: currency.minorUnit, |
| 597 | currentMaxValue: maxPriceInput |
| 598 | }), |
| 599 | onValueChange: value => { |
| 600 | if (value === minPriceInput) { |
| 601 | return; |
| 602 | } |
| 603 | setMinPriceInput(value); |
| 604 | }, |
| 605 | value: minPriceInput |
| 606 | }) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 607 | className: "input-loading" |
| 608 | }), inlineInputAvailable && slider, !isUpdating ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_4__.FormattedMonetaryAmount, { |
| 609 | ...commonFormattedMonetaryAmountInputProps, |
| 610 | className: getInputClassName('max'), |
| 611 | "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter products by maximum price', 'woocommerce'), |
| 612 | isAllowed: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.isValidMaxValue)({ |
| 613 | maxConstraint, |
| 614 | minorUnit: currency.minorUnit |
| 615 | }), |
| 616 | onValueChange: value => { |
| 617 | if (value === maxPriceInput) { |
| 618 | return; |
| 619 | } |
| 620 | setMaxPriceInput(value); |
| 621 | }, |
| 622 | value: maxPriceInput |
| 623 | }) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 624 | className: "input-loading" |
| 625 | })), !showInputFields && !isUpdating && Number.isFinite(minPrice) && Number.isFinite(maxPrice) && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 626 | className: "wc-block-price-filter__range-text wc-block-components-price-slider__range-text" |
| 627 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_4__.FormattedMonetaryAmount, { |
| 628 | ...commonFormattedMonetaryAmountProps, |
| 629 | value: minPrice |
| 630 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_4__.FormattedMonetaryAmount, { |
| 631 | ...commonFormattedMonetaryAmountProps, |
| 632 | value: maxPrice |
| 633 | })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 634 | className: "wc-block-components-price-slider__actions" |
| 635 | }, (isEditor || !isUpdating && (minPrice !== minConstraint || maxPrice !== maxConstraint)) && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_filter_reset_button__WEBPACK_IMPORTED_MODULE_9__["default"], { |
| 636 | onClick: () => { |
| 637 | onChange([minConstraint, maxConstraint]); |
| 638 | debouncedUpdateQuery(); |
| 639 | }, |
| 640 | screenReaderLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reset price filter', 'woocommerce') |
| 641 | }), showFilterButton && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_filter_submit_button__WEBPACK_IMPORTED_MODULE_7__["default"], { |
| 642 | className: "wc-block-price-filter__button wc-block-components-price-slider__button", |
| 643 | isLoading: isUpdating, |
| 644 | disabled: isLoading || !hasValidConstraints, |
| 645 | onClick: onSubmit, |
| 646 | screenReaderLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Apply price filter', 'woocommerce') |
| 647 | }))); |
| 648 | }; |
| 649 | PriceSlider.__docgenInfo = { |
| 650 | "description": "", |
| 651 | "methods": [], |
| 652 | "displayName": "PriceSlider", |
| 653 | "props": { |
| 654 | "showInputFields": { |
| 655 | "defaultValue": { |
| 656 | "value": "true", |
| 657 | "computed": false |
| 658 | }, |
| 659 | "required": false, |
| 660 | "tsType": { |
| 661 | "name": "boolean" |
| 662 | }, |
| 663 | "description": "Whether to show input fields for the values or not." |
| 664 | }, |
| 665 | "showFilterButton": { |
| 666 | "defaultValue": { |
| 667 | "value": "false", |
| 668 | "computed": false |
| 669 | }, |
| 670 | "required": false, |
| 671 | "tsType": { |
| 672 | "name": "boolean" |
| 673 | }, |
| 674 | "description": "Whether to show the filter button for the slider." |
| 675 | }, |
| 676 | "inlineInput": { |
| 677 | "defaultValue": { |
| 678 | "value": "true", |
| 679 | "computed": false |
| 680 | }, |
| 681 | "required": false, |
| 682 | "tsType": { |
| 683 | "name": "boolean" |
| 684 | }, |
| 685 | "description": "Whether to show input fields inline with the slider or not." |
| 686 | }, |
| 687 | "isLoading": { |
| 688 | "defaultValue": { |
| 689 | "value": "false", |
| 690 | "computed": false |
| 691 | }, |
| 692 | "required": false, |
| 693 | "tsType": { |
| 694 | "name": "boolean" |
| 695 | }, |
| 696 | "description": "Whether values are loading or not." |
| 697 | }, |
| 698 | "isUpdating": { |
| 699 | "defaultValue": { |
| 700 | "value": "false", |
| 701 | "computed": false |
| 702 | }, |
| 703 | "required": false, |
| 704 | "tsType": { |
| 705 | "name": "boolean" |
| 706 | }, |
| 707 | "description": "Whether values are updating or not. The update starts when the price slider is changed." |
| 708 | }, |
| 709 | "isEditor": { |
| 710 | "defaultValue": { |
| 711 | "value": "false", |
| 712 | "computed": false |
| 713 | }, |
| 714 | "required": false, |
| 715 | "tsType": { |
| 716 | "name": "boolean" |
| 717 | }, |
| 718 | "description": "Wheter we're in the editor or not." |
| 719 | }, |
| 720 | "onSubmit": { |
| 721 | "defaultValue": { |
| 722 | "value": "() => void 0", |
| 723 | "computed": false |
| 724 | }, |
| 725 | "required": false, |
| 726 | "tsType": { |
| 727 | "name": "signature", |
| 728 | "type": "function", |
| 729 | "raw": "() => void", |
| 730 | "signature": { |
| 731 | "arguments": [], |
| 732 | "return": { |
| 733 | "name": "void" |
| 734 | } |
| 735 | } |
| 736 | }, |
| 737 | "description": "Function to call when submit event fires." |
| 738 | }, |
| 739 | "currency": { |
| 740 | "required": true, |
| 741 | "tsType": { |
| 742 | "name": "Currency" |
| 743 | }, |
| 744 | "description": "Currency configuration object." |
| 745 | }, |
| 746 | "maxConstraint": { |
| 747 | "required": true, |
| 748 | "tsType": { |
| 749 | "name": "union", |
| 750 | "raw": "number | null | undefined", |
| 751 | "elements": [{ |
| 752 | "name": "number" |
| 753 | }, { |
| 754 | "name": "null" |
| 755 | }, { |
| 756 | "name": "undefined" |
| 757 | }] |
| 758 | }, |
| 759 | "description": "Maximum constraint." |
| 760 | }, |
| 761 | "maxPrice": { |
| 762 | "required": true, |
| 763 | "tsType": { |
| 764 | "name": "union", |
| 765 | "raw": "number | null", |
| 766 | "elements": [{ |
| 767 | "name": "number" |
| 768 | }, { |
| 769 | "name": "null" |
| 770 | }] |
| 771 | }, |
| 772 | "description": "Maximum price for slider." |
| 773 | }, |
| 774 | "minConstraint": { |
| 775 | "required": true, |
| 776 | "tsType": { |
| 777 | "name": "union", |
| 778 | "raw": "number | null | undefined", |
| 779 | "elements": [{ |
| 780 | "name": "number" |
| 781 | }, { |
| 782 | "name": "null" |
| 783 | }, { |
| 784 | "name": "undefined" |
| 785 | }] |
| 786 | }, |
| 787 | "description": "Minimum constraint." |
| 788 | }, |
| 789 | "minPrice": { |
| 790 | "required": true, |
| 791 | "tsType": { |
| 792 | "name": "union", |
| 793 | "raw": "number | null", |
| 794 | "elements": [{ |
| 795 | "name": "number" |
| 796 | }, { |
| 797 | "name": "null" |
| 798 | }] |
| 799 | }, |
| 800 | "description": "Minimum price for slider." |
| 801 | }, |
| 802 | "onChange": { |
| 803 | "required": true, |
| 804 | "tsType": { |
| 805 | "name": "signature", |
| 806 | "type": "function", |
| 807 | "raw": "( value: [ number, number ] ) => void", |
| 808 | "signature": { |
| 809 | "arguments": [{ |
| 810 | "name": "value", |
| 811 | "type": { |
| 812 | "name": "tuple", |
| 813 | "raw": "[ number, number ]", |
| 814 | "elements": [{ |
| 815 | "name": "number" |
| 816 | }, { |
| 817 | "name": "number" |
| 818 | }] |
| 819 | } |
| 820 | }], |
| 821 | "return": { |
| 822 | "name": "void" |
| 823 | } |
| 824 | } |
| 825 | }, |
| 826 | "description": "Function to call on the change event." |
| 827 | }, |
| 828 | "step": { |
| 829 | "required": false, |
| 830 | "tsType": { |
| 831 | "name": "number" |
| 832 | }, |
| 833 | "description": "What step values the slider uses." |
| 834 | } |
| 835 | } |
| 836 | }; |
| 837 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PriceSlider); |
| 838 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 839 | STORYBOOK_REACT_CLASSES["assets/js/base/components/price-slider/index.tsx"] = { |
| 840 | name: "PriceSlider", |
| 841 | docgenInfo: PriceSlider.__docgenInfo, |
| 842 | path: "assets/js/base/components/price-slider/index.tsx" |
| 843 | }; |
| 844 | } |
| 845 | |
| 846 | /***/ }), |
| 847 | |
| 848 | /***/ "./assets/js/base/components/price-slider/utils.ts": |
| 849 | /*!*********************************************************!*\ |
| 850 | !*** ./assets/js/base/components/price-slider/utils.ts ***! |
| 851 | \*********************************************************/ |
| 852 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 853 | |
| 854 | "use strict"; |
| 855 | __webpack_require__.r(__webpack_exports__); |
| 856 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 857 | /* harmony export */ isValidMaxValue: () => (/* binding */ isValidMaxValue), |
| 858 | /* harmony export */ isValidMinValue: () => (/* binding */ isValidMinValue) |
| 859 | /* harmony export */ }); |
| 860 | /** |
| 861 | * External dependencies |
| 862 | */ |
| 863 | |
| 864 | /** |
| 865 | Check if that the value is minor than the max price and greater than 0. |
| 866 | */ |
| 867 | const isValidMaxValue = ({ |
| 868 | maxConstraint, |
| 869 | minorUnit |
| 870 | }) => ({ |
| 871 | floatValue |
| 872 | }) => { |
| 873 | const maxPrice = maxConstraint / 10 ** minorUnit; |
| 874 | return floatValue !== undefined && floatValue <= maxPrice && floatValue > 0; |
| 875 | }; |
| 876 | |
| 877 | /** |
| 878 | Check if that the value is minor than the max price and greater than 0. |
| 879 | */ |
| 880 | const isValidMinValue = ({ |
| 881 | minConstraint, |
| 882 | currentMaxValue, |
| 883 | minorUnit |
| 884 | }) => ({ |
| 885 | floatValue |
| 886 | }) => { |
| 887 | const minPrice = minConstraint / 10 ** minorUnit; |
| 888 | const currentMaxPrice = currentMaxValue / 10 ** minorUnit; |
| 889 | return floatValue !== undefined && floatValue >= minPrice && floatValue < currentMaxPrice; |
| 890 | }; |
| 891 | |
| 892 | /***/ }), |
| 893 | |
| 894 | /***/ "./assets/js/base/context/hooks/collections/use-collection-data.ts": |
| 895 | /*!*************************************************************************!*\ |
| 896 | !*** ./assets/js/base/context/hooks/collections/use-collection-data.ts ***! |
| 897 | \*************************************************************************/ |
| 898 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 899 | |
| 900 | "use strict"; |
| 901 | __webpack_require__.r(__webpack_exports__); |
| 902 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 903 | /* harmony export */ useCollectionData: () => (/* binding */ useCollectionData) |
| 904 | /* harmony export */ }); |
| 905 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 906 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
| 907 | /* harmony import */ var use_debounce__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! use-debounce */ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js"); |
| 908 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts"); |
| 909 | /* harmony import */ var fast_sort__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fast-sort */ "../../node_modules/.pnpm/fast-sort@3.4.0/node_modules/fast-sort/dist/sort.mjs"); |
| 910 | /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-shallow-equal.ts"); |
| 911 | /* harmony import */ var _use_query_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../use-query-state */ "./assets/js/base/context/hooks/use-query-state.js"); |
| 912 | /* harmony import */ var _use_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./use-collection */ "./assets/js/base/context/hooks/collections/use-collection.ts"); |
| 913 | /* harmony import */ var _providers_query_state_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../providers/query-state-context */ "./assets/js/base/context/providers/query-state-context.js"); |
| 914 | /** |
| 915 | * External dependencies |
| 916 | */ |
| 917 | |
| 918 | |
| 919 | |
| 920 | |
| 921 | |
| 922 | |
| 923 | /** |
| 924 | * Internal dependencies |
| 925 | */ |
| 926 | |
| 927 | |
| 928 | |
| 929 | const buildCollectionDataQuery = collectionDataQueryState => { |
| 930 | const query = collectionDataQueryState; |
| 931 | if (Array.isArray(collectionDataQueryState.calculate_attribute_counts)) { |
| 932 | query.calculate_attribute_counts = (0,fast_sort__WEBPACK_IMPORTED_MODULE_1__.sort)(collectionDataQueryState.calculate_attribute_counts.map(({ |
| 933 | taxonomy, |
| 934 | queryType |
| 935 | }) => { |
| 936 | return { |
| 937 | taxonomy, |
| 938 | query_type: queryType |
| 939 | }; |
| 940 | })).asc(['taxonomy', 'query_type']); |
| 941 | } |
| 942 | return query; |
| 943 | }; |
| 944 | const useCollectionData = ({ |
| 945 | queryAttribute, |
| 946 | queryPrices, |
| 947 | queryStock, |
| 948 | queryRating, |
| 949 | queryState, |
| 950 | isEditor = false |
| 951 | }) => { |
| 952 | let context = (0,_providers_query_state_context__WEBPACK_IMPORTED_MODULE_2__.useQueryStateContext)(); |
| 953 | context = `${context}-collection-data`; |
| 954 | const [collectionDataQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByContext)(context); |
| 955 | const [calculateAttributesQueryState, setCalculateAttributesQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByKey)('calculate_attribute_counts', [], context); |
| 956 | const [calculatePriceRangeQueryState, setCalculatePriceRangeQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByKey)('calculate_price_range', null, context); |
| 957 | const [calculateStockStatusQueryState, setCalculateStockStatusQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByKey)('calculate_stock_status_counts', null, context); |
| 958 | const [calculateRatingQueryState, setCalculateRatingQueryState] = (0,_use_query_state__WEBPACK_IMPORTED_MODULE_3__.useQueryStateByKey)('calculate_rating_counts', null, context); |
| 959 | const currentQueryAttribute = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useShallowEqual)(queryAttribute || {}); |
| 960 | const currentQueryPrices = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useShallowEqual)(queryPrices); |
| 961 | const currentQueryStock = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useShallowEqual)(queryStock); |
| 962 | const currentQueryRating = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useShallowEqual)(queryRating); |
| 963 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { |
| 964 | if (typeof currentQueryAttribute === 'object' && Object.keys(currentQueryAttribute).length) { |
| 965 | const foundAttribute = calculateAttributesQueryState.find(attribute => { |
| 966 | return (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_5__.objectHasProp)(currentQueryAttribute, 'taxonomy') && attribute.taxonomy === currentQueryAttribute.taxonomy; |
| 967 | }); |
| 968 | if (!foundAttribute) { |
| 969 | setCalculateAttributesQueryState([...calculateAttributesQueryState, currentQueryAttribute]); |
| 970 | } |
| 971 | } |
| 972 | }, [currentQueryAttribute, calculateAttributesQueryState, setCalculateAttributesQueryState]); |
| 973 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { |
| 974 | if (calculatePriceRangeQueryState !== currentQueryPrices && currentQueryPrices !== undefined) { |
| 975 | setCalculatePriceRangeQueryState(currentQueryPrices); |
| 976 | } |
| 977 | }, [currentQueryPrices, setCalculatePriceRangeQueryState, calculatePriceRangeQueryState]); |
| 978 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { |
| 979 | if (calculateStockStatusQueryState !== currentQueryStock && currentQueryStock !== undefined) { |
| 980 | setCalculateStockStatusQueryState(currentQueryStock); |
| 981 | } |
| 982 | }, [currentQueryStock, setCalculateStockStatusQueryState, calculateStockStatusQueryState]); |
| 983 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { |
| 984 | if (calculateRatingQueryState !== currentQueryRating && currentQueryRating !== undefined) { |
| 985 | setCalculateRatingQueryState(currentQueryRating); |
| 986 | } |
| 987 | }, [currentQueryRating, setCalculateRatingQueryState, calculateRatingQueryState]); |
| 988 | |
| 989 | // Defer the select query so all collection-data query vars can be gathered. |
| 990 | const [shouldSelect, setShouldSelect] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(isEditor); |
| 991 | const [debouncedShouldSelect] = (0,use_debounce__WEBPACK_IMPORTED_MODULE_6__.useDebounce)(shouldSelect, 200); |
| 992 | if (!shouldSelect) { |
| 993 | setShouldSelect(true); |
| 994 | } |
| 995 | const collectionDataQueryVars = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { |
| 996 | return buildCollectionDataQuery(collectionDataQueryState); |
| 997 | }, [collectionDataQueryState]); |
| 998 | return (0,_use_collection__WEBPACK_IMPORTED_MODULE_7__.useCollection)({ |
| 999 | namespace: '/wc/store/v1', |
| 1000 | resourceName: 'products/collection-data', |
| 1001 | query: { |
| 1002 | ...queryState, |
| 1003 | page: undefined, |
| 1004 | per_page: undefined, |
| 1005 | orderby: undefined, |
| 1006 | order: undefined, |
| 1007 | ...collectionDataQueryVars |
| 1008 | }, |
| 1009 | shouldSelect: debouncedShouldSelect |
| 1010 | }); |
| 1011 | }; |
| 1012 | |
| 1013 | /***/ }), |
| 1014 | |
| 1015 | /***/ "./assets/js/base/context/hooks/collections/use-collection.ts": |
| 1016 | /*!********************************************************************!*\ |
| 1017 | !*** ./assets/js/base/context/hooks/collections/use-collection.ts ***! |
| 1018 | \********************************************************************/ |
| 1019 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1020 | |
| 1021 | "use strict"; |
| 1022 | __webpack_require__.r(__webpack_exports__); |
| 1023 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1024 | /* harmony export */ useCollection: () => (/* binding */ useCollection) |
| 1025 | /* harmony export */ }); |
| 1026 | /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data"); |
| 1027 | /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__); |
| 1028 | /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); |
| 1029 | /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); |
| 1030 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1031 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); |
| 1032 | /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-shallow-equal.ts"); |
| 1033 | /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-throw-error.ts"); |
| 1034 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/error.ts"); |
| 1035 | /** |
| 1036 | * External dependencies |
| 1037 | */ |
| 1038 | |
| 1039 | |
| 1040 | |
| 1041 | |
| 1042 | |
| 1043 | |
| 1044 | /** |
| 1045 | * This is a custom hook that is wired up to the `wc/store/collections` data |
| 1046 | * store. Given a collections option object, this will ensure a component is |
| 1047 | * kept up to date with the collection matching that query in the store state. |
| 1048 | * |
| 1049 | * @throws {Object} Throws an exception object if there was a problem with the |
| 1050 | * API request, to be picked up by BlockErrorBoundry. |
| 1051 | * |
| 1052 | * @param {Object} options An object declaring the various |
| 1053 | * collection arguments. |
| 1054 | * @param {string} options.namespace The namespace for the collection. |
| 1055 | * Example: `'/wc/blocks'` |
| 1056 | * @param {string} options.resourceName The name of the resource for the |
| 1057 | * collection. Example: |
| 1058 | * `'products/attributes'` |
| 1059 | * @param {Array} [options.resourceValues] An array of values (in correct order) |
| 1060 | * that are substituted in the route |
| 1061 | * placeholders for the collection route. |
| 1062 | * Example: `[10, 20]` |
| 1063 | * @param {Object} [options.query] An object of key value pairs for the |
| 1064 | * query to execute on the collection |
| 1065 | * Example: |
| 1066 | * `{ order: 'ASC', order_by: 'price' }` |
| 1067 | * @param {boolean} [options.shouldSelect] If false, the previous results will be |
| 1068 | * returned and internal selects will not |
| 1069 | * fire. |
| 1070 | * |
| 1071 | * @return {Object} This hook will return an object with two properties: |
| 1072 | * - results An array of collection items returned. |
| 1073 | * - isLoading A boolean indicating whether the collection is |
| 1074 | * loading (true) or not. |
| 1075 | */ |
| 1076 | |
| 1077 | const useCollection = options => { |
| 1078 | const { |
| 1079 | namespace, |
| 1080 | resourceName, |
| 1081 | resourceValues = [], |
| 1082 | query = {}, |
| 1083 | shouldSelect = true |
| 1084 | } = options; |
| 1085 | if (!namespace || !resourceName) { |
| 1086 | throw new Error('The options object must have valid values for the namespace and ' + 'the resource properties.'); |
| 1087 | } |
| 1088 | const currentResults = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)({ |
| 1089 | results: [], |
| 1090 | isLoading: true |
| 1091 | }); |
| 1092 | // ensure we feed the previous reference if it's equivalent |
| 1093 | const currentQuery = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__.useShallowEqual)(query); |
| 1094 | const currentResourceValues = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__.useShallowEqual)(resourceValues); |
| 1095 | const throwError = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_4__.useThrowError)(); |
| 1096 | const results = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => { |
| 1097 | if (!shouldSelect) { |
| 1098 | return null; |
| 1099 | } |
| 1100 | const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.COLLECTIONS_STORE_KEY); |
| 1101 | const args = [namespace, resourceName, currentQuery, currentResourceValues]; |
| 1102 | const error = store.getCollectionError(...args); |
| 1103 | if (error) { |
| 1104 | if ((0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_5__.isError)(error)) { |
| 1105 | throwError(error); |
| 1106 | } else { |
| 1107 | throw new Error('TypeError: `error` object is not an instance of Error constructor'); |
| 1108 | } |
| 1109 | } |
| 1110 | return { |
| 1111 | results: store.getCollection(...args), |
| 1112 | isLoading: !store.hasFinishedResolution('getCollection', args) |
| 1113 | }; |
| 1114 | }, [namespace, resourceName, currentResourceValues, currentQuery, shouldSelect]); |
| 1115 | // if selector was not bailed, then update current results. Otherwise return |
| 1116 | // previous results |
| 1117 | if (results !== null) { |
| 1118 | currentResults.current = results; |
| 1119 | } |
| 1120 | return currentResults.current; |
| 1121 | }; |
| 1122 | |
| 1123 | /***/ }), |
| 1124 | |
| 1125 | /***/ "./assets/js/base/context/hooks/use-query-state.js": |
| 1126 | /*!*********************************************************!*\ |
| 1127 | !*** ./assets/js/base/context/hooks/use-query-state.js ***! |
| 1128 | \*********************************************************/ |
| 1129 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1130 | |
| 1131 | "use strict"; |
| 1132 | __webpack_require__.r(__webpack_exports__); |
| 1133 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1134 | /* harmony export */ useQueryStateByContext: () => (/* binding */ useQueryStateByContext), |
| 1135 | /* harmony export */ useQueryStateByKey: () => (/* binding */ useQueryStateByKey), |
| 1136 | /* harmony export */ useSynchronizedQueryState: () => (/* binding */ useSynchronizedQueryState) |
| 1137 | /* harmony export */ }); |
| 1138 | /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data"); |
| 1139 | /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__); |
| 1140 | /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); |
| 1141 | /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); |
| 1142 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1143 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); |
| 1144 | /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal"); |
| 1145 | /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3__); |
| 1146 | /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-shallow-equal.ts"); |
| 1147 | /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-previous.ts"); |
| 1148 | /* harmony import */ var _providers_query_state_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../providers/query-state-context */ "./assets/js/base/context/providers/query-state-context.js"); |
| 1149 | /** |
| 1150 | * External dependencies |
| 1151 | */ |
| 1152 | |
| 1153 | |
| 1154 | |
| 1155 | |
| 1156 | |
| 1157 | |
| 1158 | /** |
| 1159 | * Internal dependencies |
| 1160 | */ |
| 1161 | |
| 1162 | |
| 1163 | |
| 1164 | /** |
| 1165 | * A custom hook that exposes the current query state and a setter for the query |
| 1166 | * state store for the given context. |
| 1167 | * |
| 1168 | * "Query State" is a wp.data store that keeps track of an arbitrary object of |
| 1169 | * query keys and their values. |
| 1170 | * |
| 1171 | * @param {string} [context] What context to retrieve the query state for. If not |
| 1172 | * provided, this hook will attempt to get the context |
| 1173 | * from the query state context provided by the |
| 1174 | * QueryStateContextProvider |
| 1175 | * |
| 1176 | * @return {Array} An array that has two elements. The first element is the |
| 1177 | * query state value for the given context. The second element |
| 1178 | * is a dispatcher function for setting the query state. |
| 1179 | */ |
| 1180 | const useQueryStateByContext = context => { |
| 1181 | const queryStateContext = (0,_providers_query_state_context__WEBPACK_IMPORTED_MODULE_4__.useQueryStateContext)(); |
| 1182 | context = context || queryStateContext; |
| 1183 | const queryState = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => { |
| 1184 | const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.QUERY_STATE_STORE_KEY); |
| 1185 | return store.getValueForQueryContext(context, undefined); |
| 1186 | }, [context]); |
| 1187 | const { |
| 1188 | setValueForQueryContext |
| 1189 | } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.QUERY_STATE_STORE_KEY); |
| 1190 | const setQueryState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(value => { |
| 1191 | setValueForQueryContext(context, value); |
| 1192 | }, [context, setValueForQueryContext]); |
| 1193 | return [queryState, setQueryState]; |
| 1194 | }; |
| 1195 | |
| 1196 | /** |
| 1197 | * A custom hook that exposes the current query state value and a setter for the |
| 1198 | * given context and query key. |
| 1199 | * |
| 1200 | * "Query State" is a wp.data store that keeps track of an arbitrary object of |
| 1201 | * query keys and their values. |
| 1202 | * |
| 1203 | * @param {*} queryKey The specific query key to retrieve the value for. |
| 1204 | * @param {*} [defaultValue] Default value if query does not exist. |
| 1205 | * @param {string} [context] What context to retrieve the query state for. If |
| 1206 | * not provided will attempt to use what is provided |
| 1207 | * by query state context. |
| 1208 | * |
| 1209 | * @return {*} Whatever value is set at the query state index using the |
| 1210 | * provided context and query key. |
| 1211 | */ |
| 1212 | const useQueryStateByKey = (queryKey, defaultValue, context) => { |
| 1213 | const queryStateContext = (0,_providers_query_state_context__WEBPACK_IMPORTED_MODULE_4__.useQueryStateContext)(); |
| 1214 | context = context || queryStateContext; |
| 1215 | const queryValue = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => { |
| 1216 | const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.QUERY_STATE_STORE_KEY); |
| 1217 | return store.getValueForQueryKey(context, queryKey, defaultValue); |
| 1218 | }, |
| 1219 | // eslint-disable-next-line react-hooks/exhaustive-deps |
| 1220 | [context, queryKey]); |
| 1221 | const { |
| 1222 | setQueryValue |
| 1223 | } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_0__.QUERY_STATE_STORE_KEY); |
| 1224 | const setQueryValueByKey = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(value => { |
| 1225 | setQueryValue(context, queryKey, value); |
| 1226 | }, [context, queryKey, setQueryValue]); |
| 1227 | return [queryValue, setQueryValueByKey]; |
| 1228 | }; |
| 1229 | |
| 1230 | /** |
| 1231 | * A custom hook that works similarly to useQueryStateByContext. However, this |
| 1232 | * hook allows for synchronizing with a provided queryState object. |
| 1233 | * |
| 1234 | * This hook does the following things with the provided `synchronizedQuery` |
| 1235 | * object: |
| 1236 | * |
| 1237 | * - whenever synchronizedQuery varies between renders, the queryState will be |
| 1238 | * updated to a merged object of the internal queryState and the provided |
| 1239 | * object. Note, any values from the same properties between objects will |
| 1240 | * be set from synchronizedQuery. |
| 1241 | * - if there are no changes between renders, then the existing internal |
| 1242 | * queryState is always returned. |
| 1243 | * - on initial render, the synchronizedQuery value is returned. |
| 1244 | * |
| 1245 | * Typically, this hook would be used in a scenario where there may be external |
| 1246 | * triggers for updating the query state (i.e. initial population of query |
| 1247 | * state by hydration or component attributes, or routing url changes that |
| 1248 | * affect query state). |
| 1249 | * |
| 1250 | * @param {Object} synchronizedQuery A provided query state object to |
| 1251 | * synchronize internal query state with. |
| 1252 | * @param {string} [context] What context to retrieve the query state |
| 1253 | * for. If not provided, will be pulled from |
| 1254 | * the QueryStateContextProvider in the tree. |
| 1255 | */ |
| 1256 | const useSynchronizedQueryState = (synchronizedQuery, context) => { |
| 1257 | const queryStateContext = (0,_providers_query_state_context__WEBPACK_IMPORTED_MODULE_4__.useQueryStateContext)(); |
| 1258 | context = context || queryStateContext; |
| 1259 | const [queryState, setQueryState] = useQueryStateByContext(context); |
| 1260 | const currentQueryState = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_5__.useShallowEqual)(queryState); |
| 1261 | const currentSynchronizedQuery = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_5__.useShallowEqual)(synchronizedQuery); |
| 1262 | const previousSynchronizedQuery = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_6__.usePrevious)(currentSynchronizedQuery); |
| 1263 | // used to ensure we allow initial synchronization to occur before |
| 1264 | // returning non-synced state. |
| 1265 | const isInitialized = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(false); |
| 1266 | // update queryState anytime incoming synchronizedQuery changes |
| 1267 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { |
| 1268 | if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3___default()(previousSynchronizedQuery, currentSynchronizedQuery)) { |
| 1269 | setQueryState(Object.assign({}, currentQueryState, currentSynchronizedQuery)); |
| 1270 | isInitialized.current = true; |
| 1271 | } |
| 1272 | }, [currentQueryState, currentSynchronizedQuery, previousSynchronizedQuery, setQueryState]); |
| 1273 | return isInitialized.current ? [queryState, setQueryState] : [synchronizedQuery, setQueryState]; |
| 1274 | }; |
| 1275 | |
| 1276 | /***/ }), |
| 1277 | |
| 1278 | /***/ "./assets/js/base/context/providers/query-state-context.js": |
| 1279 | /*!*****************************************************************!*\ |
| 1280 | !*** ./assets/js/base/context/providers/query-state-context.js ***! |
| 1281 | \*****************************************************************/ |
| 1282 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1283 | |
| 1284 | "use strict"; |
| 1285 | __webpack_require__.r(__webpack_exports__); |
| 1286 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1287 | /* harmony export */ QueryStateContextProvider: () => (/* binding */ QueryStateContextProvider), |
| 1288 | /* harmony export */ useQueryStateContext: () => (/* binding */ useQueryStateContext) |
| 1289 | /* harmony export */ }); |
| 1290 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1291 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
| 1292 | /** |
| 1293 | * External dependencies |
| 1294 | */ |
| 1295 | |
| 1296 | |
| 1297 | /** |
| 1298 | * Query state context is the index for used for a query state store. By |
| 1299 | * exposing this via context, it allows for all children blocks to be |
| 1300 | * synchronized to the same query state defined by the parent in the tree. |
| 1301 | * |
| 1302 | * Defaults to 'page' for general global query state shared among all blocks |
| 1303 | * in a view. |
| 1304 | * |
| 1305 | * @member {Object} QueryStateContext A react context object |
| 1306 | */ |
| 1307 | const QueryStateContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)('page'); |
| 1308 | const useQueryStateContext = () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(QueryStateContext); |
| 1309 | const QueryStateContextProvider = QueryStateContext.Provider; |
| 1310 | |
| 1311 | /***/ }), |
| 1312 | |
| 1313 | /***/ "./assets/js/base/hooks/use-previous.ts": |
| 1314 | /*!**********************************************!*\ |
| 1315 | !*** ./assets/js/base/hooks/use-previous.ts ***! |
| 1316 | \**********************************************/ |
| 1317 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1318 | |
| 1319 | "use strict"; |
| 1320 | __webpack_require__.r(__webpack_exports__); |
| 1321 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1322 | /* harmony export */ usePrevious: () => (/* binding */ usePrevious) |
| 1323 | /* harmony export */ }); |
| 1324 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1325 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
| 1326 | /** |
| 1327 | * External dependencies |
| 1328 | */ |
| 1329 | |
| 1330 | /** |
| 1331 | * Use Previous based on https://usehooks.com/useprevious/. |
| 1332 | * |
| 1333 | * @param {*} value |
| 1334 | * @param {Function} [validation] Function that needs to validate for the value |
| 1335 | * to be updated. |
| 1336 | */ |
| 1337 | function usePrevious(value, validation) { |
| 1338 | const ref = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); |
| 1339 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { |
| 1340 | if (ref.current !== value && (!validation || validation(value, ref.current))) { |
| 1341 | ref.current = value; |
| 1342 | } |
| 1343 | }, [value, validation]); |
| 1344 | return ref.current; |
| 1345 | } |
| 1346 | |
| 1347 | /***/ }), |
| 1348 | |
| 1349 | /***/ "./assets/js/base/hooks/use-shallow-equal.ts": |
| 1350 | /*!***************************************************!*\ |
| 1351 | !*** ./assets/js/base/hooks/use-shallow-equal.ts ***! |
| 1352 | \***************************************************/ |
| 1353 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1354 | |
| 1355 | "use strict"; |
| 1356 | __webpack_require__.r(__webpack_exports__); |
| 1357 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1358 | /* harmony export */ useShallowEqual: () => (/* binding */ useShallowEqual) |
| 1359 | /* harmony export */ }); |
| 1360 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1361 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
| 1362 | /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal"); |
| 1363 | /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1__); |
| 1364 | /** |
| 1365 | * External dependencies |
| 1366 | */ |
| 1367 | |
| 1368 | |
| 1369 | |
| 1370 | /** |
| 1371 | * A custom hook that compares the provided value across renders and returns the |
| 1372 | * previous instance if shallow equality with previous instance exists. |
| 1373 | * |
| 1374 | * This is particularly useful when non-primitive types are used as |
| 1375 | * dependencies for react hooks. |
| 1376 | * |
| 1377 | * @param {*} value Value to keep the same if satisfies shallow equality. |
| 1378 | * |
| 1379 | * @return {*} The previous cached instance of the value if the current has shallow equality with it. |
| 1380 | */ |
| 1381 | function useShallowEqual(value) { |
| 1382 | const ref = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(value); |
| 1383 | if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1___default()(value, ref.current)) { |
| 1384 | ref.current = value; |
| 1385 | } |
| 1386 | return ref.current; |
| 1387 | } |
| 1388 | |
| 1389 | /***/ }), |
| 1390 | |
| 1391 | /***/ "./assets/js/base/hooks/use-style-props.ts": |
| 1392 | /*!*************************************************!*\ |
| 1393 | !*** ./assets/js/base/hooks/use-style-props.ts ***! |
| 1394 | \*************************************************/ |
| 1395 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1396 | |
| 1397 | "use strict"; |
| 1398 | __webpack_require__.r(__webpack_exports__); |
| 1399 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1400 | /* harmony export */ useStyleProps: () => (/* binding */ useStyleProps) |
| 1401 | /* harmony export */ }); |
| 1402 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 1403 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); |
| 1404 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts"); |
| 1405 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts"); |
| 1406 | /* harmony import */ var _use_typography_props__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use-typography-props */ "./assets/js/base/hooks/use-typography-props.ts"); |
| 1407 | /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./assets/js/base/utils/get-inline-styles.ts"); |
| 1408 | /** |
| 1409 | * External dependencies |
| 1410 | */ |
| 1411 | |
| 1412 | |
| 1413 | /** |
| 1414 | * Internal dependencies |
| 1415 | */ |
| 1416 | |
| 1417 | |
| 1418 | /** |
| 1419 | * Parses incoming props. |
| 1420 | * |
| 1421 | * This may include style properties at the top level, or may include a nested `style` object. This ensures the expected |
| 1422 | * values are present and converts any string based values to objects as required. |
| 1423 | */ |
| 1424 | const parseStyleAttributes = rawProps => { |
| 1425 | const props = (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_1__.isObject)(rawProps) ? rawProps : { |
| 1426 | style: {} |
| 1427 | }; |
| 1428 | let style = props.style; |
| 1429 | if ((0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_2__.isString)(style)) { |
| 1430 | style = JSON.parse(style) || {}; |
| 1431 | } |
| 1432 | if (!(0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_1__.isObject)(style)) { |
| 1433 | style = {}; |
| 1434 | } |
| 1435 | return { |
| 1436 | ...props, |
| 1437 | style |
| 1438 | }; |
| 1439 | }; |
| 1440 | |
| 1441 | /** |
| 1442 | * Returns the CSS class names and inline styles for a block when provided with its props/attributes. |
| 1443 | * |
| 1444 | * This hook (and its utilities) borrow functionality from the Gutenberg Block Editor package--something we don't want |
| 1445 | * to import on the frontend. |
| 1446 | */ |
| 1447 | const useStyleProps = props => { |
| 1448 | const styleAttributes = parseStyleAttributes(props); |
| 1449 | const colorProps = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getColorClassesAndStyles)(styleAttributes); |
| 1450 | const borderProps = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getBorderClassesAndStyles)(styleAttributes); |
| 1451 | const spacingProps = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getSpacingClassesAndStyles)(styleAttributes); |
| 1452 | const typographyProps = (0,_use_typography_props__WEBPACK_IMPORTED_MODULE_4__.useTypographyProps)(styleAttributes); |
| 1453 | return { |
| 1454 | className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(typographyProps.className, colorProps.className, borderProps.className, spacingProps.className), |
| 1455 | style: { |
| 1456 | ...typographyProps.style, |
| 1457 | ...colorProps.style, |
| 1458 | ...borderProps.style, |
| 1459 | ...spacingProps.style |
| 1460 | } |
| 1461 | }; |
| 1462 | }; |
| 1463 | |
| 1464 | /***/ }), |
| 1465 | |
| 1466 | /***/ "./assets/js/base/hooks/use-throw-error.ts": |
| 1467 | /*!*************************************************!*\ |
| 1468 | !*** ./assets/js/base/hooks/use-throw-error.ts ***! |
| 1469 | \*************************************************/ |
| 1470 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1471 | |
| 1472 | "use strict"; |
| 1473 | __webpack_require__.r(__webpack_exports__); |
| 1474 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1475 | /* harmony export */ useThrowError: () => (/* binding */ useThrowError) |
| 1476 | /* harmony export */ }); |
| 1477 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1478 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
| 1479 | /** |
| 1480 | * External dependencies |
| 1481 | */ |
| 1482 | |
| 1483 | |
| 1484 | /** |
| 1485 | * Helper method for throwing an error in a React Hook. |
| 1486 | * |
| 1487 | * @see https://github.com/facebook/react/issues/14981 |
| 1488 | */ |
| 1489 | const useThrowError = () => { |
| 1490 | const [, setState] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(); |
| 1491 | return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(error => { |
| 1492 | setState(() => { |
| 1493 | throw error; |
| 1494 | }); |
| 1495 | }, []); |
| 1496 | }; |
| 1497 | |
| 1498 | /***/ }), |
| 1499 | |
| 1500 | /***/ "./assets/js/base/hooks/use-typography-props.ts": |
| 1501 | /*!******************************************************!*\ |
| 1502 | !*** ./assets/js/base/hooks/use-typography-props.ts ***! |
| 1503 | \******************************************************/ |
| 1504 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1505 | |
| 1506 | "use strict"; |
| 1507 | __webpack_require__.r(__webpack_exports__); |
| 1508 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1509 | /* harmony export */ useTypographyProps: () => (/* binding */ useTypographyProps) |
| 1510 | /* harmony export */ }); |
| 1511 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts"); |
| 1512 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts"); |
| 1513 | /** |
| 1514 | * External dependencies |
| 1515 | */ |
| 1516 | |
| 1517 | |
| 1518 | /** |
| 1519 | * Internal dependencies |
| 1520 | */ |
| 1521 | |
| 1522 | const useTypographyProps = props => { |
| 1523 | const typography = (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.isObject)(props.style.typography) ? props.style.typography : {}; |
| 1524 | const classNameFallback = (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_1__.isString)(typography.fontFamily) ? typography.fontFamily : ''; |
| 1525 | const className = props.fontFamily ? `has-${props.fontFamily}-font-family` : classNameFallback; |
| 1526 | return { |
| 1527 | className, |
| 1528 | style: { |
| 1529 | fontSize: props.fontSize ? `var(--wp--preset--font-size--${props.fontSize})` : typography.fontSize, |
| 1530 | fontStyle: typography.fontStyle, |
| 1531 | fontWeight: typography.fontWeight, |
| 1532 | letterSpacing: typography.letterSpacing, |
| 1533 | lineHeight: typography.lineHeight, |
| 1534 | textDecoration: typography.textDecoration, |
| 1535 | textTransform: typography.textTransform |
| 1536 | } |
| 1537 | }; |
| 1538 | }; |
| 1539 | |
| 1540 | /***/ }), |
| 1541 | |
| 1542 | /***/ "./assets/js/base/utils/get-inline-styles.ts": |
| 1543 | /*!***************************************************!*\ |
| 1544 | !*** ./assets/js/base/utils/get-inline-styles.ts ***! |
| 1545 | \***************************************************/ |
| 1546 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1547 | |
| 1548 | "use strict"; |
| 1549 | __webpack_require__.r(__webpack_exports__); |
| 1550 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1551 | /* harmony export */ getBorderClassesAndStyles: () => (/* binding */ getBorderClassesAndStyles), |
| 1552 | /* harmony export */ getColorClassesAndStyles: () => (/* binding */ getColorClassesAndStyles), |
| 1553 | /* harmony export */ getSpacingClassesAndStyles: () => (/* binding */ getSpacingClassesAndStyles) |
| 1554 | /* harmony export */ }); |
| 1555 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 1556 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); |
| 1557 | /* harmony import */ var change_case__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! change-case */ "../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js"); |
| 1558 | /* harmony import */ var _wordpress_style_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/style-engine */ "@wordpress/style-engine"); |
| 1559 | /* harmony import */ var _wordpress_style_engine__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_style_engine__WEBPACK_IMPORTED_MODULE_1__); |
| 1560 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts"); |
| 1561 | /** |
| 1562 | * External dependencies |
| 1563 | */ |
| 1564 | |
| 1565 | |
| 1566 | |
| 1567 | |
| 1568 | /** |
| 1569 | * Returns the inline styles to add depending on the style object |
| 1570 | * |
| 1571 | * @param {Object} styles Styles configuration. |
| 1572 | * @return {Object} Flattened CSS variables declaration. |
| 1573 | */ |
| 1574 | function getInlineStyles(styles = {}) { |
| 1575 | const output = {}; |
| 1576 | (0,_wordpress_style_engine__WEBPACK_IMPORTED_MODULE_1__.getCSSRules)(styles, { |
| 1577 | selector: '' |
| 1578 | }).forEach(rule => { |
| 1579 | output[rule.key] = rule.value; |
| 1580 | }); |
| 1581 | return output; |
| 1582 | } |
| 1583 | |
| 1584 | /** |
| 1585 | * Get the classname for a given color. |
| 1586 | */ |
| 1587 | function getColorClassName(colorContextName, colorSlug) { |
| 1588 | if (!colorContextName || !colorSlug) { |
| 1589 | return ''; |
| 1590 | } |
| 1591 | return `has-${(0,change_case__WEBPACK_IMPORTED_MODULE_2__.paramCase)(colorSlug)}-${colorContextName}`; |
| 1592 | } |
| 1593 | |
| 1594 | /** |
| 1595 | * Generates a CSS class name consisting of all the applicable border color |
| 1596 | * classes given the current block attributes. |
| 1597 | */ |
| 1598 | function getBorderClassName(attributes) { |
| 1599 | var _style$border; |
| 1600 | const { |
| 1601 | borderColor, |
| 1602 | style |
| 1603 | } = attributes; |
| 1604 | const borderColorClass = borderColor ? getColorClassName('border-color', borderColor) : ''; |
| 1605 | return classnames__WEBPACK_IMPORTED_MODULE_0___default()({ |
| 1606 | 'has-border-color': !!borderColor || !!(style !== null && style !== void 0 && (_style$border = style.border) !== null && _style$border !== void 0 && _style$border.color), |
| 1607 | [borderColorClass]: !!borderColorClass |
| 1608 | }); |
| 1609 | } |
| 1610 | function getGradientClassName(gradientSlug) { |
| 1611 | if (!gradientSlug) { |
| 1612 | return undefined; |
| 1613 | } |
| 1614 | return `has-${gradientSlug}-gradient-background`; |
| 1615 | } |
| 1616 | |
| 1617 | /** |
| 1618 | * Provides the CSS class names and inline styles for a block's color support |
| 1619 | * attributes. |
| 1620 | */ |
| 1621 | function getColorClassesAndStyles(props) { |
| 1622 | var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements2, _style$elements2$link; |
| 1623 | const { |
| 1624 | backgroundColor, |
| 1625 | textColor, |
| 1626 | gradient, |
| 1627 | style |
| 1628 | } = props; |
| 1629 | |
| 1630 | // Collect color CSS classes. |
| 1631 | const backgroundClass = getColorClassName('background-color', backgroundColor); |
| 1632 | const textClass = getColorClassName('color', textColor); |
| 1633 | const gradientClass = getGradientClassName(gradient); |
| 1634 | const hasGradient = gradientClass || (style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.gradient); |
| 1635 | |
| 1636 | // Determine color CSS class name list. |
| 1637 | const className = classnames__WEBPACK_IMPORTED_MODULE_0___default()(textClass, gradientClass, { |
| 1638 | // Don't apply the background class if there's a gradient. |
| 1639 | [backgroundClass]: !hasGradient && !!backgroundClass, |
| 1640 | 'has-text-color': textColor || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.text), |
| 1641 | 'has-background': backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.background) || gradient || (style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.gradient), |
| 1642 | 'has-link-color': (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_3__.isObject)(style === null || style === void 0 ? void 0 : (_style$elements = style.elements) === null || _style$elements === void 0 ? void 0 : _style$elements.link) ? style === null || style === void 0 ? void 0 : (_style$elements2 = style.elements) === null || _style$elements2 === void 0 ? void 0 : (_style$elements2$link = _style$elements2.link) === null || _style$elements2$link === void 0 ? void 0 : _style$elements2$link.color : undefined |
| 1643 | }); |
| 1644 | |
| 1645 | // Collect inline styles for colors. |
| 1646 | const colorStyles = (style === null || style === void 0 ? void 0 : style.color) || {}; |
| 1647 | return { |
| 1648 | className, |
| 1649 | style: getInlineStyles({ |
| 1650 | color: colorStyles |
| 1651 | }) |
| 1652 | }; |
| 1653 | } |
| 1654 | |
| 1655 | /** |
| 1656 | * Provides the CSS class names and inline styles for a block's border support |
| 1657 | * attributes. |
| 1658 | */ |
| 1659 | function getBorderClassesAndStyles(props) { |
| 1660 | var _props$style; |
| 1661 | const border = ((_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.border) || {}; |
| 1662 | const className = getBorderClassName(props); |
| 1663 | return { |
| 1664 | className, |
| 1665 | style: getInlineStyles({ |
| 1666 | border |
| 1667 | }) |
| 1668 | }; |
| 1669 | } |
| 1670 | |
| 1671 | /** |
| 1672 | * Provides the CSS class names and inline styles for a block's spacing support |
| 1673 | * attributes. |
| 1674 | */ |
| 1675 | function getSpacingClassesAndStyles(props) { |
| 1676 | var _props$style2; |
| 1677 | const spacingStyles = ((_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.spacing) || {}; |
| 1678 | const styleProp = getInlineStyles({ |
| 1679 | spacing: spacingStyles |
| 1680 | }); |
| 1681 | return { |
| 1682 | className: undefined, |
| 1683 | style: styleProp |
| 1684 | }; |
| 1685 | } |
| 1686 | |
| 1687 | /***/ }), |
| 1688 | |
| 1689 | /***/ "./assets/js/blocks/price-filter/block-wrapper.tsx": |
| 1690 | /*!*********************************************************!*\ |
| 1691 | !*** ./assets/js/blocks/price-filter/block-wrapper.tsx ***! |
| 1692 | \*********************************************************/ |
| 1693 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1694 | |
| 1695 | "use strict"; |
| 1696 | __webpack_require__.r(__webpack_exports__); |
| 1697 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1698 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1699 | /* harmony export */ }); |
| 1700 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1701 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1702 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 1703 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); |
| 1704 | /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-style-props.ts"); |
| 1705 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts"); |
| 1706 | /* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./block */ "./assets/js/blocks/price-filter/block.tsx"); |
| 1707 | /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./assets/js/blocks/price-filter/utils.ts"); |
| 1708 | |
| 1709 | /** |
| 1710 | * External dependencies |
| 1711 | */ |
| 1712 | |
| 1713 | |
| 1714 | |
| 1715 | |
| 1716 | /** |
| 1717 | * Internal dependencies |
| 1718 | */ |
| 1719 | |
| 1720 | |
| 1721 | const BlockWrapper = props => { |
| 1722 | const styleProps = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_2__.useStyleProps)(props); |
| 1723 | const parsedBlockAttributes = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.parseAttributes)(props); |
| 1724 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1725 | className: classnames__WEBPACK_IMPORTED_MODULE_1___default()((0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_4__.isString)(props.className) ? props.className : '', styleProps.className), |
| 1726 | style: styleProps.style |
| 1727 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_block__WEBPACK_IMPORTED_MODULE_5__["default"], { |
| 1728 | isEditor: false, |
| 1729 | attributes: parsedBlockAttributes |
| 1730 | })); |
| 1731 | }; |
| 1732 | BlockWrapper.__docgenInfo = { |
| 1733 | "description": "", |
| 1734 | "methods": [], |
| 1735 | "displayName": "BlockWrapper" |
| 1736 | }; |
| 1737 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockWrapper); |
| 1738 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 1739 | STORYBOOK_REACT_CLASSES["assets/js/blocks/price-filter/block-wrapper.tsx"] = { |
| 1740 | name: "BlockWrapper", |
| 1741 | docgenInfo: BlockWrapper.__docgenInfo, |
| 1742 | path: "assets/js/blocks/price-filter/block-wrapper.tsx" |
| 1743 | }; |
| 1744 | } |
| 1745 | |
| 1746 | /***/ }), |
| 1747 | |
| 1748 | /***/ "./assets/js/blocks/price-filter/block.tsx": |
| 1749 | /*!*************************************************!*\ |
| 1750 | !*** ./assets/js/blocks/price-filter/block.tsx ***! |
| 1751 | \*************************************************/ |
| 1752 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1753 | |
| 1754 | "use strict"; |
| 1755 | __webpack_require__.r(__webpack_exports__); |
| 1756 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1757 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1758 | /* harmony export */ }); |
| 1759 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1760 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1761 | /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-previous.ts"); |
| 1762 | /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/use-query-state.js"); |
| 1763 | /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/collections/use-collection-data.ts"); |
| 1764 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1765 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); |
| 1766 | /* harmony import */ var _woocommerce_base_components_price_slider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/base-components/price-slider */ "./assets/js/base/components/price-slider/index.tsx"); |
| 1767 | /* harmony import */ var _woocommerce_base_components_filter_placeholder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-components/filter-placeholder */ "./assets/js/base/components/filter-placeholder/index.tsx"); |
| 1768 | /* harmony import */ var use_debounce__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! use-debounce */ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js"); |
| 1769 | /* harmony import */ var _woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/price-format */ "@woocommerce/price-format"); |
| 1770 | /* harmony import */ var _woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__); |
| 1771 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 1772 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_5__); |
| 1773 | /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); |
| 1774 | /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_6__); |
| 1775 | /* harmony import */ var _woocommerce_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @woocommerce/utils */ "./assets/js/utils/filters.ts"); |
| 1776 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/boolean.ts"); |
| 1777 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts"); |
| 1778 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts"); |
| 1779 | /* harmony import */ var _use_price_constraints__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./use-price-constraints */ "./assets/js/blocks/price-filter/use-price-constraints.ts"); |
| 1780 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./style.scss */ "./assets/js/blocks/price-filter/style.scss"); |
| 1781 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_7__); |
| 1782 | /* harmony import */ var _filter_wrapper_context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../filter-wrapper/context */ "./assets/js/blocks/filter-wrapper/context.ts"); |
| 1783 | |
| 1784 | /** |
| 1785 | * External dependencies |
| 1786 | */ |
| 1787 | |
| 1788 | |
| 1789 | |
| 1790 | |
| 1791 | |
| 1792 | |
| 1793 | |
| 1794 | |
| 1795 | |
| 1796 | |
| 1797 | |
| 1798 | |
| 1799 | /** |
| 1800 | * Internal dependencies |
| 1801 | */ |
| 1802 | |
| 1803 | |
| 1804 | |
| 1805 | |
| 1806 | /** |
| 1807 | * Formats filter values into a string for the URL parameters needed for filtering PHP templates. |
| 1808 | * |
| 1809 | * @param {string} url Current page URL. |
| 1810 | * @param {Object} params Parameters and their constraints. |
| 1811 | * |
| 1812 | * @return {string} New URL with query parameters in it. |
| 1813 | */ |
| 1814 | function formatParams(url, params) { |
| 1815 | const paramObject = {}; |
| 1816 | for (const [key, value] of Object.entries(params)) { |
| 1817 | if (value) { |
| 1818 | paramObject[key] = value.toString(); |
| 1819 | } else { |
| 1820 | delete paramObject[key]; |
| 1821 | } |
| 1822 | } |
| 1823 | |
| 1824 | // Clean the URL before we add our new query parameters to it. |
| 1825 | const cleanUrl = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_6__.removeQueryArgs)(url, ...Object.keys(params)); |
| 1826 | return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_6__.addQueryArgs)(cleanUrl, paramObject); |
| 1827 | } |
| 1828 | |
| 1829 | /** |
| 1830 | * Formats price values taking into account precision |
| 1831 | * |
| 1832 | * @param {string|void} value |
| 1833 | * @param {number} minorUnit |
| 1834 | * |
| 1835 | * @return {number} Formatted price. |
| 1836 | */ |
| 1837 | |
| 1838 | function formatPrice(value, minorUnit) { |
| 1839 | return Number(value) * 10 ** minorUnit; |
| 1840 | } |
| 1841 | /** |
| 1842 | * Component displaying a price filter. |
| 1843 | * |
| 1844 | * @param {Object} props Component props. |
| 1845 | * @param {Object} props.attributes Incoming block attributes. |
| 1846 | * @param {boolean} props.isEditor Whether the component is being rendered in the editor. |
| 1847 | */ |
| 1848 | const PriceFilterBlock = ({ |
| 1849 | attributes, |
| 1850 | isEditor = false |
| 1851 | }) => { |
| 1852 | const setWrapperVisibility = (0,_filter_wrapper_context__WEBPACK_IMPORTED_MODULE_8__.useSetWraperVisibility)(); |
| 1853 | const hasFilterableProducts = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_5__.getSettingWithCoercion)('hasFilterableProducts', false, _woocommerce_types__WEBPACK_IMPORTED_MODULE_9__.isBoolean); |
| 1854 | const filteringForPhpTemplate = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_5__.getSettingWithCoercion)('isRenderingPhpTemplate', false, _woocommerce_types__WEBPACK_IMPORTED_MODULE_9__.isBoolean); |
| 1855 | const [hasSetFilterDefaultsFromUrl, setHasSetFilterDefaultsFromUrl] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false); |
| 1856 | const minPriceParam = (0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_10__.getUrlParameter)('min_price'); |
| 1857 | const maxPriceParam = (0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_10__.getUrlParameter)('max_price'); |
| 1858 | const [queryState] = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_11__.useQueryStateByContext)(); |
| 1859 | const { |
| 1860 | results, |
| 1861 | isLoading |
| 1862 | } = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_12__.useCollectionData)({ |
| 1863 | queryPrices: true, |
| 1864 | queryState, |
| 1865 | isEditor |
| 1866 | }); |
| 1867 | const currency = (0,_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__.getCurrencyFromPriceResponse)((0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_13__.objectHasProp)(results, 'price_range') ? results.price_range : undefined); |
| 1868 | const [minPriceQuery, setMinPriceQuery] = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_11__.useQueryStateByKey)('min_price'); |
| 1869 | const [maxPriceQuery, setMaxPriceQuery] = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_11__.useQueryStateByKey)('max_price'); |
| 1870 | const [minPrice, setMinPrice] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(formatPrice(minPriceParam, currency.minorUnit) || null); |
| 1871 | const [maxPrice, setMaxPrice] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(formatPrice(maxPriceParam, currency.minorUnit) || null); |
| 1872 | const { |
| 1873 | minConstraint, |
| 1874 | maxConstraint |
| 1875 | } = (0,_use_price_constraints__WEBPACK_IMPORTED_MODULE_14__["default"])({ |
| 1876 | minPrice: (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_13__.objectHasProp)(results, 'price_range') && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_13__.objectHasProp)(results.price_range, 'min_price') && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_15__.isString)(results.price_range.min_price) ? results.price_range.min_price : undefined, |
| 1877 | maxPrice: (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_13__.objectHasProp)(results, 'price_range') && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_13__.objectHasProp)(results.price_range, 'max_price') && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_15__.isString)(results.price_range.max_price) ? results.price_range.max_price : undefined, |
| 1878 | minorUnit: currency.minorUnit |
| 1879 | }); |
| 1880 | |
| 1881 | /** |
| 1882 | * Try get the min and/or max price from the URL. |
| 1883 | */ |
| 1884 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { |
| 1885 | if (!hasSetFilterDefaultsFromUrl) { |
| 1886 | setMinPriceQuery(formatPrice(minPriceParam, currency.minorUnit)); |
| 1887 | setMaxPriceQuery(formatPrice(maxPriceParam, currency.minorUnit)); |
| 1888 | setHasSetFilterDefaultsFromUrl(true); |
| 1889 | } |
| 1890 | }, [currency.minorUnit, hasSetFilterDefaultsFromUrl, maxPriceParam, minPriceParam, setMaxPriceQuery, setMinPriceQuery]); |
| 1891 | const [isUpdating, setIsUpdating] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(isLoading); |
| 1892 | |
| 1893 | // Updates the query based on slider values. |
| 1894 | const onSubmit = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((newMinPrice, newMaxPrice) => { |
| 1895 | const finalMaxPrice = newMaxPrice >= Number(maxConstraint) ? undefined : newMaxPrice; |
| 1896 | const finalMinPrice = newMinPrice <= Number(minConstraint) ? undefined : newMinPrice; |
| 1897 | if (window) { |
| 1898 | const newUrl = formatParams(window.location.href, { |
| 1899 | min_price: finalMinPrice / 10 ** currency.minorUnit, |
| 1900 | max_price: finalMaxPrice / 10 ** currency.minorUnit |
| 1901 | }); |
| 1902 | |
| 1903 | // If the params have changed, lets update the filter URL. |
| 1904 | if (window.location.href !== newUrl) { |
| 1905 | (0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_10__.changeUrl)(newUrl); |
| 1906 | } |
| 1907 | } |
| 1908 | setMinPriceQuery(finalMinPrice); |
| 1909 | setMaxPriceQuery(finalMaxPrice); |
| 1910 | }, [minConstraint, maxConstraint, setMinPriceQuery, setMaxPriceQuery, currency.minorUnit]); |
| 1911 | |
| 1912 | // Updates the query after a short delay. |
| 1913 | const debouncedUpdateQuery = (0,use_debounce__WEBPACK_IMPORTED_MODULE_16__.useDebouncedCallback)(onSubmit, 500); |
| 1914 | |
| 1915 | // Callback when slider or input fields are changed. |
| 1916 | const onChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(prices => { |
| 1917 | setIsUpdating(true); |
| 1918 | if (prices[0] !== minPrice) { |
| 1919 | setMinPrice(prices[0]); |
| 1920 | } |
| 1921 | if (prices[1] !== maxPrice) { |
| 1922 | setMaxPrice(prices[1]); |
| 1923 | } |
| 1924 | if (filteringForPhpTemplate && hasSetFilterDefaultsFromUrl && !attributes.showFilterButton) { |
| 1925 | debouncedUpdateQuery(prices[0], prices[1]); |
| 1926 | } |
| 1927 | }, [minPrice, maxPrice, setMinPrice, setMaxPrice, filteringForPhpTemplate, hasSetFilterDefaultsFromUrl, debouncedUpdateQuery, attributes.showFilterButton]); |
| 1928 | |
| 1929 | // Track price STATE changes - if state changes, update the query. |
| 1930 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { |
| 1931 | if (!attributes.showFilterButton && !filteringForPhpTemplate) { |
| 1932 | debouncedUpdateQuery(minPrice, maxPrice); |
| 1933 | } |
| 1934 | }, [minPrice, maxPrice, attributes.showFilterButton, debouncedUpdateQuery, filteringForPhpTemplate]); |
| 1935 | |
| 1936 | // Track price query/price constraint changes so the slider reflects current filters. |
| 1937 | const previousMinPriceQuery = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_17__.usePrevious)(minPriceQuery); |
| 1938 | const previousMaxPriceQuery = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_17__.usePrevious)(maxPriceQuery); |
| 1939 | const previousMinConstraint = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_17__.usePrevious)(minConstraint); |
| 1940 | const previousMaxConstraint = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_17__.usePrevious)(maxConstraint); |
| 1941 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { |
| 1942 | if (!Number.isFinite(minPrice) || minPriceQuery !== previousMinPriceQuery && |
| 1943 | // minPrice from query changed |
| 1944 | minPriceQuery !== minPrice || |
| 1945 | // minPrice from query doesn't match the UI min price |
| 1946 | minConstraint !== previousMinConstraint && |
| 1947 | // minPrice from query changed |
| 1948 | minConstraint !== minPrice // minPrice from query doesn't match the UI min price |
| 1949 | ) { |
| 1950 | setMinPrice(Number.isFinite(minPriceQuery) ? minPriceQuery : minConstraint); |
| 1951 | } |
| 1952 | if (!Number.isFinite(maxPrice) || maxPriceQuery !== previousMaxPriceQuery && |
| 1953 | // maxPrice from query changed |
| 1954 | maxPriceQuery !== maxPrice || |
| 1955 | // maxPrice from query doesn't match the UI max price |
| 1956 | maxConstraint !== previousMaxConstraint && |
| 1957 | // maxPrice from query changed |
| 1958 | maxConstraint !== maxPrice // maxPrice from query doesn't match the UI max price |
| 1959 | ) { |
| 1960 | setMaxPrice(Number.isFinite(maxPriceQuery) ? maxPriceQuery : maxConstraint); |
| 1961 | } |
| 1962 | }, [minPrice, maxPrice, minPriceQuery, maxPriceQuery, minConstraint, maxConstraint, previousMinConstraint, previousMaxConstraint, previousMinPriceQuery, previousMaxPriceQuery]); |
| 1963 | if (!hasFilterableProducts) { |
| 1964 | setWrapperVisibility(false); |
| 1965 | return null; |
| 1966 | } |
| 1967 | if (!isLoading && (minConstraint === null || maxConstraint === null || minConstraint === maxConstraint)) { |
| 1968 | setWrapperVisibility(false); |
| 1969 | return null; |
| 1970 | } |
| 1971 | const TagName = `h${attributes.headingLevel}`; |
| 1972 | setWrapperVisibility(true); |
| 1973 | if (!isLoading && isUpdating) { |
| 1974 | setIsUpdating(false); |
| 1975 | } |
| 1976 | const heading = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, { |
| 1977 | className: "wc-block-price-filter__title" |
| 1978 | }, attributes.heading); |
| 1979 | const filterHeading = isLoading && isUpdating ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_filter_placeholder__WEBPACK_IMPORTED_MODULE_3__["default"], null, heading) : heading; |
| 1980 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !isEditor && attributes.heading && filterHeading, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1981 | className: "wc-block-price-slider" |
| 1982 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_price_slider__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 1983 | minConstraint: minConstraint, |
| 1984 | maxConstraint: maxConstraint, |
| 1985 | minPrice: minPrice, |
| 1986 | maxPrice: maxPrice, |
| 1987 | currency: currency, |
| 1988 | showInputFields: attributes.showInputFields, |
| 1989 | inlineInput: attributes.inlineInput, |
| 1990 | showFilterButton: attributes.showFilterButton, |
| 1991 | onChange: onChange, |
| 1992 | onSubmit: () => onSubmit(minPrice, maxPrice), |
| 1993 | isLoading: isLoading, |
| 1994 | isUpdating: isUpdating, |
| 1995 | isEditor: isEditor |
| 1996 | }))); |
| 1997 | }; |
| 1998 | PriceFilterBlock.__docgenInfo = { |
| 1999 | "description": "Component displaying a price filter.\n\n@param {Object} props Component props.\n@param {Object} props.attributes Incoming block attributes.\n@param {boolean} props.isEditor Whether the component is being rendered in the editor.", |
| 2000 | "methods": [], |
| 2001 | "displayName": "PriceFilterBlock", |
| 2002 | "props": { |
| 2003 | "isEditor": { |
| 2004 | "defaultValue": { |
| 2005 | "value": "false", |
| 2006 | "computed": false |
| 2007 | }, |
| 2008 | "required": false, |
| 2009 | "tsType": { |
| 2010 | "name": "boolean" |
| 2011 | }, |
| 2012 | "description": "Whether it's in the editor or frontend display." |
| 2013 | }, |
| 2014 | "attributes": { |
| 2015 | "required": true, |
| 2016 | "tsType": { |
| 2017 | "name": "Attributes" |
| 2018 | }, |
| 2019 | "description": "The attributes for this block." |
| 2020 | } |
| 2021 | } |
| 2022 | }; |
| 2023 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PriceFilterBlock); |
| 2024 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 2025 | STORYBOOK_REACT_CLASSES["assets/js/blocks/price-filter/block.tsx"] = { |
| 2026 | name: "PriceFilterBlock", |
| 2027 | docgenInfo: PriceFilterBlock.__docgenInfo, |
| 2028 | path: "assets/js/blocks/price-filter/block.tsx" |
| 2029 | }; |
| 2030 | } |
| 2031 | |
| 2032 | /***/ }), |
| 2033 | |
| 2034 | /***/ "./assets/js/blocks/price-filter/constants.ts": |
| 2035 | /*!****************************************************!*\ |
| 2036 | !*** ./assets/js/blocks/price-filter/constants.ts ***! |
| 2037 | \****************************************************/ |
| 2038 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2039 | |
| 2040 | "use strict"; |
| 2041 | __webpack_require__.r(__webpack_exports__); |
| 2042 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2043 | /* harmony export */ ROUND_DOWN: () => (/* binding */ ROUND_DOWN), |
| 2044 | /* harmony export */ ROUND_UP: () => (/* binding */ ROUND_UP) |
| 2045 | /* harmony export */ }); |
| 2046 | const ROUND_UP = 'ROUND_UP'; |
| 2047 | const ROUND_DOWN = 'ROUND_DOWN'; |
| 2048 | |
| 2049 | /***/ }), |
| 2050 | |
| 2051 | /***/ "./assets/js/blocks/price-filter/use-price-constraints.ts": |
| 2052 | /*!****************************************************************!*\ |
| 2053 | !*** ./assets/js/blocks/price-filter/use-price-constraints.ts ***! |
| 2054 | \****************************************************************/ |
| 2055 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2056 | |
| 2057 | "use strict"; |
| 2058 | __webpack_require__.r(__webpack_exports__); |
| 2059 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2060 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), |
| 2061 | /* harmony export */ usePriceConstraint: () => (/* binding */ usePriceConstraint) |
| 2062 | /* harmony export */ }); |
| 2063 | /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-previous.ts"); |
| 2064 | /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/price-filter/constants.ts"); |
| 2065 | /** |
| 2066 | * External dependencies |
| 2067 | */ |
| 2068 | |
| 2069 | |
| 2070 | /** |
| 2071 | * Internal dependencies |
| 2072 | */ |
| 2073 | |
| 2074 | |
| 2075 | /** |
| 2076 | * Return the price constraint. |
| 2077 | * |
| 2078 | * @param {string} price Price in minor unit, e.g. cents. |
| 2079 | * @param {number} minorUnit Price minor unit (number of digits after the decimal separator). |
| 2080 | * @param {ROUND_UP|ROUND_DOWN} direction Rounding flag whether we round up or down. |
| 2081 | */ |
| 2082 | const usePriceConstraint = (price, minorUnit, direction) => { |
| 2083 | const step = 10 * 10 ** minorUnit; |
| 2084 | let currentConstraint = null; |
| 2085 | const parsedPrice = parseFloat(price); |
| 2086 | if (!isNaN(parsedPrice)) { |
| 2087 | if (direction === _constants__WEBPACK_IMPORTED_MODULE_0__.ROUND_UP) { |
| 2088 | currentConstraint = Math.ceil(parsedPrice / step) * step; |
| 2089 | } else if (direction === _constants__WEBPACK_IMPORTED_MODULE_0__.ROUND_DOWN) { |
| 2090 | currentConstraint = Math.floor(parsedPrice / step) * step; |
| 2091 | } |
| 2092 | } |
| 2093 | const previousConstraint = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_1__.usePrevious)(currentConstraint, Number.isFinite); |
| 2094 | return Number.isFinite(currentConstraint) ? currentConstraint : previousConstraint; |
| 2095 | }; |
| 2096 | |
| 2097 | /** |
| 2098 | * Return the min and max price constraints. |
| 2099 | * |
| 2100 | * @param {Object} priceData Price data object. |
| 2101 | * @param {string|undefined} priceData.minPrice Min price in minor unit, e.g. cents. |
| 2102 | * @param {string|undefined} priceData.maxPrice Max price in minor unit, e.g. cents. |
| 2103 | * @param {number} priceData.minorUnit Price minor unit (number of digits after the decimal separator). |
| 2104 | */ |
| 2105 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (({ |
| 2106 | minPrice, |
| 2107 | maxPrice, |
| 2108 | minorUnit |
| 2109 | }) => { |
| 2110 | return { |
| 2111 | minConstraint: usePriceConstraint(minPrice || '', minorUnit, _constants__WEBPACK_IMPORTED_MODULE_0__.ROUND_DOWN), |
| 2112 | maxConstraint: usePriceConstraint(maxPrice || '', minorUnit, _constants__WEBPACK_IMPORTED_MODULE_0__.ROUND_UP) |
| 2113 | }; |
| 2114 | }); |
| 2115 | |
| 2116 | /***/ }), |
| 2117 | |
| 2118 | /***/ "./assets/js/blocks/price-filter/utils.ts": |
| 2119 | /*!************************************************!*\ |
| 2120 | !*** ./assets/js/blocks/price-filter/utils.ts ***! |
| 2121 | \************************************************/ |
| 2122 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2123 | |
| 2124 | "use strict"; |
| 2125 | __webpack_require__.r(__webpack_exports__); |
| 2126 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2127 | /* harmony export */ parseAttributes: () => (/* binding */ parseAttributes) |
| 2128 | /* harmony export */ }); |
| 2129 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts"); |
| 2130 | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./block.json */ "./assets/js/blocks/price-filter/block.json"); |
| 2131 | /** |
| 2132 | * External dependencies |
| 2133 | */ |
| 2134 | |
| 2135 | |
| 2136 | /** |
| 2137 | * Internal dependencies |
| 2138 | */ |
| 2139 | |
| 2140 | const parseAttributes = data => { |
| 2141 | return { |
| 2142 | heading: (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.isString)(data === null || data === void 0 ? void 0 : data.heading) ? data.heading : '', |
| 2143 | headingLevel: (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.isString)(data === null || data === void 0 ? void 0 : data.headingLevel) && parseInt(data.headingLevel, 10) || _block_json__WEBPACK_IMPORTED_MODULE_1__.attributes.headingLevel["default"], |
| 2144 | showFilterButton: (data === null || data === void 0 ? void 0 : data.showFilterButton) === 'true', |
| 2145 | showInputFields: (data === null || data === void 0 ? void 0 : data.showInputFields) !== 'false', |
| 2146 | inlineInput: (data === null || data === void 0 ? void 0 : data.inlineInput) === 'true' |
| 2147 | }; |
| 2148 | }; |
| 2149 | |
| 2150 | /***/ }), |
| 2151 | |
| 2152 | /***/ "./assets/js/types/type-guards/boolean.ts": |
| 2153 | /*!************************************************!*\ |
| 2154 | !*** ./assets/js/types/type-guards/boolean.ts ***! |
| 2155 | \************************************************/ |
| 2156 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2157 | |
| 2158 | "use strict"; |
| 2159 | __webpack_require__.r(__webpack_exports__); |
| 2160 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2161 | /* harmony export */ isBoolean: () => (/* binding */ isBoolean) |
| 2162 | /* harmony export */ }); |
| 2163 | const isBoolean = term => { |
| 2164 | return typeof term === 'boolean'; |
| 2165 | }; |
| 2166 | |
| 2167 | /***/ }), |
| 2168 | |
| 2169 | /***/ "./assets/js/types/type-guards/error.ts": |
| 2170 | /*!**********************************************!*\ |
| 2171 | !*** ./assets/js/types/type-guards/error.ts ***! |
| 2172 | \**********************************************/ |
| 2173 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2174 | |
| 2175 | "use strict"; |
| 2176 | __webpack_require__.r(__webpack_exports__); |
| 2177 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2178 | /* harmony export */ isError: () => (/* binding */ isError) |
| 2179 | /* harmony export */ }); |
| 2180 | const isError = term => { |
| 2181 | return term instanceof Error; |
| 2182 | }; |
| 2183 | |
| 2184 | /***/ }), |
| 2185 | |
| 2186 | /***/ "./assets/js/types/type-guards/null.ts": |
| 2187 | /*!*********************************************!*\ |
| 2188 | !*** ./assets/js/types/type-guards/null.ts ***! |
| 2189 | \*********************************************/ |
| 2190 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2191 | |
| 2192 | "use strict"; |
| 2193 | __webpack_require__.r(__webpack_exports__); |
| 2194 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2195 | /* harmony export */ isNull: () => (/* binding */ isNull) |
| 2196 | /* harmony export */ }); |
| 2197 | const isNull = term => { |
| 2198 | return term === null; |
| 2199 | }; |
| 2200 | |
| 2201 | /***/ }), |
| 2202 | |
| 2203 | /***/ "./assets/js/types/type-guards/object.ts": |
| 2204 | /*!***********************************************!*\ |
| 2205 | !*** ./assets/js/types/type-guards/object.ts ***! |
| 2206 | \***********************************************/ |
| 2207 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2208 | |
| 2209 | "use strict"; |
| 2210 | __webpack_require__.r(__webpack_exports__); |
| 2211 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2212 | /* harmony export */ isEmptyObject: () => (/* binding */ isEmptyObject), |
| 2213 | /* harmony export */ isObject: () => (/* binding */ isObject), |
| 2214 | /* harmony export */ objectHasProp: () => (/* binding */ objectHasProp) |
| 2215 | /* harmony export */ }); |
| 2216 | /* harmony import */ var _null__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./null */ "./assets/js/types/type-guards/null.ts"); |
| 2217 | /** |
| 2218 | * Internal dependencies |
| 2219 | */ |
| 2220 | |
| 2221 | |
| 2222 | const isObject = term => { |
| 2223 | return !(0,_null__WEBPACK_IMPORTED_MODULE_0__.isNull)(term) && term instanceof Object && term.constructor === Object; |
| 2224 | }; |
| 2225 | function objectHasProp(target, property) { |
| 2226 | // The `in` operator throws a `TypeError` for non-object values. |
| 2227 | return isObject(target) && property in target; |
| 2228 | } |
| 2229 | const isEmptyObject = object => { |
| 2230 | return Object.keys(object).length === 0; |
| 2231 | }; |
| 2232 | |
| 2233 | /***/ }), |
| 2234 | |
| 2235 | /***/ "./assets/js/types/type-guards/string.ts": |
| 2236 | /*!***********************************************!*\ |
| 2237 | !*** ./assets/js/types/type-guards/string.ts ***! |
| 2238 | \***********************************************/ |
| 2239 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2240 | |
| 2241 | "use strict"; |
| 2242 | __webpack_require__.r(__webpack_exports__); |
| 2243 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2244 | /* harmony export */ isString: () => (/* binding */ isString) |
| 2245 | /* harmony export */ }); |
| 2246 | const isString = term => { |
| 2247 | return typeof term === 'string'; |
| 2248 | }; |
| 2249 | |
| 2250 | /***/ }), |
| 2251 | |
| 2252 | /***/ "./assets/js/utils/filters.ts": |
| 2253 | /*!************************************!*\ |
| 2254 | !*** ./assets/js/utils/filters.ts ***! |
| 2255 | \************************************/ |
| 2256 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2257 | |
| 2258 | "use strict"; |
| 2259 | __webpack_require__.r(__webpack_exports__); |
| 2260 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2261 | /* harmony export */ PREFIX_QUERY_ARG_FILTER_TYPE: () => (/* binding */ PREFIX_QUERY_ARG_FILTER_TYPE), |
| 2262 | /* harmony export */ PREFIX_QUERY_ARG_QUERY_TYPE: () => (/* binding */ PREFIX_QUERY_ARG_QUERY_TYPE), |
| 2263 | /* harmony export */ changeUrl: () => (/* binding */ changeUrl), |
| 2264 | /* harmony export */ getUrlParameter: () => (/* binding */ getUrlParameter), |
| 2265 | /* harmony export */ normalizeQueryParams: () => (/* binding */ normalizeQueryParams) |
| 2266 | /* harmony export */ }); |
| 2267 | /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); |
| 2268 | /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__); |
| 2269 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 2270 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__); |
| 2271 | /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/boolean.ts"); |
| 2272 | /** |
| 2273 | * External dependencies |
| 2274 | */ |
| 2275 | |
| 2276 | |
| 2277 | |
| 2278 | const filteringForPhpTemplate = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__.getSettingWithCoercion)('isRenderingPhpTemplate', false, _woocommerce_types__WEBPACK_IMPORTED_MODULE_2__.isBoolean); |
| 2279 | |
| 2280 | /** |
| 2281 | * Returns specified parameter from URL |
| 2282 | * |
| 2283 | * @param {string} name Parameter you want the value of. |
| 2284 | */ |
| 2285 | |
| 2286 | const PREFIX_QUERY_ARG_QUERY_TYPE = 'query_type_'; |
| 2287 | const PREFIX_QUERY_ARG_FILTER_TYPE = 'filter_'; |
| 2288 | function getUrlParameter(name) { |
| 2289 | if (!window) { |
| 2290 | return null; |
| 2291 | } |
| 2292 | return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.getQueryArg)(window.location.href, name); |
| 2293 | } |
| 2294 | |
| 2295 | /** |
| 2296 | * Change the URL and reload the page if filtering for PHP templates. |
| 2297 | * |
| 2298 | * @param {string} newUrl New URL to be set. |
| 2299 | */ |
| 2300 | function changeUrl(newUrl) { |
| 2301 | if (filteringForPhpTemplate) { |
| 2302 | /** |
| 2303 | * We want to remove page number from URL whenever filters are changed. |
| 2304 | * This will move the user to the first page of results. |
| 2305 | * |
| 2306 | * There are following page number formats: |
| 2307 | * 1. query-{number}-page={number} (ex. query-1-page=2) |
| 2308 | * - ref: https://github.com/WordPress/gutenberg/blob/5693a62214b6c76d3dc5f3f69d8aad187748af79/packages/block-library/src/query-pagination-numbers/index.php#L18 |
| 2309 | * 2. query-page={number} (ex. query-page=2) |
| 2310 | * - ref: same as above |
| 2311 | * 3. page/{number} (ex. page/2) (Default WordPress pagination format) |
| 2312 | */ |
| 2313 | newUrl = newUrl.replace(/(?:query-(?:\d+-)?page=(\d+))|(?:page\/(\d+))/g, ''); |
| 2314 | |
| 2315 | /** |
| 2316 | * If the URL ends with '?', we remove the trailing '?' from the URL. |
| 2317 | * The trailing '?' in a URL is unnecessary and can cause the page to |
| 2318 | * reload, which can negatively affect performance. By removing the '?', |
| 2319 | * we prevent this unnecessary reload. This is safe to do even if there |
| 2320 | * are query parameters, as they will not be affected by the removal |
| 2321 | * of a trailing '?'. |
| 2322 | */ |
| 2323 | if (newUrl.endsWith('?')) { |
| 2324 | newUrl = newUrl.slice(0, -1); |
| 2325 | } |
| 2326 | window.location.href = newUrl; |
| 2327 | } else { |
| 2328 | window.history.replaceState({}, '', newUrl); |
| 2329 | } |
| 2330 | } |
| 2331 | |
| 2332 | /** |
| 2333 | * Run the query params through buildQueryString to normalise the params. |
| 2334 | * |
| 2335 | * @param {string} url URL to encode the search param from. |
| 2336 | */ |
| 2337 | const normalizeQueryParams = url => { |
| 2338 | const queryArgs = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.getQueryArgs)(url); |
| 2339 | return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(url, queryArgs); |
| 2340 | }; |
| 2341 | |
| 2342 | /***/ }), |
| 2343 | |
| 2344 | /***/ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js": |
| 2345 | /*!**********************************************************************************!*\ |
| 2346 | !*** ../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js ***! |
| 2347 | \**********************************************************************************/ |
| 2348 | /***/ ((module, exports) => { |
| 2349 | |
| 2350 | var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! |
| 2351 | Copyright (c) 2018 Jed Watson. |
| 2352 | Licensed under the MIT License (MIT), see |
| 2353 | http://jedwatson.github.io/classnames |
| 2354 | */ |
| 2355 | /* global define */ |
| 2356 | |
| 2357 | (function () { |
| 2358 | 'use strict'; |
| 2359 | |
| 2360 | var hasOwn = {}.hasOwnProperty; |
| 2361 | |
| 2362 | function classNames() { |
| 2363 | var classes = []; |
| 2364 | |
| 2365 | for (var i = 0; i < arguments.length; i++) { |
| 2366 | var arg = arguments[i]; |
| 2367 | if (!arg) continue; |
| 2368 | |
| 2369 | var argType = typeof arg; |
| 2370 | |
| 2371 | if (argType === 'string' || argType === 'number') { |
| 2372 | classes.push(arg); |
| 2373 | } else if (Array.isArray(arg)) { |
| 2374 | if (arg.length) { |
| 2375 | var inner = classNames.apply(null, arg); |
| 2376 | if (inner) { |
| 2377 | classes.push(inner); |
| 2378 | } |
| 2379 | } |
| 2380 | } else if (argType === 'object') { |
| 2381 | if (arg.toString === Object.prototype.toString) { |
| 2382 | for (var key in arg) { |
| 2383 | if (hasOwn.call(arg, key) && arg[key]) { |
| 2384 | classes.push(key); |
| 2385 | } |
| 2386 | } |
| 2387 | } else { |
| 2388 | classes.push(arg.toString()); |
| 2389 | } |
| 2390 | } |
| 2391 | } |
| 2392 | |
| 2393 | return classes.join(' '); |
| 2394 | } |
| 2395 | |
| 2396 | if ( true && module.exports) { |
| 2397 | classNames.default = classNames; |
| 2398 | module.exports = classNames; |
| 2399 | } else if (true) { |
| 2400 | // register as 'classnames', consistent with npm package name |
| 2401 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { |
| 2402 | return classNames; |
| 2403 | }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), |
| 2404 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
| 2405 | } else {} |
| 2406 | }()); |
| 2407 | |
| 2408 | |
| 2409 | /***/ }), |
| 2410 | |
| 2411 | /***/ "../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js": |
| 2412 | /*!******************************************************************************************!*\ |
| 2413 | !*** ../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js ***! |
| 2414 | \******************************************************************************************/ |
| 2415 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2416 | |
| 2417 | "use strict"; |
| 2418 | __webpack_require__.r(__webpack_exports__); |
| 2419 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2420 | /* harmony export */ dotCase: () => (/* binding */ dotCase) |
| 2421 | /* harmony export */ }); |
| 2422 | /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs"); |
| 2423 | /* harmony import */ var no_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! no-case */ "../../node_modules/.pnpm/no-case@3.0.4/node_modules/no-case/dist.es2015/index.js"); |
| 2424 | |
| 2425 | |
| 2426 | function dotCase(input, options) { |
| 2427 | if (options === void 0) { options = {}; } |
| 2428 | return (0,no_case__WEBPACK_IMPORTED_MODULE_0__.noCase)(input, (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({ delimiter: "." }, options)); |
| 2429 | } |
| 2430 | //# sourceMappingURL=index.js.map |
| 2431 | |
| 2432 | /***/ }), |
| 2433 | |
| 2434 | /***/ "./assets/js/base/components/filter-placeholder/style.scss": |
| 2435 | /*!*****************************************************************!*\ |
| 2436 | !*** ./assets/js/base/components/filter-placeholder/style.scss ***! |
| 2437 | \*****************************************************************/ |
| 2438 | /***/ (() => { |
| 2439 | |
| 2440 | |
| 2441 | |
| 2442 | /***/ }), |
| 2443 | |
| 2444 | /***/ "./assets/js/base/components/filter-reset-button/style.scss": |
| 2445 | /*!******************************************************************!*\ |
| 2446 | !*** ./assets/js/base/components/filter-reset-button/style.scss ***! |
| 2447 | \******************************************************************/ |
| 2448 | /***/ (() => { |
| 2449 | |
| 2450 | |
| 2451 | |
| 2452 | /***/ }), |
| 2453 | |
| 2454 | /***/ "./assets/js/base/components/filter-submit-button/style.scss": |
| 2455 | /*!*******************************************************************!*\ |
| 2456 | !*** ./assets/js/base/components/filter-submit-button/style.scss ***! |
| 2457 | \*******************************************************************/ |
| 2458 | /***/ (() => { |
| 2459 | |
| 2460 | |
| 2461 | |
| 2462 | /***/ }), |
| 2463 | |
| 2464 | /***/ "./assets/js/base/components/price-slider/style.scss": |
| 2465 | /*!***********************************************************!*\ |
| 2466 | !*** ./assets/js/base/components/price-slider/style.scss ***! |
| 2467 | \***********************************************************/ |
| 2468 | /***/ (() => { |
| 2469 | |
| 2470 | |
| 2471 | |
| 2472 | /***/ }), |
| 2473 | |
| 2474 | /***/ "./assets/js/blocks/price-filter/style.scss": |
| 2475 | /*!**************************************************!*\ |
| 2476 | !*** ./assets/js/blocks/price-filter/style.scss ***! |
| 2477 | \**************************************************/ |
| 2478 | /***/ (() => { |
| 2479 | |
| 2480 | |
| 2481 | |
| 2482 | /***/ }), |
| 2483 | |
| 2484 | /***/ "../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js": |
| 2485 | /*!**********************************************************************************************!*\ |
| 2486 | !*** ../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js ***! |
| 2487 | \**********************************************************************************************/ |
| 2488 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2489 | |
| 2490 | "use strict"; |
| 2491 | __webpack_require__.r(__webpack_exports__); |
| 2492 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2493 | /* harmony export */ localeLowerCase: () => (/* binding */ localeLowerCase), |
| 2494 | /* harmony export */ lowerCase: () => (/* binding */ lowerCase) |
| 2495 | /* harmony export */ }); |
| 2496 | /** |
| 2497 | * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt |
| 2498 | */ |
| 2499 | var SUPPORTED_LOCALE = { |
| 2500 | tr: { |
| 2501 | regexp: /\u0130|\u0049|\u0049\u0307/g, |
| 2502 | map: { |
| 2503 | İ: "\u0069", |
| 2504 | I: "\u0131", |
| 2505 | İ: "\u0069", |
| 2506 | }, |
| 2507 | }, |
| 2508 | az: { |
| 2509 | regexp: /\u0130/g, |
| 2510 | map: { |
| 2511 | İ: "\u0069", |
| 2512 | I: "\u0131", |
| 2513 | İ: "\u0069", |
| 2514 | }, |
| 2515 | }, |
| 2516 | lt: { |
| 2517 | regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, |
| 2518 | map: { |
| 2519 | I: "\u0069\u0307", |
| 2520 | J: "\u006A\u0307", |
| 2521 | Į: "\u012F\u0307", |
| 2522 | Ì: "\u0069\u0307\u0300", |
| 2523 | Í: "\u0069\u0307\u0301", |
| 2524 | Ĩ: "\u0069\u0307\u0303", |
| 2525 | }, |
| 2526 | }, |
| 2527 | }; |
| 2528 | /** |
| 2529 | * Localized lower case. |
| 2530 | */ |
| 2531 | function localeLowerCase(str, locale) { |
| 2532 | var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; |
| 2533 | if (lang) |
| 2534 | return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); |
| 2535 | return lowerCase(str); |
| 2536 | } |
| 2537 | /** |
| 2538 | * Lower case as a function. |
| 2539 | */ |
| 2540 | function lowerCase(str) { |
| 2541 | return str.toLowerCase(); |
| 2542 | } |
| 2543 | //# sourceMappingURL=index.js.map |
| 2544 | |
| 2545 | /***/ }), |
| 2546 | |
| 2547 | /***/ "../../node_modules/.pnpm/no-case@3.0.4/node_modules/no-case/dist.es2015/index.js": |
| 2548 | /*!****************************************************************************************!*\ |
| 2549 | !*** ../../node_modules/.pnpm/no-case@3.0.4/node_modules/no-case/dist.es2015/index.js ***! |
| 2550 | \****************************************************************************************/ |
| 2551 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2552 | |
| 2553 | "use strict"; |
| 2554 | __webpack_require__.r(__webpack_exports__); |
| 2555 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2556 | /* harmony export */ noCase: () => (/* binding */ noCase) |
| 2557 | /* harmony export */ }); |
| 2558 | /* harmony import */ var lower_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lower-case */ "../../node_modules/.pnpm/lower-case@2.0.2/node_modules/lower-case/dist.es2015/index.js"); |
| 2559 | |
| 2560 | // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). |
| 2561 | var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; |
| 2562 | // Remove all non-word characters. |
| 2563 | var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; |
| 2564 | /** |
| 2565 | * Normalize the string into something other libraries can manipulate easier. |
| 2566 | */ |
| 2567 | function noCase(input, options) { |
| 2568 | if (options === void 0) { options = {}; } |
| 2569 | var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lower_case__WEBPACK_IMPORTED_MODULE_0__.lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; |
| 2570 | var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); |
| 2571 | var start = 0; |
| 2572 | var end = result.length; |
| 2573 | // Trim the delimiter from around the output string. |
| 2574 | while (result.charAt(start) === "\0") |
| 2575 | start++; |
| 2576 | while (result.charAt(end - 1) === "\0") |
| 2577 | end--; |
| 2578 | // Transform each token independently. |
| 2579 | return result.slice(start, end).split("\0").map(transform).join(delimiter); |
| 2580 | } |
| 2581 | /** |
| 2582 | * Replace `re` in the input string with the replacement value. |
| 2583 | */ |
| 2584 | function replace(input, re, value) { |
| 2585 | if (re instanceof RegExp) |
| 2586 | return input.replace(re, value); |
| 2587 | return re.reduce(function (input, re) { return input.replace(re, value); }, input); |
| 2588 | } |
| 2589 | //# sourceMappingURL=index.js.map |
| 2590 | |
| 2591 | /***/ }), |
| 2592 | |
| 2593 | /***/ "../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js": |
| 2594 | /*!**********************************************************************************************!*\ |
| 2595 | !*** ../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js ***! |
| 2596 | \**********************************************************************************************/ |
| 2597 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2598 | |
| 2599 | "use strict"; |
| 2600 | __webpack_require__.r(__webpack_exports__); |
| 2601 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2602 | /* harmony export */ paramCase: () => (/* binding */ paramCase) |
| 2603 | /* harmony export */ }); |
| 2604 | /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs"); |
| 2605 | /* harmony import */ var dot_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dot-case */ "../../node_modules/.pnpm/dot-case@3.0.4/node_modules/dot-case/dist.es2015/index.js"); |
| 2606 | |
| 2607 | |
| 2608 | function paramCase(input, options) { |
| 2609 | if (options === void 0) { options = {}; } |
| 2610 | return (0,dot_case__WEBPACK_IMPORTED_MODULE_0__.dotCase)(input, (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({ delimiter: "-" }, options)); |
| 2611 | } |
| 2612 | //# sourceMappingURL=index.js.map |
| 2613 | |
| 2614 | /***/ }), |
| 2615 | |
| 2616 | /***/ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js": |
| 2617 | /*!***************************************************************************************************************!*\ |
| 2618 | !*** ../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js ***! |
| 2619 | \***************************************************************************************************************/ |
| 2620 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2621 | |
| 2622 | "use strict"; |
| 2623 | __webpack_require__.r(__webpack_exports__); |
| 2624 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2625 | /* harmony export */ useDebounce: () => (/* binding */ o), |
| 2626 | /* harmony export */ useDebouncedCallback: () => (/* binding */ c), |
| 2627 | /* harmony export */ useThrottledCallback: () => (/* binding */ f) |
| 2628 | /* harmony export */ }); |
| 2629 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2630 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2631 | function c(u,e,c){var i=this,a=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),o=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0),f=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),l=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]),m=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(),v=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(),d=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(u),p=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(!0);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function(){d.current=u},[u]);var g=!e&&0!==e&&"undefined"!=typeof window;if("function"!=typeof u)throw new TypeError("Expected a function");e=+e||0;var w=!!(c=c||{}).leading,s=!("trailing"in c)||!!c.trailing,x="maxWait"in c,y=x?Math.max(+c.maxWait||0,e):null;(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function(){return p.current=!0,function(){p.current=!1}},[]);var h=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function(){var r=function(r){var n=l.current,t=m.current;return l.current=m.current=null,o.current=r,v.current=d.current.apply(t,n)},n=function(r,n){g&&cancelAnimationFrame(f.current),f.current=g?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!p.current)return!1;var n=r-a.current;return!a.current||n>=e||n<0||x&&r-o.current>=y},u=function(n){return f.current=null,s&&l.current?r(n):(l.current=m.current=null,v.current)},c=function r(){var c=Date.now();if(t(c))return u(c);if(p.current){var i=e-(c-a.current),f=x?Math.min(i,y-(c-o.current)):i;n(r,f)}},h=function(){var u=Date.now(),d=t(u);if(l.current=[].slice.call(arguments),m.current=i,a.current=u,d){if(!f.current&&p.current)return o.current=a.current,n(c,e),w?r(a.current):v.current;if(x)return n(c,e),r(a.current)}return f.current||n(c,e),v.current};return h.cancel=function(){f.current&&(g?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=m.current=f.current=null},h.isPending=function(){return!!f.current},h.flush=function(){return f.current?u(Date.now()):v.current},h},[w,x,e,y,s,g]);return h}function i(r,n){return r===n}function a(r){return"function"==typeof r?function(){return r}:r}function o(n,t,o){var f,l,m=o&&o.equalityFn||i,v=(f=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(a(n)),l=f[1],[f[0],(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(r){return l(a(r))},[])]),d=v[0],p=v[1],g=c((0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(r){return p(r)},[p]),t,o),w=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(n);return m(w.current,n)||(g(n),w.current=n),[d,g]}function f(r,n,t){var u=void 0===t?{}:t,e=u.leading,i=u.trailing;return c(r,n,{maxWait:n,leading:void 0===e||e,trailing:void 0===i||i})} |
| 2632 | //# sourceMappingURL=index.module.js.map |
| 2633 | |
| 2634 | |
| 2635 | /***/ }), |
| 2636 | |
| 2637 | /***/ "../../node_modules/.pnpm/fast-sort@3.4.0/node_modules/fast-sort/dist/sort.mjs": |
| 2638 | /*!*************************************************************************************!*\ |
| 2639 | !*** ../../node_modules/.pnpm/fast-sort@3.4.0/node_modules/fast-sort/dist/sort.mjs ***! |
| 2640 | \*************************************************************************************/ |
| 2641 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 2642 | |
| 2643 | "use strict"; |
| 2644 | __webpack_require__.r(__webpack_exports__); |
| 2645 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2646 | /* harmony export */ createNewSortInstance: () => (/* binding */ createNewSortInstance), |
| 2647 | /* harmony export */ defaultComparer: () => (/* binding */ defaultComparer), |
| 2648 | /* harmony export */ inPlaceSort: () => (/* binding */ inPlaceSort), |
| 2649 | /* harmony export */ sort: () => (/* binding */ sort) |
| 2650 | /* harmony export */ }); |
| 2651 | // >>> INTERFACES <<< |
| 2652 | // >>> HELPERS <<< |
| 2653 | var castComparer = function (comparer) { return function (a, b, order) { return comparer(a, b, order) * order; }; }; |
| 2654 | var throwInvalidConfigErrorIfTrue = function (condition, context) { |
| 2655 | if (condition) |
| 2656 | throw Error("Invalid sort config: " + context); |
| 2657 | }; |
| 2658 | var unpackObjectSorter = function (sortByObj) { |
| 2659 | var _a = sortByObj || {}, asc = _a.asc, desc = _a.desc; |
| 2660 | var order = asc ? 1 : -1; |
| 2661 | var sortBy = (asc || desc); |
| 2662 | // Validate object config |
| 2663 | throwInvalidConfigErrorIfTrue(!sortBy, 'Expected `asc` or `desc` property'); |
| 2664 | throwInvalidConfigErrorIfTrue(asc && desc, 'Ambiguous object with `asc` and `desc` config properties'); |
| 2665 | var comparer = sortByObj.comparer && castComparer(sortByObj.comparer); |
| 2666 | return { order: order, sortBy: sortBy, comparer: comparer }; |
| 2667 | }; |
| 2668 | // >>> SORTERS <<< |
| 2669 | var multiPropertySorterProvider = function (defaultComparer) { |
| 2670 | return function multiPropertySorter(sortBy, sortByArr, depth, order, comparer, a, b) { |
| 2671 | var valA; |
| 2672 | var valB; |
| 2673 | if (typeof sortBy === 'string') { |
| 2674 | valA = a[sortBy]; |
| 2675 | valB = b[sortBy]; |
| 2676 | } |
| 2677 | else if (typeof sortBy === 'function') { |
| 2678 | valA = sortBy(a); |
| 2679 | valB = sortBy(b); |
| 2680 | } |
| 2681 | else { |
| 2682 | var objectSorterConfig = unpackObjectSorter(sortBy); |
| 2683 | return multiPropertySorter(objectSorterConfig.sortBy, sortByArr, depth, objectSorterConfig.order, objectSorterConfig.comparer || defaultComparer, a, b); |
| 2684 | } |
| 2685 | var equality = comparer(valA, valB, order); |
| 2686 | if ((equality === 0 || (valA == null && valB == null)) && |
| 2687 | sortByArr.length > depth) { |
| 2688 | return multiPropertySorter(sortByArr[depth], sortByArr, depth + 1, order, comparer, a, b); |
| 2689 | } |
| 2690 | return equality; |
| 2691 | }; |
| 2692 | }; |
| 2693 | function getSortStrategy(sortBy, comparer, order) { |
| 2694 | // Flat array sorter |
| 2695 | if (sortBy === undefined || sortBy === true) { |
| 2696 | return function (a, b) { return comparer(a, b, order); }; |
| 2697 | } |
| 2698 | // Sort list of objects by single object key |
| 2699 | if (typeof sortBy === 'string') { |
| 2700 | throwInvalidConfigErrorIfTrue(sortBy.includes('.'), 'String syntax not allowed for nested properties.'); |
| 2701 | return function (a, b) { return comparer(a[sortBy], b[sortBy], order); }; |
| 2702 | } |
| 2703 | // Sort list of objects by single function sorter |
| 2704 | if (typeof sortBy === 'function') { |
| 2705 | return function (a, b) { return comparer(sortBy(a), sortBy(b), order); }; |
| 2706 | } |
| 2707 | // Sort by multiple properties |
| 2708 | if (Array.isArray(sortBy)) { |
| 2709 | var multiPropSorter_1 = multiPropertySorterProvider(comparer); |
| 2710 | return function (a, b) { return multiPropSorter_1(sortBy[0], sortBy, 1, order, comparer, a, b); }; |
| 2711 | } |
| 2712 | // Unpack object config to get actual sorter strategy |
| 2713 | var objectSorterConfig = unpackObjectSorter(sortBy); |
| 2714 | return getSortStrategy(objectSorterConfig.sortBy, objectSorterConfig.comparer || comparer, objectSorterConfig.order); |
| 2715 | } |
| 2716 | var sortArray = function (order, ctx, sortBy, comparer) { |
| 2717 | var _a; |
| 2718 | if (!Array.isArray(ctx)) { |
| 2719 | return ctx; |
| 2720 | } |
| 2721 | // Unwrap sortBy if array with only 1 value to get faster sort strategy |
| 2722 | if (Array.isArray(sortBy) && sortBy.length < 2) { |
| 2723 | _a = sortBy, sortBy = _a[0]; |
| 2724 | } |
| 2725 | return ctx.sort(getSortStrategy(sortBy, comparer, order)); |
| 2726 | }; |
| 2727 | function createNewSortInstance(opts) { |
| 2728 | var comparer = castComparer(opts.comparer); |
| 2729 | return function (arrayToSort) { |
| 2730 | var ctx = Array.isArray(arrayToSort) && !opts.inPlaceSorting |
| 2731 | ? arrayToSort.slice() |
| 2732 | : arrayToSort; |
| 2733 | return { |
| 2734 | asc: function (sortBy) { |
| 2735 | return sortArray(1, ctx, sortBy, comparer); |
| 2736 | }, |
| 2737 | desc: function (sortBy) { |
| 2738 | return sortArray(-1, ctx, sortBy, comparer); |
| 2739 | }, |
| 2740 | by: function (sortBy) { |
| 2741 | return sortArray(1, ctx, sortBy, comparer); |
| 2742 | }, |
| 2743 | }; |
| 2744 | }; |
| 2745 | } |
| 2746 | var defaultComparer = function (a, b, order) { |
| 2747 | if (a == null) |
| 2748 | return order; |
| 2749 | if (b == null) |
| 2750 | return -order; |
| 2751 | if (typeof a !== typeof b) { |
| 2752 | return typeof a < typeof b ? -1 : 1; |
| 2753 | } |
| 2754 | if (a < b) |
| 2755 | return -1; |
| 2756 | if (a > b) |
| 2757 | return 1; |
| 2758 | return 0; |
| 2759 | }; |
| 2760 | var sort = createNewSortInstance({ |
| 2761 | comparer: defaultComparer, |
| 2762 | }); |
| 2763 | var inPlaceSort = createNewSortInstance({ |
| 2764 | comparer: defaultComparer, |
| 2765 | inPlaceSorting: true, |
| 2766 | }); |
| 2767 | |
| 2768 | |
| 2769 | |
| 2770 | |
| 2771 | /***/ }), |
| 2772 | |
| 2773 | /***/ "../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs": |
| 2774 | /*!*****************************************************************************!*\ |
| 2775 | !*** ../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs ***! |
| 2776 | \*****************************************************************************/ |
| 2777 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 2778 | |
| 2779 | "use strict"; |
| 2780 | __webpack_require__.r(__webpack_exports__); |
| 2781 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2782 | /* harmony export */ __addDisposableResource: () => (/* binding */ __addDisposableResource), |
| 2783 | /* harmony export */ __assign: () => (/* binding */ __assign), |
| 2784 | /* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator), |
| 2785 | /* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator), |
| 2786 | /* harmony export */ __asyncValues: () => (/* binding */ __asyncValues), |
| 2787 | /* harmony export */ __await: () => (/* binding */ __await), |
| 2788 | /* harmony export */ __awaiter: () => (/* binding */ __awaiter), |
| 2789 | /* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet), |
| 2790 | /* harmony export */ __classPrivateFieldIn: () => (/* binding */ __classPrivateFieldIn), |
| 2791 | /* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet), |
| 2792 | /* harmony export */ __createBinding: () => (/* binding */ __createBinding), |
| 2793 | /* harmony export */ __decorate: () => (/* binding */ __decorate), |
| 2794 | /* harmony export */ __disposeResources: () => (/* binding */ __disposeResources), |
| 2795 | /* harmony export */ __esDecorate: () => (/* binding */ __esDecorate), |
| 2796 | /* harmony export */ __exportStar: () => (/* binding */ __exportStar), |
| 2797 | /* harmony export */ __extends: () => (/* binding */ __extends), |
| 2798 | /* harmony export */ __generator: () => (/* binding */ __generator), |
| 2799 | /* harmony export */ __importDefault: () => (/* binding */ __importDefault), |
| 2800 | /* harmony export */ __importStar: () => (/* binding */ __importStar), |
| 2801 | /* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject), |
| 2802 | /* harmony export */ __metadata: () => (/* binding */ __metadata), |
| 2803 | /* harmony export */ __param: () => (/* binding */ __param), |
| 2804 | /* harmony export */ __propKey: () => (/* binding */ __propKey), |
| 2805 | /* harmony export */ __read: () => (/* binding */ __read), |
| 2806 | /* harmony export */ __rest: () => (/* binding */ __rest), |
| 2807 | /* harmony export */ __runInitializers: () => (/* binding */ __runInitializers), |
| 2808 | /* harmony export */ __setFunctionName: () => (/* binding */ __setFunctionName), |
| 2809 | /* harmony export */ __spread: () => (/* binding */ __spread), |
| 2810 | /* harmony export */ __spreadArray: () => (/* binding */ __spreadArray), |
| 2811 | /* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays), |
| 2812 | /* harmony export */ __values: () => (/* binding */ __values), |
| 2813 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 2814 | /* harmony export */ }); |
| 2815 | /****************************************************************************** |
| 2816 | Copyright (c) Microsoft Corporation. |
| 2817 | |
| 2818 | Permission to use, copy, modify, and/or distribute this software for any |
| 2819 | purpose with or without fee is hereby granted. |
| 2820 | |
| 2821 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH |
| 2822 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
| 2823 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, |
| 2824 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
| 2825 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR |
| 2826 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 2827 | PERFORMANCE OF THIS SOFTWARE. |
| 2828 | ***************************************************************************** */ |
| 2829 | /* global Reflect, Promise, SuppressedError, Symbol */ |
| 2830 | |
| 2831 | var extendStatics = function(d, b) { |
| 2832 | extendStatics = Object.setPrototypeOf || |
| 2833 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 2834 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; |
| 2835 | return extendStatics(d, b); |
| 2836 | }; |
| 2837 | |
| 2838 | function __extends(d, b) { |
| 2839 | if (typeof b !== "function" && b !== null) |
| 2840 | throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); |
| 2841 | extendStatics(d, b); |
| 2842 | function __() { this.constructor = d; } |
| 2843 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 2844 | } |
| 2845 | |
| 2846 | var __assign = function() { |
| 2847 | __assign = Object.assign || function __assign(t) { |
| 2848 | for (var s, i = 1, n = arguments.length; i < n; i++) { |
| 2849 | s = arguments[i]; |
| 2850 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; |
| 2851 | } |
| 2852 | return t; |
| 2853 | } |
| 2854 | return __assign.apply(this, arguments); |
| 2855 | } |
| 2856 | |
| 2857 | function __rest(s, e) { |
| 2858 | var t = {}; |
| 2859 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) |
| 2860 | t[p] = s[p]; |
| 2861 | if (s != null && typeof Object.getOwnPropertySymbols === "function") |
| 2862 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { |
| 2863 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) |
| 2864 | t[p[i]] = s[p[i]]; |
| 2865 | } |
| 2866 | return t; |
| 2867 | } |
| 2868 | |
| 2869 | function __decorate(decorators, target, key, desc) { |
| 2870 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
| 2871 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
| 2872 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
| 2873 | return c > 3 && r && Object.defineProperty(target, key, r), r; |
| 2874 | } |
| 2875 | |
| 2876 | function __param(paramIndex, decorator) { |
| 2877 | return function (target, key) { decorator(target, key, paramIndex); } |
| 2878 | } |
| 2879 | |
| 2880 | function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { |
| 2881 | function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } |
| 2882 | var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; |
| 2883 | var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; |
| 2884 | var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); |
| 2885 | var _, done = false; |
| 2886 | for (var i = decorators.length - 1; i >= 0; i--) { |
| 2887 | var context = {}; |
| 2888 | for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; |
| 2889 | for (var p in contextIn.access) context.access[p] = contextIn.access[p]; |
| 2890 | context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; |
| 2891 | var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); |
| 2892 | if (kind === "accessor") { |
| 2893 | if (result === void 0) continue; |
| 2894 | if (result === null || typeof result !== "object") throw new TypeError("Object expected"); |
| 2895 | if (_ = accept(result.get)) descriptor.get = _; |
| 2896 | if (_ = accept(result.set)) descriptor.set = _; |
| 2897 | if (_ = accept(result.init)) initializers.unshift(_); |
| 2898 | } |
| 2899 | else if (_ = accept(result)) { |
| 2900 | if (kind === "field") initializers.unshift(_); |
| 2901 | else descriptor[key] = _; |
| 2902 | } |
| 2903 | } |
| 2904 | if (target) Object.defineProperty(target, contextIn.name, descriptor); |
| 2905 | done = true; |
| 2906 | }; |
| 2907 | |
| 2908 | function __runInitializers(thisArg, initializers, value) { |
| 2909 | var useValue = arguments.length > 2; |
| 2910 | for (var i = 0; i < initializers.length; i++) { |
| 2911 | value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); |
| 2912 | } |
| 2913 | return useValue ? value : void 0; |
| 2914 | }; |
| 2915 | |
| 2916 | function __propKey(x) { |
| 2917 | return typeof x === "symbol" ? x : "".concat(x); |
| 2918 | }; |
| 2919 | |
| 2920 | function __setFunctionName(f, name, prefix) { |
| 2921 | if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; |
| 2922 | return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); |
| 2923 | }; |
| 2924 | |
| 2925 | function __metadata(metadataKey, metadataValue) { |
| 2926 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); |
| 2927 | } |
| 2928 | |
| 2929 | function __awaiter(thisArg, _arguments, P, generator) { |
| 2930 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |
| 2931 | return new (P || (P = Promise))(function (resolve, reject) { |
| 2932 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } |
| 2933 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } |
| 2934 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |
| 2935 | step((generator = generator.apply(thisArg, _arguments || [])).next()); |
| 2936 | }); |
| 2937 | } |
| 2938 | |
| 2939 | function __generator(thisArg, body) { |
| 2940 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; |
| 2941 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; |
| 2942 | function verb(n) { return function (v) { return step([n, v]); }; } |
| 2943 | function step(op) { |
| 2944 | if (f) throw new TypeError("Generator is already executing."); |
| 2945 | while (g && (g = 0, op[0] && (_ = 0)), _) try { |
| 2946 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; |
| 2947 | if (y = 0, t) op = [op[0] & 2, t.value]; |
| 2948 | switch (op[0]) { |
| 2949 | case 0: case 1: t = op; break; |
| 2950 | case 4: _.label++; return { value: op[1], done: false }; |
| 2951 | case 5: _.label++; y = op[1]; op = [0]; continue; |
| 2952 | case 7: op = _.ops.pop(); _.trys.pop(); continue; |
| 2953 | default: |
| 2954 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } |
| 2955 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } |
| 2956 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } |
| 2957 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } |
| 2958 | if (t[2]) _.ops.pop(); |
| 2959 | _.trys.pop(); continue; |
| 2960 | } |
| 2961 | op = body.call(thisArg, _); |
| 2962 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } |
| 2963 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; |
| 2964 | } |
| 2965 | } |
| 2966 | |
| 2967 | var __createBinding = Object.create ? (function(o, m, k, k2) { |
| 2968 | if (k2 === undefined) k2 = k; |
| 2969 | var desc = Object.getOwnPropertyDescriptor(m, k); |
| 2970 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { |
| 2971 | desc = { enumerable: true, get: function() { return m[k]; } }; |
| 2972 | } |
| 2973 | Object.defineProperty(o, k2, desc); |
| 2974 | }) : (function(o, m, k, k2) { |
| 2975 | if (k2 === undefined) k2 = k; |
| 2976 | o[k2] = m[k]; |
| 2977 | }); |
| 2978 | |
| 2979 | function __exportStar(m, o) { |
| 2980 | for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); |
| 2981 | } |
| 2982 | |
| 2983 | function __values(o) { |
| 2984 | var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; |
| 2985 | if (m) return m.call(o); |
| 2986 | if (o && typeof o.length === "number") return { |
| 2987 | next: function () { |
| 2988 | if (o && i >= o.length) o = void 0; |
| 2989 | return { value: o && o[i++], done: !o }; |
| 2990 | } |
| 2991 | }; |
| 2992 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); |
| 2993 | } |
| 2994 | |
| 2995 | function __read(o, n) { |
| 2996 | var m = typeof Symbol === "function" && o[Symbol.iterator]; |
| 2997 | if (!m) return o; |
| 2998 | var i = m.call(o), r, ar = [], e; |
| 2999 | try { |
| 3000 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); |
| 3001 | } |
| 3002 | catch (error) { e = { error: error }; } |
| 3003 | finally { |
| 3004 | try { |
| 3005 | if (r && !r.done && (m = i["return"])) m.call(i); |
| 3006 | } |
| 3007 | finally { if (e) throw e.error; } |
| 3008 | } |
| 3009 | return ar; |
| 3010 | } |
| 3011 | |
| 3012 | /** @deprecated */ |
| 3013 | function __spread() { |
| 3014 | for (var ar = [], i = 0; i < arguments.length; i++) |
| 3015 | ar = ar.concat(__read(arguments[i])); |
| 3016 | return ar; |
| 3017 | } |
| 3018 | |
| 3019 | /** @deprecated */ |
| 3020 | function __spreadArrays() { |
| 3021 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; |
| 3022 | for (var r = Array(s), k = 0, i = 0; i < il; i++) |
| 3023 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) |
| 3024 | r[k] = a[j]; |
| 3025 | return r; |
| 3026 | } |
| 3027 | |
| 3028 | function __spreadArray(to, from, pack) { |
| 3029 | if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { |
| 3030 | if (ar || !(i in from)) { |
| 3031 | if (!ar) ar = Array.prototype.slice.call(from, 0, i); |
| 3032 | ar[i] = from[i]; |
| 3033 | } |
| 3034 | } |
| 3035 | return to.concat(ar || Array.prototype.slice.call(from)); |
| 3036 | } |
| 3037 | |
| 3038 | function __await(v) { |
| 3039 | return this instanceof __await ? (this.v = v, this) : new __await(v); |
| 3040 | } |
| 3041 | |
| 3042 | function __asyncGenerator(thisArg, _arguments, generator) { |
| 3043 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); |
| 3044 | var g = generator.apply(thisArg, _arguments || []), i, q = []; |
| 3045 | return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; |
| 3046 | function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } |
| 3047 | function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } |
| 3048 | function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } |
| 3049 | function fulfill(value) { resume("next", value); } |
| 3050 | function reject(value) { resume("throw", value); } |
| 3051 | function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } |
| 3052 | } |
| 3053 | |
| 3054 | function __asyncDelegator(o) { |
| 3055 | var i, p; |
| 3056 | return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; |
| 3057 | function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } |
| 3058 | } |
| 3059 | |
| 3060 | function __asyncValues(o) { |
| 3061 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); |
| 3062 | var m = o[Symbol.asyncIterator], i; |
| 3063 | return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); |
| 3064 | function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } |
| 3065 | function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } |
| 3066 | } |
| 3067 | |
| 3068 | function __makeTemplateObject(cooked, raw) { |
| 3069 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } |
| 3070 | return cooked; |
| 3071 | }; |
| 3072 | |
| 3073 | var __setModuleDefault = Object.create ? (function(o, v) { |
| 3074 | Object.defineProperty(o, "default", { enumerable: true, value: v }); |
| 3075 | }) : function(o, v) { |
| 3076 | o["default"] = v; |
| 3077 | }; |
| 3078 | |
| 3079 | function __importStar(mod) { |
| 3080 | if (mod && mod.__esModule) return mod; |
| 3081 | var result = {}; |
| 3082 | if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); |
| 3083 | __setModuleDefault(result, mod); |
| 3084 | return result; |
| 3085 | } |
| 3086 | |
| 3087 | function __importDefault(mod) { |
| 3088 | return (mod && mod.__esModule) ? mod : { default: mod }; |
| 3089 | } |
| 3090 | |
| 3091 | function __classPrivateFieldGet(receiver, state, kind, f) { |
| 3092 | if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); |
| 3093 | if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); |
| 3094 | return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); |
| 3095 | } |
| 3096 | |
| 3097 | function __classPrivateFieldSet(receiver, state, value, kind, f) { |
| 3098 | if (kind === "m") throw new TypeError("Private method is not writable"); |
| 3099 | if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); |
| 3100 | if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); |
| 3101 | return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; |
| 3102 | } |
| 3103 | |
| 3104 | function __classPrivateFieldIn(state, receiver) { |
| 3105 | if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); |
| 3106 | return typeof state === "function" ? receiver === state : state.has(receiver); |
| 3107 | } |
| 3108 | |
| 3109 | function __addDisposableResource(env, value, async) { |
| 3110 | if (value !== null && value !== void 0) { |
| 3111 | if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); |
| 3112 | var dispose; |
| 3113 | if (async) { |
| 3114 | if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); |
| 3115 | dispose = value[Symbol.asyncDispose]; |
| 3116 | } |
| 3117 | if (dispose === void 0) { |
| 3118 | if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); |
| 3119 | dispose = value[Symbol.dispose]; |
| 3120 | } |
| 3121 | if (typeof dispose !== "function") throw new TypeError("Object not disposable."); |
| 3122 | env.stack.push({ value: value, dispose: dispose, async: async }); |
| 3123 | } |
| 3124 | else if (async) { |
| 3125 | env.stack.push({ async: true }); |
| 3126 | } |
| 3127 | return value; |
| 3128 | } |
| 3129 | |
| 3130 | var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { |
| 3131 | var e = new Error(message); |
| 3132 | return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; |
| 3133 | }; |
| 3134 | |
| 3135 | function __disposeResources(env) { |
| 3136 | function fail(e) { |
| 3137 | env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; |
| 3138 | env.hasError = true; |
| 3139 | } |
| 3140 | function next() { |
| 3141 | while (env.stack.length) { |
| 3142 | var rec = env.stack.pop(); |
| 3143 | try { |
| 3144 | var result = rec.dispose && rec.dispose.call(rec.value); |
| 3145 | if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); |
| 3146 | } |
| 3147 | catch (e) { |
| 3148 | fail(e); |
| 3149 | } |
| 3150 | } |
| 3151 | if (env.hasError) throw env.error; |
| 3152 | } |
| 3153 | return next(); |
| 3154 | } |
| 3155 | |
| 3156 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
| 3157 | __extends, |
| 3158 | __assign, |
| 3159 | __rest, |
| 3160 | __decorate, |
| 3161 | __param, |
| 3162 | __metadata, |
| 3163 | __awaiter, |
| 3164 | __generator, |
| 3165 | __createBinding, |
| 3166 | __exportStar, |
| 3167 | __values, |
| 3168 | __read, |
| 3169 | __spread, |
| 3170 | __spreadArrays, |
| 3171 | __spreadArray, |
| 3172 | __await, |
| 3173 | __asyncGenerator, |
| 3174 | __asyncDelegator, |
| 3175 | __asyncValues, |
| 3176 | __makeTemplateObject, |
| 3177 | __importStar, |
| 3178 | __importDefault, |
| 3179 | __classPrivateFieldGet, |
| 3180 | __classPrivateFieldSet, |
| 3181 | __classPrivateFieldIn, |
| 3182 | __addDisposableResource, |
| 3183 | __disposeResources, |
| 3184 | }); |
| 3185 | |
| 3186 | |
| 3187 | /***/ }), |
| 3188 | |
| 3189 | /***/ "./assets/js/blocks/price-filter/block.json": |
| 3190 | /*!**************************************************!*\ |
| 3191 | !*** ./assets/js/blocks/price-filter/block.json ***! |
| 3192 | \**************************************************/ |
| 3193 | /***/ ((module) => { |
| 3194 | |
| 3195 | "use strict"; |
| 3196 | module.exports = JSON.parse('{"name":"woocommerce/price-filter","version":"1.0.0","title":"Filter by Price Controls","description":"Enable customers to filter the product grid by choosing a price range.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false,"color":{"text":true,"background":false},"inserter":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"showInputFields":{"type":"boolean","default":true},"inlineInput":{"type":"boolean","default":false},"showFilterButton":{"type":"boolean","default":false},"headingLevel":{"type":"number","default":3}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}'); |
| 3197 | |
| 3198 | /***/ }) |
| 3199 | |
| 3200 | }]); |
| 3201 | //# sourceMappingURL=price-filter-wrapper-frontend.js.map?ver=223e530bb5f26d421220 |