@salla.sa/twilight-components 2.14.547 → 2.14.548
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-DFvIrFhD.js → filepond-CGA4aTUA.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CHg39XJj.js → filepond-plugin-file-poster-DyVz7vP9.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-kGmw5h8R.js → filepond-plugin-file-validate-size-CgzYDBcU.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CQSi2A-P.js → filepond-plugin-file-validate-type-Dx2CbMZ9.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-M4teY-We.js → filepond-plugin-image-edit-D3aTsFmD.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-gBQo0ofe.js → filepond-plugin-image-exif-orientation-BW3usWts.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DTmK0D_I.js → filepond-plugin-image-preview-Bb7_UNPY.js} +1 -1
- package/dist/cjs/{index-kkUUTdZu.js → index-BssNhL-x.js} +18 -14
- package/dist/cjs/{intlTelInput-CVOJSgbc.js → intlTelInput-B7QYiZ0d.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/cjs/{vanilla-picker-itKa_-k9.js → vanilla-picker-H1di5S1s.js} +1 -1
- package/dist/components/index.js +18 -14
- package/dist/esm/{filepond-VE8WYfjh.js → filepond-CXmbiROU.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-B5RS-KUm.js → filepond-plugin-file-poster-DrmkMK37.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BdgcVHpq.js → filepond-plugin-file-validate-size-fRXLDtKY.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-CmH44b6j.js → filepond-plugin-file-validate-type-9x4CtZKy.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-B-XPDjr0.js → filepond-plugin-image-edit-BTjvSjn9.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-ENeGT6qs.js → filepond-plugin-image-exif-orientation-CnSOx2Lm.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-D9RKj5A_.js → filepond-plugin-image-preview-Cy0Nd8Xr.js} +1 -1
- package/dist/esm/{index-RGVg6FYq.js → index-B64o_70M.js} +18 -14
- package/dist/esm/{intlTelInput-ClLDqBrH.js → intlTelInput-FF2eKbuC.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_2.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm/{vanilla-picker-DWGLcuLb.js → vanilla-picker-DMNociUd.js} +1 -1
- package/dist/twilight/{p-380b8531.entry.js → p-003648b5.entry.js} +1 -1
- package/dist/twilight/{p-cdad8f41.entry.js → p-04cc5898.entry.js} +1 -1
- package/dist/twilight/{p-C8tT82U5.js → p-0MyCcOKI.js} +1 -1
- package/dist/twilight/{p-cf488159.entry.js → p-0c7bdda5.entry.js} +1 -1
- package/dist/twilight/{p-dd507247.entry.js → p-0dfd760b.entry.js} +1 -1
- package/dist/twilight/{p-af39795f.entry.js → p-13978ff2.entry.js} +1 -1
- package/dist/twilight/{p-9fafcedd.entry.js → p-1485dedd.entry.js} +1 -1
- package/dist/twilight/{p-aea12a46.entry.js → p-1628c63c.entry.js} +1 -1
- package/dist/twilight/{p-d02688da.entry.js → p-177e9071.entry.js} +1 -1
- package/dist/twilight/{p-25c61f91.entry.js → p-19b03612.entry.js} +1 -1
- package/dist/twilight/{p-eefcc343.entry.js → p-1ad71324.entry.js} +1 -1
- package/dist/twilight/{p-2ae585c9.entry.js → p-1ce848ab.entry.js} +1 -1
- package/dist/twilight/{p-a9476bc3.entry.js → p-1edbb249.entry.js} +1 -1
- package/dist/twilight/{p-eab06e84.entry.js → p-233b9115.entry.js} +1 -1
- package/dist/twilight/{p-582d081e.entry.js → p-26c750c8.entry.js} +1 -1
- package/dist/twilight/{p-a32e7b62.entry.js → p-2ddabee9.entry.js} +1 -1
- package/dist/twilight/{p-6288de29.entry.js → p-2f64c3b3.entry.js} +1 -1
- package/dist/twilight/{p-01dee064.entry.js → p-309f771b.entry.js} +1 -1
- package/dist/twilight/{p-15fea4e9.entry.js → p-37b73a97.entry.js} +1 -1
- package/dist/twilight/{p-df8d9655.entry.js → p-3b7cbf05.entry.js} +1 -1
- package/dist/twilight/{p-d67b4059.entry.js → p-3eb853f9.entry.js} +1 -1
- package/dist/twilight/{p-5b6fd8b5.entry.js → p-3f460184.entry.js} +1 -1
- package/dist/twilight/{p-f8e6aaac.entry.js → p-40d4ccbb.entry.js} +1 -1
- package/dist/twilight/{p-08fa1534.entry.js → p-440687a4.entry.js} +1 -1
- package/dist/twilight/{p-2d2e29fe.entry.js → p-441ee14a.entry.js} +1 -1
- package/dist/twilight/{p-e9b2c4a5.entry.js → p-49c7dc56.entry.js} +1 -1
- package/dist/twilight/{p-1f7d964d.entry.js → p-522fb030.entry.js} +1 -1
- package/dist/twilight/{p-9a8a1b47.entry.js → p-52607d64.entry.js} +1 -1
- package/dist/twilight/{p-c6859fd3.entry.js → p-5273dbb2.entry.js} +1 -1
- package/dist/twilight/{p-ef10024f.entry.js → p-55cbacd7.entry.js} +1 -1
- package/dist/twilight/{p-6ec304ac.entry.js → p-569ad58b.entry.js} +1 -1
- package/dist/twilight/{p-fcc66e23.entry.js → p-56e553e4.entry.js} +1 -1
- package/dist/twilight/{p-b73e784e.entry.js → p-5ab11313.entry.js} +1 -1
- package/dist/twilight/{p-ad884517.entry.js → p-5c9e4502.entry.js} +1 -1
- package/dist/twilight/{p-4d12b009.entry.js → p-5f860460.entry.js} +1 -1
- package/dist/twilight/{p-4663f4da.entry.js → p-5f9b8ada.entry.js} +1 -1
- package/dist/twilight/{p-97a7d4cf.entry.js → p-602e632c.entry.js} +1 -1
- package/dist/twilight/{p-d6ea5ca7.entry.js → p-63a2ee05.entry.js} +1 -1
- package/dist/twilight/{p-b02c4a37.entry.js → p-63acbca7.entry.js} +1 -1
- package/dist/twilight/{p-66ca510c.entry.js → p-63cebaef.entry.js} +1 -1
- package/dist/twilight/{p-d835a5dd.entry.js → p-6451e759.entry.js} +1 -1
- package/dist/twilight/{p-0adea51c.entry.js → p-647832d9.entry.js} +1 -1
- package/dist/twilight/{p-45734a3b.entry.js → p-660a552a.entry.js} +1 -1
- package/dist/twilight/{p-a4e382fb.entry.js → p-66ece3d6.entry.js} +1 -1
- package/dist/twilight/{p-b164cb76.entry.js → p-6cd863b9.entry.js} +1 -1
- package/dist/twilight/{p-3713dbff.entry.js → p-74a1a32f.entry.js} +1 -1
- package/dist/twilight/{p-5819795e.entry.js → p-74c7cc02.entry.js} +1 -1
- package/dist/twilight/{p-459ce78a.entry.js → p-77fa0f9f.entry.js} +1 -1
- package/dist/twilight/{p-bbc8f3dd.entry.js → p-7c2a0a8b.entry.js} +1 -1
- package/dist/twilight/{p-b9a8f977.entry.js → p-7ce5c2cd.entry.js} +1 -1
- package/dist/twilight/{p-acd88f45.entry.js → p-7eca6506.entry.js} +1 -1
- package/dist/twilight/{p-03de43a3.entry.js → p-840dd411.entry.js} +1 -1
- package/dist/twilight/{p-541bf8ef.entry.js → p-87227eb2.entry.js} +1 -1
- package/dist/twilight/{p-aff22960.entry.js → p-897b8824.entry.js} +1 -1
- package/dist/twilight/{p-d46ef139.entry.js → p-8e293878.entry.js} +1 -1
- package/dist/twilight/{p-d03e6073.entry.js → p-8e631629.entry.js} +1 -1
- package/dist/twilight/{p-a8af052d.entry.js → p-923a35da.entry.js} +1 -1
- package/dist/twilight/{p-1cef7ea2.entry.js → p-971b8ff5.entry.js} +1 -1
- package/dist/twilight/{p-61bc2e97.entry.js → p-991fa4ad.entry.js} +1 -1
- package/dist/twilight/{p-067e7e32.entry.js → p-9a617c41.entry.js} +1 -1
- package/dist/twilight/{p-fd9d7372.entry.js → p-9ae25175.entry.js} +1 -1
- package/dist/twilight/{p-4e904400.entry.js → p-9dbf3ff4.entry.js} +1 -1
- package/dist/twilight/p-B64o_70M.js +5 -0
- package/dist/twilight/{p-DvDYmxRj.js → p-BK166pHQ.js} +1 -1
- package/dist/twilight/{p-DqHR-XSp.js → p-BcGXp0zm.js} +1 -1
- package/dist/twilight/{p-BFco-_Zl.js → p-Bh11vKua.js} +1 -1
- package/dist/twilight/{p-D42LpeIl.js → p-DBnECOny.js} +2 -2
- package/dist/twilight/{p-CkrRlrjj.js → p-DWqu98fW.js} +1 -1
- package/dist/twilight/{p-B_QMCKVO.js → p-DrJZdc5M.js} +1 -1
- package/dist/twilight/{p-BVamrCNR.js → p-GwasjFLA.js} +1 -1
- package/dist/twilight/{p-DT4oJGXj.js → p-UxfFm_QX.js} +1 -1
- package/dist/twilight/{p-a56851b0.entry.js → p-a0e8ca67.entry.js} +1 -1
- package/dist/twilight/{p-f93cab86.entry.js → p-a5199e7d.entry.js} +1 -1
- package/dist/twilight/{p-a0543daf.entry.js → p-a7fccb9c.entry.js} +1 -1
- package/dist/twilight/{p-9b791c53.entry.js → p-a867beee.entry.js} +1 -1
- package/dist/twilight/{p-696cb80c.entry.js → p-ace041b9.entry.js} +1 -1
- package/dist/twilight/{p-bc9585d0.entry.js → p-b0500232.entry.js} +1 -1
- package/dist/twilight/{p-70ef6b79.entry.js → p-b0a87a8d.entry.js} +1 -1
- package/dist/twilight/{p-93ac34c7.entry.js → p-b16264a3.entry.js} +1 -1
- package/dist/twilight/{p-c1be2f63.entry.js → p-b17c6f84.entry.js} +1 -1
- package/dist/twilight/{p-44595831.entry.js → p-b4d47e7c.entry.js} +1 -1
- package/dist/twilight/{p-3ffe6fa7.entry.js → p-b4f2f280.entry.js} +1 -1
- package/dist/twilight/{p-f8609873.entry.js → p-b4fda5f4.entry.js} +1 -1
- package/dist/twilight/{p-c353a96a.entry.js → p-b8cd26a7.entry.js} +1 -1
- package/dist/twilight/{p-bef1df8a.entry.js → p-ba32a9d2.entry.js} +1 -1
- package/dist/twilight/{p-d40958e4.entry.js → p-be916b5f.entry.js} +1 -1
- package/dist/twilight/{p-f5f420c4.entry.js → p-c26f1183.entry.js} +1 -1
- package/dist/twilight/{p-c7abf516.entry.js → p-c5d1b2e4.entry.js} +1 -1
- package/dist/twilight/{p-6971174e.entry.js → p-c8dae54b.entry.js} +1 -1
- package/dist/twilight/{p-1c40b212.entry.js → p-c9b1ad01.entry.js} +1 -1
- package/dist/twilight/{p-2ba184be.entry.js → p-cacf3c75.entry.js} +1 -1
- package/dist/twilight/{p-fd94973d.entry.js → p-cb02e6db.entry.js} +1 -1
- package/dist/twilight/{p-9340d397.entry.js → p-d0847af9.entry.js} +1 -1
- package/dist/twilight/{p-e304b491.entry.js → p-d7e4f0f8.entry.js} +1 -1
- package/dist/twilight/{p-d2c1f52b.entry.js → p-db4dc7cc.entry.js} +1 -1
- package/dist/twilight/{p-57516065.entry.js → p-e0f3e985.entry.js} +1 -1
- package/dist/twilight/{p-36359288.entry.js → p-e354292f.entry.js} +1 -1
- package/dist/twilight/{p-95519dae.entry.js → p-e4db462b.entry.js} +1 -1
- package/dist/twilight/{p-272857bd.entry.js → p-e826d3aa.entry.js} +1 -1
- package/dist/twilight/{p-3286bfc2.entry.js → p-f12f8db3.entry.js} +1 -1
- package/dist/twilight/{p-8f1e13c5.entry.js → p-f99550d8.entry.js} +1 -1
- package/dist/twilight/{p-6cc61a70.entry.js → p-fa0467a7.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-RGVg6FYq.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,H as r}from"./p-RGVg6FYq.js";var i;!function(e){e.PERCENTAGE="percentage",e.FIXED="fixed"}(i||(i={}));const o={staticIcons:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>'],staticColors:["#993018","#444444","#D18F36","#315F9C"]};class s{static findTierByIndex(e,t){return e.find((e=>e.index===t))||null}static findTierByName(e,t){return e.find((e=>e.tier_name===t))||null}static getTierNameByIndex(e,t){return this.findTierByIndex(e,t)?.tier_name}static findCurrentTierIndex(e,t){if(!t)return 0;for(let r=t.length-1;r>=0;r--)if(e>=t[r].threshold)return t[r].index;return 0}}const n=class{constructor(t){e(this,t),this.currentTierIndex=0,this.canRender=!1,this.isLoading=!1,this.handleTabClick=e=>{this.activeTabTier=e},salla.lang.onLoaded((()=>{this.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title"),this.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier"),this.discountText=salla.lang.get("blocks.tiered_offer.discount"),this.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}async componentWillLoad(){try{if(await salla.onReady(),!this.checkFeatureEnabled())return;if(!this.checkCartExists())return;this.isLoading=!0;const e=await this.fetchTieredOfferData();if(!e)return;this.initializeComponent(e)}catch(e){this.canRender=!1,salla.logger.warn("salla-tiered-offer:: ",e)}finally{this.isLoading=!1}}checkFeatureEnabled(){return salla.config.get("store.features")?.includes("tiered-offer")}checkCartExists(){return!!salla.storage.get("cart")?.summary?.count}validateCouponCompatibility(e,t){return!(t&&!e.details?.applied_with_coupon)}shouldHideForGuest(){return salla.config.isGuest()}shouldHideUntilThreshold(e,t){return!(!e?.hide_until_threshold||0!==t)}resolveTierName(e,t){return s.getTierNameByIndex(e,t)||""}async fetchTieredOfferData(){try{const{data:e}=await salla.api.cart.offers(),t=e.find((e=>"tiered_offer"===e.type));return t?this.validateCouponCompatibility(t,salla.storage.get("cart")?.coupon)?t:(this.canRender=!1,null):null}catch(e){throw e}}initializeComponent(e){this.apiOfferData=e,this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData),this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;const t=this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0);this.shouldHideForGuest()||this.shouldHideUntilThreshold(this.apiOfferData.details,t)?this.canRender=!1:(this.currentTierIndex=t,this.currentTier=this.resolveTierName(this.tieredOfferData.tiers,t),this.activeTabTier=this.currentTier||this.tieredOfferData.tiers[0]?.tier_name,this.canRender=!0)}componentDidLoad(){salla.event.on("cart::updated",(async e=>{const t=await this.fetchTieredOfferData();t&&(this.tieredOfferData?this.updateOfferValues(e,t):this.initializeComponent(t))}))}mapApiDataToTiers(e){const t=[...e.details.discounts].sort(((e,t)=>e.min_spend-t.min_spend)).map(((e,t)=>({name:e.name,tier_name:e.name,discount:e.type===i.PERCENTAGE?`${salla.helpers.number(e.value)}%`:salla.money(e.value),icon:o.staticIcons[t]||o.staticIcons[0],threshold:e.min_spend,text_color:o.staticColors[t],index:t+1})));return{current_tier:s.getTierNameByIndex(t,this.findCurrentTierIndex(e.details.current_value,t)),tiers:t}}findCurrentTierIndex(e,t=this.tieredOfferData?.tiers){return s.findCurrentTierIndex(e,t||[])}updateOfferValues(e,t){if(!t||!this.tieredOfferData)return;if(!t.details?.discounts?.length)return void(this.canRender=!1);if(!this.validateCouponCompatibility(t,e.coupon))return void(this.canRender=!1);if(this.shouldHideForGuest())return void(this.canRender=!1);const r=this.mapApiDataToTiers(t),i=this.findCurrentTierIndex(t.details?.current_value||0,r.tiers);if(this.shouldHideUntilThreshold(t.details,i))return void(this.canRender=!1);if(!1===t.details?.with_current_cart)return void(this.canRender=!0);this.apiOfferData=t,this.tieredOfferData=r,this.canRender=!0,this.currentTierIndex=i,this.currentTier=this.resolveTierName(r.tiers,i);const o=this.currentTier||r.tiers[0]?.tier_name;this.activeTabTier!==o&&(this.activeTabTier=o)}getLoadingSkeletonView(){return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-skeleton-wrapper"},t("div",{class:"s-tiered-offer-skeleton-title"},t("salla-skeleton",{height:"16px",width:"40%"})),t("div",{class:"s-tiered-offer-skeleton-subtitle"},t("salla-skeleton",{height:"20px",width:"60%"})),t("div",{class:"s-tiered-offer-skeleton-progress"},t("salla-skeleton",{height:"16px",width:"100%"})),t("div",{class:"s-tiered-offer-skeleton-tabs"},t("salla-skeleton",{height:"50px",width:"100%"})))))}getCurrentTierData(){return s.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]}getProgressWidth(){const e=this.tieredOfferData.tiers.length;return this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0)/e*100}calculateMilestonePosition(e,t){return 1===t?"calc(100% - 18px)":`${Math.max(2,Math.min(95,(e+1)/t*100-8/t))}%`}getMilestoneStyles(e,t,r){const i="rtl"===document.documentElement.dir,o=this.calculateMilestonePosition(t,r),s=e.name.length>6?"flex-end":"center";return{[i?"right":"left"]:o,alignItems:s,position:"absolute",transform:i?"translateX(50%)":"translateX(-50%)"}}getMilestoneIconStyles(e,t,r){return t?{color:e.text_color}:r?{color:"var(--color-primary)"}:{}}renderProgressBarBackground(e){return[t("div",{class:"s-tiered-offer-progress-bg"}),t("div",{class:"s-tiered-offer-progress-fill",style:{width:`${e}%`}})]}renderMilestoneIcon(e,r,i){const o=["s-tiered-offer-milestone-icon",r?"s-tiered-offer-milestone-active":"",i?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return t("div",{class:o,style:this.getMilestoneIconStyles(e,r,i)},t("span",{innerHTML:e.icon}))}renderMilestoneName(e,r){return t("div",{class:"s-tiered-offer-milestone-name"},r&&t("span",{style:{color:e.text_color}},e.name))}renderMilestones(e,r){return t("div",{class:"s-tiered-offer-milestones-wrapper"},t("div",{class:1===r?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones"},this.tieredOfferData.tiers.map(((i,o)=>{const s=e>=i.threshold,n=i.tier_name===this.currentTier;return t("div",{class:"s-tiered-offer-milestone",style:this.getMilestoneStyles(i,o,r)},this.renderMilestoneIcon(i,n,s),this.renderMilestoneName(i,n))}))))}renderProgressBar(){const e=this.getProgressWidth(),r=this.tieredOfferData.tiers.length,i=this.apiOfferData.details?.current_value||0;return t("div",{class:"s-tiered-offer-progress-container"},t("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(e),this.renderMilestones(i,r)))}renderTabs(){return t("div",{class:"s-tiered-offer-tabs-container"},t("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((e=>t("button",{class:"s-tiered-offer-tab-header "+(e.tier_name===this.activeTabTier?"s-tiered-offer-tab-active":""),onClick:()=>this.handleTabClick(e.tier_name)},t("span",null,e.name))))),t("div",{class:"s-tiered-offer-tab-content-wrapper"},(()=>{const e=s.findTierByName(this.tieredOfferData.tiers,this.activeTabTier);return e?t("div",{class:"s-tiered-offer-tab-content"},t("div",{class:"s-tiered-offer-tab-content-inner"},t("div",{class:"s-tiered-offer-discount-section"},t("p",{class:"s-tiered-offer-discount-title"},this.discountText," ",t("span",{innerHTML:e.discount})),t("p",{class:"s-tiered-offer-benefit-description"},this.benefitText," ",e.name)))):null})()))}render(){if(this.isLoading)return this.getLoadingSkeletonView();if(!this.canRender||!this.tieredOfferData)return null;const e=this.getCurrentTierData();return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-header"},t("div",{class:"s-tiered-offer-header-content"},t("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),this.currentTier&&t("div",{class:"s-tiered-offer-current-tier-name-wrapper"},t("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",t("span",{class:"s-tiered-offer-tier-name"},e.name)),t("span",{innerHTML:e.icon})))),this.renderProgressBar(),this.renderTabs()))}};n.style="/*!twlt*/.s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{transform:scaleX(-1)}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-tiered-offer-container{position:relative;margin-bottom:1.25rem;width:100%;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem;--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}@media (min-width: 640px){.s-tiered-offer-container{padding:1.25rem;padding-left:1.5rem;padding-right:1.5rem}}.s-tiered-offer-header{margin-bottom:1.5rem;display:flex;align-items:center;gap:0.75rem}.s-tiered-offer-header-content{flex:1 1 0%}.s-tiered-offer-current-tier-name-wrapper{display:flex;flex-direction:row;align-items:flex-start;gap:0.375rem}.s-tiered-offer-current-tier-name-wrapper h2{font-size:1.125rem;line-height:1.75rem}.s-tiered-offer-current-tier-name-wrapper svg{height:1.5rem;width:1.5rem}.s-tiered-offer-program-title{margin:0px;margin-bottom:0.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-tiered-offer-program-title h2{font-size:1.125rem;line-height:1.75rem}.s-tiered-offer-current-tier{margin:0px;margin-bottom:0.375rem;font-weight:700}.s-tiered-offer-tier-name{font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-tiered-offer-progress-container{margin-top:1.5rem;margin-bottom:1rem}.s-tiered-offer-progress-wrapper{position:relative}.s-tiered-offer-progress-bg{position:absolute;top:0.5rem;left:1rem;right:1rem;height:1rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-tiered-offer-progress-fill{position:absolute;top:0.5rem;height:1rem;border-radius:9999px;background-color:var(--color-primary);transition-property:all;transition-duration:500ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-tiered-offer-milestones-wrapper{display:flex;justify-content:flex-end}.s-tiered-offer-milestones{position:relative;display:flex;height:3rem;width:100%;align-items:center;justify-content:space-between}.s-tiered-offer-single-milestone-justify-end{position:relative;display:flex;height:3rem;width:100%;align-items:center;justify-content:flex-end}.s-tiered-offer-milestone{display:flex;flex-direction:column;align-items:center}.s-tiered-offer-milestone-icon{position:relative;z-index:10;margin-top:0px;display:flex;height:2.25rem;width:2.25rem;align-items:center;justify-content:center;border-radius:0.75rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-tiered-offer-milestone-icon span{display:flex;align-items:center;justify-content:center}.s-tiered-offer-milestone-icon svg{height:1.25rem;width:1.25rem;color:currentColor}.s-tiered-offer-milestone-name{margin-top:0.5rem;display:flex;height:1rem;align-items:center;justify-content:center}.s-tiered-offer-milestone-name span{text-align:center;font-size:0.875rem;line-height:1.25rem;font-weight:500}@media (min-width: 640px){.s-tiered-offer-milestone-name span{font-size:0.75rem;line-height:1rem}}.s-tiered-offer-tabs-container{margin-top:1rem}.s-tiered-offer-tab-headers{display:flex;gap:0.25rem;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.25rem}.s-tiered-offer-tab-header{display:flex;flex:1 1 0%;cursor:pointer;align-items:center;justify-content:center;border-radius:0.125rem;border-style:none;background-color:transparent;padding-top:0.625rem;padding-bottom:0.625rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}@media (min-width: 640px){.s-tiered-offer-tab-header{padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.75rem;line-height:1rem}}.s-tiered-offer-tab-active{border-radius:0.375rem;background-color:var(--color-primary);--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-tiered-offer-tab-active:hover{background-color:var(--color-primary-dark);opacity:0.8}.s-tiered-offer-tab-content-wrapper{border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;border-width:1px;border-top-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-tiered-offer-tab-content{padding-left:1.5rem;padding-right:1.5rem}@media (min-width: 640px){.s-tiered-offer-tab-content{padding-left:1rem;padding-right:1rem}}.s-tiered-offer-tab-content.tab-hidden{display:none}.s-tiered-offer-tab-content-inner{padding-top:1rem}.s-tiered-offer-discount-section{margin-bottom:0.5rem}.s-tiered-offer-discount-title{margin:0px;margin-bottom:0.5rem;font-size:1rem;line-height:1.5rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-tiered-offer-benefit-description{margin:0px;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-tiered-offer-skeleton-wrapper{padding:1.25rem}.s-tiered-offer-skeleton-title{margin-bottom:0.75rem}.s-tiered-offer-skeleton-subtitle{margin-bottom:1.5rem}.s-tiered-offer-skeleton-progress{margin-bottom:1.25rem}";export{n as salla_tiered_offer}
|
|
4
|
+
import{r as e,h as t,H as r}from"./p-B64o_70M.js";var i;!function(e){e.PERCENTAGE="percentage",e.FIXED="fixed"}(i||(i={}));const o={staticIcons:['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>'],staticColors:["#993018","#444444","#D18F36","#315F9C"]};class s{static findTierByIndex(e,t){return e.find((e=>e.index===t))||null}static findTierByName(e,t){return e.find((e=>e.tier_name===t))||null}static getTierNameByIndex(e,t){return this.findTierByIndex(e,t)?.tier_name}static findCurrentTierIndex(e,t){if(!t)return 0;for(let r=t.length-1;r>=0;r--)if(e>=t[r].threshold)return t[r].index;return 0}}const n=class{constructor(t){e(this,t),this.currentTierIndex=0,this.canRender=!1,this.isLoading=!1,this.handleTabClick=e=>{this.activeTabTier=e},salla.lang.onLoaded((()=>{this.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title"),this.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier"),this.discountText=salla.lang.get("blocks.tiered_offer.discount"),this.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}async componentWillLoad(){try{if(await salla.onReady(),!this.checkFeatureEnabled())return;if(!this.checkCartExists())return;this.isLoading=!0;const e=await this.fetchTieredOfferData();if(!e)return;this.initializeComponent(e)}catch(e){this.canRender=!1,salla.logger.warn("salla-tiered-offer:: ",e)}finally{this.isLoading=!1}}checkFeatureEnabled(){return salla.config.get("store.features")?.includes("tiered-offer")}checkCartExists(){return!!salla.storage.get("cart")?.summary?.count}validateCouponCompatibility(e,t){return!(t&&!e.details?.applied_with_coupon)}shouldHideForGuest(){return salla.config.isGuest()}shouldHideUntilThreshold(e,t){return!(!e?.hide_until_threshold||0!==t)}resolveTierName(e,t){return s.getTierNameByIndex(e,t)||""}async fetchTieredOfferData(){try{const{data:e}=await salla.api.cart.offers(),t=e.find((e=>"tiered_offer"===e.type));return t?this.validateCouponCompatibility(t,salla.storage.get("cart")?.coupon)?t:(this.canRender=!1,null):null}catch(e){throw e}}initializeComponent(e){this.apiOfferData=e,this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData),this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;const t=this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0);this.shouldHideForGuest()||this.shouldHideUntilThreshold(this.apiOfferData.details,t)?this.canRender=!1:(this.currentTierIndex=t,this.currentTier=this.resolveTierName(this.tieredOfferData.tiers,t),this.activeTabTier=this.currentTier||this.tieredOfferData.tiers[0]?.tier_name,this.canRender=!0)}componentDidLoad(){salla.event.on("cart::updated",(async e=>{const t=await this.fetchTieredOfferData();t&&(this.tieredOfferData?this.updateOfferValues(e,t):this.initializeComponent(t))}))}mapApiDataToTiers(e){const t=[...e.details.discounts].sort(((e,t)=>e.min_spend-t.min_spend)).map(((e,t)=>({name:e.name,tier_name:e.name,discount:e.type===i.PERCENTAGE?`${salla.helpers.number(e.value)}%`:salla.money(e.value),icon:o.staticIcons[t]||o.staticIcons[0],threshold:e.min_spend,text_color:o.staticColors[t],index:t+1})));return{current_tier:s.getTierNameByIndex(t,this.findCurrentTierIndex(e.details.current_value,t)),tiers:t}}findCurrentTierIndex(e,t=this.tieredOfferData?.tiers){return s.findCurrentTierIndex(e,t||[])}updateOfferValues(e,t){if(!t||!this.tieredOfferData)return;if(!t.details?.discounts?.length)return void(this.canRender=!1);if(!this.validateCouponCompatibility(t,e.coupon))return void(this.canRender=!1);if(this.shouldHideForGuest())return void(this.canRender=!1);const r=this.mapApiDataToTiers(t),i=this.findCurrentTierIndex(t.details?.current_value||0,r.tiers);if(this.shouldHideUntilThreshold(t.details,i))return void(this.canRender=!1);if(!1===t.details?.with_current_cart)return void(this.canRender=!0);this.apiOfferData=t,this.tieredOfferData=r,this.canRender=!0,this.currentTierIndex=i,this.currentTier=this.resolveTierName(r.tiers,i);const o=this.currentTier||r.tiers[0]?.tier_name;this.activeTabTier!==o&&(this.activeTabTier=o)}getLoadingSkeletonView(){return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-skeleton-wrapper"},t("div",{class:"s-tiered-offer-skeleton-title"},t("salla-skeleton",{height:"16px",width:"40%"})),t("div",{class:"s-tiered-offer-skeleton-subtitle"},t("salla-skeleton",{height:"20px",width:"60%"})),t("div",{class:"s-tiered-offer-skeleton-progress"},t("salla-skeleton",{height:"16px",width:"100%"})),t("div",{class:"s-tiered-offer-skeleton-tabs"},t("salla-skeleton",{height:"50px",width:"100%"})))))}getCurrentTierData(){return s.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]}getProgressWidth(){const e=this.tieredOfferData.tiers.length;return this.findCurrentTierIndex(this.apiOfferData.details?.current_value||0)/e*100}calculateMilestonePosition(e,t){return 1===t?"calc(100% - 18px)":`${Math.max(2,Math.min(95,(e+1)/t*100-8/t))}%`}getMilestoneStyles(e,t,r){const i="rtl"===document.documentElement.dir,o=this.calculateMilestonePosition(t,r),s=e.name.length>6?"flex-end":"center";return{[i?"right":"left"]:o,alignItems:s,position:"absolute",transform:i?"translateX(50%)":"translateX(-50%)"}}getMilestoneIconStyles(e,t,r){return t?{color:e.text_color}:r?{color:"var(--color-primary)"}:{}}renderProgressBarBackground(e){return[t("div",{class:"s-tiered-offer-progress-bg"}),t("div",{class:"s-tiered-offer-progress-fill",style:{width:`${e}%`}})]}renderMilestoneIcon(e,r,i){const o=["s-tiered-offer-milestone-icon",r?"s-tiered-offer-milestone-active":"",i?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return t("div",{class:o,style:this.getMilestoneIconStyles(e,r,i)},t("span",{innerHTML:e.icon}))}renderMilestoneName(e,r){return t("div",{class:"s-tiered-offer-milestone-name"},r&&t("span",{style:{color:e.text_color}},e.name))}renderMilestones(e,r){return t("div",{class:"s-tiered-offer-milestones-wrapper"},t("div",{class:1===r?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones"},this.tieredOfferData.tiers.map(((i,o)=>{const s=e>=i.threshold,n=i.tier_name===this.currentTier;return t("div",{class:"s-tiered-offer-milestone",style:this.getMilestoneStyles(i,o,r)},this.renderMilestoneIcon(i,n,s),this.renderMilestoneName(i,n))}))))}renderProgressBar(){const e=this.getProgressWidth(),r=this.tieredOfferData.tiers.length,i=this.apiOfferData.details?.current_value||0;return t("div",{class:"s-tiered-offer-progress-container"},t("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(e),this.renderMilestones(i,r)))}renderTabs(){return t("div",{class:"s-tiered-offer-tabs-container"},t("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((e=>t("button",{class:"s-tiered-offer-tab-header "+(e.tier_name===this.activeTabTier?"s-tiered-offer-tab-active":""),onClick:()=>this.handleTabClick(e.tier_name)},t("span",null,e.name))))),t("div",{class:"s-tiered-offer-tab-content-wrapper"},(()=>{const e=s.findTierByName(this.tieredOfferData.tiers,this.activeTabTier);return e?t("div",{class:"s-tiered-offer-tab-content"},t("div",{class:"s-tiered-offer-tab-content-inner"},t("div",{class:"s-tiered-offer-discount-section"},t("p",{class:"s-tiered-offer-discount-title"},this.discountText," ",t("span",{innerHTML:e.discount})),t("p",{class:"s-tiered-offer-benefit-description"},this.benefitText," ",e.name)))):null})()))}render(){if(this.isLoading)return this.getLoadingSkeletonView();if(!this.canRender||!this.tieredOfferData)return null;const e=this.getCurrentTierData();return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-header"},t("div",{class:"s-tiered-offer-header-content"},t("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),this.currentTier&&t("div",{class:"s-tiered-offer-current-tier-name-wrapper"},t("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",t("span",{class:"s-tiered-offer-tier-name"},e.name)),t("span",{innerHTML:e.icon})))),this.renderProgressBar(),this.renderTabs()))}};n.style="/*!twlt*/.s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{transform:scaleX(-1)}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-tiered-offer-container{position:relative;margin-bottom:1.25rem;width:100%;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem;--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}@media (min-width: 640px){.s-tiered-offer-container{padding:1.25rem;padding-left:1.5rem;padding-right:1.5rem}}.s-tiered-offer-header{margin-bottom:1.5rem;display:flex;align-items:center;gap:0.75rem}.s-tiered-offer-header-content{flex:1 1 0%}.s-tiered-offer-current-tier-name-wrapper{display:flex;flex-direction:row;align-items:flex-start;gap:0.375rem}.s-tiered-offer-current-tier-name-wrapper h2{font-size:1.125rem;line-height:1.75rem}.s-tiered-offer-current-tier-name-wrapper svg{height:1.5rem;width:1.5rem}.s-tiered-offer-program-title{margin:0px;margin-bottom:0.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-tiered-offer-program-title h2{font-size:1.125rem;line-height:1.75rem}.s-tiered-offer-current-tier{margin:0px;margin-bottom:0.375rem;font-weight:700}.s-tiered-offer-tier-name{font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-tiered-offer-progress-container{margin-top:1.5rem;margin-bottom:1rem}.s-tiered-offer-progress-wrapper{position:relative}.s-tiered-offer-progress-bg{position:absolute;top:0.5rem;left:1rem;right:1rem;height:1rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-tiered-offer-progress-fill{position:absolute;top:0.5rem;height:1rem;border-radius:9999px;background-color:var(--color-primary);transition-property:all;transition-duration:500ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-tiered-offer-milestones-wrapper{display:flex;justify-content:flex-end}.s-tiered-offer-milestones{position:relative;display:flex;height:3rem;width:100%;align-items:center;justify-content:space-between}.s-tiered-offer-single-milestone-justify-end{position:relative;display:flex;height:3rem;width:100%;align-items:center;justify-content:flex-end}.s-tiered-offer-milestone{display:flex;flex-direction:column;align-items:center}.s-tiered-offer-milestone-icon{position:relative;z-index:10;margin-top:0px;display:flex;height:2.25rem;width:2.25rem;align-items:center;justify-content:center;border-radius:0.75rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-tiered-offer-milestone-icon span{display:flex;align-items:center;justify-content:center}.s-tiered-offer-milestone-icon svg{height:1.25rem;width:1.25rem;color:currentColor}.s-tiered-offer-milestone-name{margin-top:0.5rem;display:flex;height:1rem;align-items:center;justify-content:center}.s-tiered-offer-milestone-name span{text-align:center;font-size:0.875rem;line-height:1.25rem;font-weight:500}@media (min-width: 640px){.s-tiered-offer-milestone-name span{font-size:0.75rem;line-height:1rem}}.s-tiered-offer-tabs-container{margin-top:1rem}.s-tiered-offer-tab-headers{display:flex;gap:0.25rem;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.25rem}.s-tiered-offer-tab-header{display:flex;flex:1 1 0%;cursor:pointer;align-items:center;justify-content:center;border-radius:0.125rem;border-style:none;background-color:transparent;padding-top:0.625rem;padding-bottom:0.625rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}@media (min-width: 640px){.s-tiered-offer-tab-header{padding-top:0.5rem;padding-bottom:0.5rem;font-size:0.75rem;line-height:1rem}}.s-tiered-offer-tab-active{border-radius:0.375rem;background-color:var(--color-primary);--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-tiered-offer-tab-active:hover{background-color:var(--color-primary-dark);opacity:0.8}.s-tiered-offer-tab-content-wrapper{border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;border-width:1px;border-top-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-tiered-offer-tab-content{padding-left:1.5rem;padding-right:1.5rem}@media (min-width: 640px){.s-tiered-offer-tab-content{padding-left:1rem;padding-right:1rem}}.s-tiered-offer-tab-content.tab-hidden{display:none}.s-tiered-offer-tab-content-inner{padding-top:1rem}.s-tiered-offer-discount-section{margin-bottom:0.5rem}.s-tiered-offer-discount-title{margin:0px;margin-bottom:0.5rem;font-size:1rem;line-height:1.5rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-tiered-offer-benefit-description{margin:0px;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-tiered-offer-skeleton-wrapper{padding:1.25rem}.s-tiered-offer-skeleton-title{margin-bottom:0.75rem}.s-tiered-offer-skeleton-subtitle{margin-bottom:1.5rem}.s-tiered-offer-skeleton-progress{margin-bottom:1.25rem}";export{n as salla_tiered_offer}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as o,H as r,a}from"./p-RGVg6FYq.js";const s=class{constructor(o){t(this,o),this.availableCoupons=[],this.cartTotal=0,this.cartTotalReady=!1,this.currentCoupon="",this.couponInputValue="",this.couponError="",this.isApplying=!1,this.appliedCoupons=[],this.multiCoupon=!1,this.isHandlingInternalError=!1,this.cartUpdatedHandler=t=>{this.syncCartTotal(t),(this.multiCoupon?Array.isArray(t?.coupons):t&&"coupon"in t)&&this.syncAppliedFromCart(t),this.couponError=""},this.couponAddedHandler=()=>{this.isApplying||this.isHandlingInternalError||this.refreshFromServer()},this.couponAdditionFailedHandler=t=>{this.isApplying||this.isHandlingInternalError||this.showCouponError(t?.message||salla.lang.get("pages.cart.coupon_application_error"))},this.couponDeletedHandler=()=>{this.isApplying||this.isHandlingInternalError||this.refreshFromServer()},this.onKeyUp=t=>{"Enter"===t.key&&this.couponButtonRef?.click(),this.couponError=""},this.onInput=t=>{this.couponInputValue=t.target.value}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.multiCoupon=!!salla.config.get("store.settings.cart.multi_coupon"),this.loadCouponsData(),this.seedFromStorage(),this.loadCartTotal(),this.setupCartEventListeners()}setupCartEventListeners(){salla.event.on("cart::updated",this.cartUpdatedHandler),salla.event.on("cart::coupon.added",this.couponAddedHandler),salla.event.on("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.on("cart::coupon.deleted",this.couponDeletedHandler)}disconnectedCallback(){salla.event.off("cart::updated",this.cartUpdatedHandler),salla.event.off("cart::coupon.added",this.couponAddedHandler),salla.event.off("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.off("cart::coupon.deleted",this.couponDeletedHandler)}async selectCoupon(t){const o=this.availableCoupons.find((o=>o.code===t));if(o){if(!this.isEligible(o))throw new Error("Coupon not eligible: minimum cart amount not met");try{await this.applyCoupon(t),this.host.dispatchEvent(new CustomEvent("salla::cart-coupons.coupon.selected",{detail:o,bubbles:!0}))}catch(t){throw t}}return o}async loadCouponsData(){try{const t=await salla.api.request("coupons"),o=t?.data,r=Array.isArray(o)?o:Array.isArray(o?.data)?o.data:[];this.availableCoupons=r}catch(t){console.warn("Failed to load coupons:",t),this.availableCoupons=[]}}async loadCartTotal(){await this.refreshFromServer()}seedFromStorage(){if(this.multiCoupon)return;const t=salla.storage.get("cart");t&&"object"==typeof t&&"coupon"in t&&this.applyCart(t),this.seedTotalsFromSummaryStorage()}seedTotalsFromSummaryStorage(){const t=salla.storage.get("cart.summary");t&&"object"==typeof t&&null!=t.sub_total&&(this.cartTotal=Number(t.sub_total),this.cartTotalReady=!0)}syncCartTotal(t){const o=t?.summary?.sub_total??t?.sub_total??t?.total;null!=o&&(this.cartTotal=Number(o),this.cartTotalReady=!0)}async refreshFromServer(){try{const t=await salla.cart.details(),o=t?.data?.cart??t?.data??t;if(o&&"object"==typeof o&&(Array.isArray(o.coupons)||"coupon"in o))return void this.applyCart(o)}catch(t){}const t=salla.storage.get("cart");t&&this.applyCart(t),this.seedTotalsFromSummaryStorage()}applyCart(t){this.syncCartTotal(t),this.syncAppliedFromCart(t)}syncAppliedFromCart(t){this.currentCoupon=t?.coupon||"",this.multiCoupon?this.appliedCoupons=Array.isArray(t?.coupons)?t.coupons.filter(Boolean):this.currentCoupon?[this.currentCoupon]:[]:(this.couponInputValue=this.currentCoupon,this.appliedCoupons=this.currentCoupon?[this.currentCoupon]:[])}async handleApplyClick(){if(this.isApplying)return;const t=this.couponInputValue.trim();if(t){this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(t),await this.refreshFromServer(),this.couponInputValue=""}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}async handleCouponButtonClick(){if(this.isApplying)return;const t=!!this.currentCoupon;if(t||this.couponInputValue.trim()){this.isApplying=!0,this.isHandlingInternalError=!0;try{t?await salla.cart.deleteCoupon():await salla.cart.addCoupon(this.couponInputValue.trim()),await this.refreshFromServer()}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}async removeCoupon(t){if(!this.isApplying){this.isApplying=!0,this.isHandlingInternalError=!0;try{this.multiCoupon?await salla.cart.deleteCoupon(t):await salla.cart.deleteCoupon(),await this.refreshFromServer()}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}showCouponError(t){this.couponError=t}handleCouponClick(t){this.applyCoupon(t.code,!1).catch((()=>{}))}async applyCoupon(t,o=!0){if(this.isApplying){if(o)throw new Error("Coupon application already in progress")}else{this.couponInputValue=t,this.couponError="",this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(t.trim()),await this.refreshFromServer(),this.multiCoupon&&(this.couponInputValue="")}catch(t){if(this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error")),o)throw t}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}formatMainAmount(t){if("percentage"===t.type)return`${salla.helpers.number("object"==typeof t.amount?t.amount.amount:t.amount)}%`;{const r="object"==typeof t.amount?t.amount:{amount:t.amount,currency:t.minimum_amount?.currency||salla.config.get("store.currency.code","SAR")};return o("span",{innerHTML:salla.money(r.amount,r.currency)})}}isEligible(t){return!this.cartTotalReady||!t.minimum_amount||this.cartTotal>=parseFloat(t.minimum_amount.amount)}renderCouponCard(t){const r=this.isEligible(t);return o("div",{class:"s-cart-coupons-slide-one-fourth swiper-slide"},o("div",{class:"s-cart-coupons-card "+(!r||this.isApplying?"s-cart-coupons-disabled":""),onClick:()=>r&&!this.isApplying&&this.handleCouponClick(t)},o("div",{class:"s-cart-coupons-top-section"},o("div",{class:"s-cart-coupons-discount-values"},o("div",{class:"s-cart-coupons-main-amount"},this.formatMainAmount(t)),t.free_shipping?o("div",{class:"s-cart-coupons-secondary-info"},"+ ",salla.lang.get("pages.cart.free_shipping")):t.maximum_amount&&o("div",{class:"s-cart-coupons-secondary-info"},salla.lang.get("pages.cart.up_to")," ",o("span",{innerHTML:salla.money(t.maximum_amount.amount,t.maximum_amount.currency)}))),o("div",{class:"s-cart-coupons-code"},t.code)),o("div",{class:"s-cart-coupons-divider"}),o("div",{class:"s-cart-coupons-bottom-section"},o("div",{class:"s-cart-coupons-terms"},null!=t.remaining_days&&o("div",{class:"s-cart-coupons-expiry "+(t.remaining_days<=3?"s-cart-coupons-expiry-warning":"")},0===t.remaining_days?salla.lang.get("pages.cart.expires_today"):`${salla.lang.get("pages.cart.expires_after")} ${t.remaining_days} ${salla.lang.get("pages.cart.day")}`),t.minimum_amount&&parseFloat(t.minimum_amount.amount)>0&&o("div",{class:"s-cart-coupons-minimum"},salla.lang.get("pages.cart.minimum")," ",o("span",{innerHTML:salla.money(t.minimum_amount.amount,t.minimum_amount.currency)}))),o("div",{class:"s-cart-coupons-action"},r?salla.lang.get("pages.cart.save_coupon"):salla.lang.get("pages.cart.coupon_not_compatible")))))}render(){return o(r,{key:"e3bed8f1f2019db5e1c5ca4280696933913e3081"},o("div",{key:"9c6a7c383394f9bd19107db9b8e76fd9129648e3",class:"s-cart-coupons-wrapper"},o("div",{key:"1e7f74969e709062c36aa19ff4ec27bde0bb10df",class:"s-cart-coupons-input-section"},o("label",{key:"f3bc1f4ffa9c8a64bee8af273597d6f8ff1f8fd0",htmlFor:"coupon-input",class:"s-cart-coupons-coupon-label"},salla.lang.get("pages.cart.have_coupon")),o("div",{key:"7abbdbd41cf6e65b6c08928bb10a68bfb2677d85",class:"s-cart-coupons-coupon-input-container"},this.multiCoupon?[o("input",{type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:this.isApplying,onInput:this.onInput,onKeyUp:this.onKeyUp,"aria-label":salla.lang.get("pages.cart.apply_coupon"),key:"coupon-input"}),o("salla-button",{ref:t=>this.couponButtonRef=t,class:"s-cart-coupons-coupon-button s-cart-coupons-coupon-button-apply",color:"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleApplyClick(),key:"apply-button"},o("span",null,salla.lang.get("pages.cart.save_coupon")))]:[o("input",{type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:!!this.currentCoupon||this.isApplying,onInput:this.onInput,onKeyUp:this.onKeyUp,"aria-label":salla.lang.get("pages.cart.apply_coupon"),key:"coupon-input"}),o("salla-button",{ref:t=>this.couponButtonRef=t,class:"s-cart-coupons-coupon-button "+(this.currentCoupon?"s-cart-coupons-coupon-button-remove":"s-cart-coupons-coupon-button-apply"),color:this.currentCoupon?"danger":"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleCouponButtonClick(),key:"apply-button"},this.currentCoupon?o("i",{class:"sicon-cancel"}):o("span",null,salla.lang.get("pages.cart.save_coupon")))]),this.couponError&&o("span",{key:"6c259fbca7a2a3c2ece3d4c335707c833be5f8d6",class:"s-cart-coupons-coupon-error"},this.couponError),this.multiCoupon&&this.appliedCoupons.length>0&&o("div",{key:"87335fd875279e97fc7a02c9f3519af51a953a7b",class:"s-cart-coupons-applied-list"},this.appliedCoupons.map((t=>o("div",{class:"s-cart-coupons-applied-item",key:t},o("span",{class:"s-cart-coupons-applied-code"},t),o("button",{type:"button",class:"s-cart-coupons-applied-remove","aria-label":`${salla.lang.get("pages.cart.delete")} ${t}`,disabled:this.isApplying,onClick:()=>this.removeCoupon(t)},o("i",{class:"sicon-cancel"}))))))),this.availableCoupons&&this.availableCoupons.length>0&&o("salla-slider",{key:"86c665d3135fa8bc393c4b7ad9daca3ce87bed50",type:"carousel",showControls:!1,class:"s-cart-coupons-slider"},o("div",{key:"45ddccd7e0c5d38e9b98f42862a6d64f6040c942",slot:"items"},this.availableCoupons.map((t=>this.renderCouponCard(t)))))))}get host(){return a(this)}};s.style='/*!twlt*/.s-cart-coupons-applied-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}.s-cart-coupons-applied-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;border-inline-start:3px solid #10b981}.s-cart-coupons-applied-code{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:#111827}.s-cart-coupons-applied-code::before{content:"";width:7px;height:7px;border-radius:9999px;background:#10b981}.s-cart-coupons-applied-remove{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:#ef4444;background:transparent;border:0;border-radius:9999px;cursor:pointer;transition:background-color 0.15s ease, color 0.15s ease}.s-cart-coupons-applied-remove:hover{background:#fef2f2}.s-cart-coupons-applied-remove:disabled{opacity:0.5;cursor:not-allowed}.visible{visibility:visible}.fixed{position:fixed}.shrink{flex-shrink:1}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-cart-coupons-wrapper{display:block;width:100%;padding-top:1.25rem;padding-bottom:1.25rem}.s-cart-coupons-input-section{margin-bottom:0.625rem}.s-cart-coupons-coupon-label{margin-bottom:0.625rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-coupon-input-container{position:relative;display:flex;align-items:stretch}.s-cart-coupons-coupon-input-container .form-input{height:auto;flex:1 1 0%}.s-cart-coupons-coupon-input-container .form-input:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;border-right-width:0px}.s-cart-coupons-coupon-input-container .form-input:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important;border-left-width:0px}.s-cart-coupons-coupon-input-container .form-input:focus{position:relative;z-index:10}.s-cart-coupons-coupon-button:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px;border-bottom-left-radius:0px}.s-cart-coupons-coupon-button:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-cart-coupons-coupon-button-remove:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-remove:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem !important;border-bottom-right-radius:0.5rem !important;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem !important;border-bottom-left-radius:0.5rem !important;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-error{margin-top:0.5rem;display:block;font-size:10px;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-cart-coupons-slider{width:100%;overflow:hidden;padding-left:0.375rem;padding-right:0.375rem}.s-cart-coupons-card{position:relative;cursor:pointer;overflow:hidden;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-coupons-card:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:hover{--tw-translate-y:-0.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-cart-coupons-disabled{cursor:not-allowed;opacity:0.5}.s-cart-coupons-disabled:hover{transform:none;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-cart-coupons-top-section{display:flex;height:60px;flex-direction:row;align-items:center;justify-content:space-between;border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1rem;padding-bottom:1rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-discount-values{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-discount-values .s-cart-coupons-main-amount{display:flex;align-items:center;gap:0.25rem;white-space:nowrap;font-size:1.25rem;line-height:1.75rem;font-weight:900;line-height:1;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.s-cart-coupons-discount-values .s-cart-coupons-secondary-info{margin:0px;font-size:10px;line-height:1rem}.s-cart-coupons-code{font-size:10px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-coupons-divider{position:relative;z-index:10;margin:0px;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-cart-coupons-bottom-section{display:flex;min-height:44px;flex-direction:row;align-items:center;justify-content:space-between;border-bottom-right-radius:0.75rem;border-bottom-left-radius:0.75rem;border-width:1px;border-top-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-terms{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-terms .s-cart-coupons-expiry{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-minimum{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-expiry.s-cart-coupons-expiry-warning{font-weight:500;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-cart-coupons-action{cursor:pointer;white-space:nowrap;border-width:0px;background-color:transparent;padding:0px;font-size:9px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-cart-coupons-action:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.s-cart-coupons-slide-one-fourth{width:calc(75% - 10px);min-width:200px !important;padding-left:5px !important;padding-right:5px !important;padding-top:2px !important}@media (min-width: 1024px){.s-cart-coupons-slide-one-fourth{width:calc(40% - 10px) !important}}.s-cart-coupons-card:before{pointer-events:none;position:absolute;right:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):before{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:after{pointer-events:none;position:absolute;left:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):after{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-coupon-input-container .form-input.s-coupon-input-error{--tw-shadow:0 0 0 3px rgba(239,68,68,0.1) !important;--tw-shadow-colored:0 0 0 3px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}';export{s as salla_cart_coupons}
|
|
4
|
+
import{r as t,h as o,H as r,a}from"./p-B64o_70M.js";const s=class{constructor(o){t(this,o),this.availableCoupons=[],this.cartTotal=0,this.cartTotalReady=!1,this.currentCoupon="",this.couponInputValue="",this.couponError="",this.isApplying=!1,this.appliedCoupons=[],this.multiCoupon=!1,this.isHandlingInternalError=!1,this.cartUpdatedHandler=t=>{this.syncCartTotal(t),(this.multiCoupon?Array.isArray(t?.coupons):t&&"coupon"in t)&&this.syncAppliedFromCart(t),this.couponError=""},this.couponAddedHandler=()=>{this.isApplying||this.isHandlingInternalError||this.refreshFromServer()},this.couponAdditionFailedHandler=t=>{this.isApplying||this.isHandlingInternalError||this.showCouponError(t?.message||salla.lang.get("pages.cart.coupon_application_error"))},this.couponDeletedHandler=()=>{this.isApplying||this.isHandlingInternalError||this.refreshFromServer()},this.onKeyUp=t=>{"Enter"===t.key&&this.couponButtonRef?.click(),this.couponError=""},this.onInput=t=>{this.couponInputValue=t.target.value}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.multiCoupon=!!salla.config.get("store.settings.cart.multi_coupon"),this.loadCouponsData(),this.seedFromStorage(),this.loadCartTotal(),this.setupCartEventListeners()}setupCartEventListeners(){salla.event.on("cart::updated",this.cartUpdatedHandler),salla.event.on("cart::coupon.added",this.couponAddedHandler),salla.event.on("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.on("cart::coupon.deleted",this.couponDeletedHandler)}disconnectedCallback(){salla.event.off("cart::updated",this.cartUpdatedHandler),salla.event.off("cart::coupon.added",this.couponAddedHandler),salla.event.off("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.off("cart::coupon.deleted",this.couponDeletedHandler)}async selectCoupon(t){const o=this.availableCoupons.find((o=>o.code===t));if(o){if(!this.isEligible(o))throw new Error("Coupon not eligible: minimum cart amount not met");try{await this.applyCoupon(t),this.host.dispatchEvent(new CustomEvent("salla::cart-coupons.coupon.selected",{detail:o,bubbles:!0}))}catch(t){throw t}}return o}async loadCouponsData(){try{const t=await salla.api.request("coupons"),o=t?.data,r=Array.isArray(o)?o:Array.isArray(o?.data)?o.data:[];this.availableCoupons=r}catch(t){console.warn("Failed to load coupons:",t),this.availableCoupons=[]}}async loadCartTotal(){await this.refreshFromServer()}seedFromStorage(){if(this.multiCoupon)return;const t=salla.storage.get("cart");t&&"object"==typeof t&&"coupon"in t&&this.applyCart(t),this.seedTotalsFromSummaryStorage()}seedTotalsFromSummaryStorage(){const t=salla.storage.get("cart.summary");t&&"object"==typeof t&&null!=t.sub_total&&(this.cartTotal=Number(t.sub_total),this.cartTotalReady=!0)}syncCartTotal(t){const o=t?.summary?.sub_total??t?.sub_total??t?.total;null!=o&&(this.cartTotal=Number(o),this.cartTotalReady=!0)}async refreshFromServer(){try{const t=await salla.cart.details(),o=t?.data?.cart??t?.data??t;if(o&&"object"==typeof o&&(Array.isArray(o.coupons)||"coupon"in o))return void this.applyCart(o)}catch(t){}const t=salla.storage.get("cart");t&&this.applyCart(t),this.seedTotalsFromSummaryStorage()}applyCart(t){this.syncCartTotal(t),this.syncAppliedFromCart(t)}syncAppliedFromCart(t){this.currentCoupon=t?.coupon||"",this.multiCoupon?this.appliedCoupons=Array.isArray(t?.coupons)?t.coupons.filter(Boolean):this.currentCoupon?[this.currentCoupon]:[]:(this.couponInputValue=this.currentCoupon,this.appliedCoupons=this.currentCoupon?[this.currentCoupon]:[])}async handleApplyClick(){if(this.isApplying)return;const t=this.couponInputValue.trim();if(t){this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(t),await this.refreshFromServer(),this.couponInputValue=""}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}async handleCouponButtonClick(){if(this.isApplying)return;const t=!!this.currentCoupon;if(t||this.couponInputValue.trim()){this.isApplying=!0,this.isHandlingInternalError=!0;try{t?await salla.cart.deleteCoupon():await salla.cart.addCoupon(this.couponInputValue.trim()),await this.refreshFromServer()}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}async removeCoupon(t){if(!this.isApplying){this.isApplying=!0,this.isHandlingInternalError=!0;try{this.multiCoupon?await salla.cart.deleteCoupon(t):await salla.cart.deleteCoupon(),await this.refreshFromServer()}catch(t){this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}showCouponError(t){this.couponError=t}handleCouponClick(t){this.applyCoupon(t.code,!1).catch((()=>{}))}async applyCoupon(t,o=!0){if(this.isApplying){if(o)throw new Error("Coupon application already in progress")}else{this.couponInputValue=t,this.couponError="",this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(t.trim()),await this.refreshFromServer(),this.multiCoupon&&(this.couponInputValue="")}catch(t){if(this.showCouponError(t.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error")),o)throw t}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}formatMainAmount(t){if("percentage"===t.type)return`${salla.helpers.number("object"==typeof t.amount?t.amount.amount:t.amount)}%`;{const r="object"==typeof t.amount?t.amount:{amount:t.amount,currency:t.minimum_amount?.currency||salla.config.get("store.currency.code","SAR")};return o("span",{innerHTML:salla.money(r.amount,r.currency)})}}isEligible(t){return!this.cartTotalReady||!t.minimum_amount||this.cartTotal>=parseFloat(t.minimum_amount.amount)}renderCouponCard(t){const r=this.isEligible(t);return o("div",{class:"s-cart-coupons-slide-one-fourth swiper-slide"},o("div",{class:"s-cart-coupons-card "+(!r||this.isApplying?"s-cart-coupons-disabled":""),onClick:()=>r&&!this.isApplying&&this.handleCouponClick(t)},o("div",{class:"s-cart-coupons-top-section"},o("div",{class:"s-cart-coupons-discount-values"},o("div",{class:"s-cart-coupons-main-amount"},this.formatMainAmount(t)),t.free_shipping?o("div",{class:"s-cart-coupons-secondary-info"},"+ ",salla.lang.get("pages.cart.free_shipping")):t.maximum_amount&&o("div",{class:"s-cart-coupons-secondary-info"},salla.lang.get("pages.cart.up_to")," ",o("span",{innerHTML:salla.money(t.maximum_amount.amount,t.maximum_amount.currency)}))),o("div",{class:"s-cart-coupons-code"},t.code)),o("div",{class:"s-cart-coupons-divider"}),o("div",{class:"s-cart-coupons-bottom-section"},o("div",{class:"s-cart-coupons-terms"},null!=t.remaining_days&&o("div",{class:"s-cart-coupons-expiry "+(t.remaining_days<=3?"s-cart-coupons-expiry-warning":"")},0===t.remaining_days?salla.lang.get("pages.cart.expires_today"):`${salla.lang.get("pages.cart.expires_after")} ${t.remaining_days} ${salla.lang.get("pages.cart.day")}`),t.minimum_amount&&parseFloat(t.minimum_amount.amount)>0&&o("div",{class:"s-cart-coupons-minimum"},salla.lang.get("pages.cart.minimum")," ",o("span",{innerHTML:salla.money(t.minimum_amount.amount,t.minimum_amount.currency)}))),o("div",{class:"s-cart-coupons-action"},r?salla.lang.get("pages.cart.save_coupon"):salla.lang.get("pages.cart.coupon_not_compatible")))))}render(){return o(r,{key:"e3bed8f1f2019db5e1c5ca4280696933913e3081"},o("div",{key:"9c6a7c383394f9bd19107db9b8e76fd9129648e3",class:"s-cart-coupons-wrapper"},o("div",{key:"1e7f74969e709062c36aa19ff4ec27bde0bb10df",class:"s-cart-coupons-input-section"},o("label",{key:"f3bc1f4ffa9c8a64bee8af273597d6f8ff1f8fd0",htmlFor:"coupon-input",class:"s-cart-coupons-coupon-label"},salla.lang.get("pages.cart.have_coupon")),o("div",{key:"7abbdbd41cf6e65b6c08928bb10a68bfb2677d85",class:"s-cart-coupons-coupon-input-container"},this.multiCoupon?[o("input",{type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:this.isApplying,onInput:this.onInput,onKeyUp:this.onKeyUp,"aria-label":salla.lang.get("pages.cart.apply_coupon"),key:"coupon-input"}),o("salla-button",{ref:t=>this.couponButtonRef=t,class:"s-cart-coupons-coupon-button s-cart-coupons-coupon-button-apply",color:"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleApplyClick(),key:"apply-button"},o("span",null,salla.lang.get("pages.cart.save_coupon")))]:[o("input",{type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:!!this.currentCoupon||this.isApplying,onInput:this.onInput,onKeyUp:this.onKeyUp,"aria-label":salla.lang.get("pages.cart.apply_coupon"),key:"coupon-input"}),o("salla-button",{ref:t=>this.couponButtonRef=t,class:"s-cart-coupons-coupon-button "+(this.currentCoupon?"s-cart-coupons-coupon-button-remove":"s-cart-coupons-coupon-button-apply"),color:this.currentCoupon?"danger":"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleCouponButtonClick(),key:"apply-button"},this.currentCoupon?o("i",{class:"sicon-cancel"}):o("span",null,salla.lang.get("pages.cart.save_coupon")))]),this.couponError&&o("span",{key:"6c259fbca7a2a3c2ece3d4c335707c833be5f8d6",class:"s-cart-coupons-coupon-error"},this.couponError),this.multiCoupon&&this.appliedCoupons.length>0&&o("div",{key:"87335fd875279e97fc7a02c9f3519af51a953a7b",class:"s-cart-coupons-applied-list"},this.appliedCoupons.map((t=>o("div",{class:"s-cart-coupons-applied-item",key:t},o("span",{class:"s-cart-coupons-applied-code"},t),o("button",{type:"button",class:"s-cart-coupons-applied-remove","aria-label":`${salla.lang.get("pages.cart.delete")} ${t}`,disabled:this.isApplying,onClick:()=>this.removeCoupon(t)},o("i",{class:"sicon-cancel"}))))))),this.availableCoupons&&this.availableCoupons.length>0&&o("salla-slider",{key:"86c665d3135fa8bc393c4b7ad9daca3ce87bed50",type:"carousel",showControls:!1,class:"s-cart-coupons-slider"},o("div",{key:"45ddccd7e0c5d38e9b98f42862a6d64f6040c942",slot:"items"},this.availableCoupons.map((t=>this.renderCouponCard(t)))))))}get host(){return a(this)}};s.style='/*!twlt*/.s-cart-coupons-applied-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}.s-cart-coupons-applied-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;border-inline-start:3px solid #10b981}.s-cart-coupons-applied-code{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:#111827}.s-cart-coupons-applied-code::before{content:"";width:7px;height:7px;border-radius:9999px;background:#10b981}.s-cart-coupons-applied-remove{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:#ef4444;background:transparent;border:0;border-radius:9999px;cursor:pointer;transition:background-color 0.15s ease, color 0.15s ease}.s-cart-coupons-applied-remove:hover{background:#fef2f2}.s-cart-coupons-applied-remove:disabled{opacity:0.5;cursor:not-allowed}.visible{visibility:visible}.fixed{position:fixed}.shrink{flex-shrink:1}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-cart-coupons-wrapper{display:block;width:100%;padding-top:1.25rem;padding-bottom:1.25rem}.s-cart-coupons-input-section{margin-bottom:0.625rem}.s-cart-coupons-coupon-label{margin-bottom:0.625rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-coupon-input-container{position:relative;display:flex;align-items:stretch}.s-cart-coupons-coupon-input-container .form-input{height:auto;flex:1 1 0%}.s-cart-coupons-coupon-input-container .form-input:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;border-right-width:0px}.s-cart-coupons-coupon-input-container .form-input:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important;border-left-width:0px}.s-cart-coupons-coupon-input-container .form-input:focus{position:relative;z-index:10}.s-cart-coupons-coupon-button:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px;border-bottom-left-radius:0px}.s-cart-coupons-coupon-button:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-cart-coupons-coupon-button-remove:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-remove:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir="ltr"],[dir="ltr"] *){border-top-right-radius:0.5rem !important;border-bottom-right-radius:0.5rem !important;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir="rtl"],[dir="rtl"] *){border-top-left-radius:0.5rem !important;border-bottom-left-radius:0.5rem !important;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-error{margin-top:0.5rem;display:block;font-size:10px;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-cart-coupons-slider{width:100%;overflow:hidden;padding-left:0.375rem;padding-right:0.375rem}.s-cart-coupons-card{position:relative;cursor:pointer;overflow:hidden;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-coupons-card:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:hover{--tw-translate-y:-0.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-cart-coupons-disabled{cursor:not-allowed;opacity:0.5}.s-cart-coupons-disabled:hover{transform:none;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-cart-coupons-top-section{display:flex;height:60px;flex-direction:row;align-items:center;justify-content:space-between;border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1rem;padding-bottom:1rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-discount-values{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-discount-values .s-cart-coupons-main-amount{display:flex;align-items:center;gap:0.25rem;white-space:nowrap;font-size:1.25rem;line-height:1.75rem;font-weight:900;line-height:1;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.s-cart-coupons-discount-values .s-cart-coupons-secondary-info{margin:0px;font-size:10px;line-height:1rem}.s-cart-coupons-code{font-size:10px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-coupons-divider{position:relative;z-index:10;margin:0px;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-cart-coupons-bottom-section{display:flex;min-height:44px;flex-direction:row;align-items:center;justify-content:space-between;border-bottom-right-radius:0.75rem;border-bottom-left-radius:0.75rem;border-width:1px;border-top-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-terms{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-terms .s-cart-coupons-expiry{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-minimum{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-expiry.s-cart-coupons-expiry-warning{font-weight:500;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-cart-coupons-action{cursor:pointer;white-space:nowrap;border-width:0px;background-color:transparent;padding:0px;font-size:9px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-cart-coupons-action:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.s-cart-coupons-slide-one-fourth{width:calc(75% - 10px);min-width:200px !important;padding-left:5px !important;padding-right:5px !important;padding-top:2px !important}@media (min-width: 1024px){.s-cart-coupons-slide-one-fourth{width:calc(40% - 10px) !important}}.s-cart-coupons-card:before{pointer-events:none;position:absolute;right:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):before{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:after{pointer-events:none;position:absolute;left:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):after{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-coupon-input-container .form-input.s-coupon-input-error{--tw-shadow:0 0 0 3px rgba(239,68,68,0.1) !important;--tw-shadow-colored:0 0 0 3px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}';export{s as salla_cart_coupons}
|