MockProcessor-498b60c5.js
1 year ago
MockProcessor-498b60c5.js.map
1 year ago
add-query-args-0e2a8393.js
1 year ago
add-query-args-0e2a8393.js.map
1 year ago
address-b892540d.js
1 year ago
address-b892540d.js.map
1 year ago
animation-registry-12eed2e3.js
1 year ago
animation-registry-12eed2e3.js.map
1 year ago
app-globals-707edcd4.js
1 year ago
app-globals-707edcd4.js.map
1 year ago
consumer-e06b16d3.js
1 year ago
consumer-e06b16d3.js.map
1 year ago
countries-c2f41f03.js
1 year ago
countries-c2f41f03.js.map
1 year ago
currency-a0c9bff4.js
1 year ago
currency-a0c9bff4.js.map
1 year ago
error-12ea55b3.js
1 year ago
error-12ea55b3.js.map
1 year ago
fetch-e3c5d1b9.js
1 year ago
fetch-e3c5d1b9.js.map
1 year ago
form-data-76641f16.js
1 year ago
form-data-76641f16.js.map
1 year ago
functions-2a4a4ba3.js
1 year ago
functions-2a4a4ba3.js.map
1 year ago
getters-09dda855.js
1 year ago
getters-09dda855.js.map
1 year ago
getters-1a55b8a4.js
1 year ago
getters-1a55b8a4.js.map
1 year ago
getters-26526b7c.js
1 year ago
getters-26526b7c.js.map
1 year ago
getters-a7eec27c.js
1 year ago
getters-a7eec27c.js.map
1 year ago
getters-b1d93841.js
1 year ago
getters-b1d93841.js.map
1 year ago
google-a86aa761.js
1 year ago
google-a86aa761.js.map
1 year ago
google-dd89f242.js
1 year ago
google-dd89f242.js.map
1 year ago
index-06061d4e.js
1 year ago
index-06061d4e.js.map
1 year ago
index-675be13e.js
1 year ago
index-675be13e.js.map
1 year ago
index-745b6bec.js
1 year ago
index-745b6bec.js.map
1 year ago
index-822e5799.js
1 year ago
index-822e5799.js.map
1 year ago
index-871d88b8.js
1 year ago
index-871d88b8.js.map
1 year ago
index-c5a96d53.js
2 years ago
index-c5a96d53.js.map
2 years ago
index.js
1 year ago
index.js.map
2 years ago
inline-c012a0f9.js
1 year ago
inline-c012a0f9.js.map
1 year ago
lazy-deb42890.js
1 year ago
lazy-deb42890.js.map
1 year ago
library-e110eea6.js
1 year ago
library-e110eea6.js.map
1 year ago
loader.js
1 year ago
loader.js.map
1 year ago
media-d21119a3.js
1 year ago
media-d21119a3.js.map
1 year ago
mutations-066b82f0.js
1 year ago
mutations-066b82f0.js.map
1 year ago
mutations-7ba12644.js
1 year ago
mutations-7ba12644.js.map
1 year ago
mutations-e77bd122.js
1 year ago
mutations-e77bd122.js.map
1 year ago
mutations-ed6d0770.js
1 year ago
mutations-ed6d0770.js.map
1 year ago
mutations-f11a19f9.js
1 year ago
mutations-f11a19f9.js.map
1 year ago
page-align-0cdacf32.js
1 year ago
page-align-0cdacf32.js.map
1 year ago
price-d5770168.js
1 year ago
price-d5770168.js.map
1 year ago
pure-963214cb.js
1 year ago
pure-963214cb.js.map
1 year ago
quantity-1f39f750.js
1 year ago
quantity-1f39f750.js.map
1 year ago
remove-query-args-938c53ea.js
1 year ago
remove-query-args-938c53ea.js.map
1 year ago
sc-address_3.entry.js
1 year ago
sc-address_3.entry.js.map
1 year ago
sc-alert_13.entry.js
1 year ago
sc-alert_13.entry.js.map
1 year ago
sc-avatar.entry.js
1 year ago
sc-avatar.entry.js.map
1 year ago
sc-badge-notice.entry.js
1 year ago
sc-badge-notice.entry.js.map
1 year ago
sc-breadcrumb.entry.js
1 year ago
sc-breadcrumb.entry.js.map
1 year ago
sc-breadcrumbs.entry.js
1 year ago
sc-breadcrumbs.entry.js.map
1 year ago
sc-button-group.entry.js
1 year ago
sc-button-group.entry.js.map
1 year ago
sc-cancel-dialog_2.entry.js
1 year ago
sc-cancel-dialog_2.entry.js.map
1 year ago
sc-cancel-discount_4.entry.js
1 year ago
sc-cancel-discount_4.entry.js.map
1 year ago
sc-card.entry.js
1 year ago
sc-card.entry.js.map
1 year ago
sc-cart-button.entry.js
1 year ago
sc-cart-button.entry.js.map
1 year ago
sc-cart-form-submit.entry.js
1 year ago
sc-cart-form-submit.entry.js.map
1 year ago
sc-cart-form.entry.js
1 year ago
sc-cart-form.entry.js.map
1 year ago
sc-cart-header.entry.js
1 year ago
sc-cart-header.entry.js.map
1 year ago
sc-cart-icon.entry.js
1 year ago
sc-cart-icon.entry.js.map
1 year ago
sc-cart-loader.entry.js
1 year ago
sc-cart-loader.entry.js.map
1 year ago
sc-cart-session-provider_3.entry.js
1 year ago
sc-cart-session-provider_3.entry.js.map
1 year ago
sc-cart-submit.entry.js
1 year ago
sc-cart-submit.entry.js.map
1 year ago
sc-cart.entry.js
1 year ago
sc-cart.entry.js.map
1 year ago
sc-cc-logo_2.entry.js
1 year ago
sc-cc-logo_2.entry.js.map
1 year ago
sc-charges-list.entry.js
1 year ago
sc-charges-list.entry.js.map
1 year ago
sc-checkout-form-errors.entry.js
1 year ago
sc-checkout-form-errors.entry.js.map
1 year ago
sc-checkout-mollie-payment_2.entry.js
1 year ago
sc-checkout-mollie-payment_2.entry.js.map
1 year ago
sc-checkout-product-price-variant-selector.entry.js
1 year ago
sc-checkout-product-price-variant-selector.entry.js.map
1 year ago
sc-checkout-stock-alert_8.entry.js
1 year ago
sc-checkout-stock-alert_8.entry.js.map
1 year ago
sc-checkout.entry.js
1 year ago
sc-checkout.entry.js.map
1 year ago
sc-choice-container.entry.js
1 year ago
sc-choice-container.entry.js.map
1 year ago
sc-choice.entry.js
1 year ago
sc-choice.entry.js.map
1 year ago
sc-choices.entry.js
1 year ago
sc-choices.entry.js.map
1 year ago
sc-column_2.entry.js
1 year ago
sc-column_2.entry.js.map
1 year ago
sc-compact-address_11.entry.js
1 year ago
sc-compact-address_11.entry.js.map
1 year ago
sc-conditional-form.entry.js
1 year ago
sc-conditional-form.entry.js.map
1 year ago
sc-consumer.entry.js
1 year ago
sc-consumer.entry.js.map
1 year ago
sc-coupon-form.entry.js
1 year ago
sc-coupon-form.entry.js.map
1 year ago
sc-custom-order-price-input.entry.js
1 year ago
sc-custom-order-price-input.entry.js.map
1 year ago
sc-customer-details.entry.js
1 year ago
sc-customer-details.entry.js.map
1 year ago
sc-customer-edit.entry.js
1 year ago
sc-customer-edit.entry.js.map
1 year ago
sc-customer-email.entry.js
1 year ago
sc-customer-email.entry.js.map
1 year ago
sc-customer-firstname.entry.js
1 year ago
sc-customer-firstname.entry.js.map
1 year ago
sc-customer-lastname.entry.js
1 year ago
sc-customer-lastname.entry.js.map
1 year ago
sc-customer-name.entry.js
1 year ago
sc-customer-name.entry.js.map
1 year ago
sc-customer-phone.entry.js
1 year ago
sc-customer-phone.entry.js.map
1 year ago
sc-dashboard-customer-details.entry.js
1 year ago
sc-dashboard-customer-details.entry.js.map
1 year ago
sc-dashboard-downloads-list.entry.js
1 year ago
sc-dashboard-downloads-list.entry.js.map
1 year ago
sc-divider.entry.js
1 year ago
sc-divider.entry.js.map
1 year ago
sc-donation-choices.entry.js
1 year ago
sc-donation-choices.entry.js.map
1 year ago
sc-downloads-list.entry.js
1 year ago
sc-downloads-list.entry.js.map
1 year ago
sc-dropdown_3.entry.js
1 year ago
sc-dropdown_3.entry.js.map
1 year ago
sc-empty.entry.js
1 year ago
sc-empty.entry.js.map
1 year ago
sc-express-payment.entry.js
1 year ago
sc-express-payment.entry.js.map
1 year ago
sc-feature-demo-banner.entry.js
1 year ago
sc-feature-demo-banner.entry.js.map
1 year ago
sc-form-control_2.entry.js
1 year ago
sc-form-control_2.entry.js.map
1 year ago
sc-form-row.entry.js
1 year ago
sc-form-row.entry.js.map
1 year ago
sc-form.entry.js
1 year ago
sc-form.entry.js.map
1 year ago
sc-format-bytes.entry.js
1 year ago
sc-format-bytes.entry.js.map
1 year ago
sc-format-interval.entry.js
1 year ago
sc-format-interval.entry.js.map
1 year ago
sc-fulfillment-shipping-status-badge.entry.js
1 year ago
sc-fulfillment-shipping-status-badge.entry.js.map
1 year ago
sc-fulfillments.entry.js
1 year ago
sc-fulfillments.entry.js.map
1 year ago
sc-heading_2.entry.js
1 year ago
sc-heading_2.entry.js.map
1 year ago
sc-image-slider.entry.js
1 year ago
sc-image-slider.entry.js.map
1 year ago
sc-invoices-list.entry.js
1 year ago
sc-invoices-list.entry.js.map
1 year ago
sc-license.entry.js
1 year ago
sc-license.entry.js.map
1 year ago
sc-licenses-list.entry.js
1 year ago
sc-licenses-list.entry.js.map
1 year ago
sc-line-item-bump.entry.js
1 year ago
sc-line-item-bump.entry.js.map
1 year ago
sc-line-item-total.entry.js
1 year ago
sc-line-item-total.entry.js.map
1 year ago
sc-line-item.entry.js
1 year ago
sc-line-item.entry.js.map
1 year ago
sc-line-items-provider.entry.js
1 year ago
sc-line-items-provider.entry.js.map
1 year ago
sc-line-items.entry.js
1 year ago
sc-line-items.entry.js.map
1 year ago
sc-login-form.entry.js
1 year ago
sc-login-form.entry.js.map
1 year ago
sc-manual-payment-method_3.entry.js
1 year ago
sc-manual-payment-method_3.entry.js.map
1 year ago
sc-menu-divider.entry.js
1 year ago
sc-menu-divider.entry.js.map
1 year ago
sc-menu-label_2.entry.js
1 year ago
sc-menu-label_2.entry.js.map
1 year ago
sc-mollie-add-method.entry.js
1 year ago
sc-mollie-add-method.entry.js.map
1 year ago
sc-order-confirmation-customer.entry.js
1 year ago
sc-order-confirmation-customer.entry.js.map
1 year ago
sc-order-confirmation-details.entry.js
1 year ago
sc-order-confirmation-details.entry.js.map
1 year ago
sc-order-confirmation-line-items_2.entry.js
1 year ago
sc-order-confirmation-line-items_2.entry.js.map
1 year ago
sc-order-confirmation.entry.js
1 year ago
sc-order-confirmation.entry.js.map
1 year ago
sc-order-coupon-form.entry.js
1 year ago
sc-order-coupon-form.entry.js.map
1 year ago
sc-order-detail.entry.js
1 year ago
sc-order-detail.entry.js.map
1 year ago
sc-order-fulfillment-badge.entry.js
1 year ago
sc-order-fulfillment-badge.entry.js.map
1 year ago
sc-order-manual-instructions.entry.js
1 year ago
sc-order-manual-instructions.entry.js.map
1 year ago
sc-order-password.entry.js
1 year ago
sc-order-password.entry.js.map
1 year ago
sc-order-return-badge.entry.js
1 year ago
sc-order-return-badge.entry.js.map
1 year ago
sc-order-shipment-badge.entry.js
1 year ago
sc-order-shipment-badge.entry.js.map
1 year ago
sc-order-status-badge.entry.js
1 year ago
sc-order-status-badge.entry.js.map
1 year ago
sc-order-submit.entry.js
1 year ago
sc-order-submit.entry.js.map
1 year ago
sc-order-summary.entry.js
1 year ago
sc-order-summary.entry.js.map
1 year ago
sc-order.entry.js
1 year ago
sc-order.entry.js.map
1 year ago
sc-orders-list.entry.js
1 year ago
sc-orders-list.entry.js.map
1 year ago
sc-pagination.entry.js
1 year ago
sc-pagination.entry.js.map
1 year ago
sc-password-nag.entry.js
1 year ago
sc-password-nag.entry.js.map
1 year ago
sc-password.entry.js
1 year ago
sc-password.entry.js.map
1 year ago
sc-payment-method-choice_2.entry.js
1 year ago
sc-payment-method-choice_2.entry.js.map
1 year ago
sc-payment-method-details.entry.js
1 year ago
sc-payment-method-details.entry.js.map
1 year ago
sc-payment-methods-list.entry.js
1 year ago
sc-payment-methods-list.entry.js.map
1 year ago
sc-payment.entry.js
1 year ago
sc-payment.entry.js.map
1 year ago
sc-paypal-add-method.entry.js
1 year ago
sc-paypal-add-method.entry.js.map
1 year ago
sc-paypal-buttons_2.entry.js
1 year ago
sc-paypal-buttons_2.entry.js.map
1 year ago
sc-paystack-add-method.entry.js
1 year ago
sc-paystack-add-method.entry.js.map
1 year ago
sc-phone-input.entry.js
1 year ago
sc-phone-input.entry.js.map
1 year ago
sc-pill-option.entry.js
1 year ago
sc-pill-option.entry.js.map
1 year ago
sc-premium-tag.entry.js
1 year ago
sc-premium-tag.entry.js.map
1 year ago
sc-price-choice-container.entry.js
1 year ago
sc-price-choice-container.entry.js.map
1 year ago
sc-price-choice.entry.js
1 year ago
sc-price-choice.entry.js.map
1 year ago
sc-price-choices.entry.js
1 year ago
sc-price-choices.entry.js.map
1 year ago
sc-price-input.entry.js
1 year ago
sc-price-input.entry.js.map
1 year ago
sc-price-range.entry.js
1 year ago
sc-price-range.entry.js.map
1 year ago
sc-price.entry.js
1 year ago
sc-price.entry.js.map
1 year ago
sc-product-buy-button.entry.js
1 year ago
sc-product-buy-button.entry.js.map
1 year ago
sc-product-donation-amount-choice.entry.js
1 year ago
sc-product-donation-amount-choice.entry.js.map
1 year ago
sc-product-donation-choices.entry.js
1 year ago
sc-product-donation-choices.entry.js.map
1 year ago
sc-product-donation-custom-amount.entry.js
1 year ago
sc-product-donation-custom-amount.entry.js.map
1 year ago
sc-product-item-image_3.entry.js
1 year ago
sc-product-item-image_3.entry.js.map
1 year ago
sc-product-item-list.entry.js
1 year ago
sc-product-item-list.entry.js.map
1 year ago
sc-product-item.entry.js
1 year ago
sc-product-item.entry.js.map
1 year ago
sc-product-line-item_2.entry.js
1 year ago
sc-product-line-item_2.entry.js.map
1 year ago
sc-product-pills-variant-option.entry.js
1 year ago
sc-product-pills-variant-option.entry.js.map
1 year ago
sc-product-price-choices.entry.js
1 year ago
sc-product-price-choices.entry.js.map
1 year ago
sc-product-price-modal.entry.js
1 year ago
sc-product-price-modal.entry.js.map
1 year ago
sc-product-price.entry.js
1 year ago
sc-product-price.entry.js.map
1 year ago
sc-product-quantity.entry.js
1 year ago
sc-product-quantity.entry.js.map
1 year ago
sc-product-selected-price.entry.js
1 year ago
sc-product-selected-price.entry.js.map
1 year ago
sc-product-text.entry.js
1 year ago
sc-product-text.entry.js.map
1 year ago
sc-provider.entry.js
1 year ago
sc-provider.entry.js.map
1 year ago
sc-provisional-banner.entry.js
1 year ago
sc-provisional-banner.entry.js.map
1 year ago
sc-purchase-downloads-list.entry.js
1 year ago
sc-purchase-downloads-list.entry.js.map
1 year ago
sc-recurring-price-choice-container.entry.js
1 year ago
sc-recurring-price-choice-container.entry.js.map
1 year ago
sc-rich-text.entry.js
1 year ago
sc-rich-text.entry.js.map
1 year ago
sc-spacing.entry.js
1 year ago
sc-spacing.entry.js.map
1 year ago
sc-stacked-list_2.entry.js
1 year ago
sc-stacked-list_2.entry.js.map
1 year ago
sc-stripe-add-method.entry.js
1 year ago
sc-stripe-add-method.entry.js.map
1 year ago
sc-stripe-element.entry.js
1 year ago
sc-stripe-element.entry.js.map
1 year ago
sc-stripe-payment-element.entry.js
1 year ago
sc-stripe-payment-element.entry.js.map
1 year ago
sc-stripe-payment-request.entry.js
1 year ago
sc-stripe-payment-request.entry.js.map
1 year ago
sc-subscription-ad-hoc-confirm.entry.js
1 year ago
sc-subscription-ad-hoc-confirm.entry.js.map
1 year ago
sc-subscription-details_2.entry.js
1 year ago
sc-subscription-details_2.entry.js.map
1 year ago
sc-subscription-payment-method.entry.js
1 year ago
sc-subscription-payment-method.entry.js.map
1 year ago
sc-subscription-payment.entry.js
1 year ago
sc-subscription-payment.entry.js.map
1 year ago
sc-subscription-switch.entry.js
1 year ago
sc-subscription-switch.entry.js.map
1 year ago
sc-subscription-variation-confirm.entry.js
1 year ago
sc-subscription-variation-confirm.entry.js.map
1 year ago
sc-subscription.entry.js
1 year ago
sc-subscription.entry.js.map
1 year ago
sc-subscriptions-list.entry.js
1 year ago
sc-subscriptions-list.entry.js.map
1 year ago
sc-summary.entry.js
1 year ago
sc-summary.entry.js.map
1 year ago
sc-switch.entry.js
1 year ago
sc-switch.entry.js.map
1 year ago
sc-tab-group.entry.js
1 year ago
sc-tab-group.entry.js.map
1 year ago
sc-tab-panel.entry.js
1 year ago
sc-tab-panel.entry.js.map
1 year ago
sc-tab.entry.js
1 year ago
sc-tab.entry.js.map
1 year ago
sc-table-head.entry.js
1 year ago
sc-table-head.entry.js.map
1 year ago
sc-table_3.entry.js
1 year ago
sc-table_3.entry.js.map
1 year ago
sc-tag.entry.js
1 year ago
sc-tag.entry.js.map
1 year ago
sc-toggle.entry.js
1 year ago
sc-toggle.entry.js.map
1 year ago
sc-toggles.entry.js
1 year ago
sc-toggles.entry.js.map
1 year ago
sc-total.entry.js
1 year ago
sc-total.entry.js.map
1 year ago
sc-upcoming-invoice.entry.js
1 year ago
sc-upcoming-invoice.entry.js.map
1 year ago
sc-upgrade-required.entry.js
1 year ago
sc-upgrade-required.entry.js.map
1 year ago
sc-upsell-countdown-timer.entry.js
1 year ago
sc-upsell-countdown-timer.entry.js.map
1 year ago
sc-upsell-no-thanks-button.entry.js
1 year ago
sc-upsell-no-thanks-button.entry.js.map
1 year ago
sc-upsell-submit-button.entry.js
1 year ago
sc-upsell-submit-button.entry.js.map
1 year ago
sc-upsell-totals.entry.js
1 year ago
sc-upsell-totals.entry.js.map
1 year ago
sc-upsell.entry.js
1 year ago
sc-upsell.entry.js.map
1 year ago
sc-visually-hidden.entry.js
1 year ago
sc-visually-hidden.entry.js.map
1 year ago
sc-wordpress-password-edit.entry.js
1 year ago
sc-wordpress-password-edit.entry.js.map
1 year ago
sc-wordpress-user-edit.entry.js
1 year ago
sc-wordpress-user-edit.entry.js.map
1 year ago
sc-wordpress-user.entry.js
1 year ago
sc-wordpress-user.entry.js.map
1 year ago
store-093f0f6a.js
1 year ago
store-093f0f6a.js.map
1 year ago
store-a8bae355.js
1 year ago
store-a8bae355.js.map
1 year ago
store-dcefd119.js
1 year ago
store-dcefd119.js.map
1 year ago
surecart.js
1 year ago
surecart.js.map
1 year ago
tax-d4911dbc.js
1 year ago
tax-d4911dbc.js.map
1 year ago
universe-5a73abb7.js
1 year ago
universe-5a73abb7.js.map
1 year ago
util-50af2a83.js
1 year ago
util-50af2a83.js.map
1 year ago
utils-e9ee502a.js
1 year ago
utils-e9ee502a.js.map
1 year ago
watchers-38693c1f.js
1 year ago
watchers-38693c1f.js.map
1 year ago
watchers-4d2edfb0.js
1 year ago
watchers-4d2edfb0.js.map
1 year ago
watchers-4e5b728a.js
1 year ago
watchers-4e5b728a.js.map
1 year ago
watchers-67501779.js
1 year ago
watchers-67501779.js.map
1 year ago
watchers-a697b0c8.js
1 year ago
watchers-a697b0c8.js.map
1 year ago
sc-product-item-list.entry.js
313 lines
| 1 | import { r as registerInstance, c as createEvent, h, a as getElement } from './index-745b6bec.js'; |
| 2 | import { s as speak } from './index-c5a96d53.js'; |
| 3 | import { a as apiFetch, h as handleNonceError } from './fetch-e3c5d1b9.js'; |
| 4 | import './google-dd89f242.js'; |
| 5 | import { a as addQueryArgs, g as getQueryArgs } from './add-query-args-0e2a8393.js'; |
| 6 | import './remove-query-args-938c53ea.js'; |
| 7 | import './currency-a0c9bff4.js'; |
| 8 | import './google-a86aa761.js'; |
| 9 | |
| 10 | const scProductItemListCss = ":host {\n display: block;\n}\n\n.product-item-list {\n display: grid;\n grid-template-columns: repeat(var(--sc-product-item-list-column), 1fr);\n gap: var(--sc-product-item-list-gap);\n}\n.product-item-list__wrapper {\n container-type: inline-size;\n display: grid;\n gap: var(--sc-spacing-medium);\n}\n@container (max-width: 576px) {\n .product-item-list__wrapper .product-item-list {\n grid-template-columns: 1fr;\n }\n}\n@container (min-width: 576px) and (max-width: 768px) {\n .product-item-list__wrapper .product-item-list {\n grid-template-columns: repeat(3, 1fr);\n }\n}\n.product-item-list__sort, .product-item-list__empty, .product-item-list__search, .product-item-list__search-tag {\n font-size: 16px;\n}\n.product-item-list__search, .product-item-list__sort {\n display: flex;\n align-items: center;\n gap: var(--sc-spacing-small);\n}\n.product-item-list__controls {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n align-items: center;\n}\n.product-item-list__loader {\n display: grid;\n gap: 0.88rem;\n padding-top: var(--sc-product-item-padding-top);\n padding-bottom: var(--sc-product-item-padding-bottom);\n padding-left: var(--sc-product-item-padding-left);\n padding-right: var(--sc-product-item-padding-right);\n margin-top: var(--sc-product-item-margin-top);\n margin-bottom: var(--sc-product-item-margin-bottom);\n margin-left: var(--sc-product-item-margin-left);\n margin-right: var(--sc-product-item-margin-right);\n border: solid var(--sc-product-item-border-width) var(--sc-product-item-border-color);\n border-radius: var(--sc-product-item-border-radius);\n color: var(--sc-product-title-text-color);\n background-color: var(--sc-product-item-background-color);\n line-height: 1;\n}\n.product-item-list__pagination {\n padding: 40px 0 0;\n width: 100%;\n font-size: var(--sc-font-size-small, var(--wp--preset--font-size--x-small));\n}\n.product-item-list__search-tag {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--sc-spacing-small);\n}\n.product-item-list__search-label {\n font-size: var(--sc-font-size-small, var(--wp--preset--font-size--x-small));\n}\n\n.search-button,\n.clear-button {\n opacity: 0;\n visibility: hidden;\n transition: opacity var(--sc-transition-medium) ease-in-out;\n cursor: pointer;\n}\n\n.product-item-list__has-search .search-button,\n.product-item-list__has-search .clear-button {\n opacity: 1;\n visibility: visible;\n}\n\nsc-product-item::part(image) {\n aspect-ratio: var(--sc-product-image-aspect-ratio);\n}\n\nsc-dropdown sc-button::part(base):focus-visible {\n border: 1px dashed var(--sc-product-item-border-color, --sc-color-gray-50);\n}\n\nsc-pagination {\n font-size: var(--sc-pagination-font-size);\n}"; |
| 11 | const ScProductItemListStyle0 = scProductItemListCss; |
| 12 | |
| 13 | const ScProductItemList = class { |
| 14 | constructor(hostRef) { |
| 15 | registerInstance(this, hostRef); |
| 16 | this.scSearched = createEvent(this, "scSearched", 7); |
| 17 | this.scProductsViewed = createEvent(this, "scProductsViewed", 7); |
| 18 | this.ids = undefined; |
| 19 | this.sort = 'created_at:desc'; |
| 20 | this.query = undefined; |
| 21 | this.searchEnabled = true; |
| 22 | this.sortEnabled = true; |
| 23 | this.collectionEnabled = true; |
| 24 | this.collectionId = undefined; |
| 25 | this.pageTitle = undefined; |
| 26 | this.featured = false; |
| 27 | this.paginationEnabled = true; |
| 28 | this.ajaxPagination = true; |
| 29 | this.paginationAutoScroll = true; |
| 30 | this.layoutConfig = undefined; |
| 31 | this.paginationAlignment = 'center'; |
| 32 | this.limit = 15; |
| 33 | this.page = 1; |
| 34 | this.products = undefined; |
| 35 | this.loading = false; |
| 36 | this.busy = false; |
| 37 | this.error = undefined; |
| 38 | this.currentPage = 1; |
| 39 | this.currentQuery = undefined; |
| 40 | this.pagination = { |
| 41 | total: 0, |
| 42 | total_pages: 0, |
| 43 | }; |
| 44 | this.collections = undefined; |
| 45 | this.selectedCollections = []; |
| 46 | } |
| 47 | handleProductsChanged(newProducts, oldProducts) { |
| 48 | var _a; |
| 49 | const productIds = new Set([...(oldProducts || []).map(product => product.id), ...(newProducts || []).map(product => product.id)]); |
| 50 | if ((newProducts === null || newProducts === void 0 ? void 0 : newProducts.length) === (oldProducts === null || oldProducts === void 0 ? void 0 : oldProducts.length) && productIds.size === newProducts.length) { |
| 51 | return; |
| 52 | } |
| 53 | const title = [ |
| 54 | this.pageTitle, |
| 55 | this.paginationEnabled ? wp.i18n.sprintf(wp.i18n.__('Page %d', 'surecart'), this.currentPage) : undefined, |
| 56 | this.sort ? this.renderSortName() : undefined, |
| 57 | this.query || ((_a = this.selectedCollections) === null || _a === void 0 ? void 0 : _a.length) ? wp.i18n.__('Search results', 'surecart') : undefined, |
| 58 | ] |
| 59 | .filter(item => !!item) |
| 60 | .join(' - '); |
| 61 | this.scProductsViewed.emit({ |
| 62 | products: this.products, |
| 63 | pageTitle: title, |
| 64 | collectionId: this.collectionId, |
| 65 | }); |
| 66 | } |
| 67 | componentWillLoad() { |
| 68 | var _a; |
| 69 | if (!((_a = this === null || this === void 0 ? void 0 : this.products) === null || _a === void 0 ? void 0 : _a.length)) { |
| 70 | this.getProducts(); |
| 71 | } |
| 72 | else { |
| 73 | this.handleProductsChanged(this.products); |
| 74 | } |
| 75 | if (this.collectionEnabled) { |
| 76 | this.getCollections(); |
| 77 | } |
| 78 | } |
| 79 | // Append URL if no 'product-page' found |
| 80 | doPagination(page) { |
| 81 | // handle ajax pagination |
| 82 | if (this.ajaxPagination) { |
| 83 | this.page = page; |
| 84 | this.updateProducts(); |
| 85 | this.paginationAutoScroll && this.el.scrollIntoView({ behavior: 'smooth' }); |
| 86 | return; |
| 87 | } |
| 88 | // handle server pagination. |
| 89 | const newUrl = addQueryArgs(location.href, { 'product-page': page }); |
| 90 | window.location.replace(newUrl); |
| 91 | } |
| 92 | // Fetch all products |
| 93 | async getProducts() { |
| 94 | const { 'product-page': page } = getQueryArgs(window.location.href); |
| 95 | this.page = this.paginationEnabled && page ? parseInt(page) : 1; |
| 96 | try { |
| 97 | this.loading = true; |
| 98 | await this.fetchProducts(); |
| 99 | } |
| 100 | catch (error) { |
| 101 | console.error(error); |
| 102 | } |
| 103 | finally { |
| 104 | this.loading = false; |
| 105 | } |
| 106 | } |
| 107 | // Fetch all collections |
| 108 | async getCollections() { |
| 109 | try { |
| 110 | this.collections = (await apiFetch({ |
| 111 | path: addQueryArgs('surecart/v1/product_collections/', { |
| 112 | per_page: 100, |
| 113 | }), |
| 114 | })); |
| 115 | } |
| 116 | catch (error) { |
| 117 | console.error(error); |
| 118 | } |
| 119 | } |
| 120 | async handleSortChange() { |
| 121 | this.page = 1; |
| 122 | this.updateProducts(); |
| 123 | } |
| 124 | async updateProducts(emitSearchEvent = false) { |
| 125 | var _a; |
| 126 | try { |
| 127 | this.busy = true; |
| 128 | await this.fetchProducts(); |
| 129 | if (!!this.query && emitSearchEvent) { |
| 130 | this.scSearched.emit({ |
| 131 | searchString: this.query, |
| 132 | searchResultCount: (_a = this.products) === null || _a === void 0 ? void 0 : _a.length, |
| 133 | searchResultIds: this.products.map(product => product.id), |
| 134 | }); |
| 135 | } |
| 136 | } |
| 137 | catch (error) { |
| 138 | console.log('error'); |
| 139 | console.error(error); |
| 140 | this.error = error.message || wp.i18n.__('An unknown error occurred.', 'surecart'); |
| 141 | } |
| 142 | finally { |
| 143 | this.busy = false; |
| 144 | } |
| 145 | } |
| 146 | handleIdsChange() { |
| 147 | if (this.debounce !== null) { |
| 148 | clearTimeout(this.debounce); |
| 149 | this.debounce = null; |
| 150 | } |
| 151 | this.debounce = window.setTimeout(() => { |
| 152 | // your debounced traitment |
| 153 | this.updateProducts(); |
| 154 | this.debounce = null; |
| 155 | }, 200); |
| 156 | } |
| 157 | async fetchProducts() { |
| 158 | var _a, _b; |
| 159 | let collectionIds = ((_a = this.selectedCollections) === null || _a === void 0 ? void 0 : _a.map(collection => collection.id)) || []; |
| 160 | // If we have a collectionId, we should only fetch products from that collection. |
| 161 | if (this.collectionId) { |
| 162 | collectionIds = [this.collectionId]; |
| 163 | } |
| 164 | try { |
| 165 | const response = (await apiFetch({ |
| 166 | path: addQueryArgs(`surecart/v1/products/`, { |
| 167 | expand: ['prices', 'featured_product_media', 'product_medias', 'product_media.media', 'variants'], |
| 168 | archived: false, |
| 169 | status: ['published'], |
| 170 | per_page: this.limit, |
| 171 | page: this.page, |
| 172 | sort: this.sort, |
| 173 | product_collection_ids: collectionIds, |
| 174 | ...(this.featured ? { featured: true } : {}), |
| 175 | ...(((_b = this.ids) === null || _b === void 0 ? void 0 : _b.length) ? { ids: this.ids } : {}), |
| 176 | ...(this.query ? { query: this.query } : {}), |
| 177 | }), |
| 178 | parse: false, |
| 179 | })); |
| 180 | this.currentQuery = this.query; |
| 181 | this.pagination = { |
| 182 | total: parseInt(response.headers.get('X-WP-Total')), |
| 183 | total_pages: parseInt(response.headers.get('X-WP-TotalPages')), |
| 184 | }; |
| 185 | this.products = (await response.json()); |
| 186 | if (!!collectionIds.length || !!this.query) { |
| 187 | speak(wp.i18n.sprintf(wp.i18n.__('%s products found', 'surecart'), this.pagination.total)); |
| 188 | } |
| 189 | } |
| 190 | catch (response) { |
| 191 | // we will want to handle nonce error if we are bypassing the apiFetch parser. |
| 192 | await handleNonceError(response) |
| 193 | .then(() => this.fetchProducts()) |
| 194 | .catch(error => { |
| 195 | this.error = error.message || wp.i18n.__('An unknown error occurred.', 'surecart'); |
| 196 | }); |
| 197 | } |
| 198 | } |
| 199 | renderSortName() { |
| 200 | switch (this.sort) { |
| 201 | case 'created_at:desc': |
| 202 | return wp.i18n.__('Latest', 'surecart'); |
| 203 | case 'created_at:asc': |
| 204 | return wp.i18n.__('Oldest', 'surecart'); |
| 205 | case 'name:asc': |
| 206 | return wp.i18n.__('Alphabetical, A-Z', 'surecart'); |
| 207 | case 'name:desc': |
| 208 | return wp.i18n.__('Alphabetical, Z-A', 'surecart'); |
| 209 | default: |
| 210 | return wp.i18n.__('Sort', 'surecart'); |
| 211 | } |
| 212 | } |
| 213 | toggleSelectCollection(collection) { |
| 214 | // if collection not in selectedCollections, add it, otherwise remove it |
| 215 | if (!this.selectedCollections.find(c => c.id === collection.id)) { |
| 216 | this.selectedCollections = [...this.selectedCollections, collection]; |
| 217 | } |
| 218 | else { |
| 219 | this.selectedCollections = this.selectedCollections.filter(c => c.id !== collection.id); |
| 220 | } |
| 221 | } |
| 222 | getCollectionsAfterFiltered() { |
| 223 | var _a; |
| 224 | return ((_a = this.collections) !== null && _a !== void 0 ? _a : []).filter(collection => { |
| 225 | return !this.selectedCollections.some(selected => selected.id === collection.id); |
| 226 | }); |
| 227 | } |
| 228 | isPaginationAvailable() { |
| 229 | var _a; |
| 230 | return !!((_a = this.products) === null || _a === void 0 ? void 0 : _a.length) && this.pagination.total > this.products.length && this.paginationEnabled; |
| 231 | } |
| 232 | render() { |
| 233 | var _a, _b, _c, _d, _e, _f; |
| 234 | return (h("div", { key: 'c9c2ceec8d9c9994694de5f39d4910996de5b2fa', class: { |
| 235 | 'product-item-list__wrapper': true, |
| 236 | 'product-item-list__has-search': !!this.query, |
| 237 | } }, this.error && (h("sc-alert", { key: '1644dc91f2c9f401e6bdf0a3946df145716611cd', type: "danger", open: true }, this.error)), (this.searchEnabled || this.sortEnabled || this.collectionEnabled) && (h("div", { key: '2c8fb0a26fb09cdaa1d037ed3745217a304167f1', class: "product-item-list__header" }, h("div", { key: '8ecadb8df88e30b607e417a08e61d905cae54163', class: "product-item-list__controls" }, h("div", { key: 'e3ccdbf2dceb3c14d046d1dfb32b2f98a50b8846', class: "product-item-list__sort" }, this.sortEnabled && (h("sc-dropdown", { key: '3b72b8ee6ade415131c40d87d4a64f436b722191', style: { '--panel-width': '15em' } }, h("sc-button", { key: 'ff86f46d839ac83db0d33e8282dd2939681e08bf', type: "text", caret: true, slot: "trigger" }, h("sc-visually-hidden", { key: 'e27cae5128030bb0054833a7ba26c9ccdbff4344' }, wp.i18n.__('Dropdown to sort products.', 'surecart'), " "), this.renderSortName(), h("sc-visually-hidden", { key: '371e28d536545758ed898cf2fffc44d83acf2284' }, " ", wp.i18n.__('selected.', 'surecart'))), h("sc-menu", { key: 'e86d27f29f81a863661c5f9556461ad8f1206e61', "aria-label": wp.i18n.__('Sort Products', 'surecart') }, h("sc-menu-item", { key: 'd919e430f26dd43a276b1930ddfa1fc57438f307', "aria-label": wp.i18n.__('Sort by latest', 'surecart'), onClick: () => (this.sort = 'created_at:desc') }, wp.i18n.__('Latest', 'surecart')), h("sc-menu-item", { key: 'f4e43671adc3d0bd3b5899427c0582365b98bd52', "aria-label": wp.i18n.__('Sort by oldest', 'surecart'), onClick: () => (this.sort = 'created_at:asc') }, wp.i18n.__('Oldest', 'surecart')), h("sc-menu-item", { key: '329a2cde1a4a7a095e04d68fa3a501519a40969d', "aria-label": wp.i18n.__('Sort by name, A to Z', 'surecart'), onClick: () => (this.sort = 'name:asc') }, wp.i18n.__('Alphabetical, A-Z', 'surecart')), h("sc-menu-item", { key: '04de026ff909611be9b1cae548cc4a38b2641ad0', "aria-label": wp.i18n.__('Sort by name, Z to A', 'surecart'), onClick: () => (this.sort = 'name:desc') }, wp.i18n.__('Alphabetical, Z-A', 'surecart'))))), this.collectionEnabled && ((_a = this.collections) !== null && _a !== void 0 ? _a : []).length > 0 && (h("sc-dropdown", { key: 'bb9046f138c2fc904554d06528b873a2c4cb745b', style: { '--panel-width': '15rem' } }, h("sc-button", { key: '6280bb183b547dbe6761aa62c5f07baa07a4ec4d', type: "text", caret: true, slot: "trigger" }, h("sc-visually-hidden", { key: '3ac2dbe6d39d2dd898aace5713ac4f6006ef23ac' }, wp.i18n.sprintf(wp.i18n.__('Dropdown to filter products by collection. %s selected.', 'surecart'), ((_b = this.selectedCollections) === null || _b === void 0 ? void 0 : _b.length) ? this.selectedCollections.map(collection => collection === null || collection === void 0 ? void 0 : collection.name).join(',') : wp.i18n.__('None', 'surecart'))), h("span", { key: '5dc1c82bed56d82067a60fe7cfabd8501cfee93d', "aria-hidden": true }, " ", wp.i18n.__('Filter', 'surecart'))), h("sc-menu", { key: 'a5d8eee82110fbbdef098181dbbff54f881387cf', "aria-label": wp.i18n.__('Filter products', 'surecart') }, ((_c = this.collections) !== null && _c !== void 0 ? _c : []).map(collection => { |
| 238 | return (h("sc-menu-item", { checked: this.selectedCollections.some(selected => (selected === null || selected === void 0 ? void 0 : selected.id) === (collection === null || collection === void 0 ? void 0 : collection.id)), onClick: () => this.toggleSelectCollection(collection), key: collection === null || collection === void 0 ? void 0 : collection.id, "aria-label": wp.i18n.sprintf(wp.i18n.__('Filter by %s', 'surecart'), collection === null || collection === void 0 ? void 0 : collection.name) }, collection.name)); |
| 239 | }))))), h("div", { key: '29b83e85c63546ef896a62103c10cd03969c8743', class: "product-item-list__search" }, this.searchEnabled && |
| 240 | (((_d = this.query) === null || _d === void 0 ? void 0 : _d.length) && this.query === this.currentQuery ? (h("div", { class: "product-item-list__search-tag" }, h("div", { class: "product-item-list__search-label" }, wp.i18n.__('Search Results:', 'surecart')), h("sc-tag", { clearable: true, onScClear: () => { |
| 241 | this.query = ''; |
| 242 | this.currentQuery = ''; |
| 243 | this.updateProducts(); |
| 244 | }, "aria-label": wp.i18n.sprintf(wp.i18n.__('Searched for %s. Press space to clear search.', 'surecart'), this.query) }, this.query))) : (h("sc-input", { type: "text", placeholder: wp.i18n.__('Search', 'surecart'), size: "small", onKeyUp: e => { |
| 245 | if (e.key === 'Enter') { |
| 246 | this.query = e.target.value; |
| 247 | this.updateProducts(true); |
| 248 | } |
| 249 | }, value: this.query, clearable: true }, this.query ? (h("sc-icon", { class: "clear-button", slot: "prefix", name: "x", onClick: () => { |
| 250 | this.query = ''; |
| 251 | } })) : (h("sc-icon", { slot: "prefix", name: "search" })), h("sc-button", { class: "search-button", type: "link", slot: "suffix", busy: this.busy, onClick: () => { |
| 252 | this.updateProducts(true); |
| 253 | } }, wp.i18n.__('Search', 'surecart'))))))), this.collectionEnabled && this.selectedCollections.length > 0 && (h("div", { key: 'ec86d3a86af5b7af3494e8fdc6fe2362d7b42922', class: "product-item-list__search-tag" }, this.selectedCollections.map(collection => (h("sc-tag", { key: collection === null || collection === void 0 ? void 0 : collection.id, clearable: true, onScClear: () => { |
| 254 | this.toggleSelectCollection(collection); |
| 255 | } }, collection === null || collection === void 0 ? void 0 : collection.name))))))), !((_e = this.products) === null || _e === void 0 ? void 0 : _e.length) && !this.loading && (h("sc-empty", { key: 'da8f898f3d56cede4497bbdbbc1440f58efef1b9', class: "product-item-list__empty", icon: "shopping-bag" }, wp.i18n.__('No products found.', 'surecart'))), h("section", { key: 'c87896537d42614501ba67cc45273248faae4d93', class: "product-item-list", "aria-label": wp.i18n.__('Product list', 'surecart') }, this.loading |
| 256 | ? [...Array(((_f = this.products) === null || _f === void 0 ? void 0 : _f.length) || this.limit || 10)].map((_, index) => (h("div", { class: "product-item-list__loader", key: index }, (this.layoutConfig || []).map(layout => { |
| 257 | var _a, _b; |
| 258 | switch (layout.blockName) { |
| 259 | case 'surecart/product-item-title': |
| 260 | return (h("div", { style: { |
| 261 | textAlign: 'var(--sc-product-title-align)', |
| 262 | } }, h("sc-skeleton", { style: { |
| 263 | width: '80%', |
| 264 | display: 'inline-block', |
| 265 | } }))); |
| 266 | case 'surecart/product-item-image': |
| 267 | return (h("sc-skeleton", { style: { |
| 268 | 'width': '100%', |
| 269 | 'minHeight': '90%', |
| 270 | 'aspectRatio': (_b = (_a = layout.attributes) === null || _a === void 0 ? void 0 : _a.ratio) !== null && _b !== void 0 ? _b : '1/1.4', |
| 271 | '--sc-border-radius-pill': '12px', |
| 272 | 'display': 'inline-block', |
| 273 | } })); |
| 274 | case 'surecart/product-item-price': |
| 275 | return (h("div", { style: { |
| 276 | textAlign: 'var(--sc-product-price-align)', |
| 277 | } }, h("sc-skeleton", { style: { |
| 278 | width: '40%', |
| 279 | display: 'inline-block', |
| 280 | } }))); |
| 281 | default: |
| 282 | return null; |
| 283 | } |
| 284 | })))) |
| 285 | : (this.products || []).map((product, index) => { |
| 286 | return (h("sc-product-item", { key: product === null || product === void 0 ? void 0 : product.id, ...(this.products.length - 1 === index |
| 287 | ? { |
| 288 | 'aria-label': wp.i18n.sprintf(wp.i18n.__('You have reached the end of product list. %s', 'surecart'), this.isPaginationAvailable() ? wp.i18n.__('Press tab to browse more products using pagination.', 'surecart') : wp.i18n.__('No more products to browse.', 'surecart')), |
| 289 | } |
| 290 | : {}), exportparts: "title, price, image", product: product, layoutConfig: this.layoutConfig })); |
| 291 | })), this.isPaginationAvailable() && (h("div", { key: 'a164e4a7a29da3a4a99d26c0c9e87384b7833a93', class: { |
| 292 | 'product-item-list__pagination': true, |
| 293 | '--is-aligned-left': this.paginationAlignment === 'left', |
| 294 | '--is-aligned-center': this.paginationAlignment === 'center', |
| 295 | '--is-aligned-right': this.paginationAlignment === 'right', |
| 296 | } }, h("sc-pagination", { key: '2e6c53c4e5a58549b679272d6362e02c5cec76d4', page: this.page, perPage: this.limit, total: this.pagination.total, totalPages: this.pagination.total_pages, totalShowing: this.limit, onScNextPage: () => this.doPagination(this.page + 1), onScPrevPage: () => this.doPagination(this.page - 1) }))), (this.busy || this.loading) && h("sc-block-ui", { key: '4c07b99cff5fef542c2c8f4c0e9ac814da229441' }))); |
| 297 | } |
| 298 | get el() { return getElement(this); } |
| 299 | static get watchers() { return { |
| 300 | "products": ["handleProductsChanged"], |
| 301 | "sort": ["handleSortChange"], |
| 302 | "selectedCollections": ["handleSortChange"], |
| 303 | "query": ["handleSortChange"], |
| 304 | "ids": ["handleIdsChange"], |
| 305 | "limit": ["handleIdsChange"], |
| 306 | "featured": ["handleIdsChange"] |
| 307 | }; } |
| 308 | }; |
| 309 | ScProductItemList.style = ScProductItemListStyle0; |
| 310 | |
| 311 | export { ScProductItemList as sc_product_item_list }; |
| 312 | |
| 313 | //# sourceMappingURL=sc-product-item-list.entry.js.map |