MockProcessor-5c5e066a.js
1 month ago
MockProcessor-5c5e066a.js.map
1 month ago
add-query-args-0e2a8393.js
1 year ago
add-query-args-0e2a8393.js.map
1 year ago
address-b8e2e4c8.js
2 months ago
address-b8e2e4c8.js.map
2 months ago
animation-registry-de37bd7e.js
2 months ago
animation-registry-de37bd7e.js.map
2 months ago
app-globals-0eef0276.js
1 month ago
app-globals-0eef0276.js.map
1 month ago
consumer-f1775a76.js
1 month ago
consumer-f1775a76.js.map
1 month ago
currency-a0c9bff4.js
1 year ago
currency-a0c9bff4.js.map
1 year ago
error-b146b98f.js
4 days ago
error-b146b98f.js.map
4 days ago
fetch-cdff67be.js
2 weeks ago
fetch-cdff67be.js.map
2 weeks ago
floating-ui.dom.esm-8dce4ea1.js
5 months ago
floating-ui.dom.esm-8dce4ea1.js.map
5 months ago
form-data-76641f16.js
1 year ago
form-data-76641f16.js.map
1 year ago
functions-4f009ce1.js
2 months ago
functions-4f009ce1.js.map
2 months ago
geo-permission-62aea8ee.js
4 days ago
geo-permission-62aea8ee.js.map
4 days ago
getters-1049a6f8.js
1 month ago
getters-1049a6f8.js.map
1 month ago
getters-1477d792.js
1 month ago
getters-1477d792.js.map
1 month ago
getters-4b4a9eb5.js
4 days ago
getters-4b4a9eb5.js.map
4 days ago
getters-4bb6cc1b.js
1 month ago
getters-4bb6cc1b.js.map
1 month ago
getters-92cbd197.js
4 days ago
getters-92cbd197.js.map
4 days ago
google-a86aa761.js
1 year ago
google-a86aa761.js.map
1 year ago
google-ff13b5f8.js
2 weeks ago
google-ff13b5f8.js.map
2 weeks ago
google-maps-e8b00ffd.js
2 months ago
google-maps-e8b00ffd.js.map
2 months ago
index-18f5a1bc.js
1 month ago
index-18f5a1bc.js.map
1 month ago
index-1db2635f.js
1 year ago
index-1db2635f.js.map
1 year ago
index-25e5af33.js
1 month ago
index-25e5af33.js.map
1 month ago
index-4aa538b7.js
4 days ago
index-4aa538b7.js.map
4 days ago
index-824c562b.js
1 month ago
index-824c562b.js.map
1 month 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-d602bc13.js
2 weeks ago
index-d602bc13.js.map
2 weeks ago
index.js
4 days ago
index.js.map
4 days 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-1bd957d5.js
1 month ago
library-1bd957d5.js.map
1 month ago
loader.js
4 days ago
loader.js.map
1 year ago
media-d21119a3.js
1 year ago
media-d21119a3.js.map
1 year ago
mutations-596ff451.js
4 days ago
mutations-596ff451.js.map
4 days ago
mutations-636921ce.js
4 days ago
mutations-636921ce.js.map
4 days ago
mutations-7458343f.js
1 month ago
mutations-7458343f.js.map
1 month ago
mutations-c99167c2.js
2 weeks ago
mutations-c99167c2.js.map
2 weeks ago
page-align-0cdacf32.js
1 year ago
page-align-0cdacf32.js.map
1 year ago
price-1ff6aa07.js
2 months ago
price-1ff6aa07.js.map
2 months ago
pure-963214cb.js
1 year ago
pure-963214cb.js.map
1 year ago
quantity-5c986f3d.js
2 months ago
quantity-5c986f3d.js.map
2 months ago
razorpay-4c4a3d31.js
2 months ago
razorpay-4c4a3d31.js.map
2 months ago
remove-query-args-938c53ea.js
1 year ago
remove-query-args-938c53ea.js.map
1 year ago
sc-address_5.entry.js
4 days ago
sc-address_5.entry.js.map
2 months ago
sc-alert.entry.js
4 days ago
sc-alert.entry.js.map
1 year ago
sc-avatar_2.entry.js
4 days ago
sc-avatar_2.entry.js.map
1 month ago
sc-badge-notice.entry.js
4 days ago
sc-badge-notice.entry.js.map
1 year ago
sc-block-ui.entry.js
4 days ago
sc-block-ui.entry.js.map
3 months ago
sc-breadcrumb.entry.js
4 days ago
sc-breadcrumb.entry.js.map
1 year ago
sc-breadcrumbs.entry.js
4 days ago
sc-breadcrumbs.entry.js.map
1 year ago
sc-button-group.entry.js
4 days ago
sc-button-group.entry.js.map
1 year ago
sc-button_6.entry.js
4 days ago
sc-button_6.entry.js.map
1 month ago
sc-cancel-dialog_3.entry.js
4 days ago
sc-cancel-dialog_3.entry.js.map
1 month ago
sc-cancel-discount_4.entry.js
4 days ago
sc-cancel-discount_4.entry.js.map
1 month ago
sc-card_2.entry.js
4 days ago
sc-card_2.entry.js.map
2 months ago
sc-cart-button.entry.js
4 days ago
sc-cart-button.entry.js.map
1 year ago
sc-cart-form-submit.entry.js
1 month ago
sc-cart-form-submit.entry.js.map
1 year ago
sc-cart-form.entry.js
4 days ago
sc-cart-form.entry.js.map
1 month ago
sc-cart-header.entry.js
4 days ago
sc-cart-header.entry.js.map
1 year ago
sc-cart-icon.entry.js
4 days ago
sc-cart-icon.entry.js.map
1 year ago
sc-cart-loader.entry.js
4 days ago
sc-cart-loader.entry.js.map
1 year ago
sc-cart-session-provider_3.entry.js
4 days ago
sc-cart-session-provider_3.entry.js.map
1 month ago
sc-cart-submit.entry.js
1 month ago
sc-cart-submit.entry.js.map
1 year ago
sc-cart.entry.js
4 days ago
sc-cart.entry.js.map
1 month ago
sc-cc-logo_2.entry.js
4 days ago
sc-cc-logo_2.entry.js.map
4 days ago
sc-charges-list.entry.js
4 days ago
sc-charges-list.entry.js.map
1 month ago
sc-checkout-autofill-provider_11.entry.js
4 days ago
sc-checkout-autofill-provider_11.entry.js.map
4 days ago
sc-checkout-form-errors.entry.js
1 month ago
sc-checkout-form-errors.entry.js.map
1 year ago
sc-checkout-mollie-payment_3.entry.js
4 days ago
sc-checkout-mollie-payment_3.entry.js.map
1 month ago
sc-checkout-product-price-variant-selector.entry.js
4 days ago
sc-checkout-product-price-variant-selector.entry.js.map
1 month ago
sc-checkout.entry.js
4 days ago
sc-checkout.entry.js.map
4 days ago
sc-choice-container.entry.js
4 days ago
sc-choice-container.entry.js.map
1 year ago
sc-choice.entry.js
4 days ago
sc-choice.entry.js.map
1 year ago
sc-choices.entry.js
4 days ago
sc-choices.entry.js.map
1 year ago
sc-column_2.entry.js
4 days ago
sc-column_2.entry.js.map
4 days ago
sc-compact-address_18.entry.js
4 days ago
sc-compact-address_18.entry.js.map
2 weeks ago
sc-conditional-form.entry.js
4 days ago
sc-conditional-form.entry.js.map
1 month ago
sc-consumer.entry.js
1 month ago
sc-consumer.entry.js.map
1 year ago
sc-coupon-form.entry.js
4 days ago
sc-coupon-form.entry.js.map
4 months ago
sc-custom-order-price-input.entry.js
2 weeks ago
sc-custom-order-price-input.entry.js.map
1 month ago
sc-customer-details.entry.js
4 days ago
sc-customer-details.entry.js.map
6 months ago
sc-customer-edit.entry.js
4 days ago
sc-customer-edit.entry.js.map
1 month ago
sc-customer-email.entry.js
4 days ago
sc-customer-email.entry.js.map
1 month ago
sc-customer-firstname.entry.js
4 days ago
sc-customer-firstname.entry.js.map
1 month ago
sc-customer-lastname.entry.js
4 days ago
sc-customer-lastname.entry.js.map
1 month ago
sc-customer-name.entry.js
4 days ago
sc-customer-name.entry.js.map
1 month ago
sc-dashboard-customer-details.entry.js
4 days ago
sc-dashboard-customer-details.entry.js.map
1 month ago
sc-dashboard-downloads-list.entry.js
4 days ago
sc-dashboard-downloads-list.entry.js.map
1 month ago
sc-dialog.entry.js
4 days ago
sc-dialog.entry.js.map
3 months ago
sc-divider.entry.js
4 days ago
sc-divider.entry.js.map
1 year ago
sc-donation-choices.entry.js
1 month ago
sc-donation-choices.entry.js.map
1 year ago
sc-downloads-list.entry.js
4 days ago
sc-downloads-list.entry.js.map
2 weeks ago
sc-dropdown_3.entry.js
4 days ago
sc-dropdown_3.entry.js.map
5 months ago
sc-empty_3.entry.js
4 days ago
sc-empty_3.entry.js.map
2 months ago
sc-express-payment.entry.js
4 days ago
sc-express-payment.entry.js.map
2 months ago
sc-feature-demo-banner.entry.js
4 days ago
sc-feature-demo-banner.entry.js.map
1 year ago
sc-flex.entry.js
4 days ago
sc-flex.entry.js.map
1 year ago
sc-form-control_2.entry.js
4 days ago
sc-form-control_2.entry.js.map
1 month ago
sc-form-row.entry.js
4 days ago
sc-form-row.entry.js.map
1 year ago
sc-form.entry.js
4 days ago
sc-form.entry.js.map
1 year ago
sc-format-bytes.entry.js
1 month ago
sc-format-bytes.entry.js.map
1 year ago
sc-format-interval.entry.js
1 month ago
sc-format-interval.entry.js.map
1 year ago
sc-format-number.entry.js
1 month ago
sc-format-number.entry.js.map
1 year ago
sc-fulfillment-shipping-status-badge.entry.js
1 month ago
sc-fulfillment-shipping-status-badge.entry.js.map
2 months ago
sc-fulfillments.entry.js
2 weeks ago
sc-fulfillments.entry.js.map
1 month ago
sc-heading_2.entry.js
4 days ago
sc-heading_2.entry.js.map
1 year ago
sc-image-slider.entry.js
4 days ago
sc-image-slider.entry.js.map
4 days ago
sc-invoice-status-badge.entry.js
4 days ago
sc-invoice-status-badge.entry.js.map
2 months ago
sc-invoices-list.entry.js
4 days ago
sc-invoices-list.entry.js.map
1 month ago
sc-license.entry.js
4 days ago
sc-license.entry.js.map
1 month ago
sc-licenses-list.entry.js
4 days ago
sc-licenses-list.entry.js.map
4 days ago
sc-line-item-bump.entry.js
4 days ago
sc-line-item-bump.entry.js.map
1 year ago
sc-line-item-total.entry.js
4 days ago
sc-line-item-total.entry.js.map
5 months ago
sc-line-item.entry.js
4 days ago
sc-line-item.entry.js.map
1 year ago
sc-line-items-provider.entry.js
4 days ago
sc-line-items-provider.entry.js.map
1 year ago
sc-line-items.entry.js
4 days ago
sc-line-items.entry.js.map
2 weeks ago
sc-login-form.entry.js
4 days ago
sc-login-form.entry.js.map
1 month ago
sc-manual-payment-method_3.entry.js
4 days ago
sc-manual-payment-method_3.entry.js.map
2 months ago
sc-menu-divider.entry.js
4 days ago
sc-menu-divider.entry.js.map
1 year ago
sc-menu-label_2.entry.js
4 days ago
sc-menu-label_2.entry.js.map
2 weeks ago
sc-mollie-add-method.entry.js
2 weeks ago
sc-mollie-add-method.entry.js.map
1 month ago
sc-order-confirmation-customer.entry.js
1 month ago
sc-order-confirmation-customer.entry.js.map
1 year ago
sc-order-confirmation-details.entry.js
1 month ago
sc-order-confirmation-details.entry.js.map
10 months ago
sc-order-confirmation-line-items_2.entry.js
4 days ago
sc-order-confirmation-line-items_2.entry.js.map
5 months ago
sc-order-confirmation.entry.js
4 days ago
sc-order-confirmation.entry.js.map
1 month ago
sc-order-coupon-form.entry.js
4 days ago
sc-order-coupon-form.entry.js.map
1 month ago
sc-order-detail.entry.js
1 month ago
sc-order-detail.entry.js.map
1 year ago
sc-order-fulfillment-badge.entry.js
4 days ago
sc-order-fulfillment-badge.entry.js.map
2 months ago
sc-order-manual-instructions.entry.js
1 month ago
sc-order-manual-instructions.entry.js.map
1 year ago
sc-order-password.entry.js
1 month ago
sc-order-password.entry.js.map
1 year ago
sc-order-return-badge.entry.js
4 days ago
sc-order-return-badge.entry.js.map
2 months ago
sc-order-shipment-badge.entry.js
1 month ago
sc-order-shipment-badge.entry.js.map
2 months ago
sc-order-status-badge.entry.js
4 days ago
sc-order-status-badge.entry.js.map
2 months ago
sc-order-submit.entry.js
4 days ago
sc-order-submit.entry.js.map
1 month ago
sc-order-summary.entry.js
4 days ago
sc-order-summary.entry.js.map
2 weeks ago
sc-order.entry.js
4 days ago
sc-order.entry.js.map
1 month ago
sc-orders-list.entry.js
4 days ago
sc-orders-list.entry.js.map
1 month ago
sc-pagination.entry.js
1 month ago
sc-pagination.entry.js.map
1 year ago
sc-password-nag.entry.js
2 weeks ago
sc-password-nag.entry.js.map
1 month ago
sc-password.entry.js
4 days ago
sc-password.entry.js.map
4 days ago
sc-payment-method-choice_2.entry.js
4 days ago
sc-payment-method-choice_2.entry.js.map
1 year ago
sc-payment-method-details.entry.js
4 days ago
sc-payment-method-details.entry.js.map
1 year ago
sc-payment-methods-list.entry.js
4 days ago
sc-payment-methods-list.entry.js.map
1 month ago
sc-payment.entry.js
4 days ago
sc-payment.entry.js.map
2 months ago
sc-paypal-add-method.entry.js
4 days ago
sc-paypal-add-method.entry.js.map
1 month ago
sc-paypal-buttons_2.entry.js
4 days ago
sc-paypal-buttons_2.entry.js.map
1 month ago
sc-paystack-add-method.entry.js
4 days ago
sc-paystack-add-method.entry.js.map
1 month ago
sc-pill-option.entry.js
4 days ago
sc-pill-option.entry.js.map
1 year ago
sc-popover.entry.js
4 days ago
sc-popover.entry.js.map
5 months ago
sc-premium-tag.entry.js
4 days ago
sc-premium-tag.entry.js.map
1 year ago
sc-price-choice-container.entry.js
1 month ago
sc-price-choice-container.entry.js.map
1 year ago
sc-price-choice.entry.js
2 weeks ago
sc-price-choice.entry.js.map
1 month ago
sc-price-choices.entry.js
4 days ago
sc-price-choices.entry.js.map
1 year ago
sc-price-input.entry.js
4 days ago
sc-price-input.entry.js.map
1 year ago
sc-price-range_4.entry.js
4 days ago
sc-price-range_4.entry.js.map
1 year ago
sc-price.entry.js
1 month ago
sc-price.entry.js.map
10 months ago
sc-product-buy-button.entry.js
4 days ago
sc-product-buy-button.entry.js.map
1 month ago
sc-product-donation-amount-choice.entry.js
4 days ago
sc-product-donation-amount-choice.entry.js.map
1 month ago
sc-product-donation-choices.entry.js
4 days ago
sc-product-donation-choices.entry.js.map
1 month ago
sc-product-donation-custom-amount.entry.js
4 days ago
sc-product-donation-custom-amount.entry.js.map
1 month ago
sc-product-item-list.entry.js
2 weeks ago
sc-product-item-list.entry.js.map
1 month ago
sc-product-item.entry.js
4 days ago
sc-product-item.entry.js.map
1 year ago
sc-product-pills-variant-option.entry.js
4 days ago
sc-product-pills-variant-option.entry.js.map
1 year ago
sc-product-price-choices.entry.js
2 weeks ago
sc-product-price-choices.entry.js.map
1 year ago
sc-product-price-modal.entry.js
4 days ago
sc-product-price-modal.entry.js.map
1 month ago
sc-product-price.entry.js
4 days ago
sc-product-price.entry.js.map
1 month ago
sc-product-quantity.entry.js
4 days ago
sc-product-quantity.entry.js.map
1 year ago
sc-product-selected-price.entry.js
4 days ago
sc-product-selected-price.entry.js.map
1 month ago
sc-product-text.entry.js
2 weeks ago
sc-product-text.entry.js.map
1 year ago
sc-provider.entry.js
1 month ago
sc-provider.entry.js.map
1 year ago
sc-provisional-banner.entry.js
4 days ago
sc-provisional-banner.entry.js.map
10 months ago
sc-purchase-downloads-list.entry.js
4 days ago
sc-purchase-downloads-list.entry.js.map
2 weeks ago
sc-razorpay-add-method.entry.js
4 days ago
sc-razorpay-add-method.entry.js.map
1 month ago
sc-recurring-price-choice-container.entry.js
1 month ago
sc-recurring-price-choice-container.entry.js.map
1 year ago
sc-review-stars.entry.js
1 month ago
sc-review-stars.entry.js.map
4 months ago
sc-rich-text.entry.js
4 days ago
sc-rich-text.entry.js.map
4 days ago
sc-skeleton.entry.js
4 days ago
sc-skeleton.entry.js.map
1 year ago
sc-spacing.entry.js
4 days ago
sc-spacing.entry.js.map
1 year ago
sc-stripe-add-method.entry.js
4 days ago
sc-stripe-add-method.entry.js.map
1 month ago
sc-stripe-element.entry.js
4 days ago
sc-stripe-element.entry.js.map
1 month ago
sc-stripe-payment-element.entry.js
4 days ago
sc-stripe-payment-element.entry.js.map
1 month ago
sc-stripe-payment-request.entry.js
4 days ago
sc-stripe-payment-request.entry.js.map
1 month ago
sc-subscription-ad-hoc-confirm.entry.js
4 days ago
sc-subscription-ad-hoc-confirm.entry.js.map
5 months ago
sc-subscription-details_2.entry.js
4 days ago
sc-subscription-details_2.entry.js.map
1 month ago
sc-subscription-payment-method.entry.js
4 days ago
sc-subscription-payment-method.entry.js.map
1 month ago
sc-subscription-payment.entry.js
4 days ago
sc-subscription-payment.entry.js.map
1 month ago
sc-subscription-switch.entry.js
2 weeks ago
sc-subscription-switch.entry.js.map
1 month ago
sc-subscription-variation-confirm.entry.js
4 days ago
sc-subscription-variation-confirm.entry.js.map
1 year ago
sc-subscription.entry.js
4 days ago
sc-subscription.entry.js.map
1 month ago
sc-subscriptions-list.entry.js
4 days ago
sc-subscriptions-list.entry.js.map
1 month ago
sc-summary.entry.js
4 days ago
sc-summary.entry.js.map
1 year ago
sc-swap.entry.js
4 days ago
sc-swap.entry.js.map
1 month ago
sc-switch.entry.js
4 days ago
sc-switch.entry.js.map
6 months ago
sc-tab-group.entry.js
4 days ago
sc-tab-group.entry.js.map
1 year ago
sc-tab-panel.entry.js
4 days ago
sc-tab-panel.entry.js.map
1 year ago
sc-tab.entry.js
4 days ago
sc-tab.entry.js.map
1 year ago
sc-table-head.entry.js
4 days ago
sc-table-head.entry.js.map
1 year ago
sc-table_3.entry.js
4 days ago
sc-table_3.entry.js.map
8 months ago
sc-tag.entry.js
4 days ago
sc-tag.entry.js.map
2 months ago
sc-test-mode-info.entry.js
4 days ago
sc-test-mode-info.entry.js.map
5 months ago
sc-text.entry.js
4 days ago
sc-text.entry.js.map
1 year ago
sc-toggle.entry.js
4 days ago
sc-toggle.entry.js.map
1 year ago
sc-toggles.entry.js
4 days ago
sc-toggles.entry.js.map
1 year ago
sc-total.entry.js
4 days ago
sc-total.entry.js.map
10 months ago
sc-upcoming-invoice.entry.js
4 days ago
sc-upcoming-invoice.entry.js.map
1 month ago
sc-upgrade-required.entry.js
1 month ago
sc-upgrade-required.entry.js.map
1 year ago
sc-upsell-countdown-timer.entry.js
4 days ago
sc-upsell-countdown-timer.entry.js.map
1 year ago
sc-upsell-no-thanks-button.entry.js
4 days ago
sc-upsell-no-thanks-button.entry.js.map
1 month ago
sc-upsell-submit-button.entry.js
4 days ago
sc-upsell-submit-button.entry.js.map
1 month ago
sc-upsell-totals.entry.js
4 days ago
sc-upsell-totals.entry.js.map
1 month ago
sc-upsell.entry.js
4 days ago
sc-upsell.entry.js.map
1 month ago
sc-verification-code.entry.js
4 days ago
sc-verification-code.entry.js.map
1 month ago
sc-visually-hidden.entry.js
4 days ago
sc-visually-hidden.entry.js.map
1 year ago
sc-wordpress-password-edit.entry.js
4 days ago
sc-wordpress-password-edit.entry.js.map
1 month ago
sc-wordpress-user-edit.entry.js
4 days ago
sc-wordpress-user-edit.entry.js.map
1 month ago
sc-wordpress-user.entry.js
4 days ago
sc-wordpress-user.entry.js.map
1 year ago
store-02394e82.js
1 month ago
store-02394e82.js.map
1 month ago
store-289e460c.js
1 month ago
store-289e460c.js.map
1 month ago
store-b1758b00.js
1 month ago
store-b1758b00.js.map
1 month ago
surecart.js
4 days ago
surecart.js.map
1 year ago
tax-a03623ca.js
1 year ago
tax-a03623ca.js.map
1 year ago
universe-7bd0ac2b.js
1 month ago
universe-7bd0ac2b.js.map
1 month ago
util-dfbf863e.js
1 month ago
util-dfbf863e.js.map
1 month ago
utils-f84b2118.js
2 months ago
utils-f84b2118.js.map
2 months ago
watchers-17c3cde1.js
2 weeks ago
watchers-17c3cde1.js.map
2 weeks ago
watchers-35242771.js
2 weeks ago
watchers-35242771.js.map
2 weeks ago
watchers-447890ff.js
4 days ago
watchers-447890ff.js.map
4 days ago
watchers-c7bbc6b2.js
1 month ago
watchers-c7bbc6b2.js.map
1 month ago
watchers-fb5eec9b.js
4 days ago
watchers-fb5eec9b.js.map
4 days ago
sc-button_6.entry.js
482 lines
| 1 | import { r as registerInstance, c as createEvent, h, F as Fragment, a as getElement } from './index-25e5af33.js'; |
| 2 | import { i as isRtl } from './page-align-0cdacf32.js'; |
| 3 | import { w as watchIcon, u as unwatchIcon, g as getIconLibrary } from './library-1bd957d5.js'; |
| 4 | import { s as speak } from './index-c5a96d53.js'; |
| 5 | |
| 6 | const scButtonCss = ":host{display:inline-block;width:auto;cursor:pointer;--primary-color:var(--sc-color-primary-text);--primary-background:var(--sc-color-primary-500)}:host([full]){display:block}::slotted(*){pointer-events:none}.button{box-sizing:border-box;z-index:10;display:inline-flex;align-items:stretch;justify-content:center;width:100%;border-style:solid;border-width:var(--sc-input-border-width);font-family:var(--sc-input-font-family);font-weight:var(--sc-font-weight-semibold);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;transition:var(--sc-input-transition, var(--sc-transition-medium)) background-color, var(--sc-input-transition, var(--sc-transition-medium)) color, var(--sc-input-transition, var(--sc-transition-medium)) border, var(--sc-input-transition, var(--sc-transition-medium)) box-shadow, var(--sc-input-transition, var(--sc-transition-medium)) opacity;cursor:inherit}.button::-moz-focus-inner{border:0}.button:focus{outline:none}.button:focus-visible{box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.button.button--disabled{cursor:not-allowed}.button.button--disabled *{pointer-events:none}.button.button--disabled .button__label,.button.button--disabled .button__suffix,.button.button--disabled .button__prefix{opacity:0.5}.button ::slotted(.sc--icon){pointer-events:none}.button__prefix,.button__suffix{flex:0 0 auto;display:flex;align-items:center}.button__label{display:flex;align-items:center}.button__label ::slotted(sc-icon){vertical-align:-2px}.button:not(.button--text):not(.button--link){box-shadow:var(--sc-shadow-small)}.button.button--standard.button--default{background-color:var(--sc-button-default-background-color, var(--sc-color-white));border-color:var(--sc-button-default-border-color, var(--sc-color-gray-300));color:var(--sc-button-default-color, var(--sc-color-gray-600))}.button.button--standard.button--default:hover:not(.button--disabled){background-color:var(--sc-button-default-hover-background-color, var(--sc-color-white));border-color:var(--sc-button-default-focus-border-color, var(--primary-background));color:var(--primary-background)}.button.button--standard.button--default:focus:not(.button--disabled){background-color:var(--sc-button-default-focus-background-color, var(--sc-color-white));border-color:var(--sc-button-default-focus-border-color, var(--sc-color-white));color:var(--primary-background);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.button.button--standard.button--default:active:not(.button--disabled){background-color:var(--sc-button-default-active-background-color, var(--sc-color-white));border-color:var(--sc-button-default-active-border-color, var(--sc-color-white));color:var(--primary-background)}.button.button--standard.button--primary{background-color:var(--primary-background);border-color:var(--primary-background);color:var(--primary-color)}.button.button--standard.button--primary:hover:not(.button--disabled){opacity:0.8}.button.button--standard.button--primary:focus:not(.button--disabled){opacity:0.8;color:var(--primary-color);border-color:var(--sc-color-white);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.button.button--standard.button--primary:active:not(.button--disabled){background-color:var(--primary-background);border-color:var(--sc-color-white);color:var(--primary-color)}.button.button--standard.button--success{background-color:var(--sc-color-success-500);border-color:var(--sc-color-success-500);color:var(--sc-color-success-text)}.button.button--standard.button--success:hover:not(.button--disabled){background-color:var(--sc-color-success-400);border-color:var(--sc-color-success-400);color:var(--sc-color-success-text)}.button.button--standard.button--success:focus:not(.button--disabled){background-color:var(--sc-color-success-400);border-color:var(--sc-color-success-400);color:var(--sc-color-success-text);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-success)}.button.button--standard.button--success:active:not(.button--disabled){background-color:var(--sc-color-success-500);border-color:var(--sc-color-success-500);color:var(--sc-color-success-text)}.button.button--standard.button--info{background-color:var(--sc-color-info-500);border-color:var(--sc-color-info-500);color:var(--sc-color-info-text)}.button.button--standard.button--info:hover:not(.button--disabled){background-color:var(--sc-color-info-400);border-color:var(--sc-color-info-400);color:var(--sc-color-info-text)}.button.button--standard.button--info:focus:not(.button--disabled){background-color:var(--sc-color-info-400);border-color:var(--sc-color-info-400);color:var(--sc-color-info-text);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-info)}.button.button--standard.button--info:active:not(.button--disabled){background-color:var(--sc-color-info-500);border-color:var(--sc-color-info-500);color:var(--sc-color-info-text)}.button.button--standard.button--warning{background-color:var(--sc-color-warning-500);border-color:var(--sc-color-warning-500);color:var(--sc-color-warning-text)}.button.button--standard.button--warning:hover:not(.button--disabled){background-color:var(--sc-color-warning-400);border-color:var(--sc-color-warning-400);color:var(--sc-color-warning-text)}.button.button--standard.button--warning:focus:not(.button--disabled){background-color:var(--sc-color-warning-400);border-color:var(--sc-color-warning-400);color:var(--sc-color-warning-text);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-warning)}.button.button--standard.button--warning:active:not(.button--disabled){background-color:var(--sc-color-warning-500);border-color:var(--sc-color-warning-500);color:var(--sc-color-warning-text)}.button.button--standard.button--danger{background-color:var(--sc-color-danger-500);border-color:var(--sc-color-danger-500);color:var(--sc-color-danger-text)}.button.button--standard.button--danger:hover:not(.button--disabled){background-color:var(--sc-color-danger-400);border-color:var(--sc-color-danger-400);color:var(--sc-color-danger-text)}.button.button--standard.button--danger:focus:not(.button--disabled){background-color:var(--sc-color-danger-400);border-color:var(--sc-color-danger-400);color:var(--sc-color-danger-text);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-danger)}.button.button--standard.button--danger:active:not(.button--disabled){background-color:var(--sc-color-danger-500);border-color:var(--sc-color-danger-500);color:var(--sc-color-danger-text)}.button--outline{background:none;border:solid 1px}.button--outline.button--default{border-color:var(--sc-color-gray-300);color:var(--sc-color-gray-700)}.button--outline.button--default:hover:not(.button--disabled){border-color:var(--primary-background);background-color:var(--primary-background);color:var(--sc-color-white)}.button--outline.button--default:focus:not(.button--disabled){border-color:var(--primary-background);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--primary-background)/var(--sc-focus-ring-alpha)}.button--outline.button--default:active:not(.button--disabled){opacity:0.8;color:var(--sc-color-white)}.button--outline.button--primary{border-color:var(--primary-background);color:var(--primary-background)}.button--outline.button--primary:hover:not(.button--disabled){background-color:var(--primary-background);opacity:0.8;color:var(--sc-color-white)}.button--outline.button--primary:focus:not(.button--disabled){border-color:var(--primary-background);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--primary-background)/var(--sc-focus-ring-alpha)}.button--outline.button--primary:active:not(.button--disabled){border-color:var(--primary-background);background-color:var(--primary-background);opacity:0.9;color:var(--sc-color-white)}.button--outline.button--success{border-color:var(--sc-color-success-500);color:var(--sc-color-success-500)}.button--outline.button--success:hover:not(.button--disabled){background-color:var(--sc-color-success-500);color:var(--sc-color-white)}.button--outline.button--success:focus:not(.button--disabled){border-color:var(--sc-color-success-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-color-success-500)/var(--sc-focus-ring-alpha)}.button--outline.button--success:active:not(.button--disabled){border-color:var(--sc-color-success-700);background-color:var(--sc-color-success-700);color:var(--sc-color-white)}.button--outline.button--info{border-color:var(--sc-color-gray-500);color:var(--sc-color-gray-500)}.button--outline.button--info:hover:not(.button--disabled){background-color:var(--sc-color-gray-500);color:var(--sc-color-white)}.button--outline.button--info:focus:not(.button--disabled){border-color:var(--sc-color-gray-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-color-gray-500)/var(--sc-focus-ring-alpha)}.button--outline.button--info:active:not(.button--disabled){border-color:var(--sc-color-gray-700);background-color:var(--sc-color-gray-700);color:var(--sc-color-white)}.button--outline.button--warning{border-color:var(--sc-color-warning-500);color:var(--sc-color-warning-500)}.button--outline.button--warning:hover:not(.button--disabled){background-color:var(--sc-color-warning-500);color:var(--sc-color-white)}.button--outline.button--warning:focus:not(.button--disabled){border-color:var(--sc-color-warning-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-color-warning-500)/var(--sc-focus-ring-alpha)}.button--outline.button--warning:active:not(.button--disabled){border-color:var(--sc-color-warning-700);background-color:var(--sc-color-warning-700);color:var(--sc-color-white)}.button--outline.button--danger{border-color:var(--sc-color-danger-500);color:var(--sc-color-danger-500)}.button--outline.button--danger:hover:not(.button--disabled){background-color:var(--sc-color-danger-500);color:var(--sc-color-white)}.button--outline.button--danger:focus:not(.button--disabled){border-color:var(--sc-color-danger-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-color-danger-500)/var(--sc-focus-ring-alpha)}.button--outline.button--danger:active:not(.button--disabled){border-color:var(--sc-color-danger-700);background-color:var(--sc-color-danger-700);color:var(--sc-color-white)}.button--text{background-color:transparent;border-color:transparent;color:inherit}.button--text:hover:not(.button--disabled){background-color:transparent;border-color:transparent;color:var(--sc-color-gray-600)}.button--text:focus:not(.button--disabled){background-color:transparent;border-color:transparent;box-shadow:0}.button--text:active:not(.button--disabled){background-color:transparent;border-color:transparent;box-shadow:0}.button--text.button--caret.button--has-label{padding-right:var(--sc-spacing-xx-small)}.button--text.button--caret.button--has-label .button__label{padding:0 var(--sc-spacing-xx-small) !important}.button--link{background-color:transparent;border-color:transparent;box-shadow:none;color:var(--sc-button-link-color, var(--primary-background));transition:opacity var(--sc-input-transition, var(--sc-transition-medium)) ease;text-decoration:var(--sc-button-link-text-decoration, none)}.button--link.button--has-label.button--small .button__label,.button--link.button--has-label.button--medium .button__label,.button--link.button--has-label.button--large .button__label{padding:0}.button--link:hover:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.75}.button--link:focus:not(.button--disabled){background-color:transparent;border-color:transparent}.button--link:active:not(.button--disabled){background-color:transparent;border-color:transparent}.button--link.button--has-prefix:not(.button--text).button--small,.button--link.button--has-prefix:not(.button--text).button--medium,.button--link.button--has-prefix:not(.button--text).button--large{padding-left:0}.button--link.button--has-prefix:not(.button--text).button--small .button__label,.button--link.button--has-prefix:not(.button--text).button--medium .button__label,.button--link.button--has-prefix:not(.button--text).button--large .button__label{padding-left:var(--sc-spacing-xx-small)}.button--link.button--has-suffix:not(.button--text).button--small,.button--link.button--has-suffix:not(.button--text).button--medium,.button--link.button--has-suffix:not(.button--text).button--large{padding-right:0}.button--link.button--has-suffix:not(.button--text).button--small .button__label,.button--link.button--has-suffix:not(.button--text).button--medium .button__label,.button--link.button--has-suffix:not(.button--text).button--large .button__label{padding-right:var(--sc-spacing-xx-small)}.button--small{font-size:var(--sc-button-font-size-small);height:var(--sc-input-height-small);line-height:calc(var(--sc-input-height-small) - var(--sc-input-border-width) * 2);border-radius:var(--button-border-radius, var(--sc-input-border-radius-small))}.button--medium{font-size:var(--sc-button-font-size-medium);height:var(--sc-input-height-medium);line-height:calc(var(--sc-input-height-medium) - var(--sc-input-border-width) * 2);border-radius:var(--button-border-radius, var(--sc-input-border-radius-medium))}.button--large{font-size:var(--sc-button-font-size-large);height:var(--sc-input-height-large);line-height:calc(var(--sc-input-height-large) - var(--sc-input-border-width) * 2);border-radius:var(--button-border-radius, var(--sc-input-border-radius-large))}.button--full{display:block}.button--pill.button--small{border-radius:var(--sc-input-height-small)}.button--pill.button--medium{border-radius:var(--sc-input-height-medium)}.button--pill.button--large{border-radius:var(--sc-input-height-large)}.button--circle{padding-left:0;padding-right:0}.button--circle.button--small{width:var(--sc-input-height-small);border-radius:50%}.button--circle.button--medium{width:var(--sc-input-height-medium);border-radius:50%}.button--circle.button--large{width:var(--sc-input-height-large);border-radius:50%}.button--circle .button__prefix,.button--circle .button__suffix,.button--circle .button__caret{display:none}.button--caret .button__suffix{display:none}.button--caret .button__caret{display:flex;align-items:center}.button--caret .button__caret svg{width:1em;height:1em}.button--busy{position:relative;cursor:wait}.button--busy .button__prefix,.button--busy .button__label,.button--busy .button__suffix,.button--busy .button__caret{visibility:hidden}.button--busy *{pointer-events:none}.button--loading{position:relative;cursor:wait}.button--loading .button__prefix,.button--loading .button__label,.button--loading .button__suffix,.button--loading .button__caret{visibility:hidden}sc-spinner::part(base){--indicator-color:currentColor;--spinner-size:12px;position:absolute;top:calc(50% - var(--spinner-size) + var(--spinner-size) / 4);left:calc(50% - var(--spinner-size) + var(--spinner-size) / 4)}.button ::slotted(sc-badge){position:absolute;top:0;right:0;transform:translateY(-50%) translateX(50%);pointer-events:none}.button--has-label.button--small .button__label{padding:0 var(--sc-spacing-small)}.button--has-label.button--medium .button__label{padding:0 var(--sc-spacing-medium)}.button--has-label.button--large .button__label{padding:0 var(--sc-spacing-large)}.button--has-prefix:not(.button--text).button--small{padding-left:var(--sc-spacing-x-small)}.button--has-prefix:not(.button--text).button--small .button__label{padding-left:var(--sc-spacing-x-small)}.button--has-prefix:not(.button--text).button--medium{padding-left:var(--sc-spacing-small)}.button--has-prefix:not(.button--text).button--medium .button__label{padding-left:var(--sc-spacing-small)}.button--has-prefix:not(.button--text).button--large{padding-left:var(--sc-spacing-small)}.button--has-prefix:not(.button--text).button--large .button__label{padding-left:var(--sc-spacing-small)}.button--has-suffix.button--small,.button--caret.button--small{padding-right:var(--sc-spacing-x-small)}.button--has-suffix.button--small .button__label,.button--caret.button--small .button__label{padding-right:var(--sc-spacing-x-small)}.button--has-suffix.button--medium,.button--caret.button--medium{padding-right:var(--sc-spacing-small)}.button--has-suffix.button--medium .button__label,.button--caret.button--medium .button__label{padding-right:var(--sc-spacing-small)}.button--has-suffix.button--large,.button--caret.button--large{padding-right:var(--sc-spacing-small)}.button--has-suffix.button--large .button__label,.button--caret.button--large .button__label{padding-right:var(--sc-spacing-small)}:host(.sc-button-group__button--first) .button{border-top-right-radius:0;border-bottom-right-radius:0}:host(.sc-button-group__button--inner) .button{border-radius:0}:host(.sc-button-group__button--last) .button{border-top-left-radius:0;border-bottom-left-radius:0}:host(.sc-button-group__button:not(.sc-button-group__button--first)){margin-left:calc(-1 * var(--sc-input-border-width))}:host(.sc-button-group__button:not(.sc-button-group__button--focus,.sc-button-group__button--first,[type=default]):not(:hover,:active,:focus)) .button:after{content:\"\";position:absolute;top:0;left:0;bottom:0;border-left:solid 1px rgba(255, 255, 255, 0.2666666667);mix-blend-mode:lighten}:host(.sc-button-group__button--hover){z-index:1}:host(.sc-button-group__button--focus){z-index:2}@keyframes busy-animation{0%{background-position:200px 0}}.button--is-rtl.button--has-prefix.button--small,.button--is-rtl.button--has-prefix.button--medium,.button--is-rtl.button--has-prefix.button--large{padding-left:0}.button--is-rtl.button--has-prefix.button--small .button__label,.button--is-rtl.button--has-prefix.button--medium .button__label,.button--is-rtl.button--has-prefix.button--large .button__label{padding-left:0;padding-right:var(--sc-spacing-xx-small)}.button--is-rtl.button--has-suffix.button--small,.button--is-rtl.button--has-suffix.button--medium,.button--is-rtl.button--has-suffix.button--large{padding-right:0}.button--is-rtl.button--has-suffix.button--small .button__label,.button--is-rtl.button--has-suffix.button--medium .button__label,.button--is-rtl.button--has-suffix.button--large .button__label{padding-right:0;padding-left:var(--sc-spacing-xx-small)}"; |
| 7 | const ScButtonStyle0 = scButtonCss; |
| 8 | |
| 9 | const ScButton = class { |
| 10 | constructor(hostRef) { |
| 11 | registerInstance(this, hostRef); |
| 12 | this.scBlur = createEvent(this, "scBlur", 7); |
| 13 | this.scFocus = createEvent(this, "scFocus", 7); |
| 14 | this.hasFocus = false; |
| 15 | this.hasLabel = false; |
| 16 | this.hasPrefix = false; |
| 17 | this.hasSuffix = false; |
| 18 | this.type = 'default'; |
| 19 | this.size = 'medium'; |
| 20 | this.caret = false; |
| 21 | this.full = false; |
| 22 | this.disabled = false; |
| 23 | this.loading = false; |
| 24 | this.outline = false; |
| 25 | this.busy = false; |
| 26 | this.pill = false; |
| 27 | this.circle = false; |
| 28 | this.submit = false; |
| 29 | this.name = undefined; |
| 30 | this.value = undefined; |
| 31 | this.href = undefined; |
| 32 | this.target = undefined; |
| 33 | this.download = undefined; |
| 34 | this.autofocus = undefined; |
| 35 | } |
| 36 | componentWillLoad() { |
| 37 | this.handleSlotChange(); |
| 38 | } |
| 39 | /** Simulates a click on the button. */ |
| 40 | click() { |
| 41 | this.button.click(); |
| 42 | } |
| 43 | /** Sets focus on the button. */ |
| 44 | focus(options) { |
| 45 | this.button.focus(options); |
| 46 | } |
| 47 | /** Removes focus from the button. */ |
| 48 | blur() { |
| 49 | this.button.blur(); |
| 50 | } |
| 51 | handleSlotChange() { |
| 52 | this.hasLabel = !!this.button.children; |
| 53 | this.hasPrefix = !!this.button.querySelector('[slot="prefix"]'); |
| 54 | this.hasSuffix = !!this.button.querySelector('[slot="suffix"]'); |
| 55 | } |
| 56 | handleBlur() { |
| 57 | this.hasFocus = false; |
| 58 | this.scBlur.emit(); |
| 59 | } |
| 60 | handleFocus() { |
| 61 | this.hasFocus = true; |
| 62 | this.scFocus.emit(); |
| 63 | } |
| 64 | handleClick(event) { |
| 65 | if (this.disabled || this.loading || this.busy) { |
| 66 | event.preventDefault(); |
| 67 | event.stopPropagation(); |
| 68 | } |
| 69 | if (this.submit) { |
| 70 | this.submitForm(); |
| 71 | } |
| 72 | } |
| 73 | submitForm() { |
| 74 | var _a, _b; |
| 75 | const form = ((_b = (_a = this.button.closest('sc-form')) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('form')) || this.button.closest('form'); |
| 76 | // Calling form.submit() seems to bypass the submit event and constraint validation. Instead, we can inject a |
| 77 | // native submit button into the form, click it, then remove it to simulate a standard form submission. |
| 78 | const button = document.createElement('button'); |
| 79 | if (form) { |
| 80 | button.type = 'submit'; |
| 81 | button.style.position = 'absolute'; |
| 82 | button.style.width = '0'; |
| 83 | button.style.height = '0'; |
| 84 | button.style.clip = 'rect(0 0 0 0)'; |
| 85 | button.style.clipPath = 'inset(50%)'; |
| 86 | button.style.overflow = 'hidden'; |
| 87 | button.style.whiteSpace = 'nowrap'; |
| 88 | form.append(button); |
| 89 | button.click(); |
| 90 | button.remove(); |
| 91 | } |
| 92 | } |
| 93 | render() { |
| 94 | const Tag = this.href ? 'a' : 'button'; |
| 95 | const interior = (h(Fragment, { key: 'a215c69c501a67070b8134275fe4c04f63a1b766' }, h("span", { key: '14f2d8660fa655687640c1f4da89bca154c4a045', part: "prefix", class: "button__prefix" }, h("slot", { key: '70324c9b16e7aebf17afec217ef231dfb0a14cf5', onSlotchange: () => this.handleSlotChange(), name: "prefix" })), h("span", { key: 'c40bd504722c7f62ad4a5f0c4f89cbf265e22d4d', part: "label", class: "button__label" }, h("slot", { key: 'e6f368e35f244f8d940bbef3fd93d6cd8605eba8', onSlotchange: () => this.handleSlotChange() })), h("span", { key: 'b0e539bd93828a9e18754ccc2e596e5616d6c3d2', part: "suffix", class: "button__suffix" }, h("slot", { key: 'f10fdf286612e3675a054482f5e56cae5fa9ef48', onSlotchange: () => this.handleSlotChange(), name: "suffix" })), this.caret ? (h("span", { part: "caret", class: "button__caret" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polyline", { points: "6 9 12 15 18 9" })))) : (''), this.loading || this.busy ? h("sc-spinner", { exportparts: "base:spinner" }) : '')); |
| 96 | return (h(Tag, { key: 'ce822406954016315c1d9c0722bdce0bd3ffd5a7', part: "base", class: { |
| 97 | 'button': true, |
| 98 | [`button--${this.type}`]: !!this.type, |
| 99 | [`button--${this.size}`]: true, |
| 100 | 'button--caret': this.caret, |
| 101 | 'button--circle': this.circle, |
| 102 | 'button--disabled': this.disabled, |
| 103 | 'button--focused': this.hasFocus, |
| 104 | 'button--loading': this.loading, |
| 105 | 'button--busy': this.busy, |
| 106 | 'button--pill': this.pill, |
| 107 | 'button--standard': !this.outline, |
| 108 | 'button--outline': this.outline, |
| 109 | 'button--has-label': this.hasLabel, |
| 110 | 'button--has-prefix': this.hasPrefix, |
| 111 | 'button--has-suffix': this.hasSuffix, |
| 112 | 'button--is-rtl': isRtl(), |
| 113 | }, href: this.href, target: this.target, download: this.download, autoFocus: this.autofocus, rel: this.target ? 'noreferrer noopener' : undefined, role: "button", "aria-disabled": this.disabled ? 'true' : 'false', "aria-busy": this.busy || this.loading ? 'true' : 'false', tabindex: this.disabled ? '-1' : '0', disabled: this.disabled || this.busy, type: this.submit ? 'submit' : 'button', name: this.name, value: this.value, onBlur: () => this.handleBlur(), onFocus: () => this.handleFocus(), onClick: e => this.handleClick(e) }, interior)); |
| 114 | } |
| 115 | get button() { return getElement(this); } |
| 116 | }; |
| 117 | ScButton.style = ScButtonStyle0; |
| 118 | |
| 119 | const iconFiles = new Map(); |
| 120 | const requestIcon = (url) => { |
| 121 | if (iconFiles.has(url)) { |
| 122 | return iconFiles.get(url); |
| 123 | } |
| 124 | else { |
| 125 | const request = fetch(url).then(async (response) => { |
| 126 | if (response.ok) { |
| 127 | const div = document.createElement('div'); |
| 128 | div.innerHTML = await response.text(); |
| 129 | const svg = div.firstElementChild; |
| 130 | return { |
| 131 | ok: response.ok, |
| 132 | status: response.status, |
| 133 | svg: svg && svg.tagName.toLowerCase() === 'svg' ? svg.outerHTML : '', |
| 134 | }; |
| 135 | } |
| 136 | else { |
| 137 | return { |
| 138 | ok: response.ok, |
| 139 | status: response.status, |
| 140 | svg: null, |
| 141 | }; |
| 142 | } |
| 143 | }); |
| 144 | iconFiles.set(url, request); |
| 145 | return request; |
| 146 | } |
| 147 | }; |
| 148 | |
| 149 | const scIconCss = ":host{--width:1em;--height:1em;display:inline-block;width:var(--width);height:var(--height);contain:strict;box-sizing:content-box !important}.icon,svg{display:block;height:100%;width:100%;stroke-width:var(--sc-icon-stroke-width, 2px)}"; |
| 150 | const ScIconStyle0 = scIconCss; |
| 151 | |
| 152 | /** |
| 153 | * The icon's label used for accessibility. |
| 154 | */ |
| 155 | const LABEL_MAPPINGS = { |
| 156 | 'chevron-down': wp.i18n.__('Open', 'surecart'), |
| 157 | 'chevron-up': wp.i18n.__('Close', 'surecart'), |
| 158 | 'chevron-right': wp.i18n.__('Next', 'surecart'), |
| 159 | 'chevron-left': wp.i18n.__('Previous', 'surecart'), |
| 160 | 'arrow-right': wp.i18n.__('Next', 'surecart'), |
| 161 | 'arrow-left': wp.i18n.__('Previous', 'surecart'), |
| 162 | 'arrow-down': wp.i18n.__('Down', 'surecart'), |
| 163 | 'arrow-up': wp.i18n.__('Up', 'surecart'), |
| 164 | 'alert-circle': wp.i18n.__('Alert', 'surecart'), |
| 165 | }; |
| 166 | const parser = new DOMParser(); |
| 167 | const ScIcon = class { |
| 168 | constructor(hostRef) { |
| 169 | registerInstance(this, hostRef); |
| 170 | this.scLoad = createEvent(this, "scLoad", 7); |
| 171 | this.svg = ''; |
| 172 | this.name = undefined; |
| 173 | this.src = undefined; |
| 174 | this.label = undefined; |
| 175 | this.library = 'default'; |
| 176 | this.mutate = true; |
| 177 | } |
| 178 | /** @internal Fetches the icon and redraws it. Used to handle library registrations. */ |
| 179 | redraw() { |
| 180 | this.setIcon(); |
| 181 | } |
| 182 | componentWillLoad() { |
| 183 | // Get redrawn if our library is registered after we mount. |
| 184 | watchIcon(this); |
| 185 | this.setIcon(); |
| 186 | } |
| 187 | disconnectedCallback() { |
| 188 | unwatchIcon(this); |
| 189 | } |
| 190 | getLabel() { |
| 191 | let label = ''; |
| 192 | if (this.label) { |
| 193 | label = (LABEL_MAPPINGS === null || LABEL_MAPPINGS === void 0 ? void 0 : LABEL_MAPPINGS[this.label]) || this.label; |
| 194 | } |
| 195 | else if (this.name) { |
| 196 | label = ((LABEL_MAPPINGS === null || LABEL_MAPPINGS === void 0 ? void 0 : LABEL_MAPPINGS[this.name]) || this.name).replace(/-/g, ' '); |
| 197 | } |
| 198 | else if (this.src) { |
| 199 | label = this.src.replace(/.*\//, '').replace(/-/g, ' ').replace(/\.svg/i, ''); |
| 200 | } |
| 201 | return label; |
| 202 | } |
| 203 | async setIcon() { |
| 204 | const library = getIconLibrary(this.library); |
| 205 | const url = this.getUrl(); |
| 206 | if (url) { |
| 207 | try { |
| 208 | const file = await requestIcon(url); |
| 209 | if (url !== this.getUrl()) { |
| 210 | // If the url has changed while fetching the icon, ignore this request |
| 211 | return; |
| 212 | } |
| 213 | else if (file.ok) { |
| 214 | const doc = parser.parseFromString(file.svg, 'text/html'); |
| 215 | const svgEl = doc.body.querySelector('svg'); |
| 216 | if (svgEl) { |
| 217 | if (library && library.mutator && this.mutate) { |
| 218 | library.mutator(svgEl); |
| 219 | } |
| 220 | this.svg = svgEl.outerHTML; |
| 221 | // add part attribute to the svg element. |
| 222 | this.svg = this.svg.replace('<svg', '<svg part="svg" '); |
| 223 | this.scLoad.emit(); |
| 224 | } |
| 225 | else { |
| 226 | this.svg = ''; |
| 227 | console.error({ status: file === null || file === void 0 ? void 0 : file.status }); |
| 228 | } |
| 229 | } |
| 230 | else { |
| 231 | this.svg = ''; |
| 232 | console.error({ status: file === null || file === void 0 ? void 0 : file.status }); |
| 233 | } |
| 234 | } |
| 235 | catch { |
| 236 | console.error({ status: -1 }); |
| 237 | } |
| 238 | } |
| 239 | else if (this.svg) { |
| 240 | // If we can't resolve a URL and an icon was previously set, remove it |
| 241 | this.svg = ''; |
| 242 | } |
| 243 | } |
| 244 | getUrl() { |
| 245 | const library = getIconLibrary(this.library); |
| 246 | if (this.name && library) { |
| 247 | return library.resolver(this.name); |
| 248 | } |
| 249 | else { |
| 250 | return this.src; |
| 251 | } |
| 252 | } |
| 253 | render() { |
| 254 | return h("div", { key: '1d23f7f715fffdd7de869a74f9fad1e70c6f407b', part: "base", class: "icon", role: "img", "aria-label": this.getLabel(), innerHTML: this.svg }); |
| 255 | } |
| 256 | static get assetsDirs() { return ["icon-assets"]; } |
| 257 | static get watchers() { return { |
| 258 | "name": ["setIcon"], |
| 259 | "src": ["setIcon"], |
| 260 | "library": ["setIcon"] |
| 261 | }; } |
| 262 | }; |
| 263 | ScIcon.style = ScIconStyle0; |
| 264 | |
| 265 | const scProductLineItemCss = ":host {\n display: block;\n font-family: var(--sc-font-sans);\n --sc-product-line-item-line-gap: 6px;\n}\n\n.item {\n box-sizing: border-box;\n margin: 0px;\n min-width: 0px;\n display: flex;\n gap: var(--sc-spacing-large);\n justify-content: space-between;\n align-items: stretch;\n width: 100%;\n border-bottom: none;\n container-type: inline-size;\n}\n.item__text-container {\n box-sizing: border-box;\n margin: 0px;\n min-width: 0px;\n display: flex;\n flex-direction: column;\n gap: var(--sc-product-line-item-line-gap);\n justify-content: space-between;\n align-items: stretch;\n width: 100%;\n border-bottom: none;\n}\n.item__row {\n display: flex;\n gap: 18px;\n justify-content: space-between;\n align-items: stretch;\n width: 100%;\n}\n.item__row.stick-bottom {\n margin-top: auto;\n}\n.item__scratch-price {\n text-decoration: line-through;\n font-size: var(--sc-font-size-small);\n line-height: 1;\n color: var(--sc-input-help-text-color);\n white-space: nowrap;\n}\n.item__remove-container {\n display: flex;\n gap: 6px;\n align-items: center;\n line-height: 1;\n cursor: pointer;\n color: var(--sc-input-help-text-color);\n font-size: var(--sc-input-help-text-font-size-medium);\n}\n.item__add-review sc-button {\n --sc-input-border-radius-small: var(--sc-input-border-radius-medium);\n}\n.item--has-review {\n border-bottom: solid 1px var(--sc-input-border-color, var(--sc-input-border));\n padding-top: var(--sc-spacing-small);\n padding-bottom: var(--sc-spacing-large);\n}\n:host(:first-of-type) .item--has-review {\n padding-top: 0;\n}\n\n.item__text {\n box-sizing: border-box;\n margin: 0px;\n min-width: 0px;\n display: flex;\n gap: 6px;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n flex: 1 1 0%;\n}\n\n.item__text-details {\n display: grid;\n gap: var(--sc-product-line-item-line-gap);\n}\n\n.item__title {\n box-sizing: border-box;\n min-width: 0px;\n margin: 0;\n color: var(--sc-line-item-title-color, var(--sc-input-label-color));\n font-size: var(--sc-font-size-medium);\n font-weight: var(--sc-font-weight-semibold);\n line-height: 1;\n cursor: pointer;\n display: -webkit-box;\n display: -moz-box;\n -webkit-box-orient: vertical;\n -moz-box-orient: vertical;\n -webkit-line-clamp: 3;\n -moz-box-lines: 3;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item__suffix {\n flex: 1;\n box-sizing: border-box;\n margin: 0px;\n min-width: 0px;\n display: flex;\n flex-direction: column;\n -webkit-box-pack: start;\n justify-content: space-between;\n align-items: flex-end;\n min-width: 100px;\n margin-left: auto;\n align-self: center;\n}\n\n.product-line-item__removable .item__suffix {\n align-self: flex-start;\n}\n\n.product-line-item__editable .item__suffix {\n align-self: flex-start;\n}\n\n.product-line-item__purchasable-status {\n font-size: var(--sc-font-size-x-small);\n color: var(--sc-input-error-text-color);\n}\n\n.item__price {\n text-align: right;\n max-width: 100%;\n display: grid;\n gap: var(--sc-product-line-item-line-gap);\n}\n\n.item__description {\n color: var(--sc-price-label-color, var(--sc-input-help-text-color));\n font-size: var(--sc-price-label-font-size, var(--sc-input-help-text-font-size-medium));\n line-height: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n gap: var(--sc-product-line-item-line-gap);\n text-wrap: pretty;\n}\n.item__description:last-child {\n align-items: flex-end;\n text-align: right;\n}\n\n.item__image-placeholder {\n width: var(--sc-product-line-item-image-size, 65px);\n height: var(--sc-product-line-item-image-size, 65px);\n background-color: var(--sc-input-border-color, var(--sc-input-border));\n border-radius: 4px;\n flex: 0 0 var(--sc-product-line-item-image-size, 65px);\n}\n\n.item__image,\n.attachment-thumbnail {\n width: var(--sc-product-line-item-image-size, 65px);\n height: var(--sc-product-line-item-image-size, 65px);\n object-fit: cover;\n border-radius: 4px;\n border: solid 1px var(--sc-input-border-color, var(--sc-input-border));\n display: block;\n box-shadow: var(--sc-input-box-shadow);\n align-self: flex-start;\n}\n\n@container (max-width: 380px) {\n .item__image,\n .item__image-placeholder {\n display: var(--sc-product-line-item-mobile-image-display, none);\n }\n}\n.product__description {\n display: flex;\n gap: 0.5em;\n align-items: center;\n}\n\n.price {\n font-size: var(--sc-font-size-medium);\n font-weight: var(--sc-font-weight-semibold);\n color: var(--sc-input-label-color);\n line-height: 1;\n white-space: nowrap;\n display: flex;\n gap: 4px;\n align-items: baseline;\n}\n\n.price__description {\n font-size: var(--sc-font-size-small);\n line-height: 1;\n color: var(--sc-input-help-text-color);\n text-align: right;\n white-space: nowrap;\n}\n\n.item--is-rtl.price {\n text-align: right;\n}\n.item--is-rtl .item__price {\n text-align: left;\n}\n\n.base {\n display: grid;\n gap: var(--sc-spacing-x-small);\n}\n\n.fee__description {\n color: var(--sc-input-help-text-color);\n}\n\nsc-quantity-select::part(base) {\n box-shadow: none;\n background-color: transparent;\n}\n\nsc-quantity-select::part(base):not(:focus-within) {\n border-color: transparent;\n}\n\nsc-quantity-select::part(input),\nsc-quantity-select::part(plus),\nsc-quantity-select::part(minus) {\n background-color: transparent;\n}"; |
| 266 | const ScProductLineItemStyle0 = scProductLineItemCss; |
| 267 | |
| 268 | const ScProductLineItem = class { |
| 269 | constructor(hostRef) { |
| 270 | registerInstance(this, hostRef); |
| 271 | this.scUpdateQuantity = createEvent(this, "scUpdateQuantity", 3); |
| 272 | this.scRemove = createEvent(this, "scRemove", 3); |
| 273 | this.image = undefined; |
| 274 | this.name = undefined; |
| 275 | this.amount = undefined; |
| 276 | this.scratch = undefined; |
| 277 | this.displayAmount = undefined; |
| 278 | this.scratchDisplayAmount = undefined; |
| 279 | this.fees = undefined; |
| 280 | this.price = undefined; |
| 281 | this.variant = ''; |
| 282 | this.quantity = undefined; |
| 283 | this.interval = undefined; |
| 284 | this.trial = undefined; |
| 285 | this.removable = undefined; |
| 286 | this.editable = true; |
| 287 | this.max = undefined; |
| 288 | this.sku = ''; |
| 289 | this.purchasableStatus = undefined; |
| 290 | this.note = undefined; |
| 291 | this.reviewButtonLink = ''; |
| 292 | } |
| 293 | render() { |
| 294 | var _a, _b, _c; |
| 295 | const isImageFallback = ((_a = this.image) === null || _a === void 0 ? void 0 : _a.type) === 'fallback'; |
| 296 | return (h("div", { key: '93f98a7753094942de4387450eea0fb384f9f0ed', class: "base", part: "base" }, h("div", { key: '8a66cd703dc288922194403ed7c3320f4f11c565', part: "product-line-item", class: { |
| 297 | 'item': true, |
| 298 | 'item--has-image': !!((_b = this.image) === null || _b === void 0 ? void 0 : _b.src), |
| 299 | 'item--has-review': !!this.reviewButtonLink, |
| 300 | 'item--is-rtl': isRtl(), |
| 301 | 'product-line-item__editable': this.editable, |
| 302 | 'product-line-item__removable': this.removable, |
| 303 | } }, !!((_c = this.image) === null || _c === void 0 ? void 0 : _c.src) ? (h("img", { ...this.image, part: isImageFallback ? 'placeholder__image' : 'image', class: isImageFallback ? 'item__image-placeholder' : 'item__image' })) : (h("div", { class: "item__image-placeholder", part: "placeholder__image" })), h("div", { key: '46ba64b44a728e1086431e396e1a7eb058e8c541', class: "item__text-container" }, h("div", { key: '3ca6b3e0f81fc7d157a76c4ca82636d4fabcf940', class: "item__row" }, h("div", { key: '1b73c9473d0227dd38186534eb0d17520ddb6b6e', class: "item__title", part: "title" }, h("slot", { key: 'edffd6a363a6e42aa71f4daf03a9c85cbc31e198', name: "title" }, this.name)), h("div", { key: 'ec0e5336bde9dcef015746350e46b744cabd9ef8', class: "price", part: "price__amount" }, !!this.scratch && this.scratch !== this.amount && h("span", { key: '8ac8b6371b85ae3a95f2a567cf4456d4700d2b98', class: "item__scratch-price" }, this.scratch), this.amount, h("div", { key: 'c1411be20950c10620e949041d4773a3cebd1f7f', class: "price__description", part: "price__description" }, this.interval))), h("div", { key: '9de7bdea73947bec916705a31809c0d60f651361', class: "item__row" }, h("div", { key: '77de488554dd942ed3f1eefd9ba95f833ee6991f', class: "item__description", part: "description" }, this.variant && h("div", { key: '47cb94a056d9256e246caa2fdbcc0fe256424537' }, this.variant), this.price && h("div", { key: '45ae9363e8a2e7cb10aee854029b1c84ee7fee2b' }, this.price), this.sku && (h("div", { key: '9418f991f80432adb12949461ea9e03533762977' }, wp.i18n.__('SKU:', 'surecart'), " ", this.sku)), !!this.purchasableStatus && h("div", { key: '61831c69b0287662df9fd8c2653167ead38d592d' }, this.purchasableStatus), !!this.note && h("sc-product-line-item-note", { key: '27a62cbc9e463726032a88991ed953beeea8ca51', note: this.note })), h("div", { key: 'abae4e2eb4d52bbff723ed3bb9433b8a0187ea4a', class: "item__description", part: "trial-fees" }, !!this.trial && h("div", { key: 'f1abd62dfb4b962bee534c9c51805236f1b258fc' }, this.trial), (this.fees || []).map(fee => { |
| 304 | return (h("div", null, fee === null || fee === void 0 ? void 0 : |
| 305 | fee.display_amount, " ", fee === null || fee === void 0 ? void 0 : |
| 306 | fee.description)); |
| 307 | }))), h("div", { key: 'd96847e4671aaaaea10a82d1500f888f53fcfdcd', class: "item__row stick-bottom" }, this.editable ? (h("sc-quantity-select", { max: this.max || Infinity, exportparts: "base:quantity, minus:quantity__minus, minus-icon:quantity__minus-icon, plus:quantity__plus, plus-icon:quantity__plus-icon, input:quantity__input", clickEl: this.el, quantity: this.quantity, size: "small", onScChange: e => e.detail && this.scUpdateQuantity.emit(e.detail), "aria-label": |
| 308 | /** translators: %1$s: product name, %2$s: product price name */ |
| 309 | wp.i18n.sprintf(wp.i18n.__('Change Quantity - %1$s %2$s', 'surecart'), this.name, this.price), productName: this.name })) : (h("span", { class: "item__description", part: "static-quantity" }, wp.i18n.__('Qty:', 'surecart'), " ", this.quantity)), !!this.reviewButtonLink && (h("div", { key: 'de906087ec0e04a16fe5ae04f1e3f5eff8904e03', class: "item__add-review" }, h("sc-button", { key: '79d8fea7795cd326f1da7e19f487c2faf32a69c5', size: "small", href: this.reviewButtonLink, target: "_blank" }, wp.i18n.__('Review Product', 'surecart')))), !!this.removable && (h("div", { key: 'e62351437749abfada3384395af035f377d26f51', class: "item__remove-container", onClick: () => this.scRemove.emit(), onKeyDown: e => { |
| 310 | if (e.key === 'Enter') { |
| 311 | this.scRemove.emit(); |
| 312 | } |
| 313 | }, "aria-label": wp.i18n.sprintf(wp.i18n.__('Remove Item - %1$s %2$s', 'surecart'), this.name, this.amount), tabIndex: 0 }, h("sc-icon", { key: '0b4eab9c3d117e8e0165e7209d1092513d459d0f', exportparts: "base:remove-icon__base", class: "item__remove", name: "x" }), h("span", { key: 'a8c209d2ea2d30d10b7f74a34c8d7ca48bba4485', class: "item__remove-text" }, wp.i18n.__('Remove', 'surecart'))))))))); |
| 314 | } |
| 315 | get el() { return getElement(this); } |
| 316 | }; |
| 317 | ScProductLineItem.style = ScProductLineItemStyle0; |
| 318 | |
| 319 | const scProductLineItemNoteCss = ".line-item-note{display:flex;align-items:flex-start;gap:0.25em;min-height:1.5em}.line-item-note--clickable{cursor:pointer}.line-item-note__text{line-height:1.4;flex:1;display:-webkit-box;-webkit-box-orient:vertical;line-clamp:1;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;transition:all 0.2s}.line-item-note--is-expanded .line-item-note__text{display:block;line-clamp:unset;-webkit-line-clamp:unset;overflow:visible;text-overflow:unset}.line-item-note__toggle{background:none;border:none;color:var(--sc-color-gray-500);cursor:pointer;padding:0;align-self:flex-start;transition:opacity 0.2s ease;border-radius:var(--sc-border-radius-small)}.line-item-note__toggle:hover{opacity:0.8}.line-item-note__toggle:focus-visible{outline:2px solid var(--sc-color-primary-500);outline-offset:2px}.line-item-note__toggle:focus{outline:2px solid var(--sc-color-primary-500);outline-offset:2px}"; |
| 320 | const ScProductLineItemNoteStyle0 = scProductLineItemNoteCss; |
| 321 | |
| 322 | const ScProductLineItemNote = class { |
| 323 | constructor(hostRef) { |
| 324 | registerInstance(this, hostRef); |
| 325 | this.note = undefined; |
| 326 | this.expanded = false; |
| 327 | this.isOverflowing = false; |
| 328 | } |
| 329 | componentDidLoad() { |
| 330 | this.setupObservers(); |
| 331 | this.checkOverflow(); |
| 332 | } |
| 333 | disconnectedCallback() { |
| 334 | this.cleanupObservers(); |
| 335 | } |
| 336 | setupObservers() { |
| 337 | if (!this.noteEl) |
| 338 | return; |
| 339 | // ResizeObserver for container size changes |
| 340 | if (typeof ResizeObserver !== 'undefined') { |
| 341 | this.resizeObserver = new ResizeObserver(() => { |
| 342 | this.checkOverflow(); |
| 343 | }); |
| 344 | this.resizeObserver.observe(this.noteEl); |
| 345 | } |
| 346 | // MutationObserver for content changes |
| 347 | if (typeof MutationObserver !== 'undefined') { |
| 348 | this.mutationObserver = new MutationObserver(() => { |
| 349 | this.checkOverflow(); |
| 350 | }); |
| 351 | this.mutationObserver.observe(this.noteEl, { |
| 352 | characterData: true, |
| 353 | subtree: true, |
| 354 | childList: true, |
| 355 | }); |
| 356 | } |
| 357 | } |
| 358 | cleanupObservers() { |
| 359 | if (this.resizeObserver) { |
| 360 | this.resizeObserver.disconnect(); |
| 361 | this.resizeObserver = undefined; |
| 362 | } |
| 363 | if (this.mutationObserver) { |
| 364 | this.mutationObserver.disconnect(); |
| 365 | this.mutationObserver = undefined; |
| 366 | } |
| 367 | } |
| 368 | checkOverflow() { |
| 369 | if (!this.noteEl) |
| 370 | return; |
| 371 | this.isOverflowing = this.noteEl.scrollHeight > this.noteEl.clientHeight; |
| 372 | } |
| 373 | toggle() { |
| 374 | this.expanded = !this.expanded; |
| 375 | } |
| 376 | render() { |
| 377 | if (!this.note) |
| 378 | return null; |
| 379 | return (h("div", { class: "base", part: "base" }, h("div", { class: { |
| 380 | 'line-item-note': true, |
| 381 | 'line-item-note--is-expanded': this.expanded, |
| 382 | 'line-item-note--clickable': this.isOverflowing || this.expanded, |
| 383 | }, tabIndex: this.isOverflowing || this.expanded ? 0 : undefined, onClick: () => (this.isOverflowing || this.expanded) && this.toggle() }, h("div", { ref: el => (this.noteEl = el), class: "line-item-note__text" }, this.note), (this.isOverflowing || this.expanded) && (h("button", { class: "line-item-note__toggle", type: "button", onClick: e => { |
| 384 | e.stopPropagation(); |
| 385 | this.toggle(); |
| 386 | }, title: this.expanded ? wp.i18n.__('Collapse note', 'surecart') : wp.i18n.__('Expand note', 'surecart') }, h("slot", { name: "icon" }, h("sc-icon", { name: this.expanded ? 'chevron-up' : 'chevron-down', style: { width: '16px', height: '16px' } }))))))); |
| 387 | } |
| 388 | get el() { return getElement(this); } |
| 389 | }; |
| 390 | ScProductLineItemNote.style = ScProductLineItemNoteStyle0; |
| 391 | |
| 392 | const scQuantitySelectCss = ":host{--focus-ring:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary);--border-radius:var(--sc-quantity-border-radius, var(--sc-input-border-radius-small));display:inline-block}.input__control{text-align:center;line-height:1;border:none;flex:1;max-width:var(--sc-quantity-input-max-width, 35px);background-color:var(--sc-input-control-background-color, var(--sc-color-white));color:var(--sc-input-control-color, var(--sc-color-black));-moz-appearance:textfield}.input__control::-webkit-outer-spin-button,.input__control::-webkit-inner-spin-button{-webkit-appearance:none}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--sc-input-height-large) var(--sc-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--sc-input-color)}.input__control::placeholder{color:var(--sc-input-placeholder-color);user-select:none}.input__control:focus{outline:none}.quantity--trigger{cursor:pointer;white-space:nowrap}.quantity{position:relative;display:inline-block;width:var(--sc-quantity-select-width, 100px);height:var(--sc-quantity-control-height, var(--sc-input-height-small));display:flex;align-items:stretch;font-family:var(--sc-input-font-family);font-weight:var(--sc-input-font-weight);letter-spacing:var(--sc-input-letter-spacing);background-color:var(--sc-input-background-color);border:var(--sc-input-border);border-radius:var(--border-radius);vertical-align:middle;box-shadow:var(--sc-input-box-shadow);transition:var(--sc-input-transition, var(--sc-transition-medium)) color, var(--sc-input-transition, var(--sc-transition-medium)) border, var(--sc-input-transition, var(--sc-transition-medium)) box-shadow}.quantity:hover:not(.quantity--disabled){background-color:var(--sc-input-background-color-hover);border-color:var(--sc-input-border-color-hover)}.quantity:hover:not(.quantity--disabled) .quantity__control{color:var(--sc-input-color-hover)}.quantity.quantity--focused:not(.quantity--disabled){background-color:var(--sc-input-background-color-focus);border-color:var(--sc-input-border-color-focus);box-shadow:var(--focus-ring)}.quantity.quantity--focused:not(.quantity--disabled) .quantity__control{color:var(--sc-input-color-focus)}.quantity.quantity--disabled{background-color:var(--sc-input-background-color-disabled);border-color:var(--sc-input-border-color-disabled);opacity:0.5;cursor:not-allowed}.quantity.quantity--disabled .input__control{color:var(--sc-input-color-disabled)}.quantity.quantity--disabled .input__control::placeholder{color:var(--sc-input-placeholder-color-disabled)}.button__decrease,.button__increase{display:inline-block;text-align:center;vertical-align:middle;line-height:0;height:auto;top:1px;bottom:1px;width:32px;background:var(--sc-input-background-color);color:var(--sc-input-help-text-color);cursor:pointer;font-size:13px;user-select:none;border-width:0;padding:0}.button__decrease:hover:not(.button--disabled) .quantity__control,.button__increase:hover:not(.button--disabled) .quantity__control{color:var(--sc-input-color-hover)}.button__decrease.button--disabled,.button__increase.button--disabled{background-color:var(--sc-input-background-color-disabled);border-color:var(--sc-input-border-color-disabled);opacity:0.5;cursor:not-allowed}.quantity--small{width:var(--sc-quantity-select-width-small, 76px);height:var(--sc-quantity-control-height-small, 26px)}.quantity--small .button__decrease,.quantity--small .button__increase{width:24px;border:none}.quantity--small .input__control{max-width:24px}.button__decrease{left:1px;border-radius:var(--border-radius) 0 0 var(--border-radius);border-right:var(--sc-input-border)}.button__increase{right:1px;border-radius:0 var(--border-radius) var(--border-radius) 0;border-left:var(--sc-input-border)}.quantity--is-rtl .button__decrease{right:1px;border-left:var(--sc-input-border);border-right:0}.quantity--is-rtl .button__increase{left:1px;border-right:var(--sc-input-border);border-left:0}"; |
| 393 | const ScQuantitySelectStyle0 = scQuantitySelectCss; |
| 394 | |
| 395 | const ScQuantitySelect = class { |
| 396 | constructor(hostRef) { |
| 397 | registerInstance(this, hostRef); |
| 398 | this.scChange = createEvent(this, "scChange", 7); |
| 399 | this.scInput = createEvent(this, "scInput", 7); |
| 400 | this.scFocus = createEvent(this, "scFocus", 7); |
| 401 | this.scBlur = createEvent(this, "scBlur", 7); |
| 402 | this.clickEl = undefined; |
| 403 | this.disabled = undefined; |
| 404 | this.max = Infinity; |
| 405 | this.min = 1; |
| 406 | this.quantity = 0; |
| 407 | this.productName = 'Product'; |
| 408 | this.size = 'medium'; |
| 409 | this.hasFocus = undefined; |
| 410 | } |
| 411 | decrease() { |
| 412 | if (this.disabled) |
| 413 | return; |
| 414 | this.quantity = Math.max(this.quantity - 1, this.min); |
| 415 | // translators: %1$s is the product name |
| 416 | speak(wp.i18n.sprintf(wp.i18n.__('Decreased %1$s quantity by one', 'surecart'), this.productName), 'assertive'); |
| 417 | this.scChange.emit(this.quantity); |
| 418 | this.scInput.emit(this.quantity); |
| 419 | } |
| 420 | increase() { |
| 421 | if (this.disabled) |
| 422 | return; |
| 423 | this.quantity = Math.min(this.quantity + 1, this.max); |
| 424 | // translators: %1$s is the product name |
| 425 | speak(wp.i18n.sprintf(wp.i18n.__('Increased %1$s quantity by one', 'surecart'), this.productName), 'assertive'); |
| 426 | this.scChange.emit(this.quantity); |
| 427 | this.scInput.emit(this.quantity); |
| 428 | } |
| 429 | handleBlur() { |
| 430 | this.hasFocus = false; |
| 431 | this.scBlur.emit(); |
| 432 | } |
| 433 | handleFocus() { |
| 434 | this.hasFocus = true; |
| 435 | this.scFocus.emit(); |
| 436 | } |
| 437 | handleChange() { |
| 438 | this.quantity = parseInt(this.input.value) > this.max ? this.max : parseInt(this.input.value); |
| 439 | // translators: %1$s is the product name, %2$s is the quantity |
| 440 | speak(wp.i18n.sprintf(wp.i18n.__('Quantity of %1$s changed to %2$s', 'surecart'), this.productName, this.quantity), 'assertive'); |
| 441 | this.scChange.emit(this.quantity); |
| 442 | } |
| 443 | handleInput() { |
| 444 | this.quantity = parseInt(this.input.value); |
| 445 | this.scInput.emit(this.quantity); |
| 446 | } |
| 447 | render() { |
| 448 | return (h("div", { key: 'dd980cf2280eb7649eac9f593d967aef6b2f799a', part: "base", class: { |
| 449 | 'quantity': true, |
| 450 | // States |
| 451 | 'quantity--focused': this.hasFocus, |
| 452 | 'quantity--disabled': this.disabled, |
| 453 | 'quantity--is-rtl': isRtl(), |
| 454 | 'quantity--small': this.size === 'small', |
| 455 | } }, h("button", { key: '95112a89bebeaecd449ec44d70fce3063d1faee6', part: "minus", "aria-label": |
| 456 | /** translators: %1$s: product name */ |
| 457 | wp.i18n.sprintf(wp.i18n.__('Decrease %1$s quantity by one', 'surecart'), this.productName), "aria-disabled": this.disabled || (this.quantity <= this.min && this.min > 1), class: { 'button__decrease': true, 'button--disabled': this.quantity <= this.min && this.min > 1 }, onClick: () => this.quantity > this.min && this.decrease(), disabled: this.disabled || (this.quantity <= this.min && this.min > 1) }, h("sc-icon", { key: '731c1c8cd8afd3a8f863f04ee8634f096da62922', name: "minus", exportparts: "base:minus__icon" })), h("input", { key: 'cdf6af99f13594e26010e24ab3a4610c07cd77bc', part: "input", class: "input__control", ref: el => (this.input = el), step: "1", type: "number", max: this.max, min: this.min, value: this.quantity, disabled: this.disabled, autocomplete: "off", role: "spinbutton", "aria-valuemax": this.max, "aria-valuemin": this.min, "aria-valuenow": this.quantity, "aria-disabled": this.disabled, onChange: () => this.handleChange(), onInput: () => this.handleInput(), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), "aria-label": |
| 458 | /** translators: %1$s: product name */ |
| 459 | wp.i18n.sprintf(wp.i18n.__('Quantity input for %1$s product', 'surecart'), this.productName) }), h("button", { key: 'e7b1b1e1a41b6941d58119ae720cc3358453e153', part: "plus", "aria-label": |
| 460 | /** translators: %1$s: product name */ |
| 461 | wp.i18n.sprintf(wp.i18n.__('Increase %1$s quantity by one', 'surecart'), this.productName), class: { 'button__increase': true, 'button--disabled': this.quantity >= this.max }, onClick: () => this.quantity < this.max && this.increase(), "aria-disabled": this.disabled || this.quantity >= this.max, disabled: this.disabled || this.quantity >= this.max }, h("sc-icon", { key: 'b9fb517dbe592c6bfb22464363f99f2e32306b7a', name: "plus", exportparts: "base:plus__icon" })))); |
| 462 | } |
| 463 | get el() { return getElement(this); } |
| 464 | }; |
| 465 | ScQuantitySelect.style = ScQuantitySelectStyle0; |
| 466 | |
| 467 | const scSpinnerCss = ":host{--track-color:#0d131e20;--indicator-color:var(--sc-color-primary-500);--stroke-width:2px;--spinner-size:1em;display:inline-block}.spinner{display:inline-block;width:var(--spinner-size);height:var(--spinner-size);border-radius:50%;border:solid var(--stroke-width) var(--track-color);border-top-color:var(--indicator-color);border-right-color:var(--indicator-color);animation:1s linear infinite spin}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}"; |
| 468 | const ScSpinnerStyle0 = scSpinnerCss; |
| 469 | |
| 470 | const ScSpinner = class { |
| 471 | constructor(hostRef) { |
| 472 | registerInstance(this, hostRef); |
| 473 | } |
| 474 | render() { |
| 475 | return h("span", { key: '939d062fbb561d67bc0426348a24f5b51797e841', part: "base", class: "spinner", "aria-busy": "true", "aria-live": "polite" }); |
| 476 | } |
| 477 | }; |
| 478 | ScSpinner.style = ScSpinnerStyle0; |
| 479 | |
| 480 | export { ScButton as sc_button, ScIcon as sc_icon, ScProductLineItem as sc_product_line_item, ScProductLineItemNote as sc_product_line_item_note, ScQuantitySelect as sc_quantity_select, ScSpinner as sc_spinner }; |
| 481 | |
| 482 | //# sourceMappingURL=sc-button_6.entry.js.map |