PluginProbe ʕ •ᴥ•ʔ
WooCommerce / 8.5.0-beta.1
WooCommerce v8.5.0-beta.1
10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 7.8.0-beta.1 7.8.0-beta.2 7.8.0-rc.1 7.8.0-rc.2 7.8.1 7.8.2 7.8.3 7.8.4 7.9.0 7.9.0-beta.1 7.9.0-beta.2 7.9.0-rc.2 7.9.0-rc.3 7.9.1 7.9.2 8.0.0 8.0.0-beta.1 8.0.0-beta.2 8.0.0-rc.1 8.0.0-rc.2 8.0.1 8.0.2 8.0.3 8.0.4 8.0.5 8.1.0 8.1.0-beta.1 8.1.0-rc.1 8.1.0-rc.2 8.1.1 8.1.2 8.1.3 8.1.4 8.2.0 8.2.0-beta.1 8.2.0-rc.1 8.2.0-rc.2 8.2.1 8.2.2 8.2.3 8.2.4 8.2.5 8.3.0 8.3.0-beta.1 8.3.0-rc.1 8.3.0-rc.2 8.3.1 8.3.2 8.3.3 8.3.4 8.4.0 8.4.0-beta.1 8.4.0-rc.1 8.4.1 8.4.2 8.4.3 8.5.0 8.5.0-beta.1 8.5.0-rc.1 8.5.1 8.5.2 8.5.3 8.5.4 8.5.5 8.6.0 8.6.0-beta.1 8.6.0-rc.1 8.6.1 8.6.2 8.6.3 8.6.4 8.7.0 8.7.0-beta.1 8.7.0-beta.2 8.7.0-rc.1 8.7.1 8.7.2 8.7.3 8.8.0 8.8.0-beta.1 8.8.0-rc.1 8.8.1 8.8.2 8.8.3 8.8.4 8.8.5 8.8.6 8.8.7 8.9.0 8.9.0-beta.1 8.9.0-rc.1 8.9.1 8.9.2 8.9.3 8.9.4 8.9.5 9.0.0 9.0.0-beta.1 9.0.0-beta.2 9.0.0-rc.1 9.0.1 9.0.2 9.0.3 9.0.4 9.1.0 9.1.0-beta.1 9.1.0-rc.1 9.1.1 9.1.2 9.1.3 9.1.4 9.1.5 9.1.6 9.2.0 9.2.0-beta.1 9.2.0-rc.1 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.3.0 9.3.0-beta.1 9.3.0-rc.1 9.3.1 9.3.2 9.3.3 9.3.4 9.3.5 9.3.6 9.4.0 9.4.0-beta.1 9.4.0-beta.2 9.4.0-rc.1 9.4.0-rc.2 9.4.0-rc.3 9.4.0-rc.4 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.5.0 9.5.0-beta.1 9.5.0-beta.2 9.5.0-rc.1 9.5.1 9.5.2 9.5.3 9.5.4 9.6.0 9.6.0-beta.1 9.6.0-beta.2 9.6.0-rc.1 9.6.1 9.6.2 9.6.3 9.6.4 9.7.0 9.7.0-beta.1 9.7.0-rc.1 9.7.1 9.7.2 9.7.3 9.8.0 9.8.0-beta.1 9.8.0-rc.1 9.8.1 9.8.2 9.8.3 9.8.4 9.8.5 9.8.6 9.8.7 9.9.0 9.9.0-beta.1 9.9.0-rc.1 9.9.1 9.9.2 9.9.3 9.9.4 9.9.5 9.9.6 9.9.7 3.7.3 7.1.2 3.8.0 7.2.0 3.8.0-beta.1 7.2.0-beta.1 3.8.0-rc.1 7.2.0-beta.2 3.8.0-rc.2 7.2.0-rc.1 3.8.1 7.2.0-rc.2 3.8.2 7.2.1 3.8.3 7.2.2 3.9.0 7.2.3 3.9.0-beta.1 7.2.4 3.9.0-beta.2 7.3.0 3.9.0-rc.1 7.3.0-beta.1 3.9.0-rc.2 7.3.0-beta.2 3.9.0-rc.3 7.3.0-rc.1 3.9.0-rc.4 7.3.0-rc.2 3.9.1 7.3.1 3.9.2 7.4.0 3.9.3 7.4.0-beta.1 3.9.4 7.4.0-beta.2 3.9.5 7.4.0-rc.1 4.0.0 7.4.0-rc.2 4.0.0-beta.1 7.4.1 4.0.0-rc.1 7.4.2 4.0.0-rc.2 7.5.0 4.0.1 7.5.0-beta.1 4.0.2 7.5.0-beta.2 4.0.3 7.5.0-rc.1 4.0.4 7.5.1 4.1.0 7.5.2 4.1.0-beta.1 7.6.0 4.1.0-beta.2 7.6.0-beta.1 4.1.0-rc.1 7.6.0-beta.2 4.1.0-rc.2 7.6.0-rc.1 4.1.1 7.6.0-rc.2 4.1.2 7.6.0-rc.3 4.1.3 7.6.1 4.1.4 7.6.2 4.2.0 7.7.0 4.2.0-RC.1 7.7.0-beta.1 4.2.0-RC.2 7.7.0-beta.2 4.2.0-beta.1 7.7.0-rc.1 4.2.1 7.7.1 4.2.2 7.7.2 4.2.3 7.7.3 4.2.4 7.8.0 4.2.5 4.3.0 4.3.0-beta.1 4.3.0-rc.1 4.3.0-rc.2 4.3.0-rc.3 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.4.0 4.4.0-beta.1 4.4.0-rc.1 4.4.1 4.4.2 4.4.3 4.4.4 4.5.0 4.5.0-beta.1 4.5.0-rc.1 4.5.0-rc.3 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.0-beta.1 4.6.0-rc.1 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.7.0 4.7.0-beta.1 4.7.0-beta.2 4.7.0-rc.1 4.7.1 4.7.1-beta.1 4.7.2 4.7.3 4.7.4 4.8.0 4.8.0-beta.1 4.8.0-rc.1 4.8.0-rc.2 4.8.1 4.8.2 4.8.3 4.9.0 4.9.0-beta.1 4.9.0-rc.1 4.9.0-rc.2 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 5.0.0 5.0.0-beta.1 5.0.0-beta.2 5.0.0-rc.1 5.0.0-rc.2 5.0.0-rc.3 5.0.1 5.0.2 5.0.3 5.1.0 5.1.0-beta.1 5.1.0-rc.1 trunk 5.1.1 10.0.0 5.1.2 10.0.0-rc.1 5.1.3 10.0.0-rc.2 5.2.0 10.0.1 5.2.0-beta.1 10.0.2 5.2.0-rc.1 10.0.3 5.2.0-rc.2 10.0.4 5.2.1 10.0.5 5.2.2 10.0.6 5.2.3 10.1.0 5.2.4 10.1.0-rc.1 5.2.5 10.1.0-rc.2 5.3.0 10.1.0-rc.3 5.3.0-beta.1 10.1.0-rc.4 5.3.0-rc.1 10.1.1 5.3.0-rc.2 10.1.2 5.3.1 10.1.3 5.3.2 10.1.4 5.3.3 10.2.0 5.4.0 10.2.0-beta.1 5.4.0-beta.1 10.2.0-beta.2 5.4.0-rc.1 10.2.0-rc.1 5.4.1 10.2.1 5.4.2 10.2.2 5.4.3 10.2.3 5.4.4 10.2.4 5.4.5 10.3.0 5.5.0 10.3.0-beta.1 5.5.0-beta.1 10.3.0-beta.2 5.5.0-rc.1 10.3.0-rc.1 5.5.0-rc.2 10.3.0-rc.2 5.5.1 10.3.1 5.5.2 10.3.2 5.5.3 10.3.3 5.5.4 10.3.4 5.5.5 10.3.5 5.6.0 10.3.6 5.6.0-beta.1 10.3.7 5.6.0-rc.1 10.3.8 5.6.0-rc.2 10.4.0 5.6.1 10.4.0-beta.1 5.6.2 10.4.0-beta.2 5.6.3 10.4.0-rc.1 5.7.0 10.4.1 5.7.0-beta.1 10.4.2 5.7.0-rc.1 10.4.3 5.7.1 10.4.4 5.7.2 10.5.0 5.7.3 10.5.0-beta.1 5.8.0 10.5.0-beta.2 5.8.0-beta.1 10.5.0-rc.1 5.8.0-beta.2 10.5.0-rc.2 5.8.0-rc.1 10.5.0-rc.3 5.8.1 10.5.1 5.8.2 10.5.2 5.9.0 10.5.3 5.9.0-beta.1 10.6.0 5.9.0-rc.1 10.6.0-beta.1 5.9.0-rc.2 10.6.0-beta.2 5.9.1 10.6.0-rc.1 5.9.2 10.6.1 6.0.0 10.6.2 6.0.0-beta.1 10.7.0 6.0.0-rc.1 10.7.0-beta.1 6.0.1 10.7.0-beta.2 6.0.2 10.7.0-rc.1 6.1.0 3.0.0 6.1.0-beta.1 3.0.1 6.1.0-rc.1 3.0.2 6.1.0-rc.2 3.0.3 6.1.1 3.0.4 6.1.2 3.0.5 6.1.3 3.0.6 6.2.0 3.0.7 6.2.0-beta.1 3.0.8 6.2.0-rc.1 3.0.9 6.2.0-rc.2 3.1.0 6.2.1 3.1.1 6.2.2 3.1.2 6.2.3 3.2.0 6.3.0 3.2.1 6.3.0-beta.1 3.2.2 6.3.0-rc.1 3.2.3 6.3.0-rc.2 3.2.4 6.3.1 3.2.5 6.3.2 3.2.6 6.4.0 3.3.0 6.4.0-beta.1 3.3.1 6.4.0-rc.1 3.3.2 6.4.1 3.3.2-rc.1 6.4.2 3.3.3 6.5.0 3.3.4 6.5.0-beta.1 3.3.5 6.5.0-rc.1 3.3.6 6.5.0-rc.2 3.4.0 6.5.1 3.4.0-beta.1 6.5.2 3.4.0-rc.2 6.6.0 3.4.1 6.6.0-beta.1 3.4.2 6.6.0-rc.1 3.4.3 6.6.0-rc.2 3.4.4 6.6.1 3.4.5 6.6.2 3.4.6 6.7.0 3.4.7 6.7.0-beta.1 3.4.8 6.7.0-beta.2 3.5.0 6.7.0-rc.1 3.5.0-beta.1 6.7.1 3.5.0-rc.1 6.8.0 3.5.0-rc.2 6.8.0-beta.1 3.5.1 6.8.0-beta.2 3.5.10 6.8.0-rc.1 3.5.2 6.8.1 3.5.3 6.8.2 3.5.4 6.8.3 3.5.5 6.9.0 3.5.6 6.9.0-beta.1 3.5.7 6.9.0-beta.2 3.5.8 6.9.0-rc.1 3.5.9 6.9.1 3.6.0 6.9.2 3.6.0-beta.1 6.9.3 3.6.0-rc.1 6.9.4 3.6.0-rc.2 6.9.5 3.6.0-rc.3 7.0.0 3.6.1 7.0.0-beta.1 3.6.2 7.0.0-beta.2 3.6.3 7.0.0-beta.3 3.6.4 7.0.0-rc.1 3.6.5 7.0.0-rc.2 3.6.6 7.0.1 3.6.7 7.0.2 3.7.0 7.1.0 3.7.0-beta.1 7.1.0-beta.1 3.7.0-rc.1 7.1.0-beta.2 3.7.0-rc.2 7.1.0-rc.1 3.7.1 7.1.0-rc.2 3.7.2 7.1.1
woocommerce / assets / client / blocks / mini-cart-contents.js
woocommerce / assets / client / blocks Last commit date
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
mini-cart-contents.js
9224 lines
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./assets/js/base/components/button/index.tsx":
5 /*!****************************************************!*\
6 !*** ./assets/js/base/components/button/index.tsx ***!
7 \****************************************************/
8 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14 /* harmony export */ });
15 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
16 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
17 /* harmony import */ var wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! wordpress-components */ "../../node_modules/.pnpm/@wordpress+components@14.2.0_@types+react@17.0.71_react-dom@17.0.2_react-with-direction@1.4.0_g43nmvk3ohn3r3z6u5eunaboqa/node_modules/@wordpress/components/build-module/button/index.js");
18 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
19 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
20 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/button/style.scss");
21 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_2__);
22 /* harmony import */ var _packages_components_spinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../packages/components/spinner */ "./packages/components/spinner/index.tsx");
23
24 /**
25 * External dependencies
26 */
27
28
29
30 /**
31 * Internal dependencies
32 */
33
34
35 /**
36 * Component that visually renders a button but semantically might be `<button>` or `<a>` depending
37 * on the props.
38 */
39 const Button = ({
40 className,
41 showSpinner = false,
42 children,
43 variant = 'contained',
44 ...props
45 }) => {
46 const buttonClassName = classnames__WEBPACK_IMPORTED_MODULE_1___default()('wc-block-components-button', 'wp-element-button', className, variant, {
47 'wc-block-components-button--loading': showSpinner
48 });
49 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(wordpress_components__WEBPACK_IMPORTED_MODULE_4__["default"], {
50 className: buttonClassName,
51 ...props
52 }, showSpinner && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_packages_components_spinner__WEBPACK_IMPORTED_MODULE_3__["default"], null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
53 className: "wc-block-components-button__text"
54 }, children));
55 };
56 Button.__docgenInfo = {
57 "description": "Component that visually renders a button but semantically might be `<button>` or `<a>` depending\non the props.",
58 "methods": [],
59 "displayName": "Button",
60 "props": {
61 "showSpinner": {
62 "defaultValue": {
63 "value": "false",
64 "computed": false
65 },
66 "required": false,
67 "tsType": {
68 "name": "union",
69 "raw": "boolean | undefined",
70 "elements": [{
71 "name": "boolean"
72 }, {
73 "name": "undefined"
74 }]
75 },
76 "description": "Show spinner\n\n@default false"
77 },
78 "variant": {
79 "defaultValue": {
80 "value": "'contained'",
81 "computed": false
82 },
83 "required": false,
84 "tsType": {
85 "name": "union",
86 "raw": "'text' | 'contained' | 'outlined'",
87 "elements": [{
88 "name": "literal",
89 "value": "'text'"
90 }, {
91 "name": "literal",
92 "value": "'contained'"
93 }, {
94 "name": "literal",
95 "value": "'outlined'"
96 }]
97 },
98 "description": "Button variant"
99 },
100 "href": {
101 "required": false,
102 "tsType": {
103 "name": "union",
104 "raw": "string | undefined",
105 "elements": [{
106 "name": "string"
107 }, {
108 "name": "undefined"
109 }]
110 },
111 "description": "The URL the button should link to."
112 }
113 },
114 "composes": ["Omit"]
115 };
116 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Button);
117 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
118 STORYBOOK_REACT_CLASSES["assets/js/base/components/button/index.tsx"] = {
119 name: "Button",
120 docgenInfo: Button.__docgenInfo,
121 path: "assets/js/base/components/button/index.tsx"
122 };
123 }
124
125 /***/ }),
126
127 /***/ "./assets/js/base/components/cart-checkout/address-form/prepare-address-fields.ts":
128 /*!****************************************************************************************!*\
129 !*** ./assets/js/base/components/cart-checkout/address-form/prepare-address-fields.ts ***!
130 \****************************************************************************************/
131 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
132
133 "use strict";
134 __webpack_require__.r(__webpack_exports__);
135 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
136 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
137 /* harmony export */ });
138 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
139 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__);
140 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
141 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
142 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/number.ts");
143 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts");
144 /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts");
145 /** @typedef { import('@woocommerce/type-defs/address-fields').CountryAddressFields } CountryAddressFields */
146
147 /**
148 * External dependencies
149 */
150
151
152
153
154
155 /**
156 * Gets props from the core locale, then maps them to the shape we require in the client.
157 *
158 * Ignores "class", "type", "placeholder", and "autocomplete" props from core.
159 *
160 * @param {Object} localeField Locale fields from WooCommerce.
161 * @return {Object} Supported locale fields.
162 */
163 const getSupportedCoreLocaleProps = localeField => {
164 const fields = {};
165 if (localeField.label !== undefined) {
166 fields.label = localeField.label;
167 }
168 if (localeField.required !== undefined) {
169 fields.required = localeField.required;
170 }
171 if (localeField.hidden !== undefined) {
172 fields.hidden = localeField.hidden;
173 }
174 if (localeField.label !== undefined && !localeField.optionalLabel) {
175 fields.optionalLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %s Field label. */
176 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%s (optional)', 'woocommerce'), localeField.label);
177 }
178 if (localeField.priority) {
179 if ((0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_3__.isNumber)(localeField.priority)) {
180 fields.index = localeField.priority;
181 }
182 if ((0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_4__.isString)(localeField.priority)) {
183 fields.index = parseInt(localeField.priority, 10);
184 }
185 }
186 if (localeField.hidden) {
187 fields.required = false;
188 }
189 return fields;
190 };
191
192 /**
193 * COUNTRY_LOCALE is locale data from WooCommerce countries class. This doesn't match the shape of the new field data blocks uses,
194 * but we can import part of it to set which fields are required.
195 *
196 * This supports new properties such as optionalLabel which are not used by core (yet).
197 */
198 const countryAddressFields = Object.entries(_woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__.COUNTRY_LOCALE).map(([country, countryLocale]) => [country, Object.entries(countryLocale).map(([localeFieldKey, localeField]) => [localeFieldKey, getSupportedCoreLocaleProps(localeField)]).reduce((obj, [key, val]) => {
199 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
200 // @ts-ignore - Ignoring because it should be fine as long as the data from the server is correct. TS won't catch it anyway if it's not.
201 obj[key] = val;
202 return obj;
203 }, {})]).reduce((obj, [key, val]) => {
204 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
205 // @ts-ignore - Ignoring because it should be fine as long as the data from the server is correct. TS won't catch it anyway if it's not.
206 obj[key] = val;
207 return obj;
208 }, {});
209
210 /**
211 * Combines address fields, including fields from the locale, and sorts them by index.
212 *
213 * @param {Array} fields List of field keys--only address fields matching these will be returned.
214 * @param {Object} fieldConfigs Fields config contains field specific overrides at block level which may, for example, hide a field.
215 * @param {string} addressCountry Address country code. If unknown, locale fields will not be merged.
216 * @return {CountryAddressFields} Object containing address fields.
217 */
218 const prepareAddressFields = (fields, fieldConfigs, addressCountry = '') => {
219 const localeConfigs = addressCountry && countryAddressFields[addressCountry] !== undefined ? countryAddressFields[addressCountry] : {};
220 return fields.map(field => {
221 const defaultConfig = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.defaultFields[field] || {};
222 const localeConfig = localeConfigs[field] || {};
223 const fieldConfig = fieldConfigs[field] || {};
224 return {
225 key: field,
226 ...defaultConfig,
227 ...localeConfig,
228 ...fieldConfig
229 };
230 }).sort((a, b) => a.index - b.index);
231 };
232 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (prepareAddressFields);
233
234 /***/ }),
235
236 /***/ "./assets/js/base/components/cart-checkout/cart-line-items-table/cart-line-item-row.tsx":
237 /*!**********************************************************************************************!*\
238 !*** ./assets/js/base/components/cart-checkout/cart-line-items-table/cart-line-item-row.tsx ***!
239 \**********************************************************************************************/
240 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
241
242 "use strict";
243 __webpack_require__.r(__webpack_exports__);
244 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
245 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
246 /* harmony export */ });
247 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
248 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
249 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
250 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
251 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
252 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
253 /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/a11y */ "@wordpress/a11y");
254 /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__);
255 /* harmony import */ var _woocommerce_base_components_quantity_selector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-components/quantity-selector */ "./assets/js/base/components/quantity-selector/index.tsx");
256 /* harmony import */ var _woocommerce_base_components_product_price__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/base-components/product-price */ "./assets/js/base/components/product-price/index.tsx");
257 /* harmony import */ var _woocommerce_base_components_product_name__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/base-components/product-name */ "./assets/js/base/components/product-name/index.tsx");
258 /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts");
259 /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/use-store-events.ts");
260 /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/cart/use-store-cart.ts");
261 /* harmony import */ var _woocommerce_price_format__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @woocommerce/price-format */ "@woocommerce/price-format");
262 /* harmony import */ var _woocommerce_price_format__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_7__);
263 /* harmony import */ var _woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @woocommerce/blocks-checkout */ "@woocommerce/blocks-checkout");
264 /* harmony import */ var _woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__);
265 /* harmony import */ var dinero_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! dinero.js */ "../../node_modules/.pnpm/dinero.js@1.9.1/node_modules/dinero.js/build/esm/dinero.js");
266 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
267 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__);
268 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts");
269 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
270 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_11__);
271 /* harmony import */ var _product_backorder_badge__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../product-backorder-badge */ "./assets/js/base/components/cart-checkout/product-backorder-badge/index.tsx");
272 /* harmony import */ var _product_image__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../product-image */ "./assets/js/base/components/cart-checkout/product-image/index.tsx");
273 /* harmony import */ var _product_low_stock_badge__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../product-low-stock-badge */ "./assets/js/base/components/cart-checkout/product-low-stock-badge/index.tsx");
274 /* harmony import */ var _product_metadata__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../product-metadata */ "./assets/js/base/components/cart-checkout/product-metadata/index.tsx");
275 /* harmony import */ var _product_sale_badge__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../product-sale-badge */ "./assets/js/base/components/cart-checkout/product-sale-badge/index.tsx");
276
277 /**
278 * External dependencies
279 */
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294 /**
295 * Internal dependencies
296 */
297
298
299
300
301
302
303 /**
304 * Convert a Dinero object with precision to store currency minor unit.
305 *
306 * @param {Dinero} priceObject Price object to convert.
307 * @param {Object} currency Currency data.
308 * @return {number} Amount with new minor unit precision.
309 */
310 const getAmountFromRawPrice = (priceObject, currency) => {
311 return priceObject.convertPrecision(currency.minorUnit).getAmount();
312 };
313 const productPriceValidation = value => (0,_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__.mustContain)(value, '<price/>');
314 /**
315 * Cart line item table row component.
316 */
317 const CartLineItemRow = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.forwardRef)(({
318 lineItem,
319 onRemove = () => void null,
320 tabIndex
321 }, ref) => {
322 const {
323 name: initialName = '',
324 catalog_visibility: catalogVisibility = 'visible',
325 short_description: shortDescription = '',
326 description: fullDescription = '',
327 low_stock_remaining: lowStockRemaining = null,
328 show_backorder_badge: showBackorderBadge = false,
329 quantity_limits: quantityLimits = {
330 minimum: 1,
331 maximum: 99,
332 multiple_of: 1,
333 editable: true
334 },
335 sold_individually: soldIndividually = false,
336 permalink = '',
337 images = [],
338 variation = [],
339 item_data: itemData = [],
340 prices = {
341 currency_code: 'USD',
342 currency_minor_unit: 2,
343 currency_symbol: '$',
344 currency_prefix: '$',
345 currency_suffix: '',
346 currency_decimal_separator: '.',
347 currency_thousand_separator: ',',
348 price: '0',
349 regular_price: '0',
350 sale_price: '0',
351 price_range: null,
352 raw_prices: {
353 precision: 6,
354 price: '0',
355 regular_price: '0',
356 sale_price: '0'
357 }
358 },
359 totals = {
360 currency_code: 'USD',
361 currency_minor_unit: 2,
362 currency_symbol: '$',
363 currency_prefix: '$',
364 currency_suffix: '',
365 currency_decimal_separator: '.',
366 currency_thousand_separator: ',',
367 line_subtotal: '0',
368 line_subtotal_tax: '0'
369 },
370 extensions
371 } = lineItem;
372 const {
373 quantity,
374 setItemQuantity,
375 removeItem,
376 isPendingDelete
377 } = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_17__.useStoreCartItemQuantity)(lineItem);
378 const {
379 dispatchStoreEvent
380 } = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_18__.useStoreEvents)();
381
382 // Prepare props to pass to the applyCheckoutFilter filter.
383 // We need to pluck out receiveCart.
384 // eslint-disable-next-line no-unused-vars
385 const {
386 receiveCart,
387 ...cart
388 } = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_19__.useStoreCart)();
389 const arg = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useMemo)(() => ({
390 context: 'cart',
391 cartItem: lineItem,
392 cart
393 }), [lineItem, cart]);
394 const priceCurrency = (0,_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_7__.getCurrencyFromPriceResponse)(prices);
395 const name = (0,_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__.applyCheckoutFilter)({
396 filterName: 'itemName',
397 defaultValue: initialName,
398 extensions,
399 arg
400 });
401 const regularAmountSingle = (0,dinero_js__WEBPACK_IMPORTED_MODULE_9__["default"])({
402 amount: parseInt(prices.raw_prices.regular_price, 10),
403 precision: prices.raw_prices.precision
404 });
405 const purchaseAmountSingle = (0,dinero_js__WEBPACK_IMPORTED_MODULE_9__["default"])({
406 amount: parseInt(prices.raw_prices.price, 10),
407 precision: prices.raw_prices.precision
408 });
409 const saleAmountSingle = regularAmountSingle.subtract(purchaseAmountSingle);
410 const saleAmount = saleAmountSingle.multiply(quantity);
411 const totalsCurrency = (0,_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_7__.getCurrencyFromPriceResponse)(totals);
412 let lineSubtotal = parseInt(totals.line_subtotal, 10);
413 if ((0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_11__.getSetting)('displayCartPricesIncludingTax', false)) {
414 lineSubtotal += parseInt(totals.line_subtotal_tax, 10);
415 }
416 const subtotalPrice = (0,dinero_js__WEBPACK_IMPORTED_MODULE_9__["default"])({
417 amount: lineSubtotal,
418 precision: totalsCurrency.minorUnit
419 });
420 const firstImage = images.length ? images[0] : {};
421 const isProductHiddenFromCatalog = catalogVisibility === 'hidden' || catalogVisibility === 'search';
422 const cartItemClassNameFilter = (0,_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__.applyCheckoutFilter)({
423 filterName: 'cartItemClass',
424 defaultValue: '',
425 extensions,
426 arg
427 });
428
429 // Allow extensions to filter how the price is displayed. Ie: prepending or appending some values.
430 const productPriceFormat = (0,_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__.applyCheckoutFilter)({
431 filterName: 'cartItemPrice',
432 defaultValue: '<price/>',
433 extensions,
434 arg,
435 validation: productPriceValidation
436 });
437 const subtotalPriceFormat = (0,_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__.applyCheckoutFilter)({
438 filterName: 'subtotalPriceFormat',
439 defaultValue: '<price/>',
440 extensions,
441 arg,
442 validation: productPriceValidation
443 });
444 const saleBadgePriceFormat = (0,_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__.applyCheckoutFilter)({
445 filterName: 'saleBadgePriceFormat',
446 defaultValue: '<price/>',
447 extensions,
448 arg,
449 validation: productPriceValidation
450 });
451 const showRemoveItemLink = (0,_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_8__.applyCheckoutFilter)({
452 filterName: 'showRemoveItemLink',
453 defaultValue: true,
454 extensions,
455 arg
456 });
457 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("tr", {
458 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('wc-block-cart-items__row', cartItemClassNameFilter, {
459 'is-disabled': isPendingDelete
460 }),
461 ref: ref,
462 tabIndex: tabIndex
463 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("td", {
464 className: "wc-block-cart-item__image",
465 "aria-hidden": !(0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_20__.objectHasProp)(firstImage, 'alt') || !firstImage.alt
466 }, isProductHiddenFromCatalog ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_image__WEBPACK_IMPORTED_MODULE_13__["default"], {
467 image: firstImage,
468 fallbackAlt: name
469 }) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
470 href: permalink,
471 tabIndex: -1
472 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_image__WEBPACK_IMPORTED_MODULE_13__["default"], {
473 image: firstImage,
474 fallbackAlt: name
475 }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("td", {
476 className: "wc-block-cart-item__product"
477 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
478 className: "wc-block-cart-item__wrap"
479 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_name__WEBPACK_IMPORTED_MODULE_6__["default"], {
480 disabled: isPendingDelete || isProductHiddenFromCatalog,
481 name: name,
482 permalink: permalink
483 }), showBackorderBadge ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_backorder_badge__WEBPACK_IMPORTED_MODULE_12__["default"], null) : !!lowStockRemaining && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_low_stock_badge__WEBPACK_IMPORTED_MODULE_14__["default"], {
484 lowStockRemaining: lowStockRemaining
485 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
486 className: "wc-block-cart-item__prices"
487 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_price__WEBPACK_IMPORTED_MODULE_5__["default"], {
488 currency: priceCurrency,
489 regularPrice: getAmountFromRawPrice(regularAmountSingle, priceCurrency),
490 price: getAmountFromRawPrice(purchaseAmountSingle, priceCurrency),
491 format: subtotalPriceFormat
492 })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_sale_badge__WEBPACK_IMPORTED_MODULE_16__["default"], {
493 currency: priceCurrency,
494 saleAmount: getAmountFromRawPrice(saleAmountSingle, priceCurrency),
495 format: saleBadgePriceFormat
496 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_metadata__WEBPACK_IMPORTED_MODULE_15__["default"], {
497 shortDescription: shortDescription,
498 fullDescription: fullDescription,
499 itemData: itemData,
500 variation: variation
501 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
502 className: "wc-block-cart-item__quantity"
503 }, !soldIndividually && !!quantityLimits.editable && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_quantity_selector__WEBPACK_IMPORTED_MODULE_4__["default"], {
504 disabled: isPendingDelete,
505 quantity: quantity,
506 minimum: quantityLimits.minimum,
507 maximum: quantityLimits.maximum,
508 step: quantityLimits.multiple_of,
509 onChange: newQuantity => {
510 setItemQuantity(newQuantity);
511 dispatchStoreEvent('cart-set-item-quantity', {
512 product: lineItem,
513 quantity: newQuantity
514 });
515 },
516 itemName: name
517 }), showRemoveItemLink && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
518 className: "wc-block-cart-item__remove-link",
519 "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: %s refers to the item's name in the cart. */
520 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Remove %s from cart', 'woocommerce'), name),
521 onClick: () => {
522 onRemove();
523 removeItem();
524 dispatchStoreEvent('cart-remove-item', {
525 product: lineItem,
526 quantity
527 });
528 (0,_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__.speak)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: %s refers to the item name in the cart. */
529 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s has been removed from your cart.', 'woocommerce'), name));
530 },
531 disabled: isPendingDelete
532 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Remove item', 'woocommerce'))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("td", {
533 className: "wc-block-cart-item__total"
534 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
535 className: "wc-block-cart-item__total-price-and-sale-badge-wrapper"
536 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_product_price__WEBPACK_IMPORTED_MODULE_5__["default"], {
537 currency: totalsCurrency,
538 format: productPriceFormat,
539 price: subtotalPrice.getAmount()
540 }), quantity > 1 && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_sale_badge__WEBPACK_IMPORTED_MODULE_16__["default"], {
541 currency: priceCurrency,
542 saleAmount: getAmountFromRawPrice(saleAmount, priceCurrency),
543 format: saleBadgePriceFormat
544 }))));
545 });
546 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CartLineItemRow);
547
548 /***/ }),
549
550 /***/ "./assets/js/base/components/cart-checkout/cart-line-items-table/index.tsx":
551 /*!*********************************************************************************!*\
552 !*** ./assets/js/base/components/cart-checkout/cart-line-items-table/index.tsx ***!
553 \*********************************************************************************/
554 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
555
556 "use strict";
557 __webpack_require__.r(__webpack_exports__);
558 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
559 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
560 /* harmony export */ });
561 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
562 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
563 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
564 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
565 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
566 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
567 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
568 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
569 /* harmony import */ var _cart_line_item_row__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cart-line-item-row */ "./assets/js/base/components/cart-checkout/cart-line-items-table/cart-line-item-row.tsx");
570 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/cart-checkout/cart-line-items-table/style.scss");
571 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_5__);
572
573 /**
574 * External dependencies
575 */
576
577
578
579 /**
580 * Internal dependencies
581 */
582
583
584 const placeholderRows = [...Array(3)].map((_x, i) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_cart_line_item_row__WEBPACK_IMPORTED_MODULE_4__["default"], {
585 lineItem: {},
586 key: i
587 }));
588 const setRefs = lineItems => {
589 const refs = {};
590 lineItems.forEach(({
591 key
592 }) => {
593 refs[key] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createRef)();
594 });
595 return refs;
596 };
597 const CartLineItemsTable = ({
598 lineItems = [],
599 isLoading = false,
600 className
601 }) => {
602 const tableRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
603 const rowRefs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(setRefs(lineItems));
604 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
605 rowRefs.current = setRefs(lineItems);
606 }, [lineItems]);
607 const onRemoveRow = nextItemKey => () => {
608 if (rowRefs !== null && rowRefs !== void 0 && rowRefs.current && nextItemKey && rowRefs.current[nextItemKey].current instanceof HTMLElement) {
609 rowRefs.current[nextItemKey].current.focus();
610 } else if (tableRef.current instanceof HTMLElement) {
611 tableRef.current.focus();
612 }
613 };
614 const products = isLoading ? placeholderRows : lineItems.map((lineItem, i) => {
615 const nextItemKey = lineItems.length > i + 1 ? lineItems[i + 1].key : null;
616 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_cart_line_item_row__WEBPACK_IMPORTED_MODULE_4__["default"], {
617 key: lineItem.key,
618 lineItem: lineItem,
619 onRemove: onRemoveRow(nextItemKey),
620 ref: rowRefs.current[lineItem.key],
621 tabIndex: -1
622 });
623 });
624 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("table", {
625 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('wc-block-cart-items', className),
626 ref: tableRef,
627 tabIndex: -1
628 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("thead", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("tr", {
629 className: "wc-block-cart-items__header"
630 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("th", {
631 className: "wc-block-cart-items__header-image"
632 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Product', 'woocommerce'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("th", {
633 className: "wc-block-cart-items__header-product"
634 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Details', 'woocommerce'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("th", {
635 className: "wc-block-cart-items__header-total"
636 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Total', 'woocommerce'))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("tbody", null, products));
637 };
638 CartLineItemsTable.__docgenInfo = {
639 "description": "",
640 "methods": [],
641 "displayName": "CartLineItemsTable",
642 "props": {
643 "lineItems": {
644 "defaultValue": {
645 "value": "[]",
646 "computed": false
647 },
648 "required": false,
649 "tsType": {
650 "name": "Array",
651 "elements": [{
652 "name": "CartResponseItem"
653 }],
654 "raw": "CartResponseItem[]"
655 },
656 "description": ""
657 },
658 "isLoading": {
659 "defaultValue": {
660 "value": "false",
661 "computed": false
662 },
663 "required": false,
664 "tsType": {
665 "name": "boolean"
666 },
667 "description": ""
668 },
669 "className": {
670 "required": false,
671 "tsType": {
672 "name": "string"
673 },
674 "description": ""
675 }
676 }
677 };
678 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CartLineItemsTable);
679 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
680 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/cart-line-items-table/index.tsx"] = {
681 name: "CartLineItemsTable",
682 docgenInfo: CartLineItemsTable.__docgenInfo,
683 path: "assets/js/base/components/cart-checkout/cart-line-items-table/index.tsx"
684 };
685 }
686
687 /***/ }),
688
689 /***/ "./assets/js/base/components/cart-checkout/payment-method-icons/common-icons.ts":
690 /*!**************************************************************************************!*\
691 !*** ./assets/js/base/components/cart-checkout/payment-method-icons/common-icons.ts ***!
692 \**************************************************************************************/
693 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
694
695 "use strict";
696 __webpack_require__.r(__webpack_exports__);
697 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
698 /* harmony export */ commonIcons: () => (/* binding */ commonIcons),
699 /* harmony export */ getCommonIconProps: () => (/* binding */ getCommonIconProps)
700 /* harmony export */ });
701 /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts");
702 /**
703 * External dependencies
704 */
705
706 /**
707 * Array of common assets.
708 */
709 const commonIcons = [{
710 id: 'alipay',
711 alt: 'Alipay',
712 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/alipay.svg'
713 }, {
714 id: 'amex',
715 alt: 'American Express',
716 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/amex.svg'
717 }, {
718 id: 'bancontact',
719 alt: 'Bancontact',
720 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/bancontact.svg'
721 }, {
722 id: 'diners',
723 alt: 'Diners Club',
724 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/diners.svg'
725 }, {
726 id: 'discover',
727 alt: 'Discover',
728 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/discover.svg'
729 }, {
730 id: 'eps',
731 alt: 'EPS',
732 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/eps.svg'
733 }, {
734 id: 'giropay',
735 alt: 'Giropay',
736 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/giropay.svg'
737 }, {
738 id: 'ideal',
739 alt: 'iDeal',
740 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/ideal.svg'
741 }, {
742 id: 'jcb',
743 alt: 'JCB',
744 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/jcb.svg'
745 }, {
746 id: 'laser',
747 alt: 'Laser',
748 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/laser.svg'
749 }, {
750 id: 'maestro',
751 alt: 'Maestro',
752 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/maestro.svg'
753 }, {
754 id: 'mastercard',
755 alt: 'Mastercard',
756 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/mastercard.svg'
757 }, {
758 id: 'multibanco',
759 alt: 'Multibanco',
760 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/multibanco.svg'
761 }, {
762 id: 'p24',
763 alt: 'Przelewy24',
764 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/p24.svg'
765 }, {
766 id: 'sepa',
767 alt: 'Sepa',
768 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/sepa.svg'
769 }, {
770 id: 'sofort',
771 alt: 'Sofort',
772 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/sofort.svg'
773 }, {
774 id: 'unionpay',
775 alt: 'Union Pay',
776 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/unionpay.svg'
777 }, {
778 id: 'visa',
779 alt: 'Visa',
780 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/visa.svg'
781 }, {
782 id: 'wechat',
783 alt: 'WeChat',
784 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL + 'payment-methods/wechat.svg'
785 }];
786
787 /**
788 * For a given ID, see if a common icon exists and return it's props.
789 *
790 * @param {string} id Icon ID.
791 */
792 const getCommonIconProps = id => {
793 return commonIcons.find(icon => {
794 return icon.id === id;
795 }) || {};
796 };
797
798 /***/ }),
799
800 /***/ "./assets/js/base/components/cart-checkout/payment-method-icons/index.tsx":
801 /*!********************************************************************************!*\
802 !*** ./assets/js/base/components/cart-checkout/payment-method-icons/index.tsx ***!
803 \********************************************************************************/
804 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
805
806 "use strict";
807 __webpack_require__.r(__webpack_exports__);
808 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
809 /* harmony export */ PaymentMethodIcons: () => (/* binding */ PaymentMethodIcons),
810 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
811 /* harmony export */ });
812 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
813 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
814 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
815 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
816 /* harmony import */ var _payment_method_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./payment-method-icon */ "./assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.tsx");
817 /* harmony import */ var _common_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./common-icons */ "./assets/js/base/components/cart-checkout/payment-method-icons/common-icons.ts");
818 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./assets/js/base/components/cart-checkout/payment-method-icons/utils.ts");
819 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/cart-checkout/payment-method-icons/style.scss");
820 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_5__);
821
822 /**
823 * External dependencies
824 */
825
826 /**
827 * Internal dependencies
828 */
829
830
831
832
833 /**
834 * For a given list of icons, render each as a list item, using common icons
835 * where available.
836 */
837 const PaymentMethodIcons = ({
838 icons = [],
839 align = 'center',
840 className
841 }) => {
842 const iconConfigs = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.normalizeIconConfig)(icons);
843 if (iconConfigs.length === 0) {
844 return null;
845 }
846 const containerClass = classnames__WEBPACK_IMPORTED_MODULE_1___default()('wc-block-components-payment-method-icons', {
847 'wc-block-components-payment-method-icons--align-left': align === 'left',
848 'wc-block-components-payment-method-icons--align-right': align === 'right'
849 }, className);
850 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
851 className: containerClass
852 }, iconConfigs.map(icon => {
853 const iconProps = {
854 ...icon,
855 ...(0,_common_icons__WEBPACK_IMPORTED_MODULE_3__.getCommonIconProps)(icon.id)
856 };
857 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_payment_method_icon__WEBPACK_IMPORTED_MODULE_2__["default"], {
858 key: 'payment-method-icon-' + icon.id,
859 ...iconProps
860 });
861 }));
862 };
863 PaymentMethodIcons.__docgenInfo = {
864 "description": "For a given list of icons, render each as a list item, using common icons\nwhere available.",
865 "methods": [],
866 "displayName": "PaymentMethodIcons",
867 "props": {
868 "icons": {
869 "defaultValue": {
870 "value": "[]",
871 "computed": false
872 },
873 "required": false,
874 "tsType": {
875 "name": "PaymentMethodIconsType"
876 },
877 "description": ""
878 },
879 "align": {
880 "defaultValue": {
881 "value": "'center'",
882 "computed": false
883 },
884 "required": false,
885 "tsType": {
886 "name": "union",
887 "raw": "'left' | 'right' | 'center'",
888 "elements": [{
889 "name": "literal",
890 "value": "'left'"
891 }, {
892 "name": "literal",
893 "value": "'right'"
894 }, {
895 "name": "literal",
896 "value": "'center'"
897 }]
898 },
899 "description": ""
900 },
901 "className": {
902 "required": false,
903 "tsType": {
904 "name": "string"
905 },
906 "description": ""
907 }
908 }
909 };
910 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PaymentMethodIcons);
911 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
912 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/payment-method-icons/index.tsx"] = {
913 name: "PaymentMethodIcons",
914 docgenInfo: PaymentMethodIcons.__docgenInfo,
915 path: "assets/js/base/components/cart-checkout/payment-method-icons/index.tsx"
916 };
917 }
918
919 /***/ }),
920
921 /***/ "./assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.tsx":
922 /*!**********************************************************************************************!*\
923 !*** ./assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.tsx ***!
924 \**********************************************************************************************/
925 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
926
927 "use strict";
928 __webpack_require__.r(__webpack_exports__);
929 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
930 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
931 /* harmony export */ });
932 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
933 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
934
935 /**
936 * Get a class name for an icon.
937 *
938 * @param {string} id Icon ID.
939 */
940 const getIconClassName = id => {
941 return `wc-block-components-payment-method-icon wc-block-components-payment-method-icon--${id}`;
942 };
943 /**
944 * Return an element for an icon.
945 *
946 * @param {Object} props Incoming props for component.
947 * @param {string} props.id Id for component.
948 * @param {string|null} props.src Optional src value for icon.
949 * @param {string} props.alt Optional alt value for icon.
950 */
951 const PaymentMethodIcon = ({
952 id,
953 src = null,
954 alt = ''
955 }) => {
956 if (!src) {
957 return null;
958 }
959 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
960 className: getIconClassName(id),
961 src: src,
962 alt: alt
963 });
964 };
965 PaymentMethodIcon.__docgenInfo = {
966 "description": "Return an element for an icon.\n\n@param {Object} props Incoming props for component.\n@param {string} props.id Id for component.\n@param {string|null} props.src Optional src value for icon.\n@param {string} props.alt Optional alt value for icon.",
967 "methods": [],
968 "displayName": "PaymentMethodIcon",
969 "props": {
970 "src": {
971 "defaultValue": {
972 "value": "null",
973 "computed": false
974 },
975 "required": false,
976 "tsType": {
977 "name": "union",
978 "raw": "string | null",
979 "elements": [{
980 "name": "string"
981 }, {
982 "name": "null"
983 }]
984 },
985 "description": ""
986 },
987 "alt": {
988 "defaultValue": {
989 "value": "''",
990 "computed": false
991 },
992 "required": false,
993 "tsType": {
994 "name": "string"
995 },
996 "description": ""
997 },
998 "id": {
999 "required": true,
1000 "tsType": {
1001 "name": "string"
1002 },
1003 "description": ""
1004 }
1005 }
1006 };
1007 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PaymentMethodIcon);
1008 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1009 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.tsx"] = {
1010 name: "PaymentMethodIcon",
1011 docgenInfo: PaymentMethodIcon.__docgenInfo,
1012 path: "assets/js/base/components/cart-checkout/payment-method-icons/payment-method-icon.tsx"
1013 };
1014 }
1015
1016 /***/ }),
1017
1018 /***/ "./assets/js/base/components/cart-checkout/payment-method-icons/utils.ts":
1019 /*!*******************************************************************************!*\
1020 !*** ./assets/js/base/components/cart-checkout/payment-method-icons/utils.ts ***!
1021 \*******************************************************************************/
1022 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1023
1024 "use strict";
1025 __webpack_require__.r(__webpack_exports__);
1026 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1027 /* harmony export */ normalizeIconConfig: () => (/* binding */ normalizeIconConfig)
1028 /* harmony export */ });
1029 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts");
1030 /**
1031 * External dependencies
1032 */
1033
1034
1035
1036 /**
1037 * For an array of icons, normalize into objects and remove duplicates.
1038 */
1039 const normalizeIconConfig = icons => {
1040 const normalizedIcons = {};
1041 icons.forEach(raw => {
1042 let icon = {};
1043 if (typeof raw === 'string') {
1044 icon = {
1045 id: raw,
1046 alt: raw,
1047 src: null
1048 };
1049 }
1050 if (typeof raw === 'object') {
1051 icon = {
1052 id: raw.id || '',
1053 alt: raw.alt || '',
1054 src: raw.src || null
1055 };
1056 }
1057 if (icon.id && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.isString)(icon.id) && !normalizedIcons[icon.id]) {
1058 normalizedIcons[icon.id] = icon;
1059 }
1060 });
1061 return Object.values(normalizedIcons);
1062 };
1063
1064 /***/ }),
1065
1066 /***/ "./assets/js/base/components/cart-checkout/product-backorder-badge/index.tsx":
1067 /*!***********************************************************************************!*\
1068 !*** ./assets/js/base/components/cart-checkout/product-backorder-badge/index.tsx ***!
1069 \***********************************************************************************/
1070 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1071
1072 "use strict";
1073 __webpack_require__.r(__webpack_exports__);
1074 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1075 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1076 /* harmony export */ });
1077 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1078 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1079 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1080 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
1081 /* harmony import */ var _product_badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../product-badge */ "./assets/js/base/components/cart-checkout/product-badge/index.tsx");
1082
1083 /**
1084 * External dependencies
1085 */
1086
1087
1088 /**
1089 * Internal dependencies
1090 */
1091
1092
1093 /**
1094 * Returns a backorder badge.
1095 */
1096 const ProductBackorderBadge = () => {
1097 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_badge__WEBPACK_IMPORTED_MODULE_2__["default"], {
1098 className: "wc-block-components-product-backorder-badge"
1099 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Available on backorder', 'woocommerce'));
1100 };
1101 ProductBackorderBadge.__docgenInfo = {
1102 "description": "Returns a backorder badge.",
1103 "methods": [],
1104 "displayName": "ProductBackorderBadge"
1105 };
1106 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductBackorderBadge);
1107 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1108 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/product-backorder-badge/index.tsx"] = {
1109 name: "ProductBackorderBadge",
1110 docgenInfo: ProductBackorderBadge.__docgenInfo,
1111 path: "assets/js/base/components/cart-checkout/product-backorder-badge/index.tsx"
1112 };
1113 }
1114
1115 /***/ }),
1116
1117 /***/ "./assets/js/base/components/cart-checkout/product-badge/index.tsx":
1118 /*!*************************************************************************!*\
1119 !*** ./assets/js/base/components/cart-checkout/product-badge/index.tsx ***!
1120 \*************************************************************************/
1121 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1122
1123 "use strict";
1124 __webpack_require__.r(__webpack_exports__);
1125 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1126 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1127 /* harmony export */ });
1128 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1129 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1130 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
1131 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
1132 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/cart-checkout/product-badge/style.scss");
1133 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_2__);
1134
1135 /**
1136 * External dependencies
1137 */
1138
1139 /**
1140 * Internal dependencies
1141 */
1142
1143 const ProductBadge = ({
1144 children,
1145 className
1146 }) => {
1147 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1148 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('wc-block-components-product-badge', className)
1149 }, children);
1150 };
1151 ProductBadge.__docgenInfo = {
1152 "description": "",
1153 "methods": [],
1154 "displayName": "ProductBadge",
1155 "props": {
1156 "children": {
1157 "required": false,
1158 "tsType": {
1159 "name": "ReactNode"
1160 },
1161 "description": ""
1162 },
1163 "className": {
1164 "required": false,
1165 "tsType": {
1166 "name": "string"
1167 },
1168 "description": ""
1169 }
1170 }
1171 };
1172 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductBadge);
1173 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1174 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/product-badge/index.tsx"] = {
1175 name: "ProductBadge",
1176 docgenInfo: ProductBadge.__docgenInfo,
1177 path: "assets/js/base/components/cart-checkout/product-badge/index.tsx"
1178 };
1179 }
1180
1181 /***/ }),
1182
1183 /***/ "./assets/js/base/components/cart-checkout/product-details/index.tsx":
1184 /*!***************************************************************************!*\
1185 !*** ./assets/js/base/components/cart-checkout/product-details/index.tsx ***!
1186 \***************************************************************************/
1187 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1188
1189 "use strict";
1190 __webpack_require__.r(__webpack_exports__);
1191 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1192 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1193 /* harmony export */ });
1194 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1195 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1196 /* harmony import */ var change_case__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! change-case */ "../../node_modules/.pnpm/param-case@3.0.4/node_modules/param-case/dist.es2015/index.js");
1197 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
1198 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
1199 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/cart-checkout/product-details/style.scss");
1200 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_2__);
1201
1202 /**
1203 * External dependencies
1204 */
1205
1206
1207 /**
1208 * Internal dependencies
1209 */
1210
1211 // Component to display cart item data and variations.
1212 const ProductDetails = ({
1213 details = []
1214 }) => {
1215 if (!Array.isArray(details)) {
1216 return null;
1217 }
1218 details = details.filter(detail => !detail.hidden);
1219 if (details.length === 0) {
1220 return null;
1221 }
1222 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", {
1223 className: "wc-block-components-product-details"
1224 }, details.map(detail => {
1225 // Support both `key` and `name` props
1226 const name = (detail === null || detail === void 0 ? void 0 : detail.key) || detail.name || '';
1227 const className = (detail === null || detail === void 0 ? void 0 : detail.className) || (name ? `wc-block-components-product-details__${(0,change_case__WEBPACK_IMPORTED_MODULE_3__.paramCase)(name)}` : '');
1228 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", {
1229 key: name + (detail.display || detail.value),
1230 className: className
1231 }, name && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1232 className: "wc-block-components-product-details__name"
1233 }, (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(name), ":"), ' '), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1234 className: "wc-block-components-product-details__value"
1235 }, (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(detail.display || detail.value)));
1236 }));
1237 };
1238 ProductDetails.__docgenInfo = {
1239 "description": "",
1240 "methods": [],
1241 "displayName": "ProductDetails",
1242 "props": {
1243 "details": {
1244 "defaultValue": {
1245 "value": "[]",
1246 "computed": false
1247 },
1248 "required": false,
1249 "tsType": {
1250 "name": "Array",
1251 "elements": [{
1252 "name": "ProductResponseItemData"
1253 }],
1254 "raw": "ProductResponseItemData[]"
1255 },
1256 "description": ""
1257 }
1258 }
1259 };
1260 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductDetails);
1261 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1262 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/product-details/index.tsx"] = {
1263 name: "ProductDetails",
1264 docgenInfo: ProductDetails.__docgenInfo,
1265 path: "assets/js/base/components/cart-checkout/product-details/index.tsx"
1266 };
1267 }
1268
1269 /***/ }),
1270
1271 /***/ "./assets/js/base/components/cart-checkout/product-image/index.tsx":
1272 /*!*************************************************************************!*\
1273 !*** ./assets/js/base/components/cart-checkout/product-image/index.tsx ***!
1274 \*************************************************************************/
1275 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1276
1277 "use strict";
1278 __webpack_require__.r(__webpack_exports__);
1279 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1280 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1281 /* harmony export */ });
1282 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1283 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1284 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
1285 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
1286 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
1287 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__);
1288
1289 /**
1290 * External dependencies
1291 */
1292
1293
1294 /**
1295 * Formats and returns an image element.
1296 *
1297 * @param {Object} props Incoming props for the component.
1298 * @param {Object} props.image Image properties.
1299 */
1300
1301 const ProductImage = ({
1302 image = {},
1303 fallbackAlt = ''
1304 }) => {
1305 const imageProps = image.thumbnail ? {
1306 src: image.thumbnail,
1307 alt: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(image.alt) || fallbackAlt || 'Product Image'
1308 } : {
1309 src: _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.PLACEHOLDER_IMG_SRC,
1310 alt: ''
1311 };
1312 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
1313 ...imageProps,
1314 alt: imageProps.alt
1315 });
1316 };
1317 ProductImage.__docgenInfo = {
1318 "description": "Formats and returns an image element.\n\n@param {Object} props Incoming props for the component.\n@param {Object} props.image Image properties.",
1319 "methods": [],
1320 "displayName": "ProductImage",
1321 "props": {
1322 "image": {
1323 "defaultValue": {
1324 "value": "{}",
1325 "computed": false
1326 },
1327 "required": false,
1328 "tsType": {
1329 "name": "signature",
1330 "type": "object",
1331 "raw": "{ alt?: string; thumbnail?: string }",
1332 "signature": {
1333 "properties": [{
1334 "key": "alt",
1335 "value": {
1336 "name": "string",
1337 "required": false
1338 }
1339 }, {
1340 "key": "thumbnail",
1341 "value": {
1342 "name": "string",
1343 "required": false
1344 }
1345 }]
1346 }
1347 },
1348 "description": ""
1349 },
1350 "fallbackAlt": {
1351 "defaultValue": {
1352 "value": "''",
1353 "computed": false
1354 },
1355 "required": false,
1356 "tsType": {
1357 "name": "string"
1358 },
1359 "description": ""
1360 }
1361 }
1362 };
1363 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductImage);
1364 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1365 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/product-image/index.tsx"] = {
1366 name: "ProductImage",
1367 docgenInfo: ProductImage.__docgenInfo,
1368 path: "assets/js/base/components/cart-checkout/product-image/index.tsx"
1369 };
1370 }
1371
1372 /***/ }),
1373
1374 /***/ "./assets/js/base/components/cart-checkout/product-low-stock-badge/index.tsx":
1375 /*!***********************************************************************************!*\
1376 !*** ./assets/js/base/components/cart-checkout/product-low-stock-badge/index.tsx ***!
1377 \***********************************************************************************/
1378 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1379
1380 "use strict";
1381 __webpack_require__.r(__webpack_exports__);
1382 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1383 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1384 /* harmony export */ });
1385 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1386 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1387 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1388 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
1389 /* harmony import */ var _product_badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../product-badge */ "./assets/js/base/components/cart-checkout/product-badge/index.tsx");
1390
1391 /**
1392 * External dependencies
1393 */
1394
1395
1396 /**
1397 * Internal dependencies
1398 */
1399
1400 /**
1401 * Returns a low stock badge.
1402 *
1403 * @param {Object} props Incoming props for the component.
1404 * @param {number} props.lowStockRemaining Whether or not there is low stock remaining.
1405 */
1406 const ProductLowStockBadge = ({
1407 lowStockRemaining
1408 }) => {
1409 if (!lowStockRemaining) {
1410 return null;
1411 }
1412 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_badge__WEBPACK_IMPORTED_MODULE_2__["default"], {
1413 className: "wc-block-components-product-low-stock-badge"
1414 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %d stock amount (number of items in stock for product) */
1415 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%d left in stock', 'woocommerce'), lowStockRemaining));
1416 };
1417 ProductLowStockBadge.__docgenInfo = {
1418 "description": "Returns a low stock badge.\n\n@param {Object} props Incoming props for the component.\n@param {number} props.lowStockRemaining Whether or not there is low stock remaining.",
1419 "methods": [],
1420 "displayName": "ProductLowStockBadge",
1421 "props": {
1422 "lowStockRemaining": {
1423 "required": true,
1424 "tsType": {
1425 "name": "union",
1426 "raw": "number | null",
1427 "elements": [{
1428 "name": "number"
1429 }, {
1430 "name": "null"
1431 }]
1432 },
1433 "description": ""
1434 }
1435 }
1436 };
1437 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductLowStockBadge);
1438 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1439 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/product-low-stock-badge/index.tsx"] = {
1440 name: "ProductLowStockBadge",
1441 docgenInfo: ProductLowStockBadge.__docgenInfo,
1442 path: "assets/js/base/components/cart-checkout/product-low-stock-badge/index.tsx"
1443 };
1444 }
1445
1446 /***/ }),
1447
1448 /***/ "./assets/js/base/components/cart-checkout/product-metadata/index.tsx":
1449 /*!****************************************************************************!*\
1450 !*** ./assets/js/base/components/cart-checkout/product-metadata/index.tsx ***!
1451 \****************************************************************************/
1452 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1453
1454 "use strict";
1455 __webpack_require__.r(__webpack_exports__);
1456 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1457 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1458 /* harmony export */ });
1459 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1460 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1461 /* harmony import */ var _product_details__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../product-details */ "./assets/js/base/components/cart-checkout/product-details/index.tsx");
1462 /* harmony import */ var _product_summary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../product-summary */ "./assets/js/base/components/cart-checkout/product-summary/index.tsx");
1463 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/cart-checkout/product-metadata/style.scss");
1464 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_3__);
1465
1466 /**
1467 * External dependencies
1468 */
1469
1470 /**
1471 * Internal dependencies
1472 */
1473
1474
1475
1476 const ProductMetadata = ({
1477 shortDescription = '',
1478 fullDescription = '',
1479 itemData = [],
1480 variation = []
1481 }) => {
1482 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1483 className: "wc-block-components-product-metadata"
1484 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_summary__WEBPACK_IMPORTED_MODULE_2__["default"], {
1485 className: "wc-block-components-product-metadata__description",
1486 shortDescription: shortDescription,
1487 fullDescription: fullDescription
1488 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_details__WEBPACK_IMPORTED_MODULE_1__["default"], {
1489 details: itemData
1490 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_details__WEBPACK_IMPORTED_MODULE_1__["default"], {
1491 details: variation.map(({
1492 attribute = '',
1493 value
1494 }) => ({
1495 key: attribute,
1496 value
1497 }))
1498 }));
1499 };
1500 ProductMetadata.__docgenInfo = {
1501 "description": "",
1502 "methods": [],
1503 "displayName": "ProductMetadata",
1504 "props": {
1505 "shortDescription": {
1506 "defaultValue": {
1507 "value": "''",
1508 "computed": false
1509 },
1510 "required": false,
1511 "tsType": {
1512 "name": "string"
1513 },
1514 "description": ""
1515 },
1516 "fullDescription": {
1517 "defaultValue": {
1518 "value": "''",
1519 "computed": false
1520 },
1521 "required": false,
1522 "tsType": {
1523 "name": "string"
1524 },
1525 "description": ""
1526 },
1527 "itemData": {
1528 "defaultValue": {
1529 "value": "[]",
1530 "computed": false
1531 },
1532 "required": false,
1533 "tsType": {
1534 "name": "Array",
1535 "elements": [{
1536 "name": "ProductResponseItemData"
1537 }],
1538 "raw": "ProductResponseItemData[]"
1539 },
1540 "description": ""
1541 },
1542 "variation": {
1543 "defaultValue": {
1544 "value": "[]",
1545 "computed": false
1546 },
1547 "required": false,
1548 "tsType": {
1549 "name": "Array",
1550 "elements": [{
1551 "name": "CartVariationItem"
1552 }],
1553 "raw": "CartVariationItem[]"
1554 },
1555 "description": ""
1556 }
1557 }
1558 };
1559 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductMetadata);
1560 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1561 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/product-metadata/index.tsx"] = {
1562 name: "ProductMetadata",
1563 docgenInfo: ProductMetadata.__docgenInfo,
1564 path: "assets/js/base/components/cart-checkout/product-metadata/index.tsx"
1565 };
1566 }
1567
1568 /***/ }),
1569
1570 /***/ "./assets/js/base/components/cart-checkout/product-sale-badge/index.tsx":
1571 /*!******************************************************************************!*\
1572 !*** ./assets/js/base/components/cart-checkout/product-sale-badge/index.tsx ***!
1573 \******************************************************************************/
1574 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1575
1576 "use strict";
1577 __webpack_require__.r(__webpack_exports__);
1578 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1579 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1580 /* harmony export */ });
1581 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1582 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1583 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
1584 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
1585 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1586 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
1587 /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components");
1588 /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__);
1589 /* harmony import */ var _product_badge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../product-badge */ "./assets/js/base/components/cart-checkout/product-badge/index.tsx");
1590
1591 /**
1592 * External dependencies
1593 */
1594
1595
1596
1597 /**
1598 * Internal dependencies
1599 */
1600
1601 /**
1602 * ProductSaleBadge
1603 *
1604 * @param {Object} props Incoming props.
1605 * @param {Object} props.currency Currency object.
1606 * @param {number} props.saleAmount Discounted amount.
1607 * @param {string} [props.format] Format to change the price.
1608 * @return {*} The component.
1609 */
1610 const ProductSaleBadge = ({
1611 currency,
1612 saleAmount,
1613 format = '<price/>'
1614 }) => {
1615 if (!saleAmount || saleAmount <= 0) {
1616 return null;
1617 }
1618 if (!format.includes('<price/>')) {
1619 format = '<price/>';
1620 // eslint-disable-next-line no-console
1621 console.error('Price formats need to include the `<price/>` tag.');
1622 }
1623 const formattedMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: %s will be replaced by the discount amount */
1624 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(`Save %s`, 'woocommerce'), format);
1625 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_product_badge__WEBPACK_IMPORTED_MODULE_4__["default"], {
1626 className: "wc-block-components-sale-badge"
1627 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createInterpolateElement)(formattedMessage, {
1628 price: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_3__.FormattedMonetaryAmount, {
1629 currency: currency,
1630 value: saleAmount
1631 })
1632 }));
1633 };
1634 ProductSaleBadge.__docgenInfo = {
1635 "description": "ProductSaleBadge\n\n@param {Object} props Incoming props.\n@param {Object} props.currency Currency object.\n@param {number} props.saleAmount Discounted amount.\n@param {string} [props.format] Format to change the price.\n@return {*} The component.",
1636 "methods": [],
1637 "displayName": "ProductSaleBadge",
1638 "props": {
1639 "format": {
1640 "defaultValue": {
1641 "value": "'<price/>'",
1642 "computed": false
1643 },
1644 "required": false,
1645 "tsType": {
1646 "name": "string"
1647 },
1648 "description": ""
1649 },
1650 "currency": {
1651 "required": true,
1652 "tsType": {
1653 "name": "Currency"
1654 },
1655 "description": ""
1656 },
1657 "saleAmount": {
1658 "required": true,
1659 "tsType": {
1660 "name": "number"
1661 },
1662 "description": ""
1663 }
1664 }
1665 };
1666 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductSaleBadge);
1667 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1668 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/product-sale-badge/index.tsx"] = {
1669 name: "ProductSaleBadge",
1670 docgenInfo: ProductSaleBadge.__docgenInfo,
1671 path: "assets/js/base/components/cart-checkout/product-sale-badge/index.tsx"
1672 };
1673 }
1674
1675 /***/ }),
1676
1677 /***/ "./assets/js/base/components/cart-checkout/product-summary/index.tsx":
1678 /*!***************************************************************************!*\
1679 !*** ./assets/js/base/components/cart-checkout/product-summary/index.tsx ***!
1680 \***************************************************************************/
1681 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1682
1683 "use strict";
1684 __webpack_require__.r(__webpack_exports__);
1685 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1686 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1687 /* harmony export */ });
1688 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1689 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1690 /* harmony import */ var _woocommerce_base_components_summary__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/base-components/summary */ "./assets/js/base/components/summary/index.tsx");
1691 /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts");
1692
1693 /**
1694 * External dependencies
1695 */
1696
1697
1698 /**
1699 * Returns an element containing a summary of the product.
1700 *
1701 * @param {Object} props Incoming props for the component.
1702 * @param {string} props.className CSS class name used.
1703 * @param {string} props.shortDescription Short description for the product.
1704 * @param {string} props.fullDescription Full description for the product.
1705 */
1706 const ProductSummary = ({
1707 className,
1708 shortDescription = '',
1709 fullDescription = ''
1710 }) => {
1711 const source = shortDescription ? shortDescription : fullDescription;
1712 if (!source) {
1713 return null;
1714 }
1715 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_summary__WEBPACK_IMPORTED_MODULE_1__["default"], {
1716 className: className,
1717 source: source,
1718 maxLength: 15,
1719 countType: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__.blocksConfig.wordCountType || 'words'
1720 });
1721 };
1722 ProductSummary.__docgenInfo = {
1723 "description": "Returns an element containing a summary of the product.\n\n@param {Object} props Incoming props for the component.\n@param {string} props.className CSS class name used.\n@param {string} props.shortDescription Short description for the product.\n@param {string} props.fullDescription Full description for the product.",
1724 "methods": [],
1725 "displayName": "ProductSummary",
1726 "props": {
1727 "shortDescription": {
1728 "defaultValue": {
1729 "value": "''",
1730 "computed": false
1731 },
1732 "required": false,
1733 "tsType": {
1734 "name": "string"
1735 },
1736 "description": ""
1737 },
1738 "fullDescription": {
1739 "defaultValue": {
1740 "value": "''",
1741 "computed": false
1742 },
1743 "required": false,
1744 "tsType": {
1745 "name": "string"
1746 },
1747 "description": ""
1748 },
1749 "className": {
1750 "required": false,
1751 "tsType": {
1752 "name": "string"
1753 },
1754 "description": ""
1755 }
1756 }
1757 };
1758 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductSummary);
1759 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1760 STORYBOOK_REACT_CLASSES["assets/js/base/components/cart-checkout/product-summary/index.tsx"] = {
1761 name: "ProductSummary",
1762 docgenInfo: ProductSummary.__docgenInfo,
1763 path: "assets/js/base/components/cart-checkout/product-summary/index.tsx"
1764 };
1765 }
1766
1767 /***/ }),
1768
1769 /***/ "./assets/js/base/components/noninteractive/index.tsx":
1770 /*!************************************************************!*\
1771 !*** ./assets/js/base/components/noninteractive/index.tsx ***!
1772 \************************************************************/
1773 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1774
1775 "use strict";
1776 __webpack_require__.r(__webpack_exports__);
1777 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1778 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1779 /* harmony export */ });
1780 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1781 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1782 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
1783 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
1784 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
1785 /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__);
1786 /* harmony import */ var use_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! use-debounce */ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js");
1787
1788 /**
1789 * External dependencies
1790 */
1791
1792
1793
1794
1795 /**
1796 * Names of control nodes which need to be disabled.
1797 */
1798 const FOCUSABLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP', 'OPTION', 'SELECT', 'TEXTAREA', 'A'];
1799
1800 /**
1801 * Noninteractive component
1802 *
1803 * Makes children elements Noninteractive, preventing both mouse and keyboard events without affecting how the elements
1804 * appear visually. Used for previews.
1805 *
1806 * Based on the <Disabled> component in WordPress.
1807 *
1808 * @see https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/disabled/index.js
1809 */
1810 const Noninteractive = ({
1811 children,
1812 style = {},
1813 ...props
1814 }) => {
1815 const node = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1816 const disableFocus = () => {
1817 if (node.current) {
1818 _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__.focus.focusable.find(node.current).forEach(focusable => {
1819 if (FOCUSABLE_NODE_NAMES.includes(focusable.nodeName)) {
1820 focusable.setAttribute('tabindex', '-1');
1821 }
1822 if (focusable.hasAttribute('contenteditable')) {
1823 focusable.setAttribute('contenteditable', 'false');
1824 }
1825 });
1826 }
1827 };
1828
1829 // Debounce re-disable since disabling process itself will incur additional mutations which should be ignored.
1830 const debounced = (0,use_debounce__WEBPACK_IMPORTED_MODULE_3__.useDebouncedCallback)(disableFocus, 0, {
1831 leading: true
1832 });
1833 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
1834 let observer;
1835 disableFocus();
1836 if (node.current) {
1837 observer = new window.MutationObserver(debounced);
1838 observer.observe(node.current, {
1839 childList: true,
1840 attributes: true,
1841 subtree: true
1842 });
1843 }
1844 return () => {
1845 if (observer) {
1846 observer.disconnect();
1847 }
1848 debounced.cancel();
1849 };
1850 }, [debounced]);
1851 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1852 ref: node,
1853 "aria-disabled": "true",
1854 style: {
1855 userSelect: 'none',
1856 pointerEvents: 'none',
1857 cursor: 'normal',
1858 ...style
1859 },
1860 ...props
1861 }, children);
1862 };
1863 Noninteractive.__docgenInfo = {
1864 "description": "Noninteractive component\n\nMakes children elements Noninteractive, preventing both mouse and keyboard events without affecting how the elements\nappear visually. Used for previews.\n\nBased on the <Disabled> component in WordPress.\n\n@see https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/disabled/index.js",
1865 "methods": [],
1866 "displayName": "Noninteractive",
1867 "props": {
1868 "style": {
1869 "defaultValue": {
1870 "value": "{}",
1871 "computed": false
1872 },
1873 "required": false,
1874 "tsType": {
1875 "name": "Record",
1876 "elements": [{
1877 "name": "string"
1878 }, {
1879 "name": "string"
1880 }],
1881 "raw": "Record< string, string >"
1882 },
1883 "description": ""
1884 },
1885 "children": {
1886 "required": true,
1887 "tsType": {
1888 "name": "ReactReactNode",
1889 "raw": "React.ReactNode"
1890 },
1891 "description": ""
1892 }
1893 }
1894 };
1895 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Noninteractive);
1896 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
1897 STORYBOOK_REACT_CLASSES["assets/js/base/components/noninteractive/index.tsx"] = {
1898 name: "Noninteractive",
1899 docgenInfo: Noninteractive.__docgenInfo,
1900 path: "assets/js/base/components/noninteractive/index.tsx"
1901 };
1902 }
1903
1904 /***/ }),
1905
1906 /***/ "./assets/js/base/components/product-name/index.tsx":
1907 /*!**********************************************************!*\
1908 !*** ./assets/js/base/components/product-name/index.tsx ***!
1909 \**********************************************************/
1910 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1911
1912 "use strict";
1913 __webpack_require__.r(__webpack_exports__);
1914 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1915 /* harmony export */ ProductName: () => (/* binding */ ProductName),
1916 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1917 /* harmony export */ });
1918 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1919 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1920 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
1921 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
1922 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
1923 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
1924 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/product-name/style.scss");
1925 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_3__);
1926
1927 /**
1928 * External dependencies
1929 */
1930
1931
1932 /**
1933 * Internal dependencies
1934 */
1935
1936 /**
1937 * Render the Product name.
1938 *
1939 * The store API runs titles through `wp_kses_post()` which removes dangerous HTML tags, so using it inside `dangerouslySetInnerHTML` is considered safe.
1940 */
1941 const ProductName = ({
1942 className = '',
1943 disabled = false,
1944 name,
1945 permalink = '',
1946 target,
1947 rel,
1948 style,
1949 onClick,
1950 ...props
1951 }) => {
1952 const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('wc-block-components-product-name', className);
1953 if (disabled) {
1954 // Cast the props as type HTMLSpanElement.
1955 const disabledProps = props;
1956 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
1957 className: classes,
1958 ...disabledProps,
1959 dangerouslySetInnerHTML: {
1960 __html: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(name)
1961 }
1962 });
1963 }
1964 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
1965 className: classes,
1966 href: permalink,
1967 target: target,
1968 ...props,
1969 dangerouslySetInnerHTML: {
1970 __html: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(name)
1971 },
1972 style: style
1973 });
1974 };
1975 ProductName.__docgenInfo = {
1976 "description": "Render the Product name.\n\nThe store API runs titles through `wp_kses_post()` which removes dangerous HTML tags, so using it inside `dangerouslySetInnerHTML` is considered safe.",
1977 "methods": [],
1978 "displayName": "ProductName",
1979 "props": {
1980 "className": {
1981 "defaultValue": {
1982 "value": "''",
1983 "computed": false
1984 },
1985 "required": false
1986 },
1987 "disabled": {
1988 "defaultValue": {
1989 "value": "false",
1990 "computed": false
1991 },
1992 "required": false,
1993 "tsType": {
1994 "name": "boolean"
1995 },
1996 "description": "If `true` renders a `span` element instead of a link"
1997 },
1998 "permalink": {
1999 "defaultValue": {
2000 "value": "''",
2001 "computed": false
2002 },
2003 "required": false,
2004 "tsType": {
2005 "name": "string"
2006 },
2007 "description": "Link for the product"
2008 },
2009 "name": {
2010 "required": true,
2011 "tsType": {
2012 "name": "string"
2013 },
2014 "description": "The product name\n\nNote: can be an HTML string"
2015 },
2016 "onClick": {
2017 "required": false,
2018 "tsType": {
2019 "name": "signature",
2020 "type": "function",
2021 "raw": "() => void",
2022 "signature": {
2023 "arguments": [],
2024 "return": {
2025 "name": "void"
2026 }
2027 }
2028 },
2029 "description": "Click handler"
2030 }
2031 },
2032 "composes": ["AnchorHTMLAttributes"]
2033 };
2034 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductName);
2035 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
2036 STORYBOOK_REACT_CLASSES["assets/js/base/components/product-name/index.tsx"] = {
2037 name: "ProductName",
2038 docgenInfo: ProductName.__docgenInfo,
2039 path: "assets/js/base/components/product-name/index.tsx"
2040 };
2041 }
2042
2043 /***/ }),
2044
2045 /***/ "./assets/js/base/components/product-price/index.tsx":
2046 /*!***********************************************************!*\
2047 !*** ./assets/js/base/components/product-price/index.tsx ***!
2048 \***********************************************************/
2049 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2050
2051 "use strict";
2052 __webpack_require__.r(__webpack_exports__);
2053 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2054 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2055 /* harmony export */ });
2056 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2057 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2058 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2059 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2060 /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components");
2061 /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__);
2062 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
2063 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
2064 /* harmony import */ var _woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/price-format */ "@woocommerce/price-format");
2065 /* harmony import */ var _woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__);
2066 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
2067 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
2068 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/product-price/style.scss");
2069 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_6__);
2070
2071 /**
2072 * External dependencies
2073 */
2074
2075
2076
2077
2078
2079 /**
2080 * Internal dependencies
2081 */
2082
2083 const PriceRange = ({
2084 currency,
2085 maxPrice,
2086 minPrice,
2087 priceClassName,
2088 priceStyle = {}
2089 }) => {
2090 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2091 className: "screen-reader-text"
2092 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %1$s min price, %2$s max price */
2093 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Price between %1$s and %2$s', 'woocommerce'), (0,_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__.formatPrice)(minPrice), (0,_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__.formatPrice)(maxPrice))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2094 "aria-hidden": true
2095 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__.FormattedMonetaryAmount, {
2096 className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-components-product-price__value', priceClassName),
2097 currency: currency,
2098 value: minPrice,
2099 style: priceStyle
2100 }), "\xA0\u2014\xA0", (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__.FormattedMonetaryAmount, {
2101 className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-components-product-price__value', priceClassName),
2102 currency: currency,
2103 value: maxPrice,
2104 style: priceStyle
2105 })));
2106 };
2107 const SalePrice = ({
2108 currency,
2109 regularPriceClassName,
2110 regularPriceStyle,
2111 regularPrice,
2112 priceClassName,
2113 priceStyle,
2114 price
2115 }) => {
2116 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2117 className: "screen-reader-text"
2118 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Previous price:', 'woocommerce')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__.FormattedMonetaryAmount, {
2119 currency: currency,
2120 renderText: value => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("del", {
2121 className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-components-product-price__regular', regularPriceClassName),
2122 style: regularPriceStyle
2123 }, value),
2124 value: regularPrice
2125 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2126 className: "screen-reader-text"
2127 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Discounted price:', 'woocommerce')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__.FormattedMonetaryAmount, {
2128 currency: currency,
2129 renderText: value => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ins", {
2130 className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-components-product-price__value', 'is-discounted', priceClassName),
2131 style: priceStyle
2132 }, value),
2133 value: price
2134 }));
2135 };
2136 const ProductPrice = ({
2137 align,
2138 className,
2139 currency,
2140 format = '<price/>',
2141 maxPrice,
2142 minPrice,
2143 price,
2144 priceClassName,
2145 priceStyle,
2146 regularPrice,
2147 regularPriceClassName,
2148 regularPriceStyle,
2149 style
2150 }) => {
2151 const wrapperClassName = classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, 'price', 'wc-block-components-product-price', {
2152 [`wc-block-components-product-price--align-${align}`]: align
2153 });
2154 if (!format.includes('<price/>')) {
2155 format = '<price/>';
2156 // eslint-disable-next-line no-console
2157 console.error('Price formats need to include the `<price/>` tag.');
2158 }
2159 const isDiscounted = regularPrice && price && price < regularPrice;
2160 let priceComponent = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2161 className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-components-product-price__value', priceClassName)
2162 });
2163 if (isDiscounted) {
2164 priceComponent = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(SalePrice, {
2165 currency: currency,
2166 price: price,
2167 priceClassName: priceClassName,
2168 priceStyle: priceStyle,
2169 regularPrice: regularPrice,
2170 regularPriceClassName: regularPriceClassName,
2171 regularPriceStyle: regularPriceStyle
2172 });
2173 } else if (minPrice !== undefined && maxPrice !== undefined) {
2174 priceComponent = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(PriceRange, {
2175 currency: currency,
2176 maxPrice: maxPrice,
2177 minPrice: minPrice,
2178 priceClassName: priceClassName,
2179 priceStyle: priceStyle
2180 });
2181 } else if (price) {
2182 priceComponent = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__.FormattedMonetaryAmount, {
2183 className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-components-product-price__value', priceClassName),
2184 currency: currency,
2185 value: price,
2186 style: priceStyle
2187 });
2188 }
2189 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
2190 className: wrapperClassName,
2191 style: style
2192 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.createInterpolateElement)(format, {
2193 price: priceComponent
2194 }));
2195 };
2196 ProductPrice.__docgenInfo = {
2197 "description": "",
2198 "methods": [],
2199 "displayName": "ProductPrice",
2200 "props": {
2201 "format": {
2202 "defaultValue": {
2203 "value": "'<price/>'",
2204 "computed": false
2205 },
2206 "required": false,
2207 "tsType": {
2208 "name": "string"
2209 },
2210 "description": "The string version of the element to use for the price interpolation\n\n**Note:** It should contain `<price/>` (which is also the default value)"
2211 },
2212 "align": {
2213 "required": false,
2214 "tsType": {
2215 "name": "union",
2216 "raw": "'left' | 'center' | 'right' | undefined",
2217 "elements": [{
2218 "name": "literal",
2219 "value": "'left'"
2220 }, {
2221 "name": "literal",
2222 "value": "'center'"
2223 }, {
2224 "name": "literal",
2225 "value": "'right'"
2226 }, {
2227 "name": "undefined"
2228 }]
2229 },
2230 "description": "Where to align the wrapper\n\nApplies the `wc-block-components-product-price--align-${ align }` utility\nclass to the wrapper."
2231 },
2232 "className": {
2233 "required": false,
2234 "tsType": {
2235 "name": "union",
2236 "raw": "string | undefined",
2237 "elements": [{
2238 "name": "string"
2239 }, {
2240 "name": "undefined"
2241 }]
2242 },
2243 "description": "CSS class for the wrapper"
2244 },
2245 "currency": {
2246 "required": false,
2247 "tsType": {
2248 "name": "union",
2249 "raw": "Currency | Record< string, never >",
2250 "elements": [{
2251 "name": "Currency"
2252 }, {
2253 "name": "Record",
2254 "elements": [{
2255 "name": "string"
2256 }, {
2257 "name": "never"
2258 }],
2259 "raw": "Record< string, never >"
2260 }]
2261 },
2262 "description": "Currency configuration object"
2263 },
2264 "price": {
2265 "required": false,
2266 "tsType": {
2267 "name": "union",
2268 "raw": "number | string",
2269 "elements": [{
2270 "name": "number"
2271 }, {
2272 "name": "string"
2273 }]
2274 },
2275 "description": "The current price"
2276 },
2277 "priceClassName": {
2278 "required": false,
2279 "tsType": {
2280 "name": "string"
2281 },
2282 "description": "CSS class for the current price wrapper"
2283 },
2284 "priceStyle": {
2285 "required": false,
2286 "tsType": {
2287 "name": "union",
2288 "raw": "React.CSSProperties | undefined",
2289 "elements": [{
2290 "name": "ReactCSSProperties",
2291 "raw": "React.CSSProperties"
2292 }, {
2293 "name": "undefined"
2294 }]
2295 },
2296 "description": "Custom style for the current price"
2297 },
2298 "maxPrice": {
2299 "required": false,
2300 "tsType": {
2301 "name": "union",
2302 "raw": "number | string | undefined",
2303 "elements": [{
2304 "name": "number"
2305 }, {
2306 "name": "string"
2307 }, {
2308 "name": "undefined"
2309 }]
2310 },
2311 "description": "The maximum price in a range\n\nIf both `maxPrice` and `minPrice` are set, the component will be rendered\nas a `PriceRange` component, otherwise, this value will be ignored."
2312 },
2313 "minPrice": {
2314 "required": false,
2315 "tsType": {
2316 "name": "union",
2317 "raw": "number | string | undefined",
2318 "elements": [{
2319 "name": "number"
2320 }, {
2321 "name": "string"
2322 }, {
2323 "name": "undefined"
2324 }]
2325 },
2326 "description": "The minimum price in a range\n\nIf both `maxPrice` and `minPrice` are set, the component will be rendered\nas a `PriceRange` component, otherwise, this value will be ignored."
2327 },
2328 "regularPrice": {
2329 "required": false,
2330 "tsType": {
2331 "name": "union",
2332 "raw": "number | string | undefined",
2333 "elements": [{
2334 "name": "number"
2335 }, {
2336 "name": "string"
2337 }, {
2338 "name": "undefined"
2339 }]
2340 },
2341 "description": "The regular price if the item is currently on sale\n\nIf this property exists and is different from the current price, then the\ncomponent will be rendered as a `SalePrice` component."
2342 },
2343 "regularPriceClassName": {
2344 "required": false,
2345 "tsType": {
2346 "name": "union",
2347 "raw": "string | undefined",
2348 "elements": [{
2349 "name": "string"
2350 }, {
2351 "name": "undefined"
2352 }]
2353 },
2354 "description": "CSS class to apply to the regular price wrapper"
2355 },
2356 "regularPriceStyle": {
2357 "required": false,
2358 "tsType": {
2359 "name": "union",
2360 "raw": "React.CSSProperties | undefined",
2361 "elements": [{
2362 "name": "ReactCSSProperties",
2363 "raw": "React.CSSProperties"
2364 }, {
2365 "name": "undefined"
2366 }]
2367 },
2368 "description": "Custom style to apply to the regular price wrapper."
2369 },
2370 "style": {
2371 "required": false,
2372 "tsType": {
2373 "name": "union",
2374 "raw": "| Pick<\n\t\tReact.CSSProperties,\n\t\t'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft'\n >\n| undefined",
2375 "elements": [{
2376 "name": "Pick",
2377 "elements": [{
2378 "name": "ReactCSSProperties",
2379 "raw": "React.CSSProperties"
2380 }, {
2381 "name": "union",
2382 "raw": "'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft'",
2383 "elements": [{
2384 "name": "literal",
2385 "value": "'marginTop'"
2386 }, {
2387 "name": "literal",
2388 "value": "'marginRight'"
2389 }, {
2390 "name": "literal",
2391 "value": "'marginBottom'"
2392 }, {
2393 "name": "literal",
2394 "value": "'marginLeft'"
2395 }]
2396 }],
2397 "raw": "Pick<\nReact.CSSProperties,\n'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft'\n>"
2398 }, {
2399 "name": "undefined"
2400 }]
2401 },
2402 "description": "Custom margin to apply to the price wrapper."
2403 }
2404 }
2405 };
2406 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductPrice);
2407 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
2408 STORYBOOK_REACT_CLASSES["assets/js/base/components/product-price/index.tsx"] = {
2409 name: "ProductPrice",
2410 docgenInfo: ProductPrice.__docgenInfo,
2411 path: "assets/js/base/components/product-price/index.tsx"
2412 };
2413 }
2414
2415 /***/ }),
2416
2417 /***/ "./assets/js/base/components/quantity-selector/index.tsx":
2418 /*!***************************************************************!*\
2419 !*** ./assets/js/base/components/quantity-selector/index.tsx ***!
2420 \***************************************************************/
2421 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2422
2423 "use strict";
2424 __webpack_require__.r(__webpack_exports__);
2425 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2426 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2427 /* harmony export */ });
2428 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2429 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2430 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2431 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2432 /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/a11y */ "@wordpress/a11y");
2433 /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__);
2434 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
2435 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
2436 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
2437 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
2438 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
2439 /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__);
2440 /* harmony import */ var use_debounce__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! use-debounce */ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js");
2441 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/quantity-selector/style.scss");
2442 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_6__);
2443
2444 /**
2445 * External dependencies
2446 */
2447
2448
2449
2450
2451
2452
2453
2454 /**
2455 * Internal dependencies
2456 */
2457
2458 const QuantitySelector = ({
2459 className,
2460 quantity = 1,
2461 minimum = 1,
2462 maximum,
2463 onChange = () => void 0,
2464 step = 1,
2465 itemName = '',
2466 disabled
2467 }) => {
2468 const classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('wc-block-components-quantity-selector', className);
2469 const inputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
2470 const decreaseButtonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
2471 const increaseButtonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
2472 const hasMaximum = typeof maximum !== 'undefined';
2473 const canDecrease = !disabled && quantity - step >= minimum;
2474 const canIncrease = !disabled && (!hasMaximum || quantity + step <= maximum);
2475
2476 /**
2477 * The goal of this function is to normalize what was inserted,
2478 * but after the customer has stopped typing.
2479 */
2480 const normalizeQuantity = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(initialValue => {
2481 // We copy the starting value.
2482 let value = initialValue;
2483
2484 // We check if we have a maximum value, and select the lowest between what was inserted and the maximum.
2485 if (hasMaximum) {
2486 value = Math.min(value,
2487 // the maximum possible value in step increments.
2488 Math.floor(maximum / step) * step);
2489 }
2490
2491 // Select the biggest between what's inserted, the the minimum value in steps.
2492 value = Math.max(value, Math.ceil(minimum / step) * step);
2493
2494 // We round off the value to our steps.
2495 value = Math.floor(value / step) * step;
2496
2497 // Only commit if the value has changed
2498 if (value !== initialValue) {
2499 onChange(value);
2500 }
2501 }, [hasMaximum, maximum, minimum, onChange, step]);
2502
2503 /*
2504 * It's important to wait before normalizing or we end up with
2505 * a frustrating experience, for example, if the minimum is 2 and
2506 * the customer is trying to type "10", premature normalizing would
2507 * always kick in at "1" and turn that into 2.
2508 */
2509 const debouncedNormalizeQuantity = (0,use_debounce__WEBPACK_IMPORTED_MODULE_7__.useDebouncedCallback)(normalizeQuantity,
2510 // This value is deliberately smaller than what's in useStoreCartItemQuantity so we don't end up with two requests.
2511 300);
2512
2513 /**
2514 * Normalize qty on mount before render.
2515 */
2516 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useLayoutEffect)(() => {
2517 normalizeQuantity(quantity);
2518 }, [quantity, normalizeQuantity]);
2519
2520 /**
2521 * Handles keyboard up and down keys to change quantity value.
2522 *
2523 * @param {Object} event event data.
2524 */
2525 const quantityInputOnKeyDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(event => {
2526 const isArrowDown = typeof event.key !== undefined ? event.key === 'ArrowDown' : event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__.DOWN;
2527 const isArrowUp = typeof event.key !== undefined ? event.key === 'ArrowUp' : event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__.UP;
2528 if (isArrowDown && canDecrease) {
2529 event.preventDefault();
2530 onChange(quantity - step);
2531 }
2532 if (isArrowUp && canIncrease) {
2533 event.preventDefault();
2534 onChange(quantity + step);
2535 }
2536 }, [quantity, onChange, canIncrease, canDecrease, step]);
2537 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
2538 className: classes
2539 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", {
2540 ref: inputRef,
2541 className: "wc-block-components-quantity-selector__input",
2542 disabled: disabled,
2543 type: "number",
2544 step: step,
2545 min: minimum,
2546 max: maximum,
2547 value: quantity,
2548 onKeyDown: quantityInputOnKeyDown,
2549 onChange: event => {
2550 // Inputs values are strings, we parse them here.
2551 let value = parseInt(event.target.value, 10);
2552 // parseInt would throw NaN for anything not a number,
2553 // so we revert value to the quantity value.
2554 value = isNaN(value) ? quantity : value;
2555 if (value !== quantity) {
2556 // we commit this value immediately.
2557 onChange(value);
2558 // but once the customer has stopped typing, we make sure his value is respecting the bounds (maximum value, minimum value, step value), and commit the normalized value.
2559 debouncedNormalizeQuantity(value);
2560 }
2561 },
2562 "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %s refers to the item name in the cart. */
2563 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Quantity of %s in your cart.', 'woocommerce'), itemName)
2564 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
2565 ref: decreaseButtonRef,
2566 "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %s refers to the item name in the cart. */
2567 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reduce quantity of %s', 'woocommerce'), itemName),
2568 className: "wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",
2569 disabled: !canDecrease,
2570 onClick: () => {
2571 const newQuantity = quantity - step;
2572 onChange(newQuantity);
2573 (0,_wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__.speak)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %s refers to the item's new quantity in the cart. */
2574 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Quantity reduced to %s.', 'woocommerce'), newQuantity));
2575 normalizeQuantity(newQuantity);
2576 }
2577 }, "\uFF0D"), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", {
2578 ref: increaseButtonRef,
2579 "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %s refers to the item's name in the cart. */
2580 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Increase quantity of %s', 'woocommerce'), itemName),
2581 disabled: !canIncrease,
2582 className: "wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",
2583 onClick: () => {
2584 const newQuantity = quantity + step;
2585 onChange(newQuantity);
2586 (0,_wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__.speak)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %s refers to the item's new quantity in the cart. */
2587 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Quantity increased to %s.', 'woocommerce'), newQuantity));
2588 normalizeQuantity(newQuantity);
2589 }
2590 }, "\uFF0B"));
2591 };
2592 QuantitySelector.__docgenInfo = {
2593 "description": "",
2594 "methods": [],
2595 "displayName": "QuantitySelector",
2596 "props": {
2597 "quantity": {
2598 "defaultValue": {
2599 "value": "1",
2600 "computed": false
2601 },
2602 "required": false,
2603 "tsType": {
2604 "name": "number"
2605 },
2606 "description": "Current quantity"
2607 },
2608 "minimum": {
2609 "defaultValue": {
2610 "value": "1",
2611 "computed": false
2612 },
2613 "required": false,
2614 "tsType": {
2615 "name": "number"
2616 },
2617 "description": "Minimum quantity"
2618 },
2619 "onChange": {
2620 "defaultValue": {
2621 "value": "() => void 0",
2622 "computed": false
2623 },
2624 "required": false,
2625 "tsType": {
2626 "name": "signature",
2627 "type": "function",
2628 "raw": "( newQuantity: number ) => void",
2629 "signature": {
2630 "arguments": [{
2631 "name": "newQuantity",
2632 "type": {
2633 "name": "number"
2634 }
2635 }],
2636 "return": {
2637 "name": "void"
2638 }
2639 }
2640 },
2641 "description": "Event handler triggered when the quantity is changed"
2642 },
2643 "step": {
2644 "defaultValue": {
2645 "value": "1",
2646 "computed": false
2647 },
2648 "required": false,
2649 "tsType": {
2650 "name": "number"
2651 },
2652 "description": "Input step attribute."
2653 },
2654 "itemName": {
2655 "defaultValue": {
2656 "value": "''",
2657 "computed": false
2658 },
2659 "required": false,
2660 "tsType": {
2661 "name": "string"
2662 },
2663 "description": "Name of the item the quantity selector refers to\n\nUsed for a11y purposes"
2664 },
2665 "className": {
2666 "required": false,
2667 "tsType": {
2668 "name": "string"
2669 },
2670 "description": "Component wrapper classname\n\n@default 'wc-block-components-quantity-selector'"
2671 },
2672 "maximum": {
2673 "required": true,
2674 "tsType": {
2675 "name": "number"
2676 },
2677 "description": "Maximum quantity"
2678 },
2679 "disabled": {
2680 "required": true,
2681 "tsType": {
2682 "name": "boolean"
2683 },
2684 "description": "Whether the component should be interactable or not"
2685 }
2686 }
2687 };
2688 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuantitySelector);
2689 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
2690 STORYBOOK_REACT_CLASSES["assets/js/base/components/quantity-selector/index.tsx"] = {
2691 name: "QuantitySelector",
2692 docgenInfo: QuantitySelector.__docgenInfo,
2693 path: "assets/js/base/components/quantity-selector/index.tsx"
2694 };
2695 }
2696
2697 /***/ }),
2698
2699 /***/ "./assets/js/base/components/summary/index.tsx":
2700 /*!*****************************************************!*\
2701 !*** ./assets/js/base/components/summary/index.tsx ***!
2702 \*****************************************************/
2703 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2704
2705 "use strict";
2706 __webpack_require__.r(__webpack_exports__);
2707 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2708 /* harmony export */ Summary: () => (/* binding */ Summary),
2709 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2710 /* harmony export */ });
2711 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2712 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2713 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
2714 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
2715 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./assets/js/base/components/summary/utils.ts");
2716
2717 /**
2718 * External dependencies
2719 */
2720
2721 /**
2722 * Internal dependencies
2723 */
2724
2725 /**
2726 * Summary component.
2727 *
2728 * @param {Object} props Component props.
2729 * @param {string} props.source Source text.
2730 * @param {number} props.maxLength Max length of the summary, using countType.
2731 * @param {string} props.countType One of words, characters_excluding_spaces, or characters_including_spaces.
2732 * @param {string} props.className Class name for rendered component.
2733 * @param {CSSProperties} props.style Style Object for rendered component.
2734 *
2735 */
2736 const Summary = ({
2737 source,
2738 maxLength = 15,
2739 countType = 'words',
2740 className = '',
2741 style = {}
2742 }) => {
2743 const summaryText = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
2744 return (0,_utils__WEBPACK_IMPORTED_MODULE_2__.generateSummary)(source, maxLength, countType);
2745 }, [source, maxLength, countType]);
2746 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, {
2747 style: style,
2748 className: className
2749 }, summaryText);
2750 };
2751 Summary.__docgenInfo = {
2752 "description": "Summary component.\n\n@param {Object} props Component props.\n@param {string} props.source Source text.\n@param {number} props.maxLength Max length of the summary, using countType.\n@param {string} props.countType One of words, characters_excluding_spaces, or characters_including_spaces.\n@param {string} props.className Class name for rendered component.\n@param {CSSProperties} props.style Style Object for rendered component.",
2753 "methods": [],
2754 "displayName": "Summary",
2755 "props": {
2756 "maxLength": {
2757 "defaultValue": {
2758 "value": "15",
2759 "computed": false
2760 },
2761 "required": false,
2762 "tsType": {
2763 "name": "number"
2764 },
2765 "description": ""
2766 },
2767 "countType": {
2768 "defaultValue": {
2769 "value": "'words'",
2770 "computed": false
2771 },
2772 "required": false,
2773 "tsType": {
2774 "name": "WordCountType"
2775 },
2776 "description": ""
2777 },
2778 "className": {
2779 "defaultValue": {
2780 "value": "''",
2781 "computed": false
2782 },
2783 "required": false,
2784 "tsType": {
2785 "name": "string"
2786 },
2787 "description": ""
2788 },
2789 "style": {
2790 "defaultValue": {
2791 "value": "{}",
2792 "computed": false
2793 },
2794 "required": false,
2795 "tsType": {
2796 "name": "CSSProperties"
2797 },
2798 "description": ""
2799 },
2800 "source": {
2801 "required": true,
2802 "tsType": {
2803 "name": "string"
2804 },
2805 "description": ""
2806 }
2807 }
2808 };
2809 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Summary);
2810 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
2811 STORYBOOK_REACT_CLASSES["assets/js/base/components/summary/index.tsx"] = {
2812 name: "Summary",
2813 docgenInfo: Summary.__docgenInfo,
2814 path: "assets/js/base/components/summary/index.tsx"
2815 };
2816 }
2817
2818 /***/ }),
2819
2820 /***/ "./assets/js/base/components/summary/utils.ts":
2821 /*!****************************************************!*\
2822 !*** ./assets/js/base/components/summary/utils.ts ***!
2823 \****************************************************/
2824 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2825
2826 "use strict";
2827 __webpack_require__.r(__webpack_exports__);
2828 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2829 /* harmony export */ generateSummary: () => (/* binding */ generateSummary)
2830 /* harmony export */ });
2831 /* harmony import */ var _wordpress_autop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/autop */ "@wordpress/autop");
2832 /* harmony import */ var _wordpress_autop__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_autop__WEBPACK_IMPORTED_MODULE_0__);
2833 /* harmony import */ var _woocommerce_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/utils */ "./assets/js/utils/trim-words.ts");
2834 /* harmony import */ var _wordpress_wordcount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/wordcount */ "@wordpress/wordcount");
2835 /* harmony import */ var _wordpress_wordcount__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_wordcount__WEBPACK_IMPORTED_MODULE_1__);
2836 /**
2837 * External dependencies
2838 */
2839
2840
2841
2842
2843 /**
2844 * Get first paragraph from some HTML text, or return whole string.
2845 *
2846 * @param {string} source Source text.
2847 * @return {string} First paragraph found in string.
2848 */
2849 const getFirstParagraph = source => {
2850 const pIndex = source.indexOf('</p>');
2851 if (pIndex === -1) {
2852 return source;
2853 }
2854 return source.substr(0, pIndex + 4);
2855 };
2856
2857 /**
2858 * Generates the summary text from a string of text.
2859 *
2860 * @param {string} source Source text.
2861 * @param {number} maxLength Limit number of countType returned if text has multiple paragraphs.
2862 * @param {string} countType What is being counted. One of words, characters_excluding_spaces, or characters_including_spaces.
2863 * @return {string} Generated summary.
2864 */
2865 const generateSummary = (source, maxLength = 15, countType = 'words') => {
2866 const sourceWithParagraphs = (0,_wordpress_autop__WEBPACK_IMPORTED_MODULE_0__.autop)(source);
2867 const sourceWordCount = (0,_wordpress_wordcount__WEBPACK_IMPORTED_MODULE_1__.count)(sourceWithParagraphs, countType);
2868 if (sourceWordCount <= maxLength) {
2869 return sourceWithParagraphs;
2870 }
2871 const firstParagraph = getFirstParagraph(sourceWithParagraphs);
2872 const firstParagraphWordCount = (0,_wordpress_wordcount__WEBPACK_IMPORTED_MODULE_1__.count)(firstParagraph, countType);
2873 if (firstParagraphWordCount <= maxLength) {
2874 return firstParagraph;
2875 }
2876 if (countType === 'words') {
2877 return (0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_2__.trimWords)(firstParagraph, maxLength);
2878 }
2879 return (0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_2__.trimCharacters)(firstParagraph, maxLength, countType === 'characters_including_spaces');
2880 };
2881
2882 /***/ }),
2883
2884 /***/ "./assets/js/base/context/event-emit/emitter-callback.ts":
2885 /*!***************************************************************!*\
2886 !*** ./assets/js/base/context/event-emit/emitter-callback.ts ***!
2887 \***************************************************************/
2888 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2889
2890 "use strict";
2891 __webpack_require__.r(__webpack_exports__);
2892 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2893 /* harmony export */ emitterCallback: () => (/* binding */ emitterCallback)
2894 /* harmony export */ });
2895 /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reducer */ "./assets/js/base/context/event-emit/reducer.ts");
2896 /**
2897 * Internal dependencies
2898 */
2899
2900 const emitterCallback = (type, observerDispatch) => (callback, priority = 10) => {
2901 const action = _reducer__WEBPACK_IMPORTED_MODULE_0__.actions.addEventCallback(type, callback, priority);
2902 observerDispatch(action);
2903 return () => {
2904 observerDispatch(_reducer__WEBPACK_IMPORTED_MODULE_0__.actions.removeEventCallback(type, action.id));
2905 };
2906 };
2907
2908 /***/ }),
2909
2910 /***/ "./assets/js/base/context/event-emit/emitters.ts":
2911 /*!*******************************************************!*\
2912 !*** ./assets/js/base/context/event-emit/emitters.ts ***!
2913 \*******************************************************/
2914 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2915
2916 "use strict";
2917 __webpack_require__.r(__webpack_exports__);
2918 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2919 /* harmony export */ emitEvent: () => (/* binding */ emitEvent),
2920 /* harmony export */ emitEventWithAbort: () => (/* binding */ emitEventWithAbort)
2921 /* harmony export */ });
2922 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./assets/js/base/context/event-emit/utils.ts");
2923 /* harmony import */ var _types_type_guards_observers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../types/type-guards/observers */ "./assets/js/types/type-guards/observers.ts");
2924 /**
2925 * Internal dependencies
2926 */
2927
2928
2929
2930 /**
2931 * Emits events on registered observers for the provided type and passes along
2932 * the provided data.
2933 *
2934 * This event emitter will silently catch promise errors, but doesn't care
2935 * otherwise if any errors are caused by observers. So events that do care
2936 * should use `emitEventWithAbort` instead.
2937 *
2938 * @param {Object} observers The registered observers to omit to.
2939 * @param {string} eventType The event type being emitted.
2940 * @param {*} data Data passed along to the observer when it is invoked.
2941 *
2942 * @return {Promise} A promise that resolves to true after all observers have executed.
2943 */
2944 const emitEvent = async (observers, eventType, data) => {
2945 const observersByType = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.getObserversByPriority)(observers, eventType);
2946 const observerResponses = [];
2947 for (const observer of observersByType) {
2948 try {
2949 const observerResponse = await Promise.resolve(observer.callback(data));
2950 if (typeof observerResponse === 'object') {
2951 observerResponses.push(observerResponse);
2952 }
2953 } catch (e) {
2954 // we don't care about errors blocking execution, but will console.error for troubleshooting.
2955 // eslint-disable-next-line no-console
2956 console.error(e);
2957 }
2958 }
2959 return observerResponses.length ? observerResponses : true;
2960 };
2961
2962 /**
2963 * Emits events on registered observers for the provided type and passes along
2964 * the provided data. This event emitter will abort if an observer throws an
2965 * error or if the response includes an object with an error type property.
2966 *
2967 * Any successful observer responses before abort will be included in the returned package.
2968 *
2969 * @param {Object} observers The registered observers to omit to.
2970 * @param {string} eventType The event type being emitted.
2971 * @param {*} data Data passed along to the observer when it is invoked.
2972 *
2973 * @return {Promise} Returns a promise that resolves to either boolean, or an array of responses
2974 * from registered observers that were invoked up to the point of an error.
2975 */
2976 const emitEventWithAbort = async (observers, eventType, data) => {
2977 const observerResponses = [];
2978 const observersByType = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.getObserversByPriority)(observers, eventType);
2979 for (const observer of observersByType) {
2980 try {
2981 const response = await Promise.resolve(observer.callback(data));
2982 if (!(0,_types_type_guards_observers__WEBPACK_IMPORTED_MODULE_1__.isObserverResponse)(response)) {
2983 continue;
2984 }
2985 if (!response.hasOwnProperty('type')) {
2986 throw new Error('Returned objects from event emitter observers must return an object with a type property');
2987 }
2988 if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.isErrorResponse)(response) || (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isFailResponse)(response)) {
2989 observerResponses.push(response);
2990 // early abort.
2991 return observerResponses;
2992 }
2993 // all potential abort conditions have been considered push the
2994 // response to the array.
2995 observerResponses.push(response);
2996 } catch (e) {
2997 // We don't handle thrown errors but just console.log for troubleshooting.
2998 // eslint-disable-next-line no-console
2999 console.error(e);
3000 observerResponses.push({
3001 type: _utils__WEBPACK_IMPORTED_MODULE_0__.responseTypes.ERROR
3002 });
3003 return observerResponses;
3004 }
3005 }
3006 return observerResponses;
3007 };
3008
3009 /***/ }),
3010
3011 /***/ "./assets/js/base/context/event-emit/reducer.ts":
3012 /*!******************************************************!*\
3013 !*** ./assets/js/base/context/event-emit/reducer.ts ***!
3014 \******************************************************/
3015 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3016
3017 "use strict";
3018 __webpack_require__.r(__webpack_exports__);
3019 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3020 /* harmony export */ actions: () => (/* binding */ actions),
3021 /* harmony export */ generateUniqueId: () => (/* binding */ generateUniqueId),
3022 /* harmony export */ reducer: () => (/* binding */ reducer)
3023 /* harmony export */ });
3024 /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./assets/js/base/context/event-emit/types.ts");
3025 /**
3026 * Internal dependencies
3027 */
3028
3029 function generateUniqueId() {
3030 return Math.floor(Math.random() * Date.now()).toString();
3031 }
3032 const actions = {
3033 addEventCallback: (eventType, callback, priority = 10) => {
3034 return {
3035 id: generateUniqueId(),
3036 type: _types__WEBPACK_IMPORTED_MODULE_0__.ACTION.ADD_EVENT_CALLBACK,
3037 eventType,
3038 callback,
3039 priority
3040 };
3041 },
3042 removeEventCallback: (eventType, id) => {
3043 return {
3044 id,
3045 type: _types__WEBPACK_IMPORTED_MODULE_0__.ACTION.REMOVE_EVENT_CALLBACK,
3046 eventType
3047 };
3048 }
3049 };
3050 const initialState = {};
3051
3052 /**
3053 * Handles actions for emitters
3054 */
3055 const reducer = (state = initialState, {
3056 type,
3057 eventType,
3058 id,
3059 callback,
3060 priority
3061 }) => {
3062 const newEvents = state.hasOwnProperty(eventType) ? new Map(state[eventType]) : new Map();
3063 switch (type) {
3064 case _types__WEBPACK_IMPORTED_MODULE_0__.ACTION.ADD_EVENT_CALLBACK:
3065 newEvents.set(id, {
3066 priority,
3067 callback
3068 });
3069 return {
3070 ...state,
3071 [eventType]: newEvents
3072 };
3073 case _types__WEBPACK_IMPORTED_MODULE_0__.ACTION.REMOVE_EVENT_CALLBACK:
3074 newEvents.delete(id);
3075 return {
3076 ...state,
3077 [eventType]: newEvents
3078 };
3079 }
3080 };
3081
3082 /***/ }),
3083
3084 /***/ "./assets/js/base/context/event-emit/types.ts":
3085 /*!****************************************************!*\
3086 !*** ./assets/js/base/context/event-emit/types.ts ***!
3087 \****************************************************/
3088 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3089
3090 "use strict";
3091 __webpack_require__.r(__webpack_exports__);
3092 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3093 /* harmony export */ ACTION: () => (/* binding */ ACTION)
3094 /* harmony export */ });
3095 let ACTION = /*#__PURE__*/function (ACTION) {
3096 ACTION["ADD_EVENT_CALLBACK"] = "add_event_callback";
3097 ACTION["REMOVE_EVENT_CALLBACK"] = "remove_event_callback";
3098 return ACTION;
3099 }({});
3100
3101 /***/ }),
3102
3103 /***/ "./assets/js/base/context/event-emit/utils.ts":
3104 /*!****************************************************!*\
3105 !*** ./assets/js/base/context/event-emit/utils.ts ***!
3106 \****************************************************/
3107 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3108
3109 "use strict";
3110 __webpack_require__.r(__webpack_exports__);
3111 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3112 /* harmony export */ getObserversByPriority: () => (/* binding */ getObserversByPriority),
3113 /* harmony export */ isErrorResponse: () => (/* binding */ isErrorResponse),
3114 /* harmony export */ isFailResponse: () => (/* binding */ isFailResponse),
3115 /* harmony export */ isSuccessResponse: () => (/* binding */ isSuccessResponse),
3116 /* harmony export */ noticeContexts: () => (/* binding */ noticeContexts),
3117 /* harmony export */ responseTypes: () => (/* binding */ responseTypes),
3118 /* harmony export */ shouldRetry: () => (/* binding */ shouldRetry)
3119 /* harmony export */ });
3120 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts");
3121 /**
3122 * External dependencies
3123 */
3124
3125
3126 /**
3127 * Internal dependencies
3128 */
3129
3130 const getObserversByPriority = (observers, eventType) => {
3131 return observers[eventType] ? Array.from(observers[eventType].values()).sort((a, b) => {
3132 return a.priority - b.priority;
3133 }) : [];
3134 };
3135 let responseTypes = /*#__PURE__*/function (responseTypes) {
3136 responseTypes["SUCCESS"] = "success";
3137 responseTypes["FAIL"] = "failure";
3138 responseTypes["ERROR"] = "error";
3139 return responseTypes;
3140 }({});
3141 let noticeContexts = /*#__PURE__*/function (noticeContexts) {
3142 noticeContexts["CART"] = "wc/cart";
3143 noticeContexts["CHECKOUT"] = "wc/checkout";
3144 noticeContexts["PAYMENTS"] = "wc/checkout/payments";
3145 noticeContexts["EXPRESS_PAYMENTS"] = "wc/checkout/express-payments";
3146 noticeContexts["CONTACT_INFORMATION"] = "wc/checkout/contact-information";
3147 noticeContexts["SHIPPING_ADDRESS"] = "wc/checkout/shipping-address";
3148 noticeContexts["BILLING_ADDRESS"] = "wc/checkout/billing-address";
3149 noticeContexts["SHIPPING_METHODS"] = "wc/checkout/shipping-methods";
3150 noticeContexts["CHECKOUT_ACTIONS"] = "wc/checkout/checkout-actions";
3151 return noticeContexts;
3152 }({});
3153
3154 /**
3155 * Observers of checkout/cart events can return a response object to indicate success/error/failure. They may also
3156 * optionally pass metadata.
3157 */
3158
3159 const isResponseOf = (response, type) => {
3160 return (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.isObject)(response) && 'type' in response && response.type === type;
3161 };
3162 const isSuccessResponse = response => {
3163 return isResponseOf(response, responseTypes.SUCCESS);
3164 };
3165 const isErrorResponse = response => {
3166 return isResponseOf(response, responseTypes.ERROR);
3167 };
3168 const isFailResponse = response => {
3169 return isResponseOf(response, responseTypes.FAIL);
3170 };
3171 const shouldRetry = response => {
3172 return !(0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.isObject)(response) || typeof response.retry === 'undefined' || response.retry === true;
3173 };
3174
3175 /***/ }),
3176
3177 /***/ "./assets/js/base/context/hooks/cart/use-store-cart-event-listeners.ts":
3178 /*!*****************************************************************************!*\
3179 !*** ./assets/js/base/context/hooks/cart/use-store-cart-event-listeners.ts ***!
3180 \*****************************************************************************/
3181 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3182
3183 "use strict";
3184 __webpack_require__.r(__webpack_exports__);
3185 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3186 /* harmony export */ useStoreCartEventListeners: () => (/* binding */ useStoreCartEventListeners)
3187 /* harmony export */ });
3188 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
3189 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
3190 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data");
3191 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_1__);
3192 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3193 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
3194 /* harmony import */ var _woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-utils */ "./assets/js/base/utils/get-navigation-type.ts");
3195 /* harmony import */ var _woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-utils */ "./assets/js/base/utils/legacy-events.ts");
3196 /**
3197 * External dependencies
3198 */
3199
3200
3201
3202
3203 const refreshData = event => {
3204 const eventDetail = event === null || event === void 0 ? void 0 : event.detail;
3205 if (!eventDetail || !eventDetail.preserveCartData) {
3206 (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_1__.CART_STORE_KEY).invalidateResolutionForStore();
3207 }
3208 };
3209
3210 /**
3211 * Refreshes data if the pageshow event is triggered by the browser history.
3212 *
3213 * - In Chrome, `back_forward` will be returned by getNavigationType() when the browser history is used.
3214 * - In safari we instead need to use `event.persisted` which is true when page cache is used.
3215 */
3216 const refreshCachedCartData = event => {
3217 if (event !== null && event !== void 0 && event.persisted || (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_3__.getNavigationType)() === 'back_forward') {
3218 (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_1__.CART_STORE_KEY).invalidateResolutionForStore();
3219 }
3220 };
3221 const setUp = () => {
3222 if (!window.wcBlocksStoreCartListeners) {
3223 window.wcBlocksStoreCartListeners = {
3224 count: 0,
3225 remove: () => void null
3226 };
3227 }
3228 };
3229
3230 // Checks if there are any listeners registered.
3231 const hasListeners = () => {
3232 var _window$wcBlocksStore;
3233 return ((_window$wcBlocksStore = window.wcBlocksStoreCartListeners) === null || _window$wcBlocksStore === void 0 ? void 0 : _window$wcBlocksStore.count) > 0;
3234 };
3235
3236 // Add listeners if there are none, otherwise just increment the count.
3237 const addListeners = () => {
3238 setUp();
3239 if (hasListeners()) {
3240 window.wcBlocksStoreCartListeners.count++;
3241 return;
3242 }
3243 document.body.addEventListener('wc-blocks_added_to_cart', refreshData);
3244 document.body.addEventListener('wc-blocks_removed_from_cart', refreshData);
3245 window.addEventListener('pageshow', refreshCachedCartData);
3246 const removeJQueryAddedToCartEvent = (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_4__.translateJQueryEventToNative)('added_to_cart', `wc-blocks_added_to_cart`);
3247 const removeJQueryRemovedFromCartEvent = (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_4__.translateJQueryEventToNative)('removed_from_cart', `wc-blocks_removed_from_cart`);
3248 window.wcBlocksStoreCartListeners.count = 1;
3249 window.wcBlocksStoreCartListeners.remove = () => {
3250 document.body.removeEventListener('wc-blocks_added_to_cart', refreshData);
3251 document.body.removeEventListener('wc-blocks_removed_from_cart', refreshData);
3252 window.removeEventListener('pageshow', refreshCachedCartData);
3253 removeJQueryAddedToCartEvent();
3254 removeJQueryRemovedFromCartEvent();
3255 };
3256 };
3257 const removeListeners = () => {
3258 if (window.wcBlocksStoreCartListeners.count === 1) {
3259 window.wcBlocksStoreCartListeners.remove();
3260 }
3261 window.wcBlocksStoreCartListeners.count--;
3262 };
3263
3264 /**
3265 * This will keep track of jQuery and DOM events that invalidate the store resolution.
3266 */
3267 const useStoreCartEventListeners = () => {
3268 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
3269 addListeners();
3270 return removeListeners;
3271 }, []);
3272 };
3273
3274 /***/ }),
3275
3276 /***/ "./assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts":
3277 /*!***************************************************************************!*\
3278 !*** ./assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts ***!
3279 \***************************************************************************/
3280 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3281
3282 "use strict";
3283 __webpack_require__.r(__webpack_exports__);
3284 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3285 /* harmony export */ useStoreCartItemQuantity: () => (/* binding */ useStoreCartItemQuantity)
3286 /* harmony export */ });
3287 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3288 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
3289 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
3290 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
3291 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data");
3292 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__);
3293 /* harmony import */ var use_debounce__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! use-debounce */ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js");
3294 /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-previous.ts");
3295 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts");
3296 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/string.ts");
3297 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/number.ts");
3298 /* harmony import */ var _use_store_cart__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./use-store-cart */ "./assets/js/base/context/hooks/cart/use-store-cart.ts");
3299 /**
3300 * External dependencies
3301 */
3302
3303
3304
3305
3306
3307
3308
3309 /**
3310 * Internal dependencies
3311 */
3312
3313
3314 /**
3315 * Ensures the object passed has props key: string and quantity: number
3316 */
3317 const cartItemHasQuantityAndKey = cartItem => (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_3__.isObject)(cartItem) && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_3__.objectHasProp)(cartItem, 'key') && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_3__.objectHasProp)(cartItem, 'quantity') && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_4__.isString)(cartItem.key) && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_5__.isNumber)(cartItem.quantity);
3318
3319 /**
3320 * This is a custom hook for loading the Store API /cart/ endpoint and actions for removing or changing item quantity.
3321 *
3322 * @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi
3323 *
3324 * @param {CartItem} cartItem The cartItem to get quantity info from and will have quantity updated on.
3325 * @return {StoreCartItemQuantity} An object exposing data and actions relating to cart items.
3326 */
3327 const useStoreCartItemQuantity = cartItem => {
3328 const verifiedCartItem = {
3329 key: '',
3330 quantity: 1
3331 };
3332 if (cartItemHasQuantityAndKey(cartItem)) {
3333 verifiedCartItem.key = cartItem.key;
3334 verifiedCartItem.quantity = cartItem.quantity;
3335 }
3336 const {
3337 key: cartItemKey = '',
3338 quantity: cartItemQuantity = 1
3339 } = verifiedCartItem;
3340 const {
3341 cartErrors
3342 } = (0,_use_store_cart__WEBPACK_IMPORTED_MODULE_6__.useStoreCart)();
3343 const {
3344 __internalIncrementCalculating,
3345 __internalDecrementCalculating
3346 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.CHECKOUT_STORE_KEY);
3347
3348 // Store quantity in hook state. This is used to keep the UI updated while server request is updated.
3349 const [quantity, setQuantity] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(cartItemQuantity);
3350 const [debouncedQuantity] = (0,use_debounce__WEBPACK_IMPORTED_MODULE_7__.useDebounce)(quantity, 400);
3351 const previousDebouncedQuantity = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_8__.usePrevious)(debouncedQuantity);
3352 const {
3353 removeItemFromCart,
3354 changeCartItemQuantity
3355 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.CART_STORE_KEY);
3356
3357 // Update local state when server updates.
3358 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => setQuantity(cartItemQuantity), [cartItemQuantity]);
3359
3360 // Track when things are already pending updates.
3361 const isPending = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
3362 if (!cartItemKey) {
3363 return {
3364 quantity: false,
3365 delete: false
3366 };
3367 }
3368 const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.CART_STORE_KEY);
3369 return {
3370 quantity: store.isItemPendingQuantity(cartItemKey),
3371 delete: store.isItemPendingDelete(cartItemKey)
3372 };
3373 }, [cartItemKey]);
3374 const removeItem = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
3375 if (cartItemKey) {
3376 return removeItemFromCart(cartItemKey).catch(error => {
3377 (0,_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.processErrorResponse)(error);
3378 });
3379 }
3380 return Promise.resolve(false);
3381 }, [cartItemKey, removeItemFromCart]);
3382
3383 // Observe debounced quantity value, fire action to update server on change.
3384 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
3385 if (cartItemKey && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_5__.isNumber)(previousDebouncedQuantity) && Number.isFinite(previousDebouncedQuantity) && previousDebouncedQuantity !== debouncedQuantity) {
3386 changeCartItemQuantity(cartItemKey, debouncedQuantity).catch(error => {
3387 (0,_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.processErrorResponse)(error);
3388 });
3389 }
3390 }, [cartItemKey, changeCartItemQuantity, debouncedQuantity, previousDebouncedQuantity]);
3391 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
3392 if (isPending.delete) {
3393 __internalIncrementCalculating();
3394 } else {
3395 __internalDecrementCalculating();
3396 }
3397 return () => {
3398 if (isPending.delete) {
3399 __internalDecrementCalculating();
3400 }
3401 };
3402 }, [__internalDecrementCalculating, __internalIncrementCalculating, isPending.delete]);
3403 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
3404 if (isPending.quantity || debouncedQuantity !== quantity) {
3405 __internalIncrementCalculating();
3406 } else {
3407 __internalDecrementCalculating();
3408 }
3409 return () => {
3410 if (isPending.quantity || debouncedQuantity !== quantity) {
3411 __internalDecrementCalculating();
3412 }
3413 };
3414 }, [__internalIncrementCalculating, __internalDecrementCalculating, isPending.quantity, debouncedQuantity, quantity]);
3415 return {
3416 isPendingDelete: isPending.delete,
3417 quantity,
3418 setItemQuantity: setQuantity,
3419 removeItem,
3420 cartItemQuantityErrors: cartErrors
3421 };
3422 };
3423
3424 /***/ }),
3425
3426 /***/ "./assets/js/base/context/hooks/cart/use-store-cart.ts":
3427 /*!*************************************************************!*\
3428 !*** ./assets/js/base/context/hooks/cart/use-store-cart.ts ***!
3429 \*************************************************************/
3430 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3431
3432 "use strict";
3433 __webpack_require__.r(__webpack_exports__);
3434 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3435 /* harmony export */ defaultCartData: () => (/* binding */ defaultCartData),
3436 /* harmony export */ useStoreCart: () => (/* binding */ useStoreCart)
3437 /* harmony export */ });
3438 /* harmony import */ var fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-deep-equal/es6 */ "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js");
3439 /* harmony import */ var fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0__);
3440 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
3441 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
3442 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data");
3443 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__);
3444 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3445 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
3446 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
3447 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__);
3448 /* harmony import */ var _woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @woocommerce/base-utils */ "./assets/js/base/utils/address.ts");
3449 /* harmony import */ var _providers_editor_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../providers/editor-context */ "./assets/js/base/context/providers/editor-context.tsx");
3450 /* harmony import */ var _use_store_cart_event_listeners__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./use-store-cart-event-listeners */ "./assets/js/base/context/hooks/cart/use-store-cart-event-listeners.ts");
3451 /** @typedef { import('@woocommerce/type-defs/hooks').StoreCart } StoreCart */
3452
3453 /**
3454 * External dependencies
3455 */
3456
3457
3458
3459
3460
3461
3462
3463 /**
3464 * Internal dependencies
3465 */
3466
3467
3468 const defaultShippingAddress = {
3469 first_name: '',
3470 last_name: '',
3471 company: '',
3472 address_1: '',
3473 address_2: '',
3474 city: '',
3475 state: '',
3476 postcode: '',
3477 country: '',
3478 phone: ''
3479 };
3480 const defaultBillingAddress = {
3481 ...defaultShippingAddress,
3482 email: ''
3483 };
3484 const defaultCartTotals = {
3485 total_items: '',
3486 total_items_tax: '',
3487 total_fees: '',
3488 total_fees_tax: '',
3489 total_discount: '',
3490 total_discount_tax: '',
3491 total_shipping: '',
3492 total_shipping_tax: '',
3493 total_price: '',
3494 total_tax: '',
3495 tax_lines: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_TAX_LINES,
3496 currency_code: '',
3497 currency_symbol: '',
3498 currency_minor_unit: 2,
3499 currency_decimal_separator: '',
3500 currency_thousand_separator: '',
3501 currency_prefix: '',
3502 currency_suffix: ''
3503 };
3504 const decodeValues = object => Object.fromEntries(Object.entries(object).map(([key, value]) => [key, (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(value)]));
3505
3506 /**
3507 * @constant
3508 * @type {StoreCart} Object containing cart data.
3509 */
3510 const defaultCartData = {
3511 cartCoupons: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_COUPONS,
3512 cartItems: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_ITEMS,
3513 cartFees: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_FEES,
3514 cartItemsCount: 0,
3515 cartItemsWeight: 0,
3516 crossSellsProducts: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_CROSS_SELLS,
3517 cartNeedsPayment: true,
3518 cartNeedsShipping: true,
3519 cartItemErrors: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_ITEM_ERRORS,
3520 cartTotals: defaultCartTotals,
3521 cartIsLoading: true,
3522 cartErrors: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_ERRORS,
3523 billingAddress: defaultBillingAddress,
3524 shippingAddress: defaultShippingAddress,
3525 shippingRates: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_SHIPPING_RATES,
3526 isLoadingRates: false,
3527 cartHasCalculatedShipping: false,
3528 paymentMethods: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_PAYMENT_METHODS,
3529 paymentRequirements: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_PAYMENT_REQUIREMENTS,
3530 receiveCart: () => undefined,
3531 receiveCartContents: () => undefined,
3532 extensions: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_EXTENSIONS
3533 };
3534
3535 /**
3536 * This is a custom hook that is wired up to the `wc/store/cart` data
3537 * store.
3538 *
3539 * @param {Object} options An object declaring the various
3540 * collection arguments.
3541 * @param {boolean} options.shouldSelect If false, the previous results will be
3542 * returned and internal selects will not
3543 * fire.
3544 *
3545 * @return {StoreCart} Object containing cart data.
3546 */
3547
3548 const useStoreCart = (options = {
3549 shouldSelect: true
3550 }) => {
3551 const {
3552 isEditor,
3553 previewData
3554 } = (0,_providers_editor_context__WEBPACK_IMPORTED_MODULE_5__.useEditorContext)();
3555 const previewCart = previewData === null || previewData === void 0 ? void 0 : previewData.previewCart;
3556 const {
3557 shouldSelect
3558 } = options;
3559 const currentResults = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)();
3560
3561 // This will keep track of jQuery and DOM events that invalidate the store resolution.
3562 (0,_use_store_cart_event_listeners__WEBPACK_IMPORTED_MODULE_6__.useStoreCartEventListeners)();
3563 const results = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)((select, {
3564 dispatch
3565 }) => {
3566 if (!shouldSelect) {
3567 return defaultCartData;
3568 }
3569 if (isEditor) {
3570 return {
3571 cartCoupons: previewCart.coupons,
3572 cartItems: previewCart.items,
3573 crossSellsProducts: previewCart.cross_sells,
3574 cartFees: previewCart.fees,
3575 cartItemsCount: previewCart.items_count,
3576 cartItemsWeight: previewCart.items_weight,
3577 cartNeedsPayment: previewCart.needs_payment,
3578 cartNeedsShipping: previewCart.needs_shipping,
3579 cartItemErrors: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_ITEM_ERRORS,
3580 cartTotals: previewCart.totals,
3581 cartIsLoading: false,
3582 cartErrors: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_ERRORS,
3583 billingData: defaultBillingAddress,
3584 billingAddress: defaultBillingAddress,
3585 shippingAddress: defaultShippingAddress,
3586 extensions: _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_EXTENSIONS,
3587 shippingRates: previewCart.shipping_rates,
3588 isLoadingRates: false,
3589 cartHasCalculatedShipping: previewCart.has_calculated_shipping,
3590 paymentRequirements: previewCart.paymentRequirements,
3591 receiveCart: typeof (previewCart === null || previewCart === void 0 ? void 0 : previewCart.receiveCart) === 'function' ? previewCart.receiveCart : () => undefined,
3592 receiveCartContents: typeof (previewCart === null || previewCart === void 0 ? void 0 : previewCart.receiveCartContents) === 'function' ? previewCart.receiveCartContents : () => undefined
3593 };
3594 }
3595 const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.CART_STORE_KEY);
3596 const cartData = store.getCartData();
3597 const cartErrors = store.getCartErrors();
3598 const cartTotals = store.getCartTotals();
3599 const cartIsLoading = !store.hasFinishedResolution('getCartData');
3600 const isLoadingRates = store.isCustomerDataUpdating();
3601 const {
3602 receiveCart,
3603 receiveCartContents
3604 } = dispatch(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.CART_STORE_KEY);
3605 const billingAddress = decodeValues(cartData.billingAddress);
3606 const shippingAddress = cartData.needsShipping ? decodeValues(cartData.shippingAddress) : billingAddress;
3607 const cartFees = cartData.fees.length > 0 ? cartData.fees.map(fee => decodeValues(fee)) : _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_FEES;
3608
3609 // Add a text property to the coupon to allow extensions to modify
3610 // the text used to display the coupon, without affecting the
3611 // functionality when it comes to removing the coupon.
3612 const cartCoupons = cartData.coupons.length > 0 ? cartData.coupons.map(coupon => ({
3613 ...coupon,
3614 label: coupon.code
3615 })) : _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.EMPTY_CART_COUPONS;
3616 return {
3617 cartCoupons,
3618 cartItems: cartData.items,
3619 crossSellsProducts: cartData.crossSells,
3620 cartFees,
3621 cartItemsCount: cartData.itemsCount,
3622 cartItemsWeight: cartData.itemsWeight,
3623 cartNeedsPayment: cartData.needsPayment,
3624 cartNeedsShipping: cartData.needsShipping,
3625 cartItemErrors: cartData.errors,
3626 cartTotals,
3627 cartIsLoading,
3628 cartErrors,
3629 billingData: (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_7__.emptyHiddenAddressFields)(billingAddress),
3630 billingAddress: (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_7__.emptyHiddenAddressFields)(billingAddress),
3631 shippingAddress: (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_7__.emptyHiddenAddressFields)(shippingAddress),
3632 extensions: cartData.extensions,
3633 shippingRates: cartData.shippingRates,
3634 isLoadingRates,
3635 cartHasCalculatedShipping: cartData.hasCalculatedShipping,
3636 paymentRequirements: cartData.paymentRequirements,
3637 receiveCart,
3638 receiveCartContents
3639 };
3640 }, [shouldSelect]);
3641 if (!currentResults.current || !fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0___default()(currentResults.current, results)) {
3642 currentResults.current = results;
3643 }
3644 return currentResults.current;
3645 };
3646
3647 /***/ }),
3648
3649 /***/ "./assets/js/base/context/hooks/payment-methods/use-payment-methods.ts":
3650 /*!*****************************************************************************!*\
3651 !*** ./assets/js/base/context/hooks/payment-methods/use-payment-methods.ts ***!
3652 \*****************************************************************************/
3653 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3654
3655 "use strict";
3656 __webpack_require__.r(__webpack_exports__);
3657 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3658 /* harmony export */ useExpressPaymentMethods: () => (/* binding */ useExpressPaymentMethods),
3659 /* harmony export */ usePaymentMethods: () => (/* binding */ usePaymentMethods)
3660 /* harmony export */ });
3661 /* harmony import */ var _woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-hooks */ "./assets/js/base/hooks/use-shallow-equal.ts");
3662 /* harmony import */ var _woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/blocks-registry */ "@woocommerce/blocks-registry");
3663 /* harmony import */ var _woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_0__);
3664 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3665 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
3666 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data");
3667 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__);
3668 /**
3669 * External dependencies
3670 */
3671
3672
3673
3674
3675 const usePaymentMethodState = (express = false) => {
3676 const {
3677 paymentMethodsInitialized,
3678 expressPaymentMethodsInitialized,
3679 availablePaymentMethods,
3680 availableExpressPaymentMethods
3681 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
3682 const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.PAYMENT_STORE_KEY);
3683 return {
3684 paymentMethodsInitialized: store.paymentMethodsInitialized(),
3685 expressPaymentMethodsInitialized: store.expressPaymentMethodsInitialized(),
3686 availableExpressPaymentMethods: store.getAvailableExpressPaymentMethods(),
3687 availablePaymentMethods: store.getAvailablePaymentMethods()
3688 };
3689 });
3690 const availablePaymentMethodNames = Object.values(availablePaymentMethods).map(({
3691 name
3692 }) => name);
3693 const availableExpressPaymentMethodNames = Object.values(availableExpressPaymentMethods).map(({
3694 name
3695 }) => name);
3696 const registeredPaymentMethods = (0,_woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_0__.getPaymentMethods)();
3697 const registeredExpressPaymentMethods = (0,_woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_0__.getExpressPaymentMethods)();
3698
3699 // Remove everything from registeredPaymentMethods that is not in availablePaymentMethodNames.
3700 const paymentMethods = Object.keys(registeredPaymentMethods).reduce((acc, key) => {
3701 if (availablePaymentMethodNames.includes(key)) {
3702 acc[key] = registeredPaymentMethods[key];
3703 }
3704 return acc;
3705 }, {});
3706 // Remove everything from registeredExpressPaymentMethods that is not in availableExpressPaymentMethodNames.
3707 const expressPaymentMethods = Object.keys(registeredExpressPaymentMethods).reduce((acc, key) => {
3708 if (availableExpressPaymentMethodNames.includes(key)) {
3709 acc[key] = registeredExpressPaymentMethods[key];
3710 }
3711 return acc;
3712 }, {});
3713 const currentPaymentMethods = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__.useShallowEqual)(paymentMethods);
3714 const currentExpressPaymentMethods = (0,_woocommerce_base_hooks__WEBPACK_IMPORTED_MODULE_3__.useShallowEqual)(expressPaymentMethods);
3715 return {
3716 paymentMethods: express ? currentExpressPaymentMethods : currentPaymentMethods,
3717 isInitialized: express ? expressPaymentMethodsInitialized : paymentMethodsInitialized
3718 };
3719 };
3720 const usePaymentMethods = () => usePaymentMethodState(false);
3721 const useExpressPaymentMethods = () => usePaymentMethodState(true);
3722
3723 /***/ }),
3724
3725 /***/ "./assets/js/base/context/hooks/use-store-events.ts":
3726 /*!**********************************************************!*\
3727 !*** ./assets/js/base/context/hooks/use-store-events.ts ***!
3728 \**********************************************************/
3729 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3730
3731 "use strict";
3732 __webpack_require__.r(__webpack_exports__);
3733 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3734 /* harmony export */ useStoreEvents: () => (/* binding */ useStoreEvents)
3735 /* harmony export */ });
3736 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
3737 /* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);
3738 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3739 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
3740 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
3741 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
3742 /**
3743 * External dependencies
3744 */
3745
3746
3747
3748 /**
3749 * Abstraction on top of @wordpress/hooks for dispatching events via doAction for 3rd parties to hook into.
3750 */
3751 const useStoreEvents = () => {
3752 const dispatchStoreEvent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)((eventName, eventParams = {}) => {
3753 try {
3754 (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.doAction)(`experimental__woocommerce_blocks-${eventName}`, eventParams);
3755 } catch (e) {
3756 // We don't handle thrown errors but just console.log for troubleshooting.
3757 // eslint-disable-next-line no-console
3758 console.error(e);
3759 }
3760 }, []);
3761 const dispatchCheckoutEvent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)((eventName, eventParams = {}) => {
3762 try {
3763 (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__.doAction)(`experimental__woocommerce_blocks-checkout-${eventName}`, {
3764 ...eventParams,
3765 storeCart: (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('wc/store/cart').getCartData()
3766 });
3767 } catch (e) {
3768 // We don't handle thrown errors but just console.log for troubleshooting.
3769 // eslint-disable-next-line no-console
3770 console.error(e);
3771 }
3772 }, []);
3773 return {
3774 dispatchStoreEvent,
3775 dispatchCheckoutEvent
3776 };
3777 };
3778
3779 /***/ }),
3780
3781 /***/ "./assets/js/base/context/providers/cart-checkout/payment-events/event-emit.ts":
3782 /*!*************************************************************************************!*\
3783 !*** ./assets/js/base/context/providers/cart-checkout/payment-events/event-emit.ts ***!
3784 \*************************************************************************************/
3785 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3786
3787 "use strict";
3788 __webpack_require__.r(__webpack_exports__);
3789 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3790 /* harmony export */ EMIT_TYPES: () => (/* binding */ EMIT_TYPES),
3791 /* harmony export */ emitEvent: () => (/* reexport safe */ _event_emit__WEBPACK_IMPORTED_MODULE_3__.emitEvent),
3792 /* harmony export */ emitEventWithAbort: () => (/* reexport safe */ _event_emit__WEBPACK_IMPORTED_MODULE_3__.emitEventWithAbort),
3793 /* harmony export */ reducer: () => (/* reexport safe */ _event_emit__WEBPACK_IMPORTED_MODULE_2__.reducer),
3794 /* harmony export */ useEventEmitters: () => (/* binding */ useEventEmitters)
3795 /* harmony export */ });
3796 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
3797 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
3798 /* harmony import */ var _event_emit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../event-emit */ "./assets/js/base/context/event-emit/emitter-callback.ts");
3799 /* harmony import */ var _event_emit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../event-emit */ "./assets/js/base/context/event-emit/reducer.ts");
3800 /* harmony import */ var _event_emit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../event-emit */ "./assets/js/base/context/event-emit/emitters.ts");
3801 /**
3802 * External dependencies
3803 */
3804
3805
3806 /**
3807 * Internal dependencies
3808 */
3809
3810 const EMIT_TYPES = {
3811 PAYMENT_SETUP: 'payment_setup'
3812 };
3813 /**
3814 * Receives a reducer dispatcher and returns an object with the
3815 * various event emitters for the payment processing events.
3816 *
3817 * Calling the event registration function with the callback will register it
3818 * for the event emitter and will return a dispatcher for removing the
3819 * registered callback (useful for implementation in `useEffect`).
3820 *
3821 * @param {Function} observerDispatch The emitter reducer dispatcher.
3822 * @return {Object} An object with the various payment event emitter registration functions
3823 */
3824 const useEventEmitters = observerDispatch => {
3825 const eventEmitters = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
3826 onPaymentSetup: (0,_event_emit__WEBPACK_IMPORTED_MODULE_1__.emitterCallback)(EMIT_TYPES.PAYMENT_SETUP, observerDispatch)
3827 }), [observerDispatch]);
3828 return eventEmitters;
3829 };
3830
3831
3832 /***/ }),
3833
3834 /***/ "./assets/js/base/context/providers/cart-checkout/payment-events/index.tsx":
3835 /*!*********************************************************************************!*\
3836 !*** ./assets/js/base/context/providers/cart-checkout/payment-events/index.tsx ***!
3837 \*********************************************************************************/
3838 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3839
3840 "use strict";
3841 __webpack_require__.r(__webpack_exports__);
3842 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3843 /* harmony export */ PaymentEventsProvider: () => (/* binding */ PaymentEventsProvider),
3844 /* harmony export */ usePaymentEventsContext: () => (/* binding */ usePaymentEventsContext)
3845 /* harmony export */ });
3846 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3847 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
3848 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
3849 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
3850 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3851 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
3852 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data");
3853 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_3__);
3854 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated");
3855 /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4__);
3856 /* harmony import */ var _event_emit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./event-emit */ "./assets/js/base/context/event-emit/reducer.ts");
3857 /* harmony import */ var _event_emit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./event-emit */ "./assets/js/base/context/providers/cart-checkout/payment-events/event-emit.ts");
3858
3859 /**
3860 * External dependencies
3861 */
3862
3863
3864
3865
3866
3867 /**
3868 * Internal dependencies
3869 */
3870
3871 const PaymentEventsContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createContext)({
3872 onPaymentProcessing: () => () => () => void null,
3873 onPaymentSetup: () => () => () => void null
3874 });
3875 const usePaymentEventsContext = () => {
3876 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(PaymentEventsContext);
3877 };
3878
3879 /**
3880 * PaymentEventsProvider is automatically included in the CheckoutProvider.
3881 *
3882 * This provides the api interface (via the context hook) for payment status and data.
3883 *
3884 * @param {Object} props Incoming props for provider
3885 * @param {Object} props.children The wrapped components in this provider.
3886 */
3887 const PaymentEventsProvider = ({
3888 children
3889 }) => {
3890 const {
3891 isProcessing: checkoutIsProcessing,
3892 isIdle: checkoutIsIdle,
3893 isCalculating: checkoutIsCalculating,
3894 hasError: checkoutHasError
3895 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
3896 const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_3__.CHECKOUT_STORE_KEY);
3897 return {
3898 isProcessing: store.isProcessing(),
3899 isIdle: store.isIdle(),
3900 hasError: store.hasError(),
3901 isCalculating: store.isCalculating()
3902 };
3903 });
3904 const {
3905 isPaymentReady
3906 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
3907 const store = select(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_3__.PAYMENT_STORE_KEY);
3908 return {
3909 // The PROCESSING status represents before the checkout runs the observers
3910 // registered for the payment_setup event.
3911 isPaymentProcessing: store.isPaymentProcessing(),
3912 // the READY status represents when the observers have finished processing and payment data
3913 // synced with the payment store, ready to be sent to the StoreApi
3914 isPaymentReady: store.isPaymentReady()
3915 };
3916 });
3917 const {
3918 setValidationErrors
3919 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_3__.VALIDATION_STORE_KEY);
3920 const [observers, observerDispatch] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useReducer)(_event_emit__WEBPACK_IMPORTED_MODULE_5__.reducer, {});
3921 const {
3922 onPaymentSetup
3923 } = (0,_event_emit__WEBPACK_IMPORTED_MODULE_6__.useEventEmitters)(observerDispatch);
3924 const currentObservers = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(observers);
3925
3926 // ensure observers are always current.
3927 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
3928 currentObservers.current = observers;
3929 }, [observers]);
3930 const {
3931 __internalSetPaymentProcessing,
3932 __internalSetPaymentIdle,
3933 __internalEmitPaymentProcessingEvent
3934 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_3__.PAYMENT_STORE_KEY);
3935
3936 // flip payment to processing if checkout processing is complete and there are no errors
3937 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
3938 if (checkoutIsProcessing && !checkoutHasError && !checkoutIsCalculating) {
3939 __internalSetPaymentProcessing();
3940
3941 // Note: the nature of this event emitter is that it will bail on any
3942 // observer that returns a response that !== true. However, this still
3943 // allows for other observers that return true for continuing through
3944 // to the next observer (or bailing if there's a problem).
3945 __internalEmitPaymentProcessingEvent(currentObservers.current, setValidationErrors);
3946 }
3947 }, [checkoutIsProcessing, checkoutHasError, checkoutIsCalculating, __internalSetPaymentProcessing, __internalEmitPaymentProcessingEvent, setValidationErrors]);
3948
3949 // When checkout is returned to idle, and the payment setup has not completed, set payment status to idle
3950 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
3951 if (checkoutIsIdle && !isPaymentReady) {
3952 __internalSetPaymentIdle();
3953 }
3954 }, [checkoutIsIdle, isPaymentReady, __internalSetPaymentIdle]);
3955
3956 // if checkout has an error sync payment status back to idle.
3957 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
3958 if (checkoutHasError && isPaymentReady) {
3959 __internalSetPaymentIdle();
3960 }
3961 }, [checkoutHasError, isPaymentReady, __internalSetPaymentIdle]);
3962
3963 /**
3964 * @deprecated use onPaymentSetup instead
3965 */
3966 const onPaymentProcessing = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
3967 return function (...args) {
3968 _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4___default()('onPaymentProcessing', {
3969 alternative: 'onPaymentSetup',
3970 plugin: 'WooCommerce Blocks'
3971 });
3972 return onPaymentSetup(...args);
3973 };
3974 }, [onPaymentSetup]);
3975 const paymentContextData = {
3976 onPaymentProcessing,
3977 onPaymentSetup
3978 };
3979 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(PaymentEventsContext.Provider, {
3980 value: paymentContextData
3981 }, children);
3982 };
3983 PaymentEventsProvider.__docgenInfo = {
3984 "description": "PaymentEventsProvider is automatically included in the CheckoutProvider.\n\nThis provides the api interface (via the context hook) for payment status and data.\n\n@param {Object} props Incoming props for provider\n@param {Object} props.children The wrapped components in this provider.",
3985 "methods": [],
3986 "displayName": "PaymentEventsProvider",
3987 "props": {
3988 "children": {
3989 "required": true,
3990 "tsType": {
3991 "name": "ReactReactNode",
3992 "raw": "React.ReactNode"
3993 },
3994 "description": ""
3995 }
3996 }
3997 };
3998 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
3999 STORYBOOK_REACT_CLASSES["assets/js/base/context/providers/cart-checkout/payment-events/index.tsx"] = {
4000 name: "PaymentEventsProvider",
4001 docgenInfo: PaymentEventsProvider.__docgenInfo,
4002 path: "assets/js/base/context/providers/cart-checkout/payment-events/index.tsx"
4003 };
4004 }
4005
4006 /***/ }),
4007
4008 /***/ "./assets/js/base/context/providers/editor-context.tsx":
4009 /*!*************************************************************!*\
4010 !*** ./assets/js/base/context/providers/editor-context.tsx ***!
4011 \*************************************************************/
4012 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4013
4014 "use strict";
4015 __webpack_require__.r(__webpack_exports__);
4016 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4017 /* harmony export */ EditorProvider: () => (/* binding */ EditorProvider),
4018 /* harmony export */ useEditorContext: () => (/* binding */ useEditorContext)
4019 /* harmony export */ });
4020 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
4021 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
4022 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
4023 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
4024 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
4025 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
4026
4027 /**
4028 * External dependencies
4029 */
4030
4031
4032 const EditorContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createContext)({
4033 isEditor: false,
4034 currentPostId: 0,
4035 currentView: '',
4036 previewData: {},
4037 getPreviewData: () => ({})
4038 });
4039 const useEditorContext = () => {
4040 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(EditorContext);
4041 };
4042 const EditorProvider = ({
4043 children,
4044 currentPostId = 0,
4045 previewData = {},
4046 currentView = '',
4047 isPreview = false
4048 }) => {
4049 const editingPostId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => currentPostId ? currentPostId : select('core/editor').getCurrentPostId(), [currentPostId]);
4050 const getPreviewData = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(name => {
4051 if (previewData && name in previewData) {
4052 return previewData[name];
4053 }
4054 return {};
4055 }, [previewData]);
4056 const editorData = {
4057 isEditor: true,
4058 currentPostId: editingPostId,
4059 currentView,
4060 previewData,
4061 getPreviewData,
4062 isPreview
4063 };
4064 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(EditorContext.Provider, {
4065 value: editorData
4066 }, children);
4067 };
4068 EditorProvider.__docgenInfo = {
4069 "description": "",
4070 "methods": [],
4071 "displayName": "EditorProvider",
4072 "props": {
4073 "currentPostId": {
4074 "defaultValue": {
4075 "value": "0",
4076 "computed": false
4077 },
4078 "required": false,
4079 "tsType": {
4080 "name": "union",
4081 "raw": "number | undefined",
4082 "elements": [{
4083 "name": "number"
4084 }, {
4085 "name": "undefined"
4086 }]
4087 },
4088 "description": ""
4089 },
4090 "previewData": {
4091 "defaultValue": {
4092 "value": "{}",
4093 "computed": false
4094 },
4095 "required": false,
4096 "tsType": {
4097 "name": "union",
4098 "raw": "Record< string, unknown > | undefined",
4099 "elements": [{
4100 "name": "Record",
4101 "elements": [{
4102 "name": "string"
4103 }, {
4104 "name": "unknown"
4105 }],
4106 "raw": "Record< string, unknown >"
4107 }, {
4108 "name": "undefined"
4109 }]
4110 },
4111 "description": ""
4112 },
4113 "currentView": {
4114 "defaultValue": {
4115 "value": "''",
4116 "computed": false
4117 },
4118 "required": false,
4119 "tsType": {
4120 "name": "union",
4121 "raw": "string | undefined",
4122 "elements": [{
4123 "name": "string"
4124 }, {
4125 "name": "undefined"
4126 }]
4127 },
4128 "description": ""
4129 },
4130 "isPreview": {
4131 "defaultValue": {
4132 "value": "false",
4133 "computed": false
4134 },
4135 "required": false,
4136 "tsType": {
4137 "name": "union",
4138 "raw": "boolean | undefined",
4139 "elements": [{
4140 "name": "boolean"
4141 }, {
4142 "name": "undefined"
4143 }]
4144 },
4145 "description": ""
4146 },
4147 "children": {
4148 "required": true,
4149 "tsType": {
4150 "name": "ReactReactChildren",
4151 "raw": "React.ReactChildren"
4152 },
4153 "description": ""
4154 }
4155 }
4156 };
4157 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
4158 STORYBOOK_REACT_CLASSES["assets/js/base/context/providers/editor-context.tsx"] = {
4159 name: "EditorProvider",
4160 docgenInfo: EditorProvider.__docgenInfo,
4161 path: "assets/js/base/context/providers/editor-context.tsx"
4162 };
4163 }
4164
4165 /***/ }),
4166
4167 /***/ "./assets/js/base/hooks/use-previous.ts":
4168 /*!**********************************************!*\
4169 !*** ./assets/js/base/hooks/use-previous.ts ***!
4170 \**********************************************/
4171 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4172
4173 "use strict";
4174 __webpack_require__.r(__webpack_exports__);
4175 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4176 /* harmony export */ usePrevious: () => (/* binding */ usePrevious)
4177 /* harmony export */ });
4178 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
4179 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
4180 /**
4181 * External dependencies
4182 */
4183
4184 /**
4185 * Use Previous based on https://usehooks.com/useprevious/.
4186 *
4187 * @param {*} value
4188 * @param {Function} [validation] Function that needs to validate for the value
4189 * to be updated.
4190 */
4191 function usePrevious(value, validation) {
4192 const ref = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
4193 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
4194 if (ref.current !== value && (!validation || validation(value, ref.current))) {
4195 ref.current = value;
4196 }
4197 }, [value, validation]);
4198 return ref.current;
4199 }
4200
4201 /***/ }),
4202
4203 /***/ "./assets/js/base/hooks/use-shallow-equal.ts":
4204 /*!***************************************************!*\
4205 !*** ./assets/js/base/hooks/use-shallow-equal.ts ***!
4206 \***************************************************/
4207 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4208
4209 "use strict";
4210 __webpack_require__.r(__webpack_exports__);
4211 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4212 /* harmony export */ useShallowEqual: () => (/* binding */ useShallowEqual)
4213 /* harmony export */ });
4214 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
4215 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
4216 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal");
4217 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1__);
4218 /**
4219 * External dependencies
4220 */
4221
4222
4223
4224 /**
4225 * A custom hook that compares the provided value across renders and returns the
4226 * previous instance if shallow equality with previous instance exists.
4227 *
4228 * This is particularly useful when non-primitive types are used as
4229 * dependencies for react hooks.
4230 *
4231 * @param {*} value Value to keep the same if satisfies shallow equality.
4232 *
4233 * @return {*} The previous cached instance of the value if the current has shallow equality with it.
4234 */
4235 function useShallowEqual(value) {
4236 const ref = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(value);
4237 if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_1___default()(value, ref.current)) {
4238 ref.current = value;
4239 }
4240 return ref.current;
4241 }
4242
4243 /***/ }),
4244
4245 /***/ "./assets/js/base/utils/address.ts":
4246 /*!*****************************************!*\
4247 !*** ./assets/js/base/utils/address.ts ***!
4248 \*****************************************/
4249 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4250
4251 "use strict";
4252 __webpack_require__.r(__webpack_exports__);
4253 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4254 /* harmony export */ emptyHiddenAddressFields: () => (/* binding */ emptyHiddenAddressFields),
4255 /* harmony export */ formatShippingAddress: () => (/* binding */ formatShippingAddress),
4256 /* harmony export */ isAddressComplete: () => (/* binding */ isAddressComplete),
4257 /* harmony export */ isSameAddress: () => (/* binding */ isSameAddress),
4258 /* harmony export */ pluckAddress: () => (/* binding */ pluckAddress),
4259 /* harmony export */ pluckEmail: () => (/* binding */ pluckEmail)
4260 /* harmony export */ });
4261 /* harmony import */ var _woocommerce_base_components_cart_checkout_address_form_prepare_address_fields__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/base-components/cart-checkout/address-form/prepare-address-fields */ "./assets/js/base/components/cart-checkout/address-form/prepare-address-fields.ts");
4262 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
4263 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__);
4264 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
4265 /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__);
4266 /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts");
4267 /**
4268 * External dependencies
4269 */
4270
4271
4272
4273
4274
4275 /**
4276 * Compare two addresses and see if they are the same.
4277 */
4278 const isSameAddress = (address1, address2) => {
4279 return _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.ADDRESS_FIELDS_KEYS.every(field => {
4280 return address1[field] === address2[field];
4281 });
4282 };
4283
4284 /**
4285 * pluckAddress takes a full address object and returns relevant fields for calculating
4286 * shipping, so we can track when one of them change to update rates.
4287 *
4288 * @param {Object} address An object containing all address information
4289 * @param {string} address.country The country.
4290 * @param {string} address.state The state.
4291 * @param {string} address.city The city.
4292 * @param {string} address.postcode The postal code.
4293 *
4294 * @return {Object} pluckedAddress An object containing shipping address that are needed to fetch an address.
4295 */
4296 const pluckAddress = ({
4297 country = '',
4298 state = '',
4299 city = '',
4300 postcode = ''
4301 }) => ({
4302 country: country.trim(),
4303 state: state.trim(),
4304 city: city.trim(),
4305 postcode: postcode ? postcode.replace(' ', '').toUpperCase() : ''
4306 });
4307
4308 /**
4309 * pluckEmail takes a full address object and returns only the email address, if set and valid. Otherwise returns an empty string.
4310 *
4311 * @param {Object} address An object containing all address information
4312 * @param {string} address.email The email address.
4313 * @return {string} The email address.
4314 */
4315 const pluckEmail = ({
4316 email = ''
4317 }) => (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.isEmail)(email) ? email.trim() : '';
4318
4319 /**
4320 * Type-guard.
4321 */
4322 const isValidAddressKey = (key, address) => {
4323 return key in address;
4324 };
4325
4326 /**
4327 * Sets fields to an empty string in an address if they are hidden by the settings in countryLocale.
4328 *
4329 * @param {Object} address The address to empty fields from.
4330 * @return {Object} The address with hidden fields values removed.
4331 */
4332 const emptyHiddenAddressFields = address => {
4333 const addressFields = (0,_woocommerce_base_components_cart_checkout_address_form_prepare_address_fields__WEBPACK_IMPORTED_MODULE_0__["default"])(_woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.ADDRESS_FIELDS_KEYS, {}, address.country);
4334 const newAddress = Object.assign({}, address);
4335 addressFields.forEach(({
4336 key = '',
4337 hidden = false
4338 }) => {
4339 if (hidden && isValidAddressKey(key, address)) {
4340 newAddress[key] = '';
4341 }
4342 });
4343 return newAddress;
4344 };
4345
4346 /*
4347 * Formats a shipping address for display.
4348 *
4349 * @param {Object} address The address to format.
4350 * @return {string | null} The formatted address or null if no address is provided.
4351 */
4352 const formatShippingAddress = address => {
4353 // We bail early if we don't have an address.
4354 if (Object.values(address).length === 0) {
4355 return null;
4356 }
4357 const formattedCountry = typeof _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.SHIPPING_COUNTRIES[address.country] === 'string' ? (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__.decodeEntities)(_woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.SHIPPING_COUNTRIES[address.country]) : '';
4358 const formattedState = typeof _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.SHIPPING_STATES[address.country] === 'object' && typeof _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.SHIPPING_STATES[address.country][address.state] === 'string' ? (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__.decodeEntities)(_woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.SHIPPING_STATES[address.country][address.state]) : address.state;
4359 const addressParts = [];
4360 addressParts.push(address.postcode.toUpperCase());
4361 addressParts.push(address.city);
4362 addressParts.push(formattedState);
4363 addressParts.push(formattedCountry);
4364 const formattedLocation = addressParts.filter(Boolean).join(', ');
4365 if (!formattedLocation) {
4366 return null;
4367 }
4368 return formattedLocation;
4369 };
4370
4371 /**
4372 * Checks that all required fields in an address are completed based on the settings in countryLocale.
4373 */
4374 const isAddressComplete = address => {
4375 if (!address.country) {
4376 return false;
4377 }
4378 const addressFields = (0,_woocommerce_base_components_cart_checkout_address_form_prepare_address_fields__WEBPACK_IMPORTED_MODULE_0__["default"])(_woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.ADDRESS_FIELDS_KEYS, {}, address.country);
4379 return addressFields.every(({
4380 key = '',
4381 hidden = false,
4382 required = false
4383 }) => {
4384 if (hidden || !required) {
4385 return true;
4386 }
4387 return isValidAddressKey(key, address) && address[key] !== '';
4388 });
4389 };
4390
4391 /***/ }),
4392
4393 /***/ "./assets/js/base/utils/get-icons-from-payment-methods.ts":
4394 /*!****************************************************************!*\
4395 !*** ./assets/js/base/utils/get-icons-from-payment-methods.ts ***!
4396 \****************************************************************/
4397 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4398
4399 "use strict";
4400 __webpack_require__.r(__webpack_exports__);
4401 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4402 /* harmony export */ getIconsFromPaymentMethods: () => (/* binding */ getIconsFromPaymentMethods)
4403 /* harmony export */ });
4404 /**
4405 * External dependencies
4406 */
4407
4408 /**
4409 * Get the provider icons from payment methods data.
4410 *
4411 * @param {PaymentMethods} paymentMethods Payment Method data
4412 * @return {PaymentMethodIconsType} Payment Method icons data.
4413 */
4414 const getIconsFromPaymentMethods = paymentMethods => {
4415 return Object.values(paymentMethods).reduce((acc, paymentMethod) => {
4416 if (paymentMethod.icons !== null) {
4417 acc = acc.concat(paymentMethod.icons);
4418 }
4419 return acc;
4420 }, []);
4421 };
4422
4423 /***/ }),
4424
4425 /***/ "./assets/js/base/utils/get-navigation-type.ts":
4426 /*!*****************************************************!*\
4427 !*** ./assets/js/base/utils/get-navigation-type.ts ***!
4428 \*****************************************************/
4429 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4430
4431 "use strict";
4432 __webpack_require__.r(__webpack_exports__);
4433 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4434 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
4435 /* harmony export */ getNavigationType: () => (/* binding */ getNavigationType)
4436 /* harmony export */ });
4437 /**
4438 * Returns the navigation type for the page load.
4439 */
4440 const getNavigationType = () => {
4441 if (window.performance && window.performance.getEntriesByType('navigation').length) {
4442 return window.performance.getEntriesByType('navigation')[0].type;
4443 }
4444 return '';
4445 };
4446 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getNavigationType);
4447
4448 /***/ }),
4449
4450 /***/ "./assets/js/base/utils/legacy-events.ts":
4451 /*!***********************************************!*\
4452 !*** ./assets/js/base/utils/legacy-events.ts ***!
4453 \***********************************************/
4454 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4455
4456 "use strict";
4457 __webpack_require__.r(__webpack_exports__);
4458 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4459 /* harmony export */ dispatchEvent: () => (/* binding */ dispatchEvent),
4460 /* harmony export */ translateJQueryEventToNative: () => (/* binding */ translateJQueryEventToNative),
4461 /* harmony export */ triggerAddedToCartEvent: () => (/* binding */ triggerAddedToCartEvent),
4462 /* harmony export */ triggerAddingToCartEvent: () => (/* binding */ triggerAddingToCartEvent)
4463 /* harmony export */ });
4464 /**
4465 * External dependencies
4466 */
4467
4468 const CustomEvent = window.CustomEvent || null;
4469 /**
4470 * Wrapper function to dispatch an event.
4471 */
4472 const dispatchEvent = (name, {
4473 bubbles = false,
4474 cancelable = false,
4475 element,
4476 detail = {}
4477 }) => {
4478 if (!CustomEvent) {
4479 return;
4480 }
4481 if (!element) {
4482 element = document.body;
4483 }
4484 const event = new CustomEvent(name, {
4485 bubbles,
4486 cancelable,
4487 detail
4488 });
4489 element.dispatchEvent(event);
4490 };
4491 const triggerAddingToCartEvent = () => {
4492 dispatchEvent('wc-blocks_adding_to_cart', {
4493 bubbles: true,
4494 cancelable: true
4495 });
4496 };
4497 const triggerAddedToCartEvent = ({
4498 preserveCartData = false
4499 }) => {
4500 dispatchEvent('wc-blocks_added_to_cart', {
4501 bubbles: true,
4502 cancelable: true,
4503 detail: {
4504 preserveCartData
4505 }
4506 });
4507 };
4508
4509 /**
4510 * Function that listens to a jQuery event and dispatches a native JS event.
4511 * Useful to convert WC Core events into events that can be read by blocks.
4512 *
4513 * Returns a function to remove the jQuery event handler. Ideally it should be
4514 * used when the component is unmounted.
4515 */
4516 const translateJQueryEventToNative = (jQueryEventName, nativeEventName,
4517 // Whether the event bubbles.
4518 bubbles = false,
4519 // Whether the event is cancelable.
4520 cancelable = false) => {
4521 if (typeof jQuery !== 'function') {
4522 return () => void null;
4523 }
4524 const eventDispatcher = () => {
4525 dispatchEvent(nativeEventName, {
4526 bubbles,
4527 cancelable
4528 });
4529 };
4530 jQuery(document).on(jQueryEventName, eventDispatcher);
4531 return () => jQuery(document).off(jQueryEventName, eventDispatcher);
4532 };
4533
4534 /***/ }),
4535
4536 /***/ "./assets/js/blocks/cart-checkout-shared/editor-utils.ts":
4537 /*!***************************************************************!*\
4538 !*** ./assets/js/blocks/cart-checkout-shared/editor-utils.ts ***!
4539 \***************************************************************/
4540 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4541
4542 "use strict";
4543 __webpack_require__.r(__webpack_exports__);
4544 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4545 /* harmony export */ getAllowedBlocks: () => (/* binding */ getAllowedBlocks)
4546 /* harmony export */ });
4547 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
4548 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
4549 /* harmony import */ var _woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/blocks-checkout */ "@woocommerce/blocks-checkout");
4550 /* harmony import */ var _woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_1__);
4551 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-data */ "@woocommerce/block-data");
4552 /* harmony import */ var _woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__);
4553 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
4554 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
4555 /**
4556 * External dependencies
4557 */
4558
4559
4560
4561
4562
4563 // List of core block types to allow in inner block areas.
4564 const coreBlockTypes = ['core/paragraph', 'core/image', 'core/separator'];
4565
4566 /**
4567 * Gets a list of allowed blocks types under a specific parent block type.
4568 */
4569 const getAllowedBlocks = block => {
4570 const additionalCartCheckoutInnerBlockTypes = (0,_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_1__.applyCheckoutFilter)({
4571 filterName: 'additionalCartCheckoutInnerBlockTypes',
4572 defaultValue: [],
4573 extensions: (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.select)(_woocommerce_block_data__WEBPACK_IMPORTED_MODULE_2__.CART_STORE_KEY).getCartData().extensions,
4574 arg: {
4575 block
4576 },
4577 validation: value => {
4578 if (Array.isArray(value) && value.every(item => typeof item === 'string')) {
4579 return true;
4580 }
4581 throw new Error('allowedBlockTypes filters must return an array of strings.');
4582 }
4583 });
4584
4585 // Convert to set here so that we remove duplicated block types.
4586 return Array.from(new Set([...(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.getBlockTypes)().filter(blockType => ((blockType === null || blockType === void 0 ? void 0 : blockType.parent) || []).includes(block)).map(({
4587 name
4588 }) => name), ...coreBlockTypes, ...additionalCartCheckoutInnerBlockTypes]));
4589 };
4590
4591 /***/ }),
4592
4593 /***/ "./assets/js/blocks/cart-checkout-shared/use-forced-layout/index.ts":
4594 /*!**************************************************************************!*\
4595 !*** ./assets/js/blocks/cart-checkout-shared/use-forced-layout/index.ts ***!
4596 \**************************************************************************/
4597 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4598
4599 "use strict";
4600 __webpack_require__.r(__webpack_exports__);
4601 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4602 /* harmony export */ useForcedLayout: () => (/* binding */ useForcedLayout)
4603 /* harmony export */ });
4604 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
4605 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
4606 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
4607 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
4608 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
4609 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__);
4610 /* harmony import */ var _woocommerce_base_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-context */ "./assets/js/base/context/providers/editor-context.tsx");
4611 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./assets/js/blocks/cart-checkout-shared/use-forced-layout/utils.ts");
4612 /**
4613 * External dependencies
4614 */
4615
4616
4617
4618
4619
4620 /**
4621 * Internal dependencies
4622 */
4623
4624
4625 /**
4626 * Hook to ensure FORCED blocks are rendered in the correct place.
4627 */
4628 const useForcedLayout = ({
4629 clientId,
4630 registeredBlocks,
4631 defaultTemplate = []
4632 }) => {
4633 const currentRegisteredBlocks = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(registeredBlocks);
4634 const currentDefaultTemplate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(defaultTemplate);
4635 const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useRegistry)();
4636 const {
4637 isPreview
4638 } = (0,_woocommerce_base_context__WEBPACK_IMPORTED_MODULE_3__.useEditorContext)();
4639 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
4640 let templateSynced = false;
4641 if (isPreview) {
4642 return;
4643 }
4644 const {
4645 replaceInnerBlocks
4646 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)('core/block-editor');
4647 return registry.subscribe(() => {
4648 const currentBlock = registry.select('core/block-editor').getBlock(clientId);
4649
4650 // If the block is removed we shouldn't reinsert its inner blocks.
4651 if (!currentBlock) {
4652 return;
4653 }
4654 const innerBlocks = registry.select('core/block-editor').getBlocks(clientId);
4655
4656 // If there are NO inner blocks, sync with the given template.
4657 if (innerBlocks.length === 0 && currentDefaultTemplate.current.length > 0 && !templateSynced) {
4658 const nextBlocks = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlocksFromInnerBlocksTemplate)(currentDefaultTemplate.current);
4659 if (nextBlocks.length !== 0) {
4660 templateSynced = true;
4661 replaceInnerBlocks(clientId, nextBlocks);
4662 return;
4663 }
4664 }
4665 const registeredBlockTypes = currentRegisteredBlocks.current.map(blockName => (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.getBlockType)(blockName));
4666 const missingBlocks = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getMissingBlocks)(innerBlocks, registeredBlockTypes);
4667 if (missingBlocks.length === 0) {
4668 return;
4669 }
4670
4671 // Initially set as -1, so we can skip checking the position multiple times. Later on in the map callback,
4672 // we check where the forced blocks should be inserted. This gets set to >= 0 if we find a missing block,
4673 // so we know we can skip calculating it.
4674 let insertAtPosition = -1;
4675 const blockConfig = missingBlocks.map(block => {
4676 const defaultTemplatePosition = currentDefaultTemplate.current.findIndex(([blockName]) => blockName === block.name);
4677 const createdBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)(block.name);
4678
4679 // As mentioned above, if this is not -1, this is the first time we're calculating the position, if it's
4680 // already been calculated we can skip doing so.
4681 if (insertAtPosition === -1) {
4682 insertAtPosition = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.findBlockPosition)({
4683 defaultTemplatePosition,
4684 innerBlocks,
4685 currentDefaultTemplate
4686 });
4687 }
4688 return createdBlock;
4689 });
4690 registry.batch(() => {
4691 registry.dispatch('core/block-editor').insertBlocks(blockConfig, insertAtPosition, clientId);
4692 });
4693 }, 'core/block-editor');
4694 }, [clientId, isPreview, registry]);
4695 };
4696
4697 /***/ }),
4698
4699 /***/ "./assets/js/blocks/cart-checkout-shared/use-forced-layout/utils.ts":
4700 /*!**************************************************************************!*\
4701 !*** ./assets/js/blocks/cart-checkout-shared/use-forced-layout/utils.ts ***!
4702 \**************************************************************************/
4703 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4704
4705 "use strict";
4706 __webpack_require__.r(__webpack_exports__);
4707 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4708 /* harmony export */ findBlockPosition: () => (/* binding */ findBlockPosition),
4709 /* harmony export */ getMissingBlocks: () => (/* binding */ getMissingBlocks),
4710 /* harmony export */ isBlockLocked: () => (/* binding */ isBlockLocked)
4711 /* harmony export */ });
4712 /**
4713 * External dependencies
4714 */
4715
4716 /**
4717 * Internal dependencies
4718 */
4719
4720 const isBlockLocked = ({
4721 attributes
4722 }) => {
4723 var _attributes$lock, _attributes$lock2, _attributes$lock2$def;
4724 return Boolean(((_attributes$lock = attributes.lock) === null || _attributes$lock === void 0 ? void 0 : _attributes$lock.remove) || ((_attributes$lock2 = attributes.lock) === null || _attributes$lock2 === void 0 ? void 0 : (_attributes$lock2$def = _attributes$lock2.default) === null || _attributes$lock2$def === void 0 ? void 0 : _attributes$lock2$def.remove));
4725 };
4726
4727 /**
4728 * This hook is used to determine which blocks are missing from a block. Given the list of inner blocks of a block, we
4729 * can check for any registered blocks that:
4730 * a) Are locked,
4731 * b) Have the parent set as the current block, and
4732 * c) Are not present in the list of inner blocks.
4733 */
4734 const getMissingBlocks = (innerBlocks, registeredBlockTypes) => {
4735 const lockedBlockTypes = registeredBlockTypes.filter(block => block && isBlockLocked(block));
4736 const missingBlocks = [];
4737 lockedBlockTypes.forEach(lockedBlock => {
4738 if (typeof lockedBlock === 'undefined') {
4739 return;
4740 }
4741 const existingBlock = innerBlocks.find(block => block.name === lockedBlock.name);
4742 if (!existingBlock) {
4743 missingBlocks.push(lockedBlock);
4744 }
4745 });
4746 return missingBlocks;
4747 };
4748
4749 /**
4750 * This hook is used to determine the position that a missing block should be inserted at.
4751 *
4752 * @return The index to insert the missing block at.
4753 */
4754 const findBlockPosition = ({
4755 defaultTemplatePosition,
4756 innerBlocks,
4757 currentDefaultTemplate
4758 }) => {
4759 switch (defaultTemplatePosition) {
4760 case -1:
4761 // The block is not part of the default template, so we append it to the current layout.
4762 return innerBlocks.length;
4763 // defaultTemplatePosition defaults to 0, so if this happens we can just return, this is because the block was
4764 // the first block in the default layout, so we can prepend it to the current layout.
4765 case 0:
4766 return 0;
4767 default:
4768 // The new layout may have extra blocks compared to the default template, so rather than insert
4769 // at the default position, we should append it after another default block.
4770 const adjacentBlock = currentDefaultTemplate.current[defaultTemplatePosition - 1];
4771 const position = innerBlocks.findIndex(({
4772 name: blockName
4773 }) => blockName === adjacentBlock[0]);
4774 return position === -1 ? defaultTemplatePosition : position + 1;
4775 }
4776 };
4777
4778 /***/ }),
4779
4780 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/attributes.tsx":
4781 /*!**********************************************************************!*\
4782 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/attributes.tsx ***!
4783 \**********************************************************************/
4784 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4785
4786 "use strict";
4787 __webpack_require__.r(__webpack_exports__);
4788 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4789 /* harmony export */ attributes: () => (/* binding */ attributes),
4790 /* harmony export */ blockName: () => (/* binding */ blockName)
4791 /* harmony export */ });
4792 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
4793 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
4794 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
4795 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
4796 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
4797 /* harmony import */ var _woocommerce_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/icons */ "./assets/js/icons/library/filled-cart.tsx");
4798 /* harmony import */ var _woocommerce_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/icons */ "./assets/js/icons/library/remove-cart.tsx");
4799
4800 /**
4801 * External dependencies
4802 */
4803
4804
4805
4806 const blockName = 'woocommerce/mini-cart-contents';
4807 const attributes = {
4808 isPreview: {
4809 type: 'boolean',
4810 default: false
4811 },
4812 lock: {
4813 type: 'object',
4814 default: {
4815 remove: true,
4816 move: true
4817 }
4818 },
4819 currentView: {
4820 type: 'string',
4821 default: 'woocommerce/filled-mini-cart-contents-block',
4822 source: 'readonly' // custom source to prevent saving to post content
4823 },
4824 editorViews: {
4825 type: 'object',
4826 default: [{
4827 view: 'woocommerce/filled-mini-cart-contents-block',
4828 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filled Mini-Cart', 'woocommerce'),
4829 icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
4830 icon: _woocommerce_icons__WEBPACK_IMPORTED_MODULE_3__["default"]
4831 })
4832 }, {
4833 view: 'woocommerce/empty-mini-cart-contents-block',
4834 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Empty Mini-Cart', 'woocommerce'),
4835 icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
4836 icon: _woocommerce_icons__WEBPACK_IMPORTED_MODULE_4__["default"]
4837 })
4838 }]
4839 },
4840 width: {
4841 type: 'string',
4842 default: '480px'
4843 }
4844 };
4845
4846 /***/ }),
4847
4848 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx":
4849 /*!****************************************************************!*\
4850 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx ***!
4851 \****************************************************************/
4852 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4853
4854 "use strict";
4855 __webpack_require__.r(__webpack_exports__);
4856 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4857 /* harmony export */ Save: () => (/* binding */ Save),
4858 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4859 /* harmony export */ });
4860 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
4861 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
4862 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
4863 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
4864 /* harmony import */ var _woocommerce_base_context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @woocommerce/base-context */ "./assets/js/base/context/providers/editor-context.tsx");
4865 /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts");
4866 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
4867 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
4868 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
4869 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
4870 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
4871 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
4872 /* harmony import */ var _cart_checkout_shared__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../cart-checkout-shared */ "./assets/js/blocks/cart-checkout-shared/use-forced-layout/index.ts");
4873 /* harmony import */ var _inner_blocks_style__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./inner-blocks-style */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx");
4874 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./assets/js/blocks/mini-cart/mini-cart-contents/editor.scss");
4875 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_editor_scss__WEBPACK_IMPORTED_MODULE_6__);
4876 /* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./attributes */ "./assets/js/blocks/mini-cart/mini-cart-contents/attributes.tsx");
4877
4878 /* eslint-disable jsdoc/check-alignment */
4879 /**
4880 * External dependencies
4881 */
4882
4883
4884
4885
4886
4887
4888
4889 /**
4890 * Internal dependencies
4891 */
4892
4893
4894
4895
4896
4897 // Array of allowed block names.
4898 const ALLOWED_BLOCKS = ['woocommerce/filled-mini-cart-contents-block', 'woocommerce/empty-mini-cart-contents-block'];
4899 const MIN_WIDTH = 300;
4900 const Edit = ({
4901 clientId,
4902 attributes,
4903 setAttributes
4904 }) => {
4905 const {
4906 currentView,
4907 width
4908 } = attributes;
4909 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)();
4910 const defaultTemplate = [['woocommerce/filled-mini-cart-contents-block', {}, []], ['woocommerce/empty-mini-cart-contents-block', {}, []]];
4911 (0,_cart_checkout_shared__WEBPACK_IMPORTED_MODULE_7__.useForcedLayout)({
4912 clientId,
4913 registeredBlocks: ALLOWED_BLOCKS,
4914 defaultTemplate
4915 });
4916
4917 /**
4918 * This is a workaround for the Site Editor to set the correct
4919 * background color of the Mini-Cart Contents block base on
4920 * the main background color set by the theme.
4921 */
4922 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
4923 var _canvasEl$contentWind;
4924 const canvasEl = document.querySelector('.edit-site-visual-editor__editor-canvas');
4925 if (!(canvasEl instanceof HTMLIFrameElement)) {
4926 return;
4927 }
4928 const canvas = canvasEl.contentDocument || ((_canvasEl$contentWind = canvasEl.contentWindow) === null || _canvasEl$contentWind === void 0 ? void 0 : _canvasEl$contentWind.document);
4929 if (!canvas) {
4930 return;
4931 }
4932 if (canvas.getElementById('mini-cart-contents-background-color')) {
4933 return;
4934 }
4935 const styles = canvas.querySelectorAll('style');
4936 const [cssRule] = Array.from(styles).map(style => {
4937 var _style$sheet;
4938 return Array.from(((_style$sheet = style.sheet) === null || _style$sheet === void 0 ? void 0 : _style$sheet.cssRules) || []);
4939 }).flatMap(style => style).filter(Boolean).filter(rule => rule.selectorText === '.editor-styles-wrapper' && rule.style.backgroundColor);
4940 if (!cssRule) {
4941 return;
4942 }
4943 const backgroundColor = cssRule.style.backgroundColor;
4944 if (!backgroundColor) {
4945 return;
4946 }
4947 const style = document.createElement('style');
4948 style.id = 'mini-cart-contents-background-color';
4949 style.appendChild(document.createTextNode(`:where(.wp-block-woocommerce-mini-cart-contents) {
4950 background-color: ${backgroundColor};
4951 }`));
4952 const body = canvas.querySelector('.editor-styles-wrapper');
4953 if (!body) {
4954 return;
4955 }
4956 body.appendChild(style);
4957 }, []);
4958 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__.isFeaturePluginBuild)() && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
4959 key: "inspector"
4960 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, {
4961 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Dimensions', 'woocommerce'),
4962 initialOpen: true
4963 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.__experimentalUnitControl, {
4964 onChange: value => {
4965 setAttributes({
4966 width: value
4967 });
4968 },
4969 onBlur: e => {
4970 if (e.target.value === '') {
4971 setAttributes({
4972 width: _attributes__WEBPACK_IMPORTED_MODULE_8__.attributes.width.default
4973 });
4974 } else if (Number(e.target.value) < MIN_WIDTH) {
4975 setAttributes({
4976 width: MIN_WIDTH + 'px'
4977 });
4978 }
4979 },
4980 value: width,
4981 units: [{
4982 value: 'px',
4983 label: 'px',
4984 default: _attributes__WEBPACK_IMPORTED_MODULE_8__.attributes.width.default
4985 }]
4986 }))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
4987 className: "wc-block-components-drawer__screen-overlay",
4988 "aria-hidden": "true"
4989 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
4990 className: "wc-block-editor-mini-cart-contents__wrapper"
4991 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
4992 ...blockProps
4993 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_context__WEBPACK_IMPORTED_MODULE_9__.EditorProvider, {
4994 currentView: currentView
4995 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
4996 allowedBlocks: ALLOWED_BLOCKS,
4997 template: defaultTemplate,
4998 templateLock: false
4999 })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_inner_blocks_style__WEBPACK_IMPORTED_MODULE_10__.MiniCartInnerBlocksStyle, {
5000 style: blockProps.style
5001 }))));
5002 };
5003 Edit.__docgenInfo = {
5004 "description": "",
5005 "methods": [],
5006 "displayName": "Edit",
5007 "props": {
5008 "clientId": {
5009 "required": true,
5010 "tsType": {
5011 "name": "string"
5012 },
5013 "description": ""
5014 },
5015 "attributes": {
5016 "required": true,
5017 "tsType": {
5018 "name": "Record",
5019 "elements": [{
5020 "name": "string"
5021 }, {
5022 "name": "unknown"
5023 }],
5024 "raw": "Record< string, unknown >"
5025 },
5026 "description": ""
5027 },
5028 "setAttributes": {
5029 "required": true,
5030 "tsType": {
5031 "name": "signature",
5032 "type": "function",
5033 "raw": "( attributes: Record< string, unknown > ) => void",
5034 "signature": {
5035 "arguments": [{
5036 "name": "attributes",
5037 "type": {
5038 "name": "Record",
5039 "elements": [{
5040 "name": "string"
5041 }, {
5042 "name": "unknown"
5043 }],
5044 "raw": "Record< string, unknown >"
5045 }
5046 }],
5047 "return": {
5048 "name": "void"
5049 }
5050 }
5051 },
5052 "description": ""
5053 }
5054 }
5055 };
5056 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Edit);
5057 const Save = () => {
5058 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5059 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
5060 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null));
5061 };
5062 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5063 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx"] = {
5064 name: "Edit",
5065 docgenInfo: Edit.__docgenInfo,
5066 path: "assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx"
5067 };
5068 }
5069 Save.__docgenInfo = {
5070 "description": "",
5071 "methods": [],
5072 "displayName": "Save"
5073 };
5074 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5075 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx"] = {
5076 name: "Save",
5077 docgenInfo: Save.__docgenInfo,
5078 path: "assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx"
5079 };
5080 }
5081
5082 /***/ }),
5083
5084 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/index.tsx":
5085 /*!*****************************************************************!*\
5086 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/index.tsx ***!
5087 \*****************************************************************/
5088 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5089
5090 "use strict";
5091 __webpack_require__.r(__webpack_exports__);
5092 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5093 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5094 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
5095 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
5096 /* harmony import */ var _woocommerce_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/icons */ "./assets/js/icons/library/cart.tsx");
5097 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
5098 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
5099 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__);
5100 /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts");
5101 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx");
5102 /* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./attributes */ "./assets/js/blocks/mini-cart/mini-cart-contents/attributes.tsx");
5103 /* harmony import */ var _inner_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inner-blocks */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/index.tsx");
5104
5105 /**
5106 * External dependencies
5107 */
5108
5109
5110
5111
5112
5113
5114 /**
5115 * Internal dependencies
5116 */
5117
5118
5119
5120 const settings = {
5121 apiVersion: 2,
5122 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Mini-Cart Contents', 'woocommerce'),
5123 icon: {
5124 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"], {
5125 icon: _woocommerce_icons__WEBPACK_IMPORTED_MODULE_6__["default"],
5126 className: "wc-block-editor-components-block-icon"
5127 })
5128 },
5129 category: 'woocommerce',
5130 keywords: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('WooCommerce', 'woocommerce')],
5131 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display a Mini-Cart widget.', 'woocommerce'),
5132 supports: {
5133 align: false,
5134 html: false,
5135 multiple: false,
5136 reusable: false,
5137 inserter: false,
5138 color: {
5139 link: true
5140 },
5141 lock: false,
5142 ...((0,_woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.isFeaturePluginBuild)() && {
5143 __experimentalBorder: {
5144 color: true,
5145 width: true
5146 }
5147 })
5148 },
5149 attributes: _attributes__WEBPACK_IMPORTED_MODULE_7__.attributes,
5150 example: {
5151 attributes: {
5152 isPreview: true
5153 }
5154 },
5155 edit: _edit__WEBPACK_IMPORTED_MODULE_8__["default"],
5156 save: _edit__WEBPACK_IMPORTED_MODULE_8__.Save
5157 };
5158 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.registerBlockType)(_attributes__WEBPACK_IMPORTED_MODULE_7__.blockName, settings);
5159
5160 /***/ }),
5161
5162 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx":
5163 /*!******************************************************************************!*\
5164 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx ***!
5165 \******************************************************************************/
5166 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5167
5168 "use strict";
5169 __webpack_require__.r(__webpack_exports__);
5170 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5171 /* harmony export */ MiniCartInnerBlocksStyle: () => (/* binding */ MiniCartInnerBlocksStyle)
5172 /* harmony export */ });
5173 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5174 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5175
5176 /**
5177 * This is a workaround to style inner blocks using the color
5178 * settings of the Mini-Cart Contents block. It's possible to get
5179 * the Mini-Cart Contents block's attributes inside the inner blocks
5180 * components, but we have 4 out of 7 inner blocks that inherit
5181 * style from the Mini-Cart Contents block, so we need to apply the
5182 * styles here to avoid duplication.
5183 *
5184 * We only use this hack for the Site Editor. On the frontend, we
5185 * manipulate the style using block attributes and inject the CSS
5186 * via `wp_add_inline_style()` function.
5187 */
5188 const MiniCartInnerBlocksStyle = ({
5189 style
5190 }) => {
5191 const innerStyles = [{
5192 selector: '.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-checkout',
5193 properties: [{
5194 property: 'color',
5195 value: style.backgroundColor
5196 }, {
5197 property: 'background-color',
5198 value: style.color
5199 }, {
5200 property: 'border-color',
5201 value: style.color
5202 }]
5203 }].map(({
5204 selector,
5205 properties
5206 }) => {
5207 const rules = properties.filter(({
5208 value
5209 }) => value).map(({
5210 property,
5211 value
5212 }) => `${property}: ${value};`).join('');
5213 if (rules) return `${selector} { ${rules} }`;
5214 return '';
5215 }).join('').trim();
5216 if (!innerStyles) {
5217 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);
5218 }
5219 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("style", null, innerStyles, " ");
5220 };
5221 MiniCartInnerBlocksStyle.__docgenInfo = {
5222 "description": "This is a workaround to style inner blocks using the color\nsettings of the Mini-Cart Contents block. It's possible to get\nthe Mini-Cart Contents block's attributes inside the inner blocks\ncomponents, but we have 4 out of 7 inner blocks that inherit\nstyle from the Mini-Cart Contents block, so we need to apply the\nstyles here to avoid duplication.\n\nWe only use this hack for the Site Editor. On the frontend, we\nmanipulate the style using block attributes and inject the CSS\nvia `wp_add_inline_style()` function.",
5223 "methods": [],
5224 "displayName": "MiniCartInnerBlocksStyle",
5225 "props": {
5226 "style": {
5227 "required": true,
5228 "tsType": {
5229 "name": "Record",
5230 "elements": [{
5231 "name": "string"
5232 }, {
5233 "name": "unknown"
5234 }],
5235 "raw": "Record< string, unknown >"
5236 },
5237 "description": ""
5238 }
5239 }
5240 };
5241 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5242 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx"] = {
5243 name: "MiniCartInnerBlocksStyle",
5244 docgenInfo: MiniCartInnerBlocksStyle.__docgenInfo,
5245 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx"
5246 };
5247 }
5248
5249 /***/ }),
5250
5251 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/allowed-blocks.ts":
5252 /*!**************************************************************************************!*\
5253 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/allowed-blocks.ts ***!
5254 \**************************************************************************************/
5255 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5256
5257 "use strict";
5258 __webpack_require__.r(__webpack_exports__);
5259 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5260 /* harmony export */ getMiniCartAllowedBlocks: () => (/* binding */ getMiniCartAllowedBlocks)
5261 /* harmony export */ });
5262 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
5263 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
5264 /**
5265 * External dependencies
5266 */
5267
5268 const EXCLUDED_BLOCKS = ['woocommerce/mini-cart', 'woocommerce/checkout', 'woocommerce/cart', 'woocommerce/single-product', 'woocommerce/cart-totals-block', 'woocommerce/checkout-fields-block', 'core/post-template', 'core/comment-template', 'core/query-pagination', 'core/comments-query-loop', 'core/post-comments-form', 'core/post-comments-link', 'core/post-comments-count', 'core/comments-pagination', 'core/post-navigation-link', 'core/button'];
5269 const getMiniCartAllowedBlocks = () => (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.getBlockTypes)().filter(block => {
5270 if (EXCLUDED_BLOCKS.includes(block.name)) {
5271 return false;
5272 }
5273
5274 // Exclude child blocks of EXCLUDED_BLOCKS.
5275 if (block.parent && block.parent.filter(value => EXCLUDED_BLOCKS.includes(value)).length > 0) {
5276 return false;
5277 }
5278 return true;
5279 }).map(({
5280 name
5281 }) => name);
5282
5283 /***/ }),
5284
5285 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/edit.tsx":
5286 /*!************************************************************************************************************!*\
5287 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/edit.tsx ***!
5288 \************************************************************************************************************/
5289 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5290
5291 "use strict";
5292 __webpack_require__.r(__webpack_exports__);
5293 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5294 /* harmony export */ Edit: () => (/* binding */ Edit),
5295 /* harmony export */ Save: () => (/* binding */ Save)
5296 /* harmony export */ });
5297 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5298 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5299 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
5300 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
5301 /* harmony import */ var _woocommerce_base_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/base-context */ "./assets/js/base/context/providers/editor-context.tsx");
5302 /* harmony import */ var _allowed_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../allowed-blocks */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/allowed-blocks.ts");
5303
5304 /**
5305 * External dependencies
5306 */
5307
5308
5309
5310 /**
5311 * Internal dependencies
5312 */
5313
5314 const Edit = () => {
5315 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)();
5316 const {
5317 currentView
5318 } = (0,_woocommerce_base_context__WEBPACK_IMPORTED_MODULE_2__.useEditorContext)();
5319 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5320 ...blockProps,
5321 hidden: currentView !== 'woocommerce/empty-mini-cart-contents-block'
5322 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
5323 allowedBlocks: (0,_allowed_blocks__WEBPACK_IMPORTED_MODULE_3__.getMiniCartAllowedBlocks)(),
5324 renderAppender: _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.ButtonBlockAppender
5325 }));
5326 };
5327 const Save = () => {
5328 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5329 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
5330 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null));
5331 };
5332 Edit.__docgenInfo = {
5333 "description": "",
5334 "methods": [],
5335 "displayName": "Edit"
5336 };
5337 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5338 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/edit.tsx"] = {
5339 name: "Edit",
5340 docgenInfo: Edit.__docgenInfo,
5341 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/edit.tsx"
5342 };
5343 }
5344 Save.__docgenInfo = {
5345 "description": "",
5346 "methods": [],
5347 "displayName": "Save"
5348 };
5349 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5350 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/edit.tsx"] = {
5351 name: "Save",
5352 docgenInfo: Save.__docgenInfo,
5353 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/edit.tsx"
5354 };
5355 }
5356
5357 /***/ }),
5358
5359 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/index.tsx":
5360 /*!*************************************************************************************************************!*\
5361 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/index.tsx ***!
5362 \*************************************************************************************************************/
5363 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5364
5365 "use strict";
5366 __webpack_require__.r(__webpack_exports__);
5367 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5368 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5369 /* harmony import */ var _woocommerce_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/icons */ "./assets/js/icons/library/remove-cart.tsx");
5370 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
5371 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
5372 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
5373 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/edit.tsx");
5374
5375 /**
5376 * External dependencies
5377 */
5378
5379
5380
5381
5382 /**
5383 * Internal dependencies
5384 */
5385
5386
5387 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5388 // @ts-ignore -- TypeScript expects some required properties which we already
5389 // registered in PHP.
5390 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/empty-mini-cart-contents-block', {
5391 icon: {
5392 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
5393 icon: _woocommerce_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
5394 className: "wc-block-editor-components-block-icon"
5395 })
5396 },
5397 edit: _edit__WEBPACK_IMPORTED_MODULE_4__.Edit,
5398 save: _edit__WEBPACK_IMPORTED_MODULE_4__.Save
5399 });
5400
5401 /***/ }),
5402
5403 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/edit.tsx":
5404 /*!*************************************************************************************************************!*\
5405 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/edit.tsx ***!
5406 \*************************************************************************************************************/
5407 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5408
5409 "use strict";
5410 __webpack_require__.r(__webpack_exports__);
5411 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5412 /* harmony export */ Edit: () => (/* binding */ Edit),
5413 /* harmony export */ Save: () => (/* binding */ Save)
5414 /* harmony export */ });
5415 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5416 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5417 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
5418 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
5419 /* harmony import */ var _woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/blocks-checkout */ "@woocommerce/blocks-checkout");
5420 /* harmony import */ var _woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_2__);
5421 /* harmony import */ var _woocommerce_base_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-context */ "./assets/js/base/context/providers/editor-context.tsx");
5422 /* harmony import */ var _woocommerce_resource_previews__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/resource-previews */ "./assets/js/previews/cart.ts");
5423 /* harmony import */ var _cart_checkout_shared__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../cart-checkout-shared */ "./assets/js/blocks/cart-checkout-shared/editor-utils.ts");
5424 /* harmony import */ var _cart_checkout_shared__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../cart-checkout-shared */ "./assets/js/blocks/cart-checkout-shared/use-forced-layout/index.ts");
5425
5426 /**
5427 * External dependencies
5428 */
5429
5430
5431
5432
5433
5434 /**
5435 * Internal dependencies
5436 */
5437
5438 const Edit = ({
5439 clientId
5440 }) => {
5441 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)();
5442 const allowedBlocks = (0,_cart_checkout_shared__WEBPACK_IMPORTED_MODULE_3__.getAllowedBlocks)(_woocommerce_blocks_checkout__WEBPACK_IMPORTED_MODULE_2__.innerBlockAreas.FILLED_MINI_CART);
5443 const {
5444 currentView
5445 } = (0,_woocommerce_base_context__WEBPACK_IMPORTED_MODULE_4__.useEditorContext)();
5446 const defaultTemplate = [['woocommerce/mini-cart-title-block', {}], ['woocommerce/mini-cart-items-block', {}], ['woocommerce/mini-cart-footer-block', {}]].filter(Boolean);
5447 (0,_cart_checkout_shared__WEBPACK_IMPORTED_MODULE_5__.useForcedLayout)({
5448 clientId,
5449 registeredBlocks: allowedBlocks,
5450 defaultTemplate
5451 });
5452 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5453 ...blockProps,
5454 hidden: currentView !== 'woocommerce/filled-mini-cart-contents-block'
5455 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_context__WEBPACK_IMPORTED_MODULE_4__.EditorProvider, {
5456 currentView: currentView,
5457 previewData: {
5458 previewCart: _woocommerce_resource_previews__WEBPACK_IMPORTED_MODULE_6__.previewCart
5459 }
5460 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
5461 template: defaultTemplate,
5462 allowedBlocks: allowedBlocks,
5463 templateLock: "insert"
5464 })));
5465 };
5466 const Save = () => {
5467 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5468 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
5469 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null));
5470 };
5471 Edit.__docgenInfo = {
5472 "description": "",
5473 "methods": [],
5474 "displayName": "Edit",
5475 "props": {
5476 "clientId": {
5477 "required": true,
5478 "tsType": {
5479 "name": "string"
5480 },
5481 "description": ""
5482 }
5483 }
5484 };
5485 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5486 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/edit.tsx"] = {
5487 name: "Edit",
5488 docgenInfo: Edit.__docgenInfo,
5489 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/edit.tsx"
5490 };
5491 }
5492 Save.__docgenInfo = {
5493 "description": "",
5494 "methods": [],
5495 "displayName": "Save"
5496 };
5497 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5498 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/edit.tsx"] = {
5499 name: "Save",
5500 docgenInfo: Save.__docgenInfo,
5501 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/edit.tsx"
5502 };
5503 }
5504
5505 /***/ }),
5506
5507 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/index.tsx":
5508 /*!**************************************************************************************************************!*\
5509 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/index.tsx ***!
5510 \**************************************************************************************************************/
5511 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5512
5513 "use strict";
5514 __webpack_require__.r(__webpack_exports__);
5515 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5516 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5517 /* harmony import */ var _woocommerce_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/icons */ "./assets/js/icons/library/filled-cart.tsx");
5518 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
5519 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
5520 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
5521 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/edit.tsx");
5522
5523 /**
5524 * External dependencies
5525 */
5526
5527
5528
5529
5530 /**
5531 * Internal dependencies
5532 */
5533
5534
5535 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5536 // @ts-ignore -- TypeScript expects some required properties which we already
5537 // registered in PHP.
5538 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/filled-mini-cart-contents-block', {
5539 icon: {
5540 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
5541 icon: _woocommerce_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
5542 className: "wc-block-editor-components-block-icon"
5543 })
5544 },
5545 edit: _edit__WEBPACK_IMPORTED_MODULE_4__.Edit,
5546 save: _edit__WEBPACK_IMPORTED_MODULE_4__.Save
5547 });
5548
5549 /***/ }),
5550
5551 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/index.tsx":
5552 /*!******************************************************************************!*\
5553 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/index.tsx ***!
5554 \******************************************************************************/
5555 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5556
5557 "use strict";
5558 __webpack_require__.r(__webpack_exports__);
5559 /* harmony import */ var _empty_mini_cart_contents_block__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./empty-mini-cart-contents-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/index.tsx");
5560 /* harmony import */ var _filled_mini_cart_contents_block__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filled-mini-cart-contents-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/index.tsx");
5561 /* harmony import */ var _mini_cart_title_block__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mini-cart-title-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/index.tsx");
5562 /* harmony import */ var _mini_cart_title_items_counter_block__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mini-cart-title-items-counter-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/index.tsx");
5563 /* harmony import */ var _mini_cart_title_label_block__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mini-cart-title-label-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/index.tsx");
5564 /* harmony import */ var _mini_cart_items_block__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mini-cart-items-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/index.tsx");
5565 /* harmony import */ var _mini_cart_products_table_block__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mini-cart-products-table-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/index.tsx");
5566 /* harmony import */ var _mini_cart_footer_block__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mini-cart-footer-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/index.tsx");
5567 /* harmony import */ var _mini_cart_shopping_button_block__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./mini-cart-shopping-button-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/index.tsx");
5568 /* harmony import */ var _mini_cart_cart_button_block__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./mini-cart-cart-button-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/index.tsx");
5569 /* harmony import */ var _mini_cart_checkout_button_block__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./mini-cart-checkout-button-block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/index.tsx");
5570 /**
5571 * Internal dependencies
5572 */
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585 /***/ }),
5586
5587 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/attributes.tsx":
5588 /*!***************************************************************************************************************!*\
5589 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/attributes.tsx ***!
5590 \***************************************************************************************************************/
5591 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5592
5593 "use strict";
5594 __webpack_require__.r(__webpack_exports__);
5595 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5596 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
5597 /* harmony export */ });
5598 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/constants.tsx");
5599 /**
5600 * Internal dependencies
5601 */
5602
5603 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
5604 cartButtonLabel: {
5605 type: 'string',
5606 default: _constants__WEBPACK_IMPORTED_MODULE_0__.defaultCartButtonLabel
5607 }
5608 });
5609
5610 /***/ }),
5611
5612 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/constants.tsx":
5613 /*!**************************************************************************************************************!*\
5614 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/constants.tsx ***!
5615 \**************************************************************************************************************/
5616 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5617
5618 "use strict";
5619 __webpack_require__.r(__webpack_exports__);
5620 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5621 /* harmony export */ defaultCartButtonLabel: () => (/* binding */ defaultCartButtonLabel)
5622 /* harmony export */ });
5623 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
5624 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
5625 /**
5626 * External dependencies
5627 */
5628
5629 const defaultCartButtonLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View my cart', 'woocommerce');
5630
5631 /***/ }),
5632
5633 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/edit.tsx":
5634 /*!*********************************************************************************************************!*\
5635 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/edit.tsx ***!
5636 \*********************************************************************************************************/
5637 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5638
5639 "use strict";
5640 __webpack_require__.r(__webpack_exports__);
5641 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5642 /* harmony export */ Edit: () => (/* binding */ Edit),
5643 /* harmony export */ Save: () => (/* binding */ Save)
5644 /* harmony export */ });
5645 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5646 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5647 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
5648 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
5649 /* harmony import */ var _woocommerce_editor_components_editable_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/editor-components/editable-button */ "./assets/js/editor-components/editable-button/index.tsx");
5650 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/constants.tsx");
5651 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/utils.ts");
5652
5653 /**
5654 * External dependencies
5655 */
5656
5657
5658
5659 /**
5660 * Internal dependencies
5661 */
5662
5663
5664 const Edit = ({
5665 attributes,
5666 setAttributes
5667 }) => {
5668 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
5669 className: 'wc-block-mini-cart__footer-cart'
5670 });
5671 const {
5672 cartButtonLabel
5673 } = attributes;
5674 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5675 ...blockProps
5676 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_editable_button__WEBPACK_IMPORTED_MODULE_2__["default"], {
5677 variant: (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getVariant)(blockProps.className, 'outlined'),
5678 value: cartButtonLabel,
5679 placeholder: _constants__WEBPACK_IMPORTED_MODULE_4__.defaultCartButtonLabel,
5680 onChange: content => {
5681 setAttributes({
5682 cartButtonLabel: content
5683 });
5684 },
5685 style: blockProps.style
5686 }));
5687 };
5688 const Save = () => {
5689 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5690 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
5691 });
5692 };
5693 Edit.__docgenInfo = {
5694 "description": "",
5695 "methods": [],
5696 "displayName": "Edit",
5697 "props": {
5698 "attributes": {
5699 "required": true,
5700 "tsType": {
5701 "name": "signature",
5702 "type": "object",
5703 "raw": "{\n\tcartButtonLabel: string;\n}",
5704 "signature": {
5705 "properties": [{
5706 "key": "cartButtonLabel",
5707 "value": {
5708 "name": "string",
5709 "required": true
5710 }
5711 }]
5712 }
5713 },
5714 "description": ""
5715 },
5716 "setAttributes": {
5717 "required": true,
5718 "tsType": {
5719 "name": "signature",
5720 "type": "function",
5721 "raw": "( attributes: Record< string, unknown > ) => void",
5722 "signature": {
5723 "arguments": [{
5724 "name": "attributes",
5725 "type": {
5726 "name": "Record",
5727 "elements": [{
5728 "name": "string"
5729 }, {
5730 "name": "unknown"
5731 }],
5732 "raw": "Record< string, unknown >"
5733 }
5734 }],
5735 "return": {
5736 "name": "void"
5737 }
5738 }
5739 },
5740 "description": ""
5741 }
5742 }
5743 };
5744 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5745 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/edit.tsx"] = {
5746 name: "Edit",
5747 docgenInfo: Edit.__docgenInfo,
5748 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/edit.tsx"
5749 };
5750 }
5751 Save.__docgenInfo = {
5752 "description": "",
5753 "methods": [],
5754 "displayName": "Save"
5755 };
5756 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5757 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/edit.tsx"] = {
5758 name: "Save",
5759 docgenInfo: Save.__docgenInfo,
5760 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/edit.tsx"
5761 };
5762 }
5763
5764 /***/ }),
5765
5766 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/index.tsx":
5767 /*!**********************************************************************************************************!*\
5768 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/index.tsx ***!
5769 \**********************************************************************************************************/
5770 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5771
5772 "use strict";
5773 __webpack_require__.r(__webpack_exports__);
5774 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5775 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5776 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
5777 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/button.js");
5778 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
5779 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
5780 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/edit.tsx");
5781 /* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributes */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/attributes.tsx");
5782
5783 /**
5784 * External dependencies
5785 */
5786
5787
5788
5789 /**
5790 * Internal dependencies
5791 */
5792
5793
5794
5795 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5796 // @ts-ignore -- TypeScript expects some required properties which we already
5797 // registered in PHP.
5798 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-cart-button-block', {
5799 icon: {
5800 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
5801 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
5802 className: "wc-block-editor-components-block-icon"
5803 })
5804 },
5805 attributes: _attributes__WEBPACK_IMPORTED_MODULE_4__["default"],
5806 edit: _edit__WEBPACK_IMPORTED_MODULE_5__.Edit,
5807 save: _edit__WEBPACK_IMPORTED_MODULE_5__.Save
5808 });
5809
5810 /***/ }),
5811
5812 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/attributes.tsx":
5813 /*!*******************************************************************************************************************!*\
5814 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/attributes.tsx ***!
5815 \*******************************************************************************************************************/
5816 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5817
5818 "use strict";
5819 __webpack_require__.r(__webpack_exports__);
5820 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5821 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
5822 /* harmony export */ });
5823 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/constants.tsx");
5824 /**
5825 * Internal dependencies
5826 */
5827
5828 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
5829 checkoutButtonLabel: {
5830 type: 'string',
5831 default: _constants__WEBPACK_IMPORTED_MODULE_0__.defaultCheckoutButtonLabel
5832 }
5833 });
5834
5835 /***/ }),
5836
5837 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/constants.tsx":
5838 /*!******************************************************************************************************************!*\
5839 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/constants.tsx ***!
5840 \******************************************************************************************************************/
5841 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5842
5843 "use strict";
5844 __webpack_require__.r(__webpack_exports__);
5845 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5846 /* harmony export */ defaultCheckoutButtonLabel: () => (/* binding */ defaultCheckoutButtonLabel)
5847 /* harmony export */ });
5848 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
5849 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
5850 /**
5851 * External dependencies
5852 */
5853
5854 const defaultCheckoutButtonLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Go to checkout', 'woocommerce');
5855
5856 /***/ }),
5857
5858 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/edit.tsx":
5859 /*!*************************************************************************************************************!*\
5860 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/edit.tsx ***!
5861 \*************************************************************************************************************/
5862 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5863
5864 "use strict";
5865 __webpack_require__.r(__webpack_exports__);
5866 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5867 /* harmony export */ Edit: () => (/* binding */ Edit),
5868 /* harmony export */ Save: () => (/* binding */ Save)
5869 /* harmony export */ });
5870 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
5871 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
5872 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
5873 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
5874 /* harmony import */ var _woocommerce_editor_components_editable_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/editor-components/editable-button */ "./assets/js/editor-components/editable-button/index.tsx");
5875 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
5876 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
5877 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/constants.tsx");
5878 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/utils.ts");
5879
5880 /**
5881 * External dependencies
5882 */
5883
5884
5885
5886
5887 /**
5888 * Internal dependencies
5889 */
5890
5891
5892 const Edit = ({
5893 attributes,
5894 setAttributes
5895 }) => {
5896 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
5897 className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('wc-block-mini-cart__footer-checkout')
5898 });
5899 const {
5900 checkoutButtonLabel
5901 } = attributes;
5902 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5903 ...blockProps
5904 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_editable_button__WEBPACK_IMPORTED_MODULE_3__["default"], {
5905 variant: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getVariant)(blockProps.className, 'contained'),
5906 value: checkoutButtonLabel,
5907 placeholder: _constants__WEBPACK_IMPORTED_MODULE_5__.defaultCheckoutButtonLabel,
5908 onChange: content => {
5909 setAttributes({
5910 checkoutButtonLabel: content
5911 });
5912 },
5913 style: blockProps.style
5914 }));
5915 };
5916 const Save = () => {
5917 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
5918 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
5919 });
5920 };
5921 Edit.__docgenInfo = {
5922 "description": "",
5923 "methods": [],
5924 "displayName": "Edit",
5925 "props": {
5926 "attributes": {
5927 "required": true,
5928 "tsType": {
5929 "name": "signature",
5930 "type": "object",
5931 "raw": "{\n\tcheckoutButtonLabel: string;\n}",
5932 "signature": {
5933 "properties": [{
5934 "key": "checkoutButtonLabel",
5935 "value": {
5936 "name": "string",
5937 "required": true
5938 }
5939 }]
5940 }
5941 },
5942 "description": ""
5943 },
5944 "setAttributes": {
5945 "required": true,
5946 "tsType": {
5947 "name": "signature",
5948 "type": "function",
5949 "raw": "( attributes: Record< string, unknown > ) => void",
5950 "signature": {
5951 "arguments": [{
5952 "name": "attributes",
5953 "type": {
5954 "name": "Record",
5955 "elements": [{
5956 "name": "string"
5957 }, {
5958 "name": "unknown"
5959 }],
5960 "raw": "Record< string, unknown >"
5961 }
5962 }],
5963 "return": {
5964 "name": "void"
5965 }
5966 }
5967 },
5968 "description": ""
5969 }
5970 }
5971 };
5972 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5973 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/edit.tsx"] = {
5974 name: "Edit",
5975 docgenInfo: Edit.__docgenInfo,
5976 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/edit.tsx"
5977 };
5978 }
5979 Save.__docgenInfo = {
5980 "description": "",
5981 "methods": [],
5982 "displayName": "Save"
5983 };
5984 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
5985 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/edit.tsx"] = {
5986 name: "Save",
5987 docgenInfo: Save.__docgenInfo,
5988 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/edit.tsx"
5989 };
5990 }
5991
5992 /***/ }),
5993
5994 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/index.tsx":
5995 /*!**************************************************************************************************************!*\
5996 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/index.tsx ***!
5997 \**************************************************************************************************************/
5998 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5999
6000 "use strict";
6001 __webpack_require__.r(__webpack_exports__);
6002 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6003 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6004 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
6005 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/button.js");
6006 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
6007 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
6008 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/edit.tsx");
6009 /* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributes */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/attributes.tsx");
6010
6011 /**
6012 * External dependencies
6013 */
6014
6015
6016
6017 /**
6018 * Internal dependencies
6019 */
6020
6021
6022
6023 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6024 // @ts-ignore -- TypeScript expects some required properties which we already
6025 // registered in PHP.
6026 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-checkout-button-block', {
6027 icon: {
6028 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
6029 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
6030 className: "wc-block-editor-components-block-icon"
6031 })
6032 },
6033 attributes: _attributes__WEBPACK_IMPORTED_MODULE_4__["default"],
6034 edit: _edit__WEBPACK_IMPORTED_MODULE_5__.Edit,
6035 save: _edit__WEBPACK_IMPORTED_MODULE_5__.Save
6036 });
6037
6038 /***/ }),
6039
6040 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/attributes.tsx":
6041 /*!**********************************************************************************************************!*\
6042 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/attributes.tsx ***!
6043 \**********************************************************************************************************/
6044 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6045
6046 "use strict";
6047 __webpack_require__.r(__webpack_exports__);
6048 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6049 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
6050 /* harmony export */ });
6051 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/constants.ts");
6052 /**
6053 * Internal dependencies
6054 */
6055
6056 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
6057 cartButtonLabel: {
6058 type: 'string',
6059 default: _constants__WEBPACK_IMPORTED_MODULE_0__.defaultCartButtonLabel
6060 },
6061 checkoutButtonLabel: {
6062 type: 'string',
6063 default: _constants__WEBPACK_IMPORTED_MODULE_0__.defaultCheckoutButtonLabel
6064 }
6065 });
6066
6067 /***/ }),
6068
6069 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/constants.ts":
6070 /*!********************************************************************************************************!*\
6071 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/constants.ts ***!
6072 \********************************************************************************************************/
6073 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6074
6075 "use strict";
6076 __webpack_require__.r(__webpack_exports__);
6077 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6078 /* harmony export */ defaultCartButtonLabel: () => (/* binding */ defaultCartButtonLabel),
6079 /* harmony export */ defaultCheckoutButtonLabel: () => (/* binding */ defaultCheckoutButtonLabel)
6080 /* harmony export */ });
6081 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
6082 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
6083 /**
6084 * External dependencies
6085 */
6086
6087 const defaultCartButtonLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View my cart', 'woocommerce');
6088 const defaultCheckoutButtonLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Go to checkout', 'woocommerce');
6089
6090 /***/ }),
6091
6092 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx":
6093 /*!****************************************************************************************************!*\
6094 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx ***!
6095 \****************************************************************************************************/
6096 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6097
6098 "use strict";
6099 __webpack_require__.r(__webpack_exports__);
6100 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6101 /* harmony export */ Edit: () => (/* binding */ Edit),
6102 /* harmony export */ Save: () => (/* binding */ Save)
6103 /* harmony export */ });
6104 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6105 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6106 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
6107 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
6108 /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components");
6109 /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__);
6110 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
6111 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
6112 /* harmony import */ var _woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/price-format */ "@woocommerce/price-format");
6113 /* harmony import */ var _woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__);
6114 /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/payment-methods/use-payment-methods.ts");
6115 /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/cart/use-store-cart.ts");
6116 /* harmony import */ var _woocommerce_base_components_cart_checkout_payment_method_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/base-components/cart-checkout/payment-method-icons */ "./assets/js/base/components/cart-checkout/payment-method-icons/index.tsx");
6117 /* harmony import */ var _woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @woocommerce/base-utils */ "./assets/js/base/utils/get-icons-from-payment-methods.ts");
6118 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
6119 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_6__);
6120 /* harmony import */ var _woocommerce_base_context__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @woocommerce/base-context */ "./assets/js/base/context/providers/cart-checkout/payment-events/index.tsx");
6121 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./editor.scss */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/editor.scss");
6122 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_editor_scss__WEBPACK_IMPORTED_MODULE_7__);
6123
6124 /**
6125 * External dependencies
6126 */
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137 /**
6138 * Internal dependencies
6139 */
6140
6141 const PaymentMethodIconsElement = () => {
6142 const {
6143 paymentMethods
6144 } = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_8__.usePaymentMethods)();
6145 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_cart_checkout_payment_method_icons__WEBPACK_IMPORTED_MODULE_5__["default"], {
6146 icons: (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_9__.getIconsFromPaymentMethods)(paymentMethods)
6147 });
6148 };
6149 const Edit = () => {
6150 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)();
6151 const {
6152 cartTotals
6153 } = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_10__.useStoreCart)();
6154 const subTotal = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_6__.getSetting)('displayCartPricesIncludingTax', false) ? parseInt(cartTotals.total_items, 10) + parseInt(cartTotals.total_items_tax, 10) : parseInt(cartTotals.total_items, 10);
6155 const TEMPLATE = [['woocommerce/mini-cart-cart-button-block', {}], ['woocommerce/mini-cart-checkout-button-block', {}]];
6156 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6157 ...blockProps
6158 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6159 className: "wc-block-mini-cart__footer"
6160 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__.TotalsItem, {
6161 className: "wc-block-mini-cart__footer-subtotal",
6162 currency: (0,_woocommerce_price_format__WEBPACK_IMPORTED_MODULE_4__.getCurrencyFromPriceResponse)(cartTotals),
6163 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Subtotal', 'woocommerce'),
6164 value: subTotal,
6165 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Shipping, taxes, and discounts calculated at checkout.', 'woocommerce')
6166 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6167 className: "wc-block-mini-cart__footer-actions"
6168 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks, {
6169 template: TEMPLATE
6170 })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_context__WEBPACK_IMPORTED_MODULE_11__.PaymentEventsProvider, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(PaymentMethodIconsElement, null))));
6171 };
6172 const Save = () => {
6173 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6174 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps.save()
6175 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks.Content, null));
6176 };
6177 Edit.__docgenInfo = {
6178 "description": "",
6179 "methods": [],
6180 "displayName": "Edit"
6181 };
6182 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6183 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx"] = {
6184 name: "Edit",
6185 docgenInfo: Edit.__docgenInfo,
6186 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx"
6187 };
6188 }
6189 Save.__docgenInfo = {
6190 "description": "",
6191 "methods": [],
6192 "displayName": "Save"
6193 };
6194 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6195 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx"] = {
6196 name: "Save",
6197 docgenInfo: Save.__docgenInfo,
6198 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx"
6199 };
6200 }
6201
6202 /***/ }),
6203
6204 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/index.tsx":
6205 /*!*****************************************************************************************************!*\
6206 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/index.tsx ***!
6207 \*****************************************************************************************************/
6208 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6209
6210 "use strict";
6211 __webpack_require__.r(__webpack_exports__);
6212 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6213 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6214 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
6215 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/payment.js");
6216 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
6217 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
6218 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
6219 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
6220 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx");
6221 /* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./attributes */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/attributes.tsx");
6222
6223 /**
6224 * External dependencies
6225 */
6226
6227
6228
6229
6230 /**
6231 * Internal dependencies
6232 */
6233
6234
6235
6236 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6237 // @ts-ignore -- TypeScript expects some required properties which we already
6238 // registered in PHP.
6239 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-footer-block', {
6240 icon: {
6241 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"], {
6242 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
6243 className: "wc-block-editor-components-block-icon"
6244 })
6245 },
6246 deprecated: [{
6247 attributes: _attributes__WEBPACK_IMPORTED_MODULE_5__["default"],
6248 migrate(attributes, innerBlocks) {
6249 const {
6250 cartButtonLabel,
6251 checkoutButtonLabel,
6252 ...restAttributes
6253 } = attributes;
6254 return [restAttributes, [(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.createBlock)('woocommerce/mini-cart-cart-button-block', {
6255 cartButtonLabel
6256 }), (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.createBlock)('woocommerce/mini-cart-checkout-button-block', {
6257 checkoutButtonLabel
6258 }), ...innerBlocks]];
6259 },
6260 isEligible: (attributes, innerBlocks) => {
6261 return !innerBlocks.length;
6262 },
6263 save: () => {
6264 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6265 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps.save()
6266 });
6267 }
6268 }],
6269 edit: _edit__WEBPACK_IMPORTED_MODULE_6__.Edit,
6270 save: _edit__WEBPACK_IMPORTED_MODULE_6__.Save
6271 });
6272
6273 /***/ }),
6274
6275 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/edit.tsx":
6276 /*!***************************************************************************************************!*\
6277 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/edit.tsx ***!
6278 \***************************************************************************************************/
6279 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6280
6281 "use strict";
6282 __webpack_require__.r(__webpack_exports__);
6283 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6284 /* harmony export */ Edit: () => (/* binding */ Edit),
6285 /* harmony export */ Save: () => (/* binding */ Save)
6286 /* harmony export */ });
6287 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6288 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6289 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
6290 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
6291 /* harmony import */ var _allowed_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../allowed-blocks */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/allowed-blocks.ts");
6292
6293 /**
6294 * External dependencies
6295 */
6296
6297 /**
6298 * Internal dependencies
6299 */
6300
6301 const Edit = () => {
6302 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
6303 className: 'wc-block-mini-cart__items'
6304 });
6305 const defaultTemplate = [['woocommerce/mini-cart-products-table-block', {}]].filter(Boolean);
6306 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6307 ...blockProps
6308 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
6309 template: defaultTemplate,
6310 renderAppender: _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.ButtonBlockAppender,
6311 templateLock: false,
6312 allowedBlocks: (0,_allowed_blocks__WEBPACK_IMPORTED_MODULE_2__.getMiniCartAllowedBlocks)()
6313 }));
6314 };
6315 const Save = () => {
6316 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6317 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
6318 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null));
6319 };
6320 Edit.__docgenInfo = {
6321 "description": "",
6322 "methods": [],
6323 "displayName": "Edit"
6324 };
6325 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6326 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/edit.tsx"] = {
6327 name: "Edit",
6328 docgenInfo: Edit.__docgenInfo,
6329 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/edit.tsx"
6330 };
6331 }
6332 Save.__docgenInfo = {
6333 "description": "",
6334 "methods": [],
6335 "displayName": "Save"
6336 };
6337 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6338 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/edit.tsx"] = {
6339 name: "Save",
6340 docgenInfo: Save.__docgenInfo,
6341 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/edit.tsx"
6342 };
6343 }
6344
6345 /***/ }),
6346
6347 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/index.tsx":
6348 /*!****************************************************************************************************!*\
6349 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/index.tsx ***!
6350 \****************************************************************************************************/
6351 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6352
6353 "use strict";
6354 __webpack_require__.r(__webpack_exports__);
6355 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6356 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6357 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
6358 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/grid.js");
6359 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
6360 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
6361 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-items-block/edit.tsx");
6362
6363 /**
6364 * External dependencies
6365 */
6366
6367
6368
6369 /**
6370 * Internal dependencies
6371 */
6372
6373
6374 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6375 // @ts-ignore -- TypeScript expects some required properties which we already
6376 // registered in PHP.
6377 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-items-block', {
6378 icon: {
6379 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
6380 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
6381 className: "wc-block-editor-components-block-icon"
6382 })
6383 },
6384 edit: _edit__WEBPACK_IMPORTED_MODULE_4__.Edit,
6385 save: _edit__WEBPACK_IMPORTED_MODULE_4__.Save
6386 });
6387
6388 /***/ }),
6389
6390 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.tsx":
6391 /*!*************************************************************************************************************!*\
6392 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.tsx ***!
6393 \*************************************************************************************************************/
6394 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6395
6396 "use strict";
6397 __webpack_require__.r(__webpack_exports__);
6398 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6399 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
6400 /* harmony export */ });
6401 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6402 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6403 /* harmony import */ var _woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/base-context/hooks */ "./assets/js/base/context/hooks/cart/use-store-cart.ts");
6404 /* harmony import */ var _woocommerce_base_components_cart_checkout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-components/cart-checkout */ "./assets/js/base/components/cart-checkout/cart-line-items-table/index.tsx");
6405 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js");
6406 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
6407
6408 /**
6409 * External dependencies
6410 */
6411
6412
6413
6414 const Block = ({
6415 className
6416 }) => {
6417 const {
6418 cartItems,
6419 cartIsLoading
6420 } = (0,_woocommerce_base_context_hooks__WEBPACK_IMPORTED_MODULE_2__.useStoreCart)();
6421 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6422 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'wc-block-mini-cart__products-table')
6423 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_cart_checkout__WEBPACK_IMPORTED_MODULE_3__["default"], {
6424 lineItems: cartItems,
6425 isLoading: cartIsLoading,
6426 className: "wc-block-mini-cart-items"
6427 }));
6428 };
6429 Block.__docgenInfo = {
6430 "description": "",
6431 "methods": [],
6432 "displayName": "Block",
6433 "props": {
6434 "className": {
6435 "required": true,
6436 "tsType": {
6437 "name": "string"
6438 },
6439 "description": ""
6440 }
6441 }
6442 };
6443 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Block);
6444 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6445 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.tsx"] = {
6446 name: "Block",
6447 docgenInfo: Block.__docgenInfo,
6448 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.tsx"
6449 };
6450 }
6451
6452 /***/ }),
6453
6454 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/edit.tsx":
6455 /*!************************************************************************************************************!*\
6456 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/edit.tsx ***!
6457 \************************************************************************************************************/
6458 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6459
6460 "use strict";
6461 __webpack_require__.r(__webpack_exports__);
6462 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6463 /* harmony export */ Edit: () => (/* binding */ Edit),
6464 /* harmony export */ Save: () => (/* binding */ Save)
6465 /* harmony export */ });
6466 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6467 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6468 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
6469 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
6470 /* harmony import */ var _woocommerce_base_components_noninteractive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/base-components/noninteractive */ "./assets/js/base/components/noninteractive/index.tsx");
6471 /* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.tsx");
6472
6473 /**
6474 * External dependencies
6475 */
6476
6477
6478
6479 /**
6480 * Internal dependencies
6481 */
6482
6483 const Edit = () => {
6484 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)();
6485 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6486 ...blockProps
6487 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_noninteractive__WEBPACK_IMPORTED_MODULE_2__["default"], null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_block__WEBPACK_IMPORTED_MODULE_3__["default"], {
6488 className: "is-mobile"
6489 })));
6490 };
6491 const Save = () => {
6492 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6493 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
6494 });
6495 };
6496 Edit.__docgenInfo = {
6497 "description": "",
6498 "methods": [],
6499 "displayName": "Edit"
6500 };
6501 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6502 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/edit.tsx"] = {
6503 name: "Edit",
6504 docgenInfo: Edit.__docgenInfo,
6505 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/edit.tsx"
6506 };
6507 }
6508 Save.__docgenInfo = {
6509 "description": "",
6510 "methods": [],
6511 "displayName": "Save"
6512 };
6513 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6514 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/edit.tsx"] = {
6515 name: "Save",
6516 docgenInfo: Save.__docgenInfo,
6517 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/edit.tsx"
6518 };
6519 }
6520
6521 /***/ }),
6522
6523 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/index.tsx":
6524 /*!*************************************************************************************************************!*\
6525 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/index.tsx ***!
6526 \*************************************************************************************************************/
6527 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6528
6529 "use strict";
6530 __webpack_require__.r(__webpack_exports__);
6531 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6532 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6533 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
6534 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/list.js");
6535 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
6536 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
6537 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-products-table-block/edit.tsx");
6538
6539 /**
6540 * External dependencies
6541 */
6542
6543
6544
6545 /**
6546 * Internal dependencies
6547 */
6548
6549
6550 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6551 // @ts-ignore -- TypeScript expects some required properties which we already
6552 // registered in PHP.
6553 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-products-table-block', {
6554 icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
6555 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
6556 className: "wc-block-editor-components-block-icon"
6557 }),
6558 edit: _edit__WEBPACK_IMPORTED_MODULE_4__.Edit,
6559 save: _edit__WEBPACK_IMPORTED_MODULE_4__.Save
6560 });
6561
6562 /***/ }),
6563
6564 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/attributes.tsx":
6565 /*!*******************************************************************************************************************!*\
6566 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/attributes.tsx ***!
6567 \*******************************************************************************************************************/
6568 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6569
6570 "use strict";
6571 __webpack_require__.r(__webpack_exports__);
6572 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6573 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
6574 /* harmony export */ });
6575 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/constants.tsx");
6576 /**
6577 * Internal dependencies
6578 */
6579
6580 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
6581 startShoppingButtonLabel: {
6582 type: 'string',
6583 default: _constants__WEBPACK_IMPORTED_MODULE_0__.defaultStartShoppingButtonLabel
6584 }
6585 });
6586
6587 /***/ }),
6588
6589 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/constants.tsx":
6590 /*!******************************************************************************************************************!*\
6591 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/constants.tsx ***!
6592 \******************************************************************************************************************/
6593 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6594
6595 "use strict";
6596 __webpack_require__.r(__webpack_exports__);
6597 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6598 /* harmony export */ defaultStartShoppingButtonLabel: () => (/* binding */ defaultStartShoppingButtonLabel)
6599 /* harmony export */ });
6600 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
6601 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
6602 /**
6603 * External dependencies
6604 */
6605
6606 const defaultStartShoppingButtonLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Start shopping', 'woocommerce');
6607
6608 /***/ }),
6609
6610 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/edit.tsx":
6611 /*!*************************************************************************************************************!*\
6612 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/edit.tsx ***!
6613 \*************************************************************************************************************/
6614 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6615
6616 "use strict";
6617 __webpack_require__.r(__webpack_exports__);
6618 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6619 /* harmony export */ Edit: () => (/* binding */ Edit),
6620 /* harmony export */ Save: () => (/* binding */ Save)
6621 /* harmony export */ });
6622 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6623 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6624 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
6625 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
6626 /* harmony import */ var _woocommerce_editor_components_editable_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/editor-components/editable-button */ "./assets/js/editor-components/editable-button/index.tsx");
6627 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/constants.tsx");
6628 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/utils.ts");
6629
6630 /**
6631 * External dependencies
6632 */
6633
6634
6635
6636 /**
6637 * Internal dependencies
6638 */
6639
6640
6641 const Edit = ({
6642 attributes,
6643 setAttributes
6644 }) => {
6645 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
6646 className: 'wp-block-button aligncenter'
6647 });
6648 const {
6649 startShoppingButtonLabel
6650 } = attributes;
6651 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6652 ...blockProps
6653 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_editable_button__WEBPACK_IMPORTED_MODULE_2__["default"], {
6654 className: "wc-block-mini-cart__shopping-button",
6655 value: startShoppingButtonLabel,
6656 placeholder: _constants__WEBPACK_IMPORTED_MODULE_3__.defaultStartShoppingButtonLabel,
6657 onChange: content => {
6658 setAttributes({
6659 startShoppingButtonLabel: content
6660 });
6661 },
6662 variant: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getVariant)(blockProps.className, 'contained')
6663 }));
6664 };
6665 const Save = () => {
6666 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6667 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
6668 });
6669 };
6670 Edit.__docgenInfo = {
6671 "description": "",
6672 "methods": [],
6673 "displayName": "Edit",
6674 "props": {
6675 "attributes": {
6676 "required": true,
6677 "tsType": {
6678 "name": "signature",
6679 "type": "object",
6680 "raw": "{\n\tstartShoppingButtonLabel: string;\n}",
6681 "signature": {
6682 "properties": [{
6683 "key": "startShoppingButtonLabel",
6684 "value": {
6685 "name": "string",
6686 "required": true
6687 }
6688 }]
6689 }
6690 },
6691 "description": ""
6692 },
6693 "setAttributes": {
6694 "required": true,
6695 "tsType": {
6696 "name": "signature",
6697 "type": "function",
6698 "raw": "( attributes: Record< string, unknown > ) => void",
6699 "signature": {
6700 "arguments": [{
6701 "name": "attributes",
6702 "type": {
6703 "name": "Record",
6704 "elements": [{
6705 "name": "string"
6706 }, {
6707 "name": "unknown"
6708 }],
6709 "raw": "Record< string, unknown >"
6710 }
6711 }],
6712 "return": {
6713 "name": "void"
6714 }
6715 }
6716 },
6717 "description": ""
6718 }
6719 }
6720 };
6721 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6722 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/edit.tsx"] = {
6723 name: "Edit",
6724 docgenInfo: Edit.__docgenInfo,
6725 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/edit.tsx"
6726 };
6727 }
6728 Save.__docgenInfo = {
6729 "description": "",
6730 "methods": [],
6731 "displayName": "Save"
6732 };
6733 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6734 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/edit.tsx"] = {
6735 name: "Save",
6736 docgenInfo: Save.__docgenInfo,
6737 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/edit.tsx"
6738 };
6739 }
6740
6741 /***/ }),
6742
6743 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/index.tsx":
6744 /*!**************************************************************************************************************!*\
6745 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/index.tsx ***!
6746 \**************************************************************************************************************/
6747 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6748
6749 "use strict";
6750 __webpack_require__.r(__webpack_exports__);
6751 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6752 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6753 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
6754 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/button.js");
6755 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
6756 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
6757 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/edit.tsx");
6758 /* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributes */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/attributes.tsx");
6759
6760 /**
6761 * External dependencies
6762 */
6763
6764
6765
6766 /**
6767 * Internal dependencies
6768 */
6769
6770
6771
6772 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6773 // @ts-ignore -- TypeScript expects some required properties which we already
6774 // registered in PHP.
6775 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-shopping-button-block', {
6776 icon: {
6777 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
6778 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
6779 className: "wc-block-editor-components-block-icon"
6780 })
6781 },
6782 attributes: _attributes__WEBPACK_IMPORTED_MODULE_4__["default"],
6783 edit: _edit__WEBPACK_IMPORTED_MODULE_5__.Edit,
6784 save: _edit__WEBPACK_IMPORTED_MODULE_5__.Save
6785 });
6786
6787 /***/ }),
6788
6789 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/edit.tsx":
6790 /*!***************************************************************************************************!*\
6791 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/edit.tsx ***!
6792 \***************************************************************************************************/
6793 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6794
6795 "use strict";
6796 __webpack_require__.r(__webpack_exports__);
6797 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6798 /* harmony export */ Edit: () => (/* binding */ Edit),
6799 /* harmony export */ Save: () => (/* binding */ Save)
6800 /* harmony export */ });
6801 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6802 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6803 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
6804 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
6805
6806 /**
6807 * External dependencies
6808 */
6809
6810 const Edit = () => {
6811 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
6812 className: 'wc-block-mini-cart__title'
6813 });
6814 const TEMPLATE = [['woocommerce/mini-cart-title-label-block', {}], ['woocommerce/mini-cart-title-items-counter-block', {}]];
6815 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
6816 ...blockProps
6817 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
6818 allowedBlocks: ['woocommerce/mini-cart-title-label-block', 'woocommerce/mini-cart-title-items-counter-block'],
6819 template: TEMPLATE,
6820 templateLock: "all"
6821 }));
6822 };
6823 const Save = () => {
6824 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6825 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
6826 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null));
6827 };
6828 Edit.__docgenInfo = {
6829 "description": "",
6830 "methods": [],
6831 "displayName": "Edit"
6832 };
6833 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6834 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/edit.tsx"] = {
6835 name: "Edit",
6836 docgenInfo: Edit.__docgenInfo,
6837 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/edit.tsx"
6838 };
6839 }
6840 Save.__docgenInfo = {
6841 "description": "",
6842 "methods": [],
6843 "displayName": "Save"
6844 };
6845 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6846 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/edit.tsx"] = {
6847 name: "Save",
6848 docgenInfo: Save.__docgenInfo,
6849 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/edit.tsx"
6850 };
6851 }
6852
6853 /***/ }),
6854
6855 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/index.tsx":
6856 /*!****************************************************************************************************!*\
6857 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/index.tsx ***!
6858 \****************************************************************************************************/
6859 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6860
6861 "use strict";
6862 __webpack_require__.r(__webpack_exports__);
6863 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6864 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6865 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
6866 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/heading.js");
6867 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
6868 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
6869 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-block/edit.tsx");
6870
6871 /**
6872 * External dependencies
6873 */
6874
6875
6876
6877 /**
6878 * Internal dependencies
6879 */
6880
6881
6882 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6883 // @ts-ignore -- TypeScript expects some required properties which we already
6884 // registered in PHP.
6885 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-title-block', {
6886 icon: {
6887 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
6888 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
6889 className: "wc-block-editor-components-block-icon"
6890 })
6891 },
6892 edit: _edit__WEBPACK_IMPORTED_MODULE_4__.Edit,
6893 save: _edit__WEBPACK_IMPORTED_MODULE_4__.Save
6894 });
6895
6896 /***/ }),
6897
6898 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/edit.tsx":
6899 /*!*****************************************************************************************************************!*\
6900 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/edit.tsx ***!
6901 \*****************************************************************************************************************/
6902 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6903
6904 "use strict";
6905 __webpack_require__.r(__webpack_exports__);
6906 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6907 /* harmony export */ Edit: () => (/* binding */ Edit),
6908 /* harmony export */ Save: () => (/* binding */ Save)
6909 /* harmony export */ });
6910 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6911 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6912 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
6913 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
6914 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
6915 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
6916 /* harmony import */ var _woocommerce_base_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-context */ "./assets/js/base/context/hooks/cart/use-store-cart.ts");
6917
6918 /**
6919 * External dependencies
6920 */
6921
6922
6923
6924 const Edit = () => {
6925 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)();
6926 const {
6927 cartItemsCount
6928 } = (0,_woocommerce_base_context__WEBPACK_IMPORTED_MODULE_3__.useStoreCart)();
6929 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
6930 ...blockProps
6931 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: %d is the count of items in the cart. */
6932 (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('(%d item)', '(%d items)', cartItemsCount, 'woocommerce'), cartItemsCount));
6933 };
6934 const Save = () => {
6935 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
6936 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
6937 });
6938 };
6939 Edit.__docgenInfo = {
6940 "description": "",
6941 "methods": [],
6942 "displayName": "Edit"
6943 };
6944 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6945 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/edit.tsx"] = {
6946 name: "Edit",
6947 docgenInfo: Edit.__docgenInfo,
6948 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/edit.tsx"
6949 };
6950 }
6951 Save.__docgenInfo = {
6952 "description": "",
6953 "methods": [],
6954 "displayName": "Save"
6955 };
6956 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
6957 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/edit.tsx"] = {
6958 name: "Save",
6959 docgenInfo: Save.__docgenInfo,
6960 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/edit.tsx"
6961 };
6962 }
6963
6964 /***/ }),
6965
6966 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/index.tsx":
6967 /*!******************************************************************************************************************!*\
6968 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/index.tsx ***!
6969 \******************************************************************************************************************/
6970 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6971
6972 "use strict";
6973 __webpack_require__.r(__webpack_exports__);
6974 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
6975 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6976 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
6977 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/heading.js");
6978 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
6979 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
6980 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/edit.tsx");
6981
6982 /**
6983 * External dependencies
6984 */
6985
6986
6987
6988 /**
6989 * Internal dependencies
6990 */
6991
6992
6993 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6994 // @ts-ignore -- TypeScript expects some required properties which we already
6995 // registered in PHP.
6996 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-title-items-counter-block', {
6997 icon: {
6998 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
6999 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
7000 className: "wc-block-editor-components-block-icon"
7001 })
7002 },
7003 edit: _edit__WEBPACK_IMPORTED_MODULE_4__.Edit,
7004 save: _edit__WEBPACK_IMPORTED_MODULE_4__.Save
7005 });
7006
7007 /***/ }),
7008
7009 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/attributes.tsx":
7010 /*!***************************************************************************************************************!*\
7011 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/attributes.tsx ***!
7012 \***************************************************************************************************************/
7013 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7014
7015 "use strict";
7016 __webpack_require__.r(__webpack_exports__);
7017 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7018 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
7019 /* harmony export */ });
7020 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/constants.ts");
7021 /**
7022 * Internal dependencies
7023 */
7024
7025 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
7026 label: {
7027 type: 'string',
7028 default: _constants__WEBPACK_IMPORTED_MODULE_0__.defaultYourCartLabel
7029 }
7030 });
7031
7032 /***/ }),
7033
7034 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/constants.ts":
7035 /*!*************************************************************************************************************!*\
7036 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/constants.ts ***!
7037 \*************************************************************************************************************/
7038 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7039
7040 "use strict";
7041 __webpack_require__.r(__webpack_exports__);
7042 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7043 /* harmony export */ defaultYourCartLabel: () => (/* binding */ defaultYourCartLabel)
7044 /* harmony export */ });
7045 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
7046 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
7047 /**
7048 * External dependencies
7049 */
7050
7051 const defaultYourCartLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your cart', 'woocommerce');
7052
7053 /***/ }),
7054
7055 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/edit.tsx":
7056 /*!*********************************************************************************************************!*\
7057 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/edit.tsx ***!
7058 \*********************************************************************************************************/
7059 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7060
7061 "use strict";
7062 __webpack_require__.r(__webpack_exports__);
7063 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7064 /* harmony export */ Edit: () => (/* binding */ Edit),
7065 /* harmony export */ Save: () => (/* binding */ Save)
7066 /* harmony export */ });
7067 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
7068 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7069 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
7070 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
7071
7072 /**
7073 * External dependencies
7074 */
7075
7076 const Edit = ({
7077 attributes: {
7078 label
7079 },
7080 setAttributes
7081 }) => {
7082 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)();
7083 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
7084 ...blockProps
7085 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText, {
7086 allowedFormats: [],
7087 value: label,
7088 onChange: newLabel => setAttributes({
7089 label: newLabel
7090 })
7091 }));
7092 };
7093 const Save = () => {
7094 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
7095 ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
7096 });
7097 };
7098 Edit.__docgenInfo = {
7099 "description": "",
7100 "methods": [],
7101 "displayName": "Edit",
7102 "props": {
7103 "attributes": {
7104 "required": true,
7105 "tsType": {
7106 "name": "signature",
7107 "type": "object",
7108 "raw": "{\n\tlabel: string;\n}",
7109 "signature": {
7110 "properties": [{
7111 "key": "label",
7112 "value": {
7113 "name": "string",
7114 "required": true
7115 }
7116 }]
7117 }
7118 },
7119 "description": ""
7120 },
7121 "setAttributes": {
7122 "required": true,
7123 "tsType": {
7124 "name": "signature",
7125 "type": "function",
7126 "raw": "( attributes: Record< string, unknown > ) => void",
7127 "signature": {
7128 "arguments": [{
7129 "name": "attributes",
7130 "type": {
7131 "name": "Record",
7132 "elements": [{
7133 "name": "string"
7134 }, {
7135 "name": "unknown"
7136 }],
7137 "raw": "Record< string, unknown >"
7138 }
7139 }],
7140 "return": {
7141 "name": "void"
7142 }
7143 }
7144 },
7145 "description": ""
7146 }
7147 }
7148 };
7149 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
7150 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/edit.tsx"] = {
7151 name: "Edit",
7152 docgenInfo: Edit.__docgenInfo,
7153 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/edit.tsx"
7154 };
7155 }
7156 Save.__docgenInfo = {
7157 "description": "",
7158 "methods": [],
7159 "displayName": "Save"
7160 };
7161 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
7162 STORYBOOK_REACT_CLASSES["assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/edit.tsx"] = {
7163 name: "Save",
7164 docgenInfo: Save.__docgenInfo,
7165 path: "assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/edit.tsx"
7166 };
7167 }
7168
7169 /***/ }),
7170
7171 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/index.tsx":
7172 /*!**********************************************************************************************************!*\
7173 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/index.tsx ***!
7174 \**********************************************************************************************************/
7175 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7176
7177 "use strict";
7178 __webpack_require__.r(__webpack_exports__);
7179 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
7180 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7181 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js");
7182 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/heading.js");
7183 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
7184 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
7185 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/edit.tsx");
7186 /* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributes */ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/attributes.tsx");
7187
7188 /**
7189 * External dependencies
7190 */
7191
7192
7193
7194 /**
7195 * Internal dependencies
7196 */
7197
7198
7199
7200 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7201 // @ts-ignore -- TypeScript expects some required properties which we already
7202 // registered in PHP.
7203 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)('woocommerce/mini-cart-title-label-block', {
7204 icon: {
7205 src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"], {
7206 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
7207 className: "wc-block-editor-components-block-icon"
7208 })
7209 },
7210 attributes: _attributes__WEBPACK_IMPORTED_MODULE_4__["default"],
7211 edit: _edit__WEBPACK_IMPORTED_MODULE_5__.Edit,
7212 save: _edit__WEBPACK_IMPORTED_MODULE_5__.Save
7213 });
7214
7215 /***/ }),
7216
7217 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/utils.ts":
7218 /*!*****************************************************************************!*\
7219 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/utils.ts ***!
7220 \*****************************************************************************/
7221 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7222
7223 "use strict";
7224 __webpack_require__.r(__webpack_exports__);
7225 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7226 /* harmony export */ getVariant: () => (/* binding */ getVariant),
7227 /* harmony export */ hasChildren: () => (/* binding */ hasChildren)
7228 /* harmony export */ });
7229 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts");
7230 /**
7231 * External dependencies
7232 */
7233
7234 const getVariant = (className = '', defaultVariant) => {
7235 if (className.includes('is-style-outline')) {
7236 return 'outlined';
7237 }
7238 if (className.includes('is-style-fill')) {
7239 return 'contained';
7240 }
7241 return defaultVariant;
7242 };
7243
7244 /**
7245 * Checks if there are any children that are blocks.
7246 */
7247 const hasChildren = children => {
7248 return children.some(child => {
7249 if (Array.isArray(child)) {
7250 return hasChildren(child);
7251 }
7252 return (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.isObject)(child) && child.key !== null;
7253 });
7254 };
7255
7256 /***/ }),
7257
7258 /***/ "./assets/js/editor-components/editable-button/index.tsx":
7259 /*!***************************************************************!*\
7260 !*** ./assets/js/editor-components/editable-button/index.tsx ***!
7261 \***************************************************************/
7262 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7263
7264 "use strict";
7265 __webpack_require__.r(__webpack_exports__);
7266 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7267 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
7268 /* harmony export */ });
7269 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
7270 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7271 /* harmony import */ var _woocommerce_base_components_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/base-components/button */ "./assets/js/base/components/button/index.tsx");
7272 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
7273 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
7274
7275 /**
7276 * External dependencies
7277 */
7278
7279
7280 const EditableButton = ({
7281 onChange,
7282 placeholder,
7283 value,
7284 ...props
7285 }) => {
7286 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_button__WEBPACK_IMPORTED_MODULE_1__["default"], {
7287 ...props
7288 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
7289 multiline: false,
7290 allowedFormats: [],
7291 value: value,
7292 placeholder: placeholder,
7293 onChange: onChange
7294 }));
7295 };
7296 EditableButton.__docgenInfo = {
7297 "description": "",
7298 "methods": [],
7299 "displayName": "EditableButton",
7300 "props": {
7301 "onChange": {
7302 "required": true,
7303 "tsType": {
7304 "name": "signature",
7305 "type": "function",
7306 "raw": "( value: string ) => void",
7307 "signature": {
7308 "arguments": [{
7309 "name": "value",
7310 "type": {
7311 "name": "string"
7312 }
7313 }],
7314 "return": {
7315 "name": "void"
7316 }
7317 }
7318 },
7319 "description": "On change callback."
7320 },
7321 "placeholder": {
7322 "required": false,
7323 "tsType": {
7324 "name": "string"
7325 },
7326 "description": "The placeholder of the editable button."
7327 },
7328 "value": {
7329 "required": true,
7330 "tsType": {
7331 "name": "string"
7332 },
7333 "description": "The current value of the editable button."
7334 }
7335 },
7336 "composes": ["Omit"]
7337 };
7338 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditableButton);
7339 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
7340 STORYBOOK_REACT_CLASSES["assets/js/editor-components/editable-button/index.tsx"] = {
7341 name: "EditableButton",
7342 docgenInfo: EditableButton.__docgenInfo,
7343 path: "assets/js/editor-components/editable-button/index.tsx"
7344 };
7345 }
7346
7347 /***/ }),
7348
7349 /***/ "./assets/js/icons/library/cart.tsx":
7350 /*!******************************************!*\
7351 !*** ./assets/js/icons/library/cart.tsx ***!
7352 \******************************************/
7353 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7354
7355 "use strict";
7356 __webpack_require__.r(__webpack_exports__);
7357 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7358 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
7359 /* harmony export */ });
7360 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
7361 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7362 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
7363 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
7364
7365 /**
7366 * External dependencies
7367 */
7368
7369 const cart = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, {
7370 xmlns: "http://www.w3.org/2000/svg",
7371 viewBox: "0 0 24 24"
7372 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
7373 fill: "none",
7374 d: "M0 0h24v24H0V0z"
7375 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
7376 d: "M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"
7377 }));
7378 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cart);
7379
7380 /***/ }),
7381
7382 /***/ "./assets/js/icons/library/filled-cart.tsx":
7383 /*!*************************************************!*\
7384 !*** ./assets/js/icons/library/filled-cart.tsx ***!
7385 \*************************************************/
7386 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7387
7388 "use strict";
7389 __webpack_require__.r(__webpack_exports__);
7390 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7391 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
7392 /* harmony export */ });
7393 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
7394 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7395 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
7396 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
7397
7398 /**
7399 * External dependencies
7400 */
7401
7402 const filledCart = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, {
7403 xmlns: "http://www.w3.org/2000/svg",
7404 viewBox: "0 0 24 24"
7405 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
7406 fill: "none",
7407 fillRule: "evenodd"
7408 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
7409 d: "M0 0h24v24H0z"
7410 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
7411 fill: "currentColor",
7412 fillRule: "nonzero",
7413 d: "M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49A.996.996 0 0 0 20.01 4H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45ZM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2Zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2Z"
7414 })), ' ');
7415 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (filledCart);
7416
7417 /***/ }),
7418
7419 /***/ "./assets/js/icons/library/remove-cart.tsx":
7420 /*!*************************************************!*\
7421 !*** ./assets/js/icons/library/remove-cart.tsx ***!
7422 \*************************************************/
7423 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7424
7425 "use strict";
7426 __webpack_require__.r(__webpack_exports__);
7427 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7428 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
7429 /* harmony export */ });
7430 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
7431 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7432 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
7433 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
7434
7435 /**
7436 * External dependencies
7437 */
7438
7439 const removeCart = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, {
7440 xmlns: "http://www.w3.org/2000/svg",
7441 viewBox: "0 0 24 24"
7442 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
7443 d: "M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z"
7444 }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
7445 fill: "none",
7446 d: "M0 0h24v24H0z"
7447 }));
7448 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (removeCart);
7449
7450 /***/ }),
7451
7452 /***/ "./assets/js/previews/cart.ts":
7453 /*!************************************!*\
7454 !*** ./assets/js/previews/cart.ts ***!
7455 \************************************/
7456 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7457
7458 "use strict";
7459 __webpack_require__.r(__webpack_exports__);
7460 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7461 /* harmony export */ previewCart: () => (/* binding */ previewCart)
7462 /* harmony export */ });
7463 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
7464 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
7465 /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts");
7466 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
7467 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__);
7468 /* harmony import */ var _shipping_rates__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shipping-rates */ "./assets/js/previews/shipping-rates.ts");
7469 /**
7470 * External dependencies
7471 */
7472
7473
7474
7475
7476 /**
7477 * Internal dependencies
7478 */
7479
7480
7481 /**
7482 * Prices from the API may change because of this display setting. This makes the response use either
7483 * wc_get_price_including_tax or wc_get_price_excluding_tax. It is correct that this setting changes the cart preview
7484 * data.
7485 *
7486 * WooCommerce core has 2 settings which control this, one for cart (displayCartPricesIncludingTax), and one for the
7487 * rest of the store (displayProductPricesIncludingTax). Because of this, Cart endpoints use displayCartPricesIncludingTax
7488 * which is the most appropriate.
7489 *
7490 * Handling the display settings server-side helps work around rounding/display issues that can arise from manually
7491 * adding tax to a price.
7492 */
7493 const displayWithTax = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('displayCartPricesIncludingTax', false);
7494
7495 // Sample data for cart block.
7496 // This closely resembles the data returned from the Store API /cart endpoint.
7497 // https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/src/StoreApi/docs/cart.md#cart-response
7498 const previewCart = {
7499 coupons: [],
7500 shipping_rates: (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('shippingMethodsExist', false) || (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('localPickupEnabled', false) ? _shipping_rates__WEBPACK_IMPORTED_MODULE_3__.previewShippingRates : [],
7501 items: [{
7502 key: '1',
7503 id: 1,
7504 type: 'simple',
7505 quantity: 2,
7506 catalog_visibility: 'visible',
7507 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Beanie', 'woocommerce'),
7508 summary: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Beanie', 'woocommerce'),
7509 short_description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Warm hat for winter', 'woocommerce'),
7510 description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
7511 sku: 'woo-beanie',
7512 permalink: 'https://example.org',
7513 low_stock_remaining: 2,
7514 backorders_allowed: false,
7515 show_backorder_badge: false,
7516 sold_individually: false,
7517 quantity_limits: {
7518 minimum: 1,
7519 maximum: 99,
7520 multiple_of: 1,
7521 editable: true
7522 },
7523 images: [{
7524 id: 10,
7525 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/beanie.jpg',
7526 thumbnail: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/beanie.jpg',
7527 srcset: '',
7528 sizes: '',
7529 name: '',
7530 alt: ''
7531 }],
7532 variation: [{
7533 attribute: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Color', 'woocommerce'),
7534 value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Yellow', 'woocommerce')
7535 }, {
7536 attribute: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Size', 'woocommerce'),
7537 value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Small', 'woocommerce')
7538 }],
7539 prices: {
7540 currency_code: 'USD',
7541 currency_symbol: '$',
7542 currency_minor_unit: 2,
7543 currency_decimal_separator: '.',
7544 currency_thousand_separator: ',',
7545 currency_prefix: '$',
7546 currency_suffix: '',
7547 price: displayWithTax ? '12000' : '10000',
7548 regular_price: displayWithTax ? '12000' : '10000',
7549 sale_price: displayWithTax ? '12000' : '10000',
7550 price_range: null,
7551 raw_prices: {
7552 precision: 6,
7553 price: displayWithTax ? '12000000' : '10000000',
7554 regular_price: displayWithTax ? '12000000' : '10000000',
7555 sale_price: displayWithTax ? '12000000' : '10000000'
7556 }
7557 },
7558 totals: {
7559 currency_code: 'USD',
7560 currency_symbol: '$',
7561 currency_minor_unit: 2,
7562 currency_decimal_separator: '.',
7563 currency_thousand_separator: ',',
7564 currency_prefix: '$',
7565 currency_suffix: '',
7566 line_subtotal: '2000',
7567 line_subtotal_tax: '400',
7568 line_total: '2000',
7569 line_total_tax: '400'
7570 },
7571 extensions: {},
7572 item_data: []
7573 }, {
7574 key: '2',
7575 id: 2,
7576 type: 'simple',
7577 quantity: 1,
7578 catalog_visibility: 'visible',
7579 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cap', 'woocommerce'),
7580 summary: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cap', 'woocommerce'),
7581 short_description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Lightweight baseball cap', 'woocommerce'),
7582 description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
7583 sku: 'woo-cap',
7584 low_stock_remaining: null,
7585 permalink: 'https://example.org',
7586 backorders_allowed: false,
7587 show_backorder_badge: false,
7588 sold_individually: false,
7589 quantity_limits: {
7590 minimum: 1,
7591 maximum: 99,
7592 multiple_of: 1,
7593 editable: true
7594 },
7595 images: [{
7596 id: 11,
7597 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/cap.jpg',
7598 thumbnail: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/cap.jpg',
7599 srcset: '',
7600 sizes: '',
7601 name: '',
7602 alt: ''
7603 }],
7604 variation: [{
7605 attribute: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Color', 'woocommerce'),
7606 value: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Orange', 'woocommerce')
7607 }],
7608 prices: {
7609 currency_code: 'USD',
7610 currency_symbol: '$',
7611 currency_minor_unit: 2,
7612 currency_decimal_separator: '.',
7613 currency_thousand_separator: ',',
7614 currency_prefix: '$',
7615 currency_suffix: '',
7616 price: displayWithTax ? '2400' : '2000',
7617 regular_price: displayWithTax ? '2400' : '2000',
7618 sale_price: displayWithTax ? '2400' : '2000',
7619 price_range: null,
7620 raw_prices: {
7621 precision: 6,
7622 price: displayWithTax ? '24000000' : '20000000',
7623 regular_price: displayWithTax ? '24000000' : '20000000',
7624 sale_price: displayWithTax ? '24000000' : '20000000'
7625 }
7626 },
7627 totals: {
7628 currency_code: 'USD',
7629 currency_symbol: '$',
7630 currency_minor_unit: 2,
7631 currency_decimal_separator: '.',
7632 currency_thousand_separator: ',',
7633 currency_prefix: '$',
7634 currency_suffix: '',
7635 line_subtotal: '2000',
7636 line_subtotal_tax: '400',
7637 line_total: '2000',
7638 line_total_tax: '400'
7639 },
7640 extensions: {},
7641 item_data: []
7642 }],
7643 cross_sells: [{
7644 id: 1,
7645 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Polo', 'woocommerce'),
7646 parent: 0,
7647 type: 'simple',
7648 variation: '',
7649 permalink: 'https://example.org',
7650 sku: 'woo-polo',
7651 short_description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Polo', 'woocommerce'),
7652 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Polo', 'woocommerce'),
7653 on_sale: false,
7654 prices: {
7655 currency_code: 'USD',
7656 currency_symbol: '$',
7657 currency_minor_unit: 2,
7658 currency_decimal_separator: '.',
7659 currency_thousand_separator: ',',
7660 currency_prefix: '$',
7661 currency_suffix: '',
7662 price: displayWithTax ? '24000' : '20000',
7663 regular_price: displayWithTax ? '24000' : '20000',
7664 sale_price: displayWithTax ? '12000' : '10000',
7665 price_range: null
7666 },
7667 price_html: '',
7668 average_rating: '4.5',
7669 review_count: 2,
7670 images: [{
7671 id: 17,
7672 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/polo.jpg',
7673 thumbnail: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/polo.jpg',
7674 srcset: '',
7675 sizes: '',
7676 name: '',
7677 alt: ''
7678 }],
7679 categories: [],
7680 tags: [],
7681 attributes: [],
7682 variations: [],
7683 has_options: false,
7684 is_purchasable: true,
7685 is_in_stock: true,
7686 is_on_backorder: false,
7687 low_stock_remaining: null,
7688 sold_individually: false,
7689 add_to_cart: {
7690 text: '',
7691 description: '',
7692 url: '',
7693 minimum: 1,
7694 maximum: 99,
7695 multiple_of: 1
7696 }
7697 }, {
7698 id: 2,
7699 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Long Sleeve Tee', 'woocommerce'),
7700 parent: 0,
7701 type: 'simple',
7702 variation: '',
7703 permalink: 'https://example.org',
7704 sku: 'woo-long-sleeve-tee',
7705 short_description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Long Sleeve Tee', 'woocommerce'),
7706 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Long Sleeve Tee', 'woocommerce'),
7707 on_sale: false,
7708 prices: {
7709 currency_code: 'USD',
7710 currency_symbol: '$',
7711 currency_minor_unit: 2,
7712 currency_decimal_separator: '.',
7713 currency_thousand_separator: ',',
7714 currency_prefix: '$',
7715 currency_suffix: '',
7716 price: displayWithTax ? '30000' : '25000',
7717 regular_price: displayWithTax ? '30000' : '25000',
7718 sale_price: displayWithTax ? '30000' : '25000',
7719 price_range: null
7720 },
7721 price_html: '',
7722 average_rating: '4',
7723 review_count: 2,
7724 images: [{
7725 id: 17,
7726 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/long-sleeve-tee.jpg',
7727 thumbnail: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/long-sleeve-tee.jpg',
7728 srcset: '',
7729 sizes: '',
7730 name: '',
7731 alt: ''
7732 }],
7733 categories: [],
7734 tags: [],
7735 attributes: [],
7736 variations: [],
7737 has_options: false,
7738 is_purchasable: true,
7739 is_in_stock: true,
7740 is_on_backorder: false,
7741 low_stock_remaining: null,
7742 sold_individually: false,
7743 add_to_cart: {
7744 text: '',
7745 description: '',
7746 url: '',
7747 minimum: 1,
7748 maximum: 99,
7749 multiple_of: 1
7750 }
7751 }, {
7752 id: 3,
7753 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hoodie with Zipper', 'woocommerce'),
7754 parent: 0,
7755 type: 'simple',
7756 variation: '',
7757 permalink: 'https://example.org',
7758 sku: 'woo-hoodie-with-zipper',
7759 short_description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hoodie with Zipper', 'woocommerce'),
7760 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hoodie with Zipper', 'woocommerce'),
7761 on_sale: true,
7762 prices: {
7763 currency_code: 'USD',
7764 currency_symbol: '$',
7765 currency_minor_unit: 2,
7766 currency_decimal_separator: '.',
7767 currency_thousand_separator: ',',
7768 currency_prefix: '$',
7769 currency_suffix: '',
7770 price: displayWithTax ? '15000' : '12500',
7771 regular_price: displayWithTax ? '30000' : '25000',
7772 sale_price: displayWithTax ? '15000' : '12500',
7773 price_range: null
7774 },
7775 price_html: '',
7776 average_rating: '1',
7777 review_count: 2,
7778 images: [{
7779 id: 17,
7780 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/hoodie-with-zipper.jpg',
7781 thumbnail: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/hoodie-with-zipper.jpg',
7782 srcset: '',
7783 sizes: '',
7784 name: '',
7785 alt: ''
7786 }],
7787 categories: [],
7788 tags: [],
7789 attributes: [],
7790 variations: [],
7791 has_options: false,
7792 is_purchasable: true,
7793 is_in_stock: true,
7794 is_on_backorder: false,
7795 low_stock_remaining: null,
7796 sold_individually: false,
7797 add_to_cart: {
7798 text: '',
7799 description: '',
7800 url: '',
7801 minimum: 1,
7802 maximum: 99,
7803 multiple_of: 1
7804 }
7805 }, {
7806 id: 4,
7807 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hoodie with Logo', 'woocommerce'),
7808 parent: 0,
7809 type: 'simple',
7810 variation: '',
7811 permalink: 'https://example.org',
7812 sku: 'woo-hoodie-with-logo',
7813 short_description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Polo', 'woocommerce'),
7814 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Polo', 'woocommerce'),
7815 on_sale: false,
7816 prices: {
7817 currency_code: 'USD',
7818 currency_symbol: '$',
7819 currency_minor_unit: 2,
7820 currency_decimal_separator: '.',
7821 currency_thousand_separator: ',',
7822 currency_prefix: '$',
7823 currency_suffix: '',
7824 price: displayWithTax ? '4500' : '4250',
7825 regular_price: displayWithTax ? '4500' : '4250',
7826 sale_price: displayWithTax ? '4500' : '4250',
7827 price_range: null
7828 },
7829 price_html: '',
7830 average_rating: '5',
7831 review_count: 2,
7832 images: [{
7833 id: 17,
7834 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/hoodie-with-logo.jpg',
7835 thumbnail: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/hoodie-with-logo.jpg',
7836 srcset: '',
7837 sizes: '',
7838 name: '',
7839 alt: ''
7840 }],
7841 categories: [],
7842 tags: [],
7843 attributes: [],
7844 variations: [],
7845 has_options: false,
7846 is_purchasable: true,
7847 is_in_stock: true,
7848 is_on_backorder: false,
7849 low_stock_remaining: null,
7850 sold_individually: false,
7851 add_to_cart: {
7852 text: '',
7853 description: '',
7854 url: '',
7855 minimum: 1,
7856 maximum: 99,
7857 multiple_of: 1
7858 }
7859 }, {
7860 id: 5,
7861 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hoodie with Pocket', 'woocommerce'),
7862 parent: 0,
7863 type: 'simple',
7864 variation: '',
7865 permalink: 'https://example.org',
7866 sku: 'woo-hoodie-with-pocket',
7867 short_description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hoodie with Pocket', 'woocommerce'),
7868 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hoodie with Pocket', 'woocommerce'),
7869 on_sale: true,
7870 prices: {
7871 currency_code: 'USD',
7872 currency_symbol: '$',
7873 currency_minor_unit: 2,
7874 currency_decimal_separator: '.',
7875 currency_thousand_separator: ',',
7876 currency_prefix: '$',
7877 currency_suffix: '',
7878 price: displayWithTax ? '3500' : '3250',
7879 regular_price: displayWithTax ? '4500' : '4250',
7880 sale_price: displayWithTax ? '3500' : '3250',
7881 price_range: null
7882 },
7883 price_html: '',
7884 average_rating: '3.75',
7885 review_count: 4,
7886 images: [{
7887 id: 17,
7888 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/hoodie-with-pocket.jpg',
7889 thumbnail: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/hoodie-with-pocket.jpg',
7890 srcset: '',
7891 sizes: '',
7892 name: '',
7893 alt: ''
7894 }],
7895 categories: [],
7896 tags: [],
7897 attributes: [],
7898 variations: [],
7899 has_options: false,
7900 is_purchasable: true,
7901 is_in_stock: true,
7902 is_on_backorder: false,
7903 low_stock_remaining: null,
7904 sold_individually: false,
7905 add_to_cart: {
7906 text: '',
7907 description: '',
7908 url: '',
7909 minimum: 1,
7910 maximum: 99,
7911 multiple_of: 1
7912 }
7913 }, {
7914 id: 6,
7915 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('T-Shirt', 'woocommerce'),
7916 parent: 0,
7917 type: 'simple',
7918 variation: '',
7919 permalink: 'https://example.org',
7920 sku: 'woo-t-shirt',
7921 short_description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('T-Shirt', 'woocommerce'),
7922 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('T-Shirt', 'woocommerce'),
7923 on_sale: false,
7924 prices: {
7925 currency_code: 'USD',
7926 currency_symbol: '$',
7927 currency_minor_unit: 2,
7928 currency_decimal_separator: '.',
7929 currency_thousand_separator: ',',
7930 currency_prefix: '$',
7931 currency_suffix: '',
7932 price: displayWithTax ? '1800' : '1500',
7933 regular_price: displayWithTax ? '1800' : '1500',
7934 sale_price: displayWithTax ? '1800' : '1500',
7935 price_range: null
7936 },
7937 price_html: '',
7938 average_rating: '3',
7939 review_count: 2,
7940 images: [{
7941 id: 17,
7942 src: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/tshirt.jpg',
7943 thumbnail: _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_IMAGE_URL + 'previews/tshirt.jpg',
7944 srcset: '',
7945 sizes: '',
7946 name: '',
7947 alt: ''
7948 }],
7949 categories: [],
7950 tags: [],
7951 attributes: [],
7952 variations: [],
7953 has_options: false,
7954 is_purchasable: true,
7955 is_in_stock: true,
7956 is_on_backorder: false,
7957 low_stock_remaining: null,
7958 sold_individually: false,
7959 add_to_cart: {
7960 text: '',
7961 description: '',
7962 url: '',
7963 minimum: 1,
7964 maximum: 99,
7965 multiple_of: 1
7966 }
7967 }],
7968 fees: [{
7969 id: 'fee',
7970 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fee', 'woocommerce'),
7971 totals: {
7972 currency_code: 'USD',
7973 currency_symbol: '$',
7974 currency_minor_unit: 2,
7975 currency_decimal_separator: '.',
7976 currency_thousand_separator: ',',
7977 currency_prefix: '$',
7978 currency_suffix: '',
7979 total: '100',
7980 total_tax: '20'
7981 }
7982 }],
7983 items_count: 3,
7984 items_weight: 0,
7985 needs_payment: true,
7986 needs_shipping: (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('shippingEnabled', true),
7987 has_calculated_shipping: true,
7988 shipping_address: {
7989 first_name: '',
7990 last_name: '',
7991 company: '',
7992 address_1: '',
7993 address_2: '',
7994 city: '',
7995 state: '',
7996 postcode: '',
7997 country: '',
7998 phone: ''
7999 },
8000 billing_address: {
8001 first_name: '',
8002 last_name: '',
8003 company: '',
8004 address_1: '',
8005 address_2: '',
8006 city: '',
8007 state: '',
8008 postcode: '',
8009 country: '',
8010 email: '',
8011 phone: ''
8012 },
8013 totals: {
8014 currency_code: 'USD',
8015 currency_symbol: '$',
8016 currency_minor_unit: 2,
8017 currency_decimal_separator: '.',
8018 currency_thousand_separator: ',',
8019 currency_prefix: '$',
8020 currency_suffix: '',
8021 total_items: '4000',
8022 total_items_tax: '800',
8023 total_fees: '100',
8024 total_fees_tax: '20',
8025 total_discount: '0',
8026 total_discount_tax: '0',
8027 total_shipping: '0',
8028 total_shipping_tax: '0',
8029 total_tax: '820',
8030 total_price: '4920',
8031 tax_lines: [{
8032 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sales tax', 'woocommerce'),
8033 rate: '20%',
8034 price: '820'
8035 }]
8036 },
8037 errors: [],
8038 payment_methods: ['cod', 'bacs', 'cheque'],
8039 payment_requirements: ['products'],
8040 extensions: {}
8041 };
8042
8043 /***/ }),
8044
8045 /***/ "./assets/js/previews/shipping-rates.ts":
8046 /*!**********************************************!*\
8047 !*** ./assets/js/previews/shipping-rates.ts ***!
8048 \**********************************************/
8049 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8050
8051 "use strict";
8052 __webpack_require__.r(__webpack_exports__);
8053 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8054 /* harmony export */ previewShippingRates: () => (/* binding */ previewShippingRates)
8055 /* harmony export */ });
8056 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
8057 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
8058 /**
8059 * External dependencies
8060 */
8061
8062 const previewShippingRates = [{
8063 destination: {
8064 address_1: '',
8065 address_2: '',
8066 city: '',
8067 state: '',
8068 postcode: '',
8069 country: ''
8070 },
8071 package_id: 0,
8072 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Shipping', 'woocommerce'),
8073 items: [{
8074 key: '33e75ff09dd601bbe69f351039152189',
8075 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Beanie with Logo', 'example product in Cart Block', 'woocommerce'),
8076 quantity: 2
8077 }, {
8078 key: '6512bd43d9caa6e02c990b0a82652dca',
8079 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Beanie', 'example product in Cart Block', 'woocommerce'),
8080 quantity: 1
8081 }],
8082 shipping_rates: [{
8083 currency_code: 'USD',
8084 currency_symbol: '$',
8085 currency_minor_unit: 2,
8086 currency_decimal_separator: '.',
8087 currency_thousand_separator: ',',
8088 currency_prefix: '$',
8089 currency_suffix: '',
8090 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Flat rate shipping', 'woocommerce'),
8091 description: '',
8092 delivery_time: '',
8093 price: '500',
8094 taxes: '0',
8095 rate_id: 'flat_rate:0',
8096 instance_id: 0,
8097 meta_data: [],
8098 method_id: 'flat_rate',
8099 selected: true
8100 }, {
8101 currency_code: 'USD',
8102 currency_symbol: '$',
8103 currency_minor_unit: 2,
8104 currency_decimal_separator: '.',
8105 currency_thousand_separator: ',',
8106 currency_prefix: '$',
8107 currency_suffix: '',
8108 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Free shipping', 'woocommerce'),
8109 description: '',
8110 delivery_time: '',
8111 price: '0',
8112 taxes: '0',
8113 rate_id: 'free_shipping:1',
8114 instance_id: 0,
8115 meta_data: [],
8116 method_id: 'flat_rate',
8117 selected: false
8118 }, {
8119 currency_code: 'USD',
8120 currency_symbol: '$',
8121 currency_minor_unit: 2,
8122 currency_decimal_separator: '.',
8123 currency_thousand_separator: ',',
8124 currency_prefix: '$',
8125 currency_suffix: '',
8126 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Local pickup', 'woocommerce'),
8127 description: '',
8128 delivery_time: '',
8129 price: '0',
8130 taxes: '0',
8131 rate_id: 'pickup_location:1',
8132 instance_id: 1,
8133 meta_data: [{
8134 key: 'pickup_location',
8135 value: 'New York'
8136 }, {
8137 key: 'pickup_address',
8138 value: '123 Easy Street, New York, 12345'
8139 }],
8140 method_id: 'pickup_location',
8141 selected: false
8142 }, {
8143 currency_code: 'USD',
8144 currency_symbol: '$',
8145 currency_minor_unit: 2,
8146 currency_decimal_separator: '.',
8147 currency_thousand_separator: ',',
8148 currency_prefix: '$',
8149 currency_suffix: '',
8150 name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Local pickup', 'woocommerce'),
8151 description: '',
8152 delivery_time: '',
8153 price: '0',
8154 taxes: '0',
8155 rate_id: 'pickup_location:2',
8156 instance_id: 1,
8157 meta_data: [{
8158 key: 'pickup_location',
8159 value: 'Los Angeles'
8160 }, {
8161 key: 'pickup_address',
8162 value: '123 Easy Street, Los Angeles, California, 90210'
8163 }],
8164 method_id: 'pickup_location',
8165 selected: false
8166 }]
8167 }];
8168
8169 /***/ }),
8170
8171 /***/ "./assets/js/settings/blocks/constants.ts":
8172 /*!************************************************!*\
8173 !*** ./assets/js/settings/blocks/constants.ts ***!
8174 \************************************************/
8175 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8176
8177 "use strict";
8178 __webpack_require__.r(__webpack_exports__);
8179 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8180 /* harmony export */ ADDITIONAL_FIELDS_KEYS: () => (/* binding */ ADDITIONAL_FIELDS_KEYS),
8181 /* harmony export */ ADDRESS_FIELDS_KEYS: () => (/* binding */ ADDRESS_FIELDS_KEYS),
8182 /* harmony export */ ALLOWED_COUNTRIES: () => (/* binding */ ALLOWED_COUNTRIES),
8183 /* harmony export */ ALLOWED_STATES: () => (/* binding */ ALLOWED_STATES),
8184 /* harmony export */ CART_PAGE_ID: () => (/* binding */ CART_PAGE_ID),
8185 /* harmony export */ CART_URL: () => (/* binding */ CART_URL),
8186 /* harmony export */ CHECKOUT_PAGE_ID: () => (/* binding */ CHECKOUT_PAGE_ID),
8187 /* harmony export */ CHECKOUT_URL: () => (/* binding */ CHECKOUT_URL),
8188 /* harmony export */ CONTACT_FIELDS_KEYS: () => (/* binding */ CONTACT_FIELDS_KEYS),
8189 /* harmony export */ COUNTRY_LOCALE: () => (/* binding */ COUNTRY_LOCALE),
8190 /* harmony export */ LOCAL_PICKUP_ENABLED: () => (/* binding */ LOCAL_PICKUP_ENABLED),
8191 /* harmony export */ LOGIN_URL: () => (/* binding */ LOGIN_URL),
8192 /* harmony export */ PRIVACY_PAGE_NAME: () => (/* binding */ PRIVACY_PAGE_NAME),
8193 /* harmony export */ PRIVACY_URL: () => (/* binding */ PRIVACY_URL),
8194 /* harmony export */ SHIPPING_COUNTRIES: () => (/* binding */ SHIPPING_COUNTRIES),
8195 /* harmony export */ SHIPPING_STATES: () => (/* binding */ SHIPPING_STATES),
8196 /* harmony export */ SHOP_URL: () => (/* binding */ SHOP_URL),
8197 /* harmony export */ TERMS_PAGE_NAME: () => (/* binding */ TERMS_PAGE_NAME),
8198 /* harmony export */ TERMS_URL: () => (/* binding */ TERMS_URL),
8199 /* harmony export */ WC_BLOCKS_BUILD_URL: () => (/* binding */ WC_BLOCKS_BUILD_URL),
8200 /* harmony export */ WC_BLOCKS_IMAGE_URL: () => (/* binding */ WC_BLOCKS_IMAGE_URL),
8201 /* harmony export */ WC_BLOCKS_PHASE: () => (/* binding */ WC_BLOCKS_PHASE),
8202 /* harmony export */ blocksConfig: () => (/* binding */ blocksConfig)
8203 /* harmony export */ });
8204 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings");
8205 /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__);
8206 var _STORE_PAGES$shop, _STORE_PAGES$checkout, _STORE_PAGES$checkout2, _STORE_PAGES$privacy, _STORE_PAGES$privacy2, _STORE_PAGES$terms, _STORE_PAGES$terms2, _STORE_PAGES$cart, _STORE_PAGES$cart2, _STORE_PAGES$myaccoun;
8207 /**
8208 * External dependencies
8209 */
8210
8211 const blocksConfig = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('wcBlocksConfig', {
8212 buildPhase: 1,
8213 pluginUrl: '',
8214 productCount: 0,
8215 defaultAvatar: '',
8216 restApiRoutes: {},
8217 wordCountType: 'words'
8218 });
8219 const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'assets/images/';
8220 const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'assets/client/blocks/';
8221 const WC_BLOCKS_PHASE = blocksConfig.buildPhase;
8222 const SHOP_URL = (_STORE_PAGES$shop = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.shop) === null || _STORE_PAGES$shop === void 0 ? void 0 : _STORE_PAGES$shop.permalink;
8223 const CHECKOUT_PAGE_ID = (_STORE_PAGES$checkout = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.checkout) === null || _STORE_PAGES$checkout === void 0 ? void 0 : _STORE_PAGES$checkout.id;
8224 const CHECKOUT_URL = (_STORE_PAGES$checkout2 = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.checkout) === null || _STORE_PAGES$checkout2 === void 0 ? void 0 : _STORE_PAGES$checkout2.permalink;
8225 const PRIVACY_URL = (_STORE_PAGES$privacy = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.privacy) === null || _STORE_PAGES$privacy === void 0 ? void 0 : _STORE_PAGES$privacy.permalink;
8226 const PRIVACY_PAGE_NAME = (_STORE_PAGES$privacy2 = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.privacy) === null || _STORE_PAGES$privacy2 === void 0 ? void 0 : _STORE_PAGES$privacy2.title;
8227 const TERMS_URL = (_STORE_PAGES$terms = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.terms) === null || _STORE_PAGES$terms === void 0 ? void 0 : _STORE_PAGES$terms.permalink;
8228 const TERMS_PAGE_NAME = (_STORE_PAGES$terms2 = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.terms) === null || _STORE_PAGES$terms2 === void 0 ? void 0 : _STORE_PAGES$terms2.title;
8229 const CART_PAGE_ID = (_STORE_PAGES$cart = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.cart) === null || _STORE_PAGES$cart === void 0 ? void 0 : _STORE_PAGES$cart.id;
8230 const CART_URL = (_STORE_PAGES$cart2 = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.cart) === null || _STORE_PAGES$cart2 === void 0 ? void 0 : _STORE_PAGES$cart2.permalink;
8231 const LOGIN_URL = (_STORE_PAGES$myaccoun = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.myaccount) !== null && _STORE_PAGES$myaccoun !== void 0 && _STORE_PAGES$myaccoun.permalink ? _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.myaccount.permalink : (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('wpLoginUrl', '/wp-login.php');
8232 const LOCAL_PICKUP_ENABLED = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('localPickupEnabled', false);
8233 // Contains country names.
8234 const countries = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('countries', {});
8235
8236 // Contains country settings.
8237 const countryData = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('countryData', {});
8238 const ALLOWED_COUNTRIES = Object.fromEntries(Object.keys(countryData).filter(countryCode => {
8239 return countryData[countryCode].allowBilling === true;
8240 }).map(countryCode => {
8241 return [countryCode, countries[countryCode] || ''];
8242 }));
8243 const ALLOWED_STATES = Object.fromEntries(Object.keys(countryData).filter(countryCode => {
8244 return countryData[countryCode].allowBilling === true;
8245 }).map(countryCode => {
8246 return [countryCode, countryData[countryCode].states || []];
8247 }));
8248 const SHIPPING_COUNTRIES = Object.fromEntries(Object.keys(countryData).filter(countryCode => {
8249 return countryData[countryCode].allowShipping === true;
8250 }).map(countryCode => {
8251 return [countryCode, countries[countryCode] || ''];
8252 }));
8253 const SHIPPING_STATES = Object.fromEntries(Object.keys(countryData).filter(countryCode => {
8254 return countryData[countryCode].allowShipping === true;
8255 }).map(countryCode => {
8256 return [countryCode, countryData[countryCode].states || []];
8257 }));
8258 const COUNTRY_LOCALE = Object.fromEntries(Object.keys(countryData).map(countryCode => {
8259 return [countryCode, countryData[countryCode].locale || []];
8260 }));
8261 const defaultFieldsLocations = {
8262 address: ['first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'postcode', 'country', 'state', 'phone'],
8263 contact: ['email'],
8264 additional: []
8265 };
8266 const ADDRESS_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).address;
8267 const CONTACT_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).contact;
8268 const ADDITIONAL_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).additional;
8269
8270 /***/ }),
8271
8272 /***/ "./assets/js/settings/blocks/feature-flags.ts":
8273 /*!****************************************************!*\
8274 !*** ./assets/js/settings/blocks/feature-flags.ts ***!
8275 \****************************************************/
8276 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8277
8278 "use strict";
8279 __webpack_require__.r(__webpack_exports__);
8280 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8281 /* harmony export */ isExperimentalBuild: () => (/* binding */ isExperimentalBuild),
8282 /* harmony export */ isFeaturePluginBuild: () => (/* binding */ isFeaturePluginBuild),
8283 /* harmony export */ registerExperimentalBlockType: () => (/* binding */ registerExperimentalBlockType),
8284 /* harmony export */ registerFeaturePluginBlockType: () => (/* binding */ registerFeaturePluginBlockType)
8285 /* harmony export */ });
8286 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
8287 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
8288 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./assets/js/settings/blocks/constants.ts");
8289 /**
8290 * External dependencies
8291 */
8292
8293 /**
8294 * Internal dependencies
8295 */
8296
8297
8298 /**
8299 * Registers a new experimental block provided a unique name and an object defining its
8300 * behavior. Once registered, the block is made available as an option to any
8301 * editor interface where blocks are implemented.
8302 */
8303 const registerExperimentalBlockType = (blockNameOrMetadata, settings) => {
8304 if (_constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 2) {
8305 return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(blockNameOrMetadata, settings);
8306 }
8307 };
8308
8309 /**
8310 * Registers a new feature plugin block provided a unique name and an object
8311 * defining its behavior. Once registered, the block is made available as an
8312 * option to any editor interface where blocks are implemented.
8313 */
8314 const registerFeaturePluginBlockType = (blockNameOrMetadata, settings) => {
8315 if (_constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 1) {
8316 return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(blockNameOrMetadata, settings);
8317 }
8318 };
8319
8320 /**
8321 * Checks if we're executing the code in an experimental build mode.
8322 *
8323 * @return {boolean} True if this is an experimental build, false otherwise.
8324 */
8325 const isExperimentalBuild = () => _constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 2;
8326
8327 /**
8328 * Checks if we're executing the code in an feature plugin or experimental build mode.
8329 *
8330 * @return {boolean} True if this is an experimental or feature plugin build, false otherwise.
8331 */
8332 const isFeaturePluginBuild = () => _constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 1;
8333
8334 /***/ }),
8335
8336 /***/ "./assets/js/settings/blocks/index.ts":
8337 /*!********************************************!*\
8338 !*** ./assets/js/settings/blocks/index.ts ***!
8339 \********************************************/
8340 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8341
8342 "use strict";
8343 __webpack_require__.r(__webpack_exports__);
8344 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8345 /* harmony export */ ADDITIONAL_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ADDITIONAL_FIELDS_KEYS),
8346 /* harmony export */ ADDRESS_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ADDRESS_FIELDS_KEYS),
8347 /* harmony export */ ALLOWED_COUNTRIES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ALLOWED_COUNTRIES),
8348 /* harmony export */ ALLOWED_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ALLOWED_STATES),
8349 /* harmony export */ CART_PAGE_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CART_PAGE_ID),
8350 /* harmony export */ CART_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CART_URL),
8351 /* harmony export */ CHECKOUT_PAGE_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CHECKOUT_PAGE_ID),
8352 /* harmony export */ CHECKOUT_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CHECKOUT_URL),
8353 /* harmony export */ CONTACT_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CONTACT_FIELDS_KEYS),
8354 /* harmony export */ COUNTRY_LOCALE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.COUNTRY_LOCALE),
8355 /* harmony export */ LOCAL_PICKUP_ENABLED: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.LOCAL_PICKUP_ENABLED),
8356 /* harmony export */ LOGIN_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.LOGIN_URL),
8357 /* harmony export */ PRIVACY_PAGE_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.PRIVACY_PAGE_NAME),
8358 /* harmony export */ PRIVACY_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.PRIVACY_URL),
8359 /* harmony export */ SHIPPING_COUNTRIES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHIPPING_COUNTRIES),
8360 /* harmony export */ SHIPPING_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHIPPING_STATES),
8361 /* harmony export */ SHOP_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHOP_URL),
8362 /* harmony export */ TERMS_PAGE_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.TERMS_PAGE_NAME),
8363 /* harmony export */ TERMS_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.TERMS_URL),
8364 /* harmony export */ WC_BLOCKS_BUILD_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_BUILD_URL),
8365 /* harmony export */ WC_BLOCKS_IMAGE_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL),
8366 /* harmony export */ WC_BLOCKS_PHASE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_PHASE),
8367 /* harmony export */ blocksConfig: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.blocksConfig),
8368 /* harmony export */ isExperimentalBuild: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.isExperimentalBuild),
8369 /* harmony export */ isFeaturePluginBuild: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.isFeaturePluginBuild),
8370 /* harmony export */ registerExperimentalBlockType: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.registerExperimentalBlockType),
8371 /* harmony export */ registerFeaturePluginBlockType: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.registerFeaturePluginBlockType)
8372 /* harmony export */ });
8373 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/settings/blocks/constants.ts");
8374 /* harmony import */ var _feature_flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./feature-flags */ "./assets/js/settings/blocks/feature-flags.ts");
8375 /**
8376 * Internal dependencies
8377 */
8378
8379
8380
8381 /***/ }),
8382
8383 /***/ "./assets/js/types/type-guards/null.ts":
8384 /*!*********************************************!*\
8385 !*** ./assets/js/types/type-guards/null.ts ***!
8386 \*********************************************/
8387 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8388
8389 "use strict";
8390 __webpack_require__.r(__webpack_exports__);
8391 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8392 /* harmony export */ isNull: () => (/* binding */ isNull)
8393 /* harmony export */ });
8394 const isNull = term => {
8395 return term === null;
8396 };
8397
8398 /***/ }),
8399
8400 /***/ "./assets/js/types/type-guards/number.ts":
8401 /*!***********************************************!*\
8402 !*** ./assets/js/types/type-guards/number.ts ***!
8403 \***********************************************/
8404 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8405
8406 "use strict";
8407 __webpack_require__.r(__webpack_exports__);
8408 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8409 /* harmony export */ isNumber: () => (/* binding */ isNumber)
8410 /* harmony export */ });
8411 const isNumber = term => {
8412 return typeof term === 'number';
8413 };
8414
8415 /***/ }),
8416
8417 /***/ "./assets/js/types/type-guards/object.ts":
8418 /*!***********************************************!*\
8419 !*** ./assets/js/types/type-guards/object.ts ***!
8420 \***********************************************/
8421 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8422
8423 "use strict";
8424 __webpack_require__.r(__webpack_exports__);
8425 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8426 /* harmony export */ isEmptyObject: () => (/* binding */ isEmptyObject),
8427 /* harmony export */ isObject: () => (/* binding */ isObject),
8428 /* harmony export */ objectHasProp: () => (/* binding */ objectHasProp)
8429 /* harmony export */ });
8430 /* harmony import */ var _null__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./null */ "./assets/js/types/type-guards/null.ts");
8431 /**
8432 * Internal dependencies
8433 */
8434
8435
8436 const isObject = term => {
8437 return !(0,_null__WEBPACK_IMPORTED_MODULE_0__.isNull)(term) && term instanceof Object && term.constructor === Object;
8438 };
8439 function objectHasProp(target, property) {
8440 // The `in` operator throws a `TypeError` for non-object values.
8441 return isObject(target) && property in target;
8442 }
8443 const isEmptyObject = object => {
8444 return Object.keys(object).length === 0;
8445 };
8446
8447 /***/ }),
8448
8449 /***/ "./assets/js/types/type-guards/observers.ts":
8450 /*!**************************************************!*\
8451 !*** ./assets/js/types/type-guards/observers.ts ***!
8452 \**************************************************/
8453 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8454
8455 "use strict";
8456 __webpack_require__.r(__webpack_exports__);
8457 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8458 /* harmony export */ isObserverResponse: () => (/* binding */ isObserverResponse)
8459 /* harmony export */ });
8460 /* harmony import */ var _woocommerce_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/types */ "./assets/js/types/type-guards/object.ts");
8461 /**
8462 * External dependencies
8463 */
8464
8465
8466
8467 /**
8468 * Whether the passed object is an ObserverResponse.
8469 */
8470 const isObserverResponse = response => {
8471 return (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.isObject)(response) && (0,_woocommerce_types__WEBPACK_IMPORTED_MODULE_0__.objectHasProp)(response, 'type');
8472 };
8473
8474 /***/ }),
8475
8476 /***/ "./assets/js/types/type-guards/string.ts":
8477 /*!***********************************************!*\
8478 !*** ./assets/js/types/type-guards/string.ts ***!
8479 \***********************************************/
8480 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8481
8482 "use strict";
8483 __webpack_require__.r(__webpack_exports__);
8484 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8485 /* harmony export */ isString: () => (/* binding */ isString)
8486 /* harmony export */ });
8487 const isString = term => {
8488 return typeof term === 'string';
8489 };
8490
8491 /***/ }),
8492
8493 /***/ "./assets/js/utils/trim-words.ts":
8494 /*!***************************************!*\
8495 !*** ./assets/js/utils/trim-words.ts ***!
8496 \***************************************/
8497 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8498
8499 "use strict";
8500 __webpack_require__.r(__webpack_exports__);
8501 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8502 /* harmony export */ appendMoreText: () => (/* binding */ appendMoreText),
8503 /* harmony export */ removeTags: () => (/* binding */ removeTags),
8504 /* harmony export */ trimCharacters: () => (/* binding */ trimCharacters),
8505 /* harmony export */ trimWords: () => (/* binding */ trimWords)
8506 /* harmony export */ });
8507 /* harmony import */ var _wordpress_autop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/autop */ "@wordpress/autop");
8508 /* harmony import */ var _wordpress_autop__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_autop__WEBPACK_IMPORTED_MODULE_0__);
8509 /**
8510 * External dependencies
8511 */
8512
8513
8514 /**
8515 * Remove HTML tags from a string.
8516 *
8517 * @param {string} htmlString String to remove tags from.
8518 * @return {string} Plain text string.
8519 */
8520 const removeTags = htmlString => {
8521 const tagsRegExp = /<\/?[a-z][^>]*?>/gi;
8522 return htmlString.replace(tagsRegExp, '');
8523 };
8524
8525 /**
8526 * Remove trailing punctuation and append some characters to a string.
8527 *
8528 * @param {string} text Text to append to.
8529 * @param {string} moreText Text to append.
8530 * @return {string} String with appended characters.
8531 */
8532 const appendMoreText = (text, moreText) => {
8533 return text.replace(/[\s|\.\,]+$/i, '') + moreText;
8534 };
8535
8536 /**
8537 * Limit words in string and returned trimmed version.
8538 *
8539 * @param {string} text Text to trim.
8540 * @param {number} maxLength Number of countType to limit to.
8541 * @param {string} moreText Appended to the trimmed string.
8542 * @param {string} useAutop Whether to format with autop before returning.
8543 * @return {string} Trimmed string.
8544 */
8545 const trimWords = (text, maxLength, moreText = '&hellip;', useAutop = true) => {
8546 const textToTrim = removeTags(text);
8547 const trimmedText = textToTrim.split(' ').splice(0, maxLength).join(' ');
8548 if (trimmedText === textToTrim) {
8549 return useAutop ? (0,_wordpress_autop__WEBPACK_IMPORTED_MODULE_0__.autop)(textToTrim) : textToTrim;
8550 }
8551 if (!useAutop) {
8552 return appendMoreText(trimmedText, moreText);
8553 }
8554 return (0,_wordpress_autop__WEBPACK_IMPORTED_MODULE_0__.autop)(appendMoreText(trimmedText, moreText));
8555 };
8556
8557 /**
8558 * Limit characters in string and returned trimmed version.
8559 *
8560 * @param {string} text Text to trim.
8561 * @param {number} maxLength Number of countType to limit to.
8562 * @param {boolean} includeSpaces Should spaces be included in the count.
8563 * @param {string} moreText Appended to the trimmed string.
8564 * @param {string} useAutop Whether to format with autop before returning.
8565 * @return {string} Trimmed string.
8566 */
8567 const trimCharacters = (text, maxLength, includeSpaces = true, moreText = '&hellip;', useAutop = true) => {
8568 const textToTrim = removeTags(text);
8569 const trimmedText = textToTrim.slice(0, maxLength);
8570 if (trimmedText === textToTrim) {
8571 return useAutop ? (0,_wordpress_autop__WEBPACK_IMPORTED_MODULE_0__.autop)(textToTrim) : textToTrim;
8572 }
8573 if (includeSpaces) {
8574 return (0,_wordpress_autop__WEBPACK_IMPORTED_MODULE_0__.autop)(appendMoreText(trimmedText, moreText));
8575 }
8576 const matchSpaces = trimmedText.match(/([\s]+)/g);
8577 const spaceCount = matchSpaces ? matchSpaces.length : 0;
8578 const trimmedTextExcludingSpaces = textToTrim.slice(0, maxLength + spaceCount);
8579 if (!useAutop) {
8580 return appendMoreText(trimmedTextExcludingSpaces, moreText);
8581 }
8582 return (0,_wordpress_autop__WEBPACK_IMPORTED_MODULE_0__.autop)(appendMoreText(trimmedTextExcludingSpaces, moreText));
8583 };
8584
8585 /***/ }),
8586
8587 /***/ "./packages/components/spinner/index.tsx":
8588 /*!***********************************************!*\
8589 !*** ./packages/components/spinner/index.tsx ***!
8590 \***********************************************/
8591 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8592
8593 "use strict";
8594 __webpack_require__.r(__webpack_exports__);
8595 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8596 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
8597 /* harmony export */ });
8598 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
8599 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
8600 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./packages/components/spinner/style.scss");
8601 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_1__);
8602
8603 /**
8604 * Internal dependencies
8605 */
8606
8607 const Spinner = () => {
8608 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
8609 className: "wc-block-components-spinner",
8610 "aria-hidden": "true"
8611 });
8612 };
8613 Spinner.__docgenInfo = {
8614 "description": "",
8615 "methods": [],
8616 "displayName": "Spinner"
8617 };
8618 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Spinner);
8619 if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
8620 STORYBOOK_REACT_CLASSES["packages/components/spinner/index.tsx"] = {
8621 name: "Spinner",
8622 docgenInfo: Spinner.__docgenInfo,
8623 path: "packages/components/spinner/index.tsx"
8624 };
8625 }
8626
8627 /***/ }),
8628
8629 /***/ "./assets/js/base/components/button/style.scss":
8630 /*!*****************************************************!*\
8631 !*** ./assets/js/base/components/button/style.scss ***!
8632 \*****************************************************/
8633 /***/ (() => {
8634
8635
8636
8637 /***/ }),
8638
8639 /***/ "./assets/js/base/components/cart-checkout/cart-line-items-table/style.scss":
8640 /*!**********************************************************************************!*\
8641 !*** ./assets/js/base/components/cart-checkout/cart-line-items-table/style.scss ***!
8642 \**********************************************************************************/
8643 /***/ (() => {
8644
8645
8646
8647 /***/ }),
8648
8649 /***/ "./assets/js/base/components/cart-checkout/payment-method-icons/style.scss":
8650 /*!*********************************************************************************!*\
8651 !*** ./assets/js/base/components/cart-checkout/payment-method-icons/style.scss ***!
8652 \*********************************************************************************/
8653 /***/ (() => {
8654
8655
8656
8657 /***/ }),
8658
8659 /***/ "./assets/js/base/components/cart-checkout/product-badge/style.scss":
8660 /*!**************************************************************************!*\
8661 !*** ./assets/js/base/components/cart-checkout/product-badge/style.scss ***!
8662 \**************************************************************************/
8663 /***/ (() => {
8664
8665
8666
8667 /***/ }),
8668
8669 /***/ "./assets/js/base/components/cart-checkout/product-details/style.scss":
8670 /*!****************************************************************************!*\
8671 !*** ./assets/js/base/components/cart-checkout/product-details/style.scss ***!
8672 \****************************************************************************/
8673 /***/ (() => {
8674
8675
8676
8677 /***/ }),
8678
8679 /***/ "./assets/js/base/components/cart-checkout/product-metadata/style.scss":
8680 /*!*****************************************************************************!*\
8681 !*** ./assets/js/base/components/cart-checkout/product-metadata/style.scss ***!
8682 \*****************************************************************************/
8683 /***/ (() => {
8684
8685
8686
8687 /***/ }),
8688
8689 /***/ "./assets/js/base/components/product-name/style.scss":
8690 /*!***********************************************************!*\
8691 !*** ./assets/js/base/components/product-name/style.scss ***!
8692 \***********************************************************/
8693 /***/ (() => {
8694
8695
8696
8697 /***/ }),
8698
8699 /***/ "./assets/js/base/components/product-price/style.scss":
8700 /*!************************************************************!*\
8701 !*** ./assets/js/base/components/product-price/style.scss ***!
8702 \************************************************************/
8703 /***/ (() => {
8704
8705
8706
8707 /***/ }),
8708
8709 /***/ "./assets/js/base/components/quantity-selector/style.scss":
8710 /*!****************************************************************!*\
8711 !*** ./assets/js/base/components/quantity-selector/style.scss ***!
8712 \****************************************************************/
8713 /***/ (() => {
8714
8715
8716
8717 /***/ }),
8718
8719 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/editor.scss":
8720 /*!*******************************************************************!*\
8721 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/editor.scss ***!
8722 \*******************************************************************/
8723 /***/ (() => {
8724
8725
8726
8727 /***/ }),
8728
8729 /***/ "./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/editor.scss":
8730 /*!*******************************************************************************************************!*\
8731 !*** ./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/editor.scss ***!
8732 \*******************************************************************************************************/
8733 /***/ (() => {
8734
8735
8736
8737 /***/ }),
8738
8739 /***/ "./packages/components/spinner/style.scss":
8740 /*!************************************************!*\
8741 !*** ./packages/components/spinner/style.scss ***!
8742 \************************************************/
8743 /***/ (() => {
8744
8745
8746
8747 /***/ }),
8748
8749 /***/ "react":
8750 /*!************************!*\
8751 !*** external "React" ***!
8752 \************************/
8753 /***/ ((module) => {
8754
8755 "use strict";
8756 module.exports = window["React"];
8757
8758 /***/ }),
8759
8760 /***/ "lodash":
8761 /*!*************************!*\
8762 !*** external "lodash" ***!
8763 \*************************/
8764 /***/ ((module) => {
8765
8766 "use strict";
8767 module.exports = window["lodash"];
8768
8769 /***/ }),
8770
8771 /***/ "@woocommerce/blocks-checkout":
8772 /*!****************************************!*\
8773 !*** external ["wc","blocksCheckout"] ***!
8774 \****************************************/
8775 /***/ ((module) => {
8776
8777 "use strict";
8778 module.exports = window["wc"]["blocksCheckout"];
8779
8780 /***/ }),
8781
8782 /***/ "@woocommerce/blocks-components":
8783 /*!******************************************!*\
8784 !*** external ["wc","blocksComponents"] ***!
8785 \******************************************/
8786 /***/ ((module) => {
8787
8788 "use strict";
8789 module.exports = window["wc"]["blocksComponents"];
8790
8791 /***/ }),
8792
8793 /***/ "@woocommerce/price-format":
8794 /*!*************************************!*\
8795 !*** external ["wc","priceFormat"] ***!
8796 \*************************************/
8797 /***/ ((module) => {
8798
8799 "use strict";
8800 module.exports = window["wc"]["priceFormat"];
8801
8802 /***/ }),
8803
8804 /***/ "@woocommerce/block-data":
8805 /*!**************************************!*\
8806 !*** external ["wc","wcBlocksData"] ***!
8807 \**************************************/
8808 /***/ ((module) => {
8809
8810 "use strict";
8811 module.exports = window["wc"]["wcBlocksData"];
8812
8813 /***/ }),
8814
8815 /***/ "@woocommerce/blocks-registry":
8816 /*!******************************************!*\
8817 !*** external ["wc","wcBlocksRegistry"] ***!
8818 \******************************************/
8819 /***/ ((module) => {
8820
8821 "use strict";
8822 module.exports = window["wc"]["wcBlocksRegistry"];
8823
8824 /***/ }),
8825
8826 /***/ "@woocommerce/settings":
8827 /*!************************************!*\
8828 !*** external ["wc","wcSettings"] ***!
8829 \************************************/
8830 /***/ ((module) => {
8831
8832 "use strict";
8833 module.exports = window["wc"]["wcSettings"];
8834
8835 /***/ }),
8836
8837 /***/ "@wordpress/a11y":
8838 /*!******************************!*\
8839 !*** external ["wp","a11y"] ***!
8840 \******************************/
8841 /***/ ((module) => {
8842
8843 "use strict";
8844 module.exports = window["wp"]["a11y"];
8845
8846 /***/ }),
8847
8848 /***/ "@wordpress/autop":
8849 /*!*******************************!*\
8850 !*** external ["wp","autop"] ***!
8851 \*******************************/
8852 /***/ ((module) => {
8853
8854 "use strict";
8855 module.exports = window["wp"]["autop"];
8856
8857 /***/ }),
8858
8859 /***/ "@wordpress/block-editor":
8860 /*!*************************************!*\
8861 !*** external ["wp","blockEditor"] ***!
8862 \*************************************/
8863 /***/ ((module) => {
8864
8865 "use strict";
8866 module.exports = window["wp"]["blockEditor"];
8867
8868 /***/ }),
8869
8870 /***/ "@wordpress/blocks":
8871 /*!********************************!*\
8872 !*** external ["wp","blocks"] ***!
8873 \********************************/
8874 /***/ ((module) => {
8875
8876 "use strict";
8877 module.exports = window["wp"]["blocks"];
8878
8879 /***/ }),
8880
8881 /***/ "@wordpress/components":
8882 /*!************************************!*\
8883 !*** external ["wp","components"] ***!
8884 \************************************/
8885 /***/ ((module) => {
8886
8887 "use strict";
8888 module.exports = window["wp"]["components"];
8889
8890 /***/ }),
8891
8892 /***/ "@wordpress/compose":
8893 /*!*********************************!*\
8894 !*** external ["wp","compose"] ***!
8895 \*********************************/
8896 /***/ ((module) => {
8897
8898 "use strict";
8899 module.exports = window["wp"]["compose"];
8900
8901 /***/ }),
8902
8903 /***/ "@wordpress/data":
8904 /*!******************************!*\
8905 !*** external ["wp","data"] ***!
8906 \******************************/
8907 /***/ ((module) => {
8908
8909 "use strict";
8910 module.exports = window["wp"]["data"];
8911
8912 /***/ }),
8913
8914 /***/ "@wordpress/deprecated":
8915 /*!************************************!*\
8916 !*** external ["wp","deprecated"] ***!
8917 \************************************/
8918 /***/ ((module) => {
8919
8920 "use strict";
8921 module.exports = window["wp"]["deprecated"];
8922
8923 /***/ }),
8924
8925 /***/ "@wordpress/dom":
8926 /*!*****************************!*\
8927 !*** external ["wp","dom"] ***!
8928 \*****************************/
8929 /***/ ((module) => {
8930
8931 "use strict";
8932 module.exports = window["wp"]["dom"];
8933
8934 /***/ }),
8935
8936 /***/ "@wordpress/element":
8937 /*!*********************************!*\
8938 !*** external ["wp","element"] ***!
8939 \*********************************/
8940 /***/ ((module) => {
8941
8942 "use strict";
8943 module.exports = window["wp"]["element"];
8944
8945 /***/ }),
8946
8947 /***/ "@wordpress/hooks":
8948 /*!*******************************!*\
8949 !*** external ["wp","hooks"] ***!
8950 \*******************************/
8951 /***/ ((module) => {
8952
8953 "use strict";
8954 module.exports = window["wp"]["hooks"];
8955
8956 /***/ }),
8957
8958 /***/ "@wordpress/html-entities":
8959 /*!**************************************!*\
8960 !*** external ["wp","htmlEntities"] ***!
8961 \**************************************/
8962 /***/ ((module) => {
8963
8964 "use strict";
8965 module.exports = window["wp"]["htmlEntities"];
8966
8967 /***/ }),
8968
8969 /***/ "@wordpress/i18n":
8970 /*!******************************!*\
8971 !*** external ["wp","i18n"] ***!
8972 \******************************/
8973 /***/ ((module) => {
8974
8975 "use strict";
8976 module.exports = window["wp"]["i18n"];
8977
8978 /***/ }),
8979
8980 /***/ "@wordpress/is-shallow-equal":
8981 /*!****************************************!*\
8982 !*** external ["wp","isShallowEqual"] ***!
8983 \****************************************/
8984 /***/ ((module) => {
8985
8986 "use strict";
8987 module.exports = window["wp"]["isShallowEqual"];
8988
8989 /***/ }),
8990
8991 /***/ "@wordpress/keycodes":
8992 /*!**********************************!*\
8993 !*** external ["wp","keycodes"] ***!
8994 \**********************************/
8995 /***/ ((module) => {
8996
8997 "use strict";
8998 module.exports = window["wp"]["keycodes"];
8999
9000 /***/ }),
9001
9002 /***/ "@wordpress/primitives":
9003 /*!************************************!*\
9004 !*** external ["wp","primitives"] ***!
9005 \************************************/
9006 /***/ ((module) => {
9007
9008 "use strict";
9009 module.exports = window["wp"]["primitives"];
9010
9011 /***/ }),
9012
9013 /***/ "@wordpress/url":
9014 /*!*****************************!*\
9015 !*** external ["wp","url"] ***!
9016 \*****************************/
9017 /***/ ((module) => {
9018
9019 "use strict";
9020 module.exports = window["wp"]["url"];
9021
9022 /***/ }),
9023
9024 /***/ "@wordpress/warning":
9025 /*!*********************************!*\
9026 !*** external ["wp","warning"] ***!
9027 \*********************************/
9028 /***/ ((module) => {
9029
9030 "use strict";
9031 module.exports = window["wp"]["warning"];
9032
9033 /***/ }),
9034
9035 /***/ "@wordpress/wordcount":
9036 /*!***********************************!*\
9037 !*** external ["wp","wordcount"] ***!
9038 \***********************************/
9039 /***/ ((module) => {
9040
9041 "use strict";
9042 module.exports = window["wp"]["wordcount"];
9043
9044 /***/ })
9045
9046 /******/ });
9047 /************************************************************************/
9048 /******/ // The module cache
9049 /******/ var __webpack_module_cache__ = {};
9050 /******/
9051 /******/ // The require function
9052 /******/ function __webpack_require__(moduleId) {
9053 /******/ // Check if module is in cache
9054 /******/ var cachedModule = __webpack_module_cache__[moduleId];
9055 /******/ if (cachedModule !== undefined) {
9056 /******/ return cachedModule.exports;
9057 /******/ }
9058 /******/ // Create a new module (and put it into the cache)
9059 /******/ var module = __webpack_module_cache__[moduleId] = {
9060 /******/ // no module.id needed
9061 /******/ // no module.loaded needed
9062 /******/ exports: {}
9063 /******/ };
9064 /******/
9065 /******/ // Execute the module function
9066 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
9067 /******/
9068 /******/ // Return the exports of the module
9069 /******/ return module.exports;
9070 /******/ }
9071 /******/
9072 /******/ // expose the modules object (__webpack_modules__)
9073 /******/ __webpack_require__.m = __webpack_modules__;
9074 /******/
9075 /************************************************************************/
9076 /******/ /* webpack/runtime/chunk loaded */
9077 /******/ (() => {
9078 /******/ var deferred = [];
9079 /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
9080 /******/ if(chunkIds) {
9081 /******/ priority = priority || 0;
9082 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
9083 /******/ deferred[i] = [chunkIds, fn, priority];
9084 /******/ return;
9085 /******/ }
9086 /******/ var notFulfilled = Infinity;
9087 /******/ for (var i = 0; i < deferred.length; i++) {
9088 /******/ var [chunkIds, fn, priority] = deferred[i];
9089 /******/ var fulfilled = true;
9090 /******/ for (var j = 0; j < chunkIds.length; j++) {
9091 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
9092 /******/ chunkIds.splice(j--, 1);
9093 /******/ } else {
9094 /******/ fulfilled = false;
9095 /******/ if(priority < notFulfilled) notFulfilled = priority;
9096 /******/ }
9097 /******/ }
9098 /******/ if(fulfilled) {
9099 /******/ deferred.splice(i--, 1)
9100 /******/ var r = fn();
9101 /******/ if (r !== undefined) result = r;
9102 /******/ }
9103 /******/ }
9104 /******/ return result;
9105 /******/ };
9106 /******/ })();
9107 /******/
9108 /******/ /* webpack/runtime/compat get default export */
9109 /******/ (() => {
9110 /******/ // getDefaultExport function for compatibility with non-harmony modules
9111 /******/ __webpack_require__.n = (module) => {
9112 /******/ var getter = module && module.__esModule ?
9113 /******/ () => (module['default']) :
9114 /******/ () => (module);
9115 /******/ __webpack_require__.d(getter, { a: getter });
9116 /******/ return getter;
9117 /******/ };
9118 /******/ })();
9119 /******/
9120 /******/ /* webpack/runtime/define property getters */
9121 /******/ (() => {
9122 /******/ // define getter functions for harmony exports
9123 /******/ __webpack_require__.d = (exports, definition) => {
9124 /******/ for(var key in definition) {
9125 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
9126 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
9127 /******/ }
9128 /******/ }
9129 /******/ };
9130 /******/ })();
9131 /******/
9132 /******/ /* webpack/runtime/global */
9133 /******/ (() => {
9134 /******/ __webpack_require__.g = (function() {
9135 /******/ if (typeof globalThis === 'object') return globalThis;
9136 /******/ try {
9137 /******/ return this || new Function('return this')();
9138 /******/ } catch (e) {
9139 /******/ if (typeof window === 'object') return window;
9140 /******/ }
9141 /******/ })();
9142 /******/ })();
9143 /******/
9144 /******/ /* webpack/runtime/hasOwnProperty shorthand */
9145 /******/ (() => {
9146 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
9147 /******/ })();
9148 /******/
9149 /******/ /* webpack/runtime/make namespace object */
9150 /******/ (() => {
9151 /******/ // define __esModule on exports
9152 /******/ __webpack_require__.r = (exports) => {
9153 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
9154 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9155 /******/ }
9156 /******/ Object.defineProperty(exports, '__esModule', { value: true });
9157 /******/ };
9158 /******/ })();
9159 /******/
9160 /******/ /* webpack/runtime/jsonp chunk loading */
9161 /******/ (() => {
9162 /******/ // no baseURI
9163 /******/
9164 /******/ // object to store loaded and loading chunks
9165 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
9166 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
9167 /******/ var installedChunks = {
9168 /******/ "mini-cart-contents": 0
9169 /******/ };
9170 /******/
9171 /******/ // no chunk on demand loading
9172 /******/
9173 /******/ // no prefetching
9174 /******/
9175 /******/ // no preloaded
9176 /******/
9177 /******/ // no HMR
9178 /******/
9179 /******/ // no HMR manifest
9180 /******/
9181 /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
9182 /******/
9183 /******/ // install a JSONP callback for chunk loading
9184 /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
9185 /******/ var [chunkIds, moreModules, runtime] = data;
9186 /******/ // add "moreModules" to the modules object,
9187 /******/ // then flag all "chunkIds" as loaded and fire callback
9188 /******/ var moduleId, chunkId, i = 0;
9189 /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
9190 /******/ for(moduleId in moreModules) {
9191 /******/ if(__webpack_require__.o(moreModules, moduleId)) {
9192 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
9193 /******/ }
9194 /******/ }
9195 /******/ if(runtime) var result = runtime(__webpack_require__);
9196 /******/ }
9197 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
9198 /******/ for(;i < chunkIds.length; i++) {
9199 /******/ chunkId = chunkIds[i];
9200 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
9201 /******/ installedChunks[chunkId][0]();
9202 /******/ }
9203 /******/ installedChunks[chunkId] = 0;
9204 /******/ }
9205 /******/ return __webpack_require__.O(result);
9206 /******/ }
9207 /******/
9208 /******/ var chunkLoadingGlobal = self["webpackChunkwebpackWcBlocksJsonp"] = self["webpackChunkwebpackWcBlocksJsonp"] || [];
9209 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
9210 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
9211 /******/ })();
9212 /******/
9213 /************************************************************************/
9214 /******/
9215 /******/ // startup
9216 /******/ // Load entry module and return exports
9217 /******/ // This entry module depends on other loaded chunks and execution need to be delayed
9218 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["wc-blocks-vendors"], () => (__webpack_require__("./assets/js/blocks/mini-cart/mini-cart-contents/index.tsx")))
9219 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
9220 /******/ ((this.wc = this.wc || {}).blocks = this.wc.blocks || {})["mini-cart-contents"] = __webpack_exports__;
9221 /******/
9222 /******/ })()
9223 ;
9224 //# sourceMappingURL=mini-cart-contents.js.map