@salla.sa/twilight-components 2.14.600 → 2.14.602
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-DVmQ7csb.js → filepond-BK4nhdz7.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DMSpzTqe.js → filepond-plugin-file-poster-4fVYpLZW.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-D_ptbEIk.js → filepond-plugin-file-validate-size-DD9PE5ii.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-0yFqmcfN.js → filepond-plugin-file-validate-type-Cu_qPxNI.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-E7sYYAWn.js → filepond-plugin-image-edit-DyMzowg7.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DbrEAQoa.js → filepond-plugin-image-exif-orientation-CWPAUAU8.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DO_tpcG1.js → filepond-plugin-image-preview-B4owEvvd.js} +1 -1
- package/dist/cjs/{index-Bw9ZFzBG.js → index-B6jjt620.js} +7 -7
- package/dist/cjs/{intlTelInput-DxYQu3W_.js → intlTelInput-DDKMbp8H.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 +3 -3
- 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-applied-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +11 -7
- 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_3.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 +11 -7
- 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-gift-card-redeem_2.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_3.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.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-card.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 +2 -2
- 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-product-card.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-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-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/salla-wishlist-summary.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/cjs/{vanilla-picker-CcRVM0uV.js → vanilla-picker-B1VZNdgU.js} +1 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.css +78 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +1 -1
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +10 -6
- package/dist/collection/components/salla-contacts/salla-contacts.js +10 -6
- package/dist/collection/components/salla-products-list/salla-products-list.js +1 -1
- package/dist/components/index.js +7 -7
- package/dist/components/salla-add-product-button2.js +2 -2
- package/dist/components/salla-apps-icons.js +10 -6
- package/dist/components/salla-contacts.js +10 -6
- package/dist/components/salla-products-list2.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{filepond-CMtCLsIc.js → filepond-JvmG37vk.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-OjOFU-jw.js → filepond-plugin-file-poster-jGgGDPBM.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BFCz_KY1.js → filepond-plugin-file-validate-size-CMRY86Hb.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-BaPcxnrR.js → filepond-plugin-file-validate-type-BJT5d0-6.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-D_tfXMIg.js → filepond-plugin-image-edit-CUgUFKuf.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DS2k4xg9.js → filepond-plugin-image-exif-orientation-Cpgh0C9U.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-B6bJkNCH.js → filepond-plugin-image-preview-Cdldbg2V.js} +1 -1
- package/dist/esm/{index-C670SYee.js → index-DSmjBlMI.js} +7 -7
- package/dist/esm/{intlTelInput-BUOxAmWZ.js → intlTelInput-rTSCUyZk.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 +3 -3
- 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-applied-filters.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +11 -7
- 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_3.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 +11 -7
- 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-gift-card-redeem_2.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_3.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.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-card.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +2 -2
- 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-product-card.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-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-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/salla-wishlist-summary.entry.js +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm/{vanilla-picker-vQxevRSA.js → vanilla-picker-iVAMFnQg.js} +1 -1
- package/dist/twilight/{p-6b28397a.entry.js → p-10173408.entry.js} +1 -1
- package/dist/twilight/{p-b3f0b7e3.entry.js → p-106e4c00.entry.js} +1 -1
- package/dist/twilight/{p-dff87ddc.entry.js → p-13cdee67.entry.js} +1 -1
- package/dist/twilight/{p-0c6290e0.entry.js → p-13f398a0.entry.js} +1 -1
- package/dist/twilight/{p-6eb365f3.entry.js → p-16e37ff7.entry.js} +1 -1
- package/dist/twilight/{p-e4ba8208.entry.js → p-1705a030.entry.js} +1 -1
- package/dist/twilight/{p-ef9567bd.entry.js → p-198cb6fe.entry.js} +1 -1
- package/dist/twilight/{p-f5f448b7.entry.js → p-1bca57e0.entry.js} +1 -1
- package/dist/twilight/{p-6cfb6628.entry.js → p-1e48420f.entry.js} +1 -1
- package/dist/twilight/{p-73125aab.entry.js → p-1f694f35.entry.js} +1 -1
- package/dist/twilight/{p-ea82cbb3.entry.js → p-2291b12c.entry.js} +1 -1
- package/dist/twilight/{p-c6f677aa.entry.js → p-22d7efce.entry.js} +1 -1
- package/dist/twilight/{p-9ace9fc5.entry.js → p-269aaae6.entry.js} +1 -1
- package/dist/twilight/{p-e506fbee.entry.js → p-285e3792.entry.js} +1 -1
- package/dist/twilight/{p-19d9b193.entry.js → p-2b7369bc.entry.js} +1 -1
- package/dist/twilight/{p-dfcb0978.entry.js → p-2b82b2e7.entry.js} +1 -1
- package/dist/twilight/{p-d923ecda.entry.js → p-2f54b8ca.entry.js} +1 -1
- package/dist/twilight/p-2f7cced2.entry.js +4 -0
- package/dist/twilight/{p-8359286c.entry.js → p-31e7a0e2.entry.js} +1 -1
- package/dist/twilight/p-3204cc50.entry.js +4 -0
- package/dist/twilight/{p-161fce7a.entry.js → p-3337976e.entry.js} +1 -1
- package/dist/twilight/{p-3eface57.entry.js → p-35c24f9b.entry.js} +1 -1
- package/dist/twilight/{p-b7f5a180.entry.js → p-3ab4a96c.entry.js} +1 -1
- package/dist/twilight/{p-167a9c58.entry.js → p-3af02a2e.entry.js} +1 -1
- package/dist/twilight/{p-07453f6c.entry.js → p-3deaae96.entry.js} +1 -1
- package/dist/twilight/{p-0116fc35.entry.js → p-3efbe99f.entry.js} +1 -1
- package/dist/twilight/{p-0f68e660.entry.js → p-41f562d9.entry.js} +1 -1
- package/dist/twilight/{p-ce8bdea8.entry.js → p-454937a1.entry.js} +1 -1
- package/dist/twilight/{p-b40466ae.entry.js → p-49f793f5.entry.js} +1 -1
- package/dist/twilight/{p-e1b853b2.entry.js → p-49f9674d.entry.js} +1 -1
- package/dist/twilight/{p-2a865b0b.entry.js → p-4b398039.entry.js} +1 -1
- package/dist/twilight/{p-1f3d5e3e.entry.js → p-4deebc34.entry.js} +1 -1
- package/dist/twilight/{p-84ed92e9.entry.js → p-5350007d.entry.js} +1 -1
- package/dist/twilight/{p-4ea3a8a1.entry.js → p-553c0419.entry.js} +1 -1
- package/dist/twilight/{p-0cb5d9c6.entry.js → p-5541311c.entry.js} +1 -1
- package/dist/twilight/{p-1c7999c9.entry.js → p-5b34d547.entry.js} +1 -1
- package/dist/twilight/{p-f106d1e8.entry.js → p-5d6f3385.entry.js} +1 -1
- package/dist/twilight/{p-4678b6d7.entry.js → p-62385bca.entry.js} +1 -1
- package/dist/twilight/p-6a575b79.entry.js +4 -0
- package/dist/twilight/{p-ea4e6f55.entry.js → p-7171284c.entry.js} +1 -1
- package/dist/twilight/{p-27d94a42.entry.js → p-74adaa0a.entry.js} +1 -1
- package/dist/twilight/{p-57768c0e.entry.js → p-754b773f.entry.js} +1 -1
- package/dist/twilight/{p-b6674eab.entry.js → p-755531d0.entry.js} +1 -1
- package/dist/twilight/{p-744c8337.entry.js → p-7907b963.entry.js} +1 -1
- package/dist/twilight/{p-e80bc0ce.entry.js → p-79d531c1.entry.js} +1 -1
- package/dist/twilight/{p-2bb95112.entry.js → p-7a3de00e.entry.js} +1 -1
- package/dist/twilight/{p-6bacaa30.entry.js → p-7e65d967.entry.js} +1 -1
- package/dist/twilight/{p-56d064c0.entry.js → p-816f0d62.entry.js} +1 -1
- package/dist/twilight/{p-57ddfcfe.entry.js → p-819ecf01.entry.js} +1 -1
- package/dist/twilight/{p-b124899c.entry.js → p-8980ba07.entry.js} +1 -1
- package/dist/twilight/{p-19b7fccb.entry.js → p-8db01cb9.entry.js} +1 -1
- package/dist/twilight/{p-f37cc89b.entry.js → p-8ef1dc8b.entry.js} +1 -1
- package/dist/twilight/{p-d2b41e2d.entry.js → p-91d886a4.entry.js} +1 -1
- package/dist/twilight/{p-b13efdf9.entry.js → p-92465380.entry.js} +1 -1
- package/dist/twilight/{p-34ab84e2.entry.js → p-94f05c52.entry.js} +1 -1
- package/dist/twilight/{p-cba57487.entry.js → p-9bc7224c.entry.js} +1 -1
- package/dist/twilight/{p-321022f5.entry.js → p-9cfeb373.entry.js} +1 -1
- package/dist/twilight/{p-afc17688.entry.js → p-9d458fdc.entry.js} +1 -1
- package/dist/twilight/{p-r8T0WY8a.js → p-BZAgJW8r.js} +1 -1
- package/dist/twilight/{p-CcijNXaY.js → p-BdfIR_j4.js} +1 -1
- package/dist/twilight/{p-DEtbzT0x.js → p-CiToackV.js} +1 -1
- package/dist/twilight/{p-D33qIToB.js → p-Cwn0juZl.js} +1 -1
- package/dist/twilight/{p-DOJsGUE-.js → p-DAZtN2b7.js} +1 -1
- package/dist/twilight/{p-DIJHCILO.js → p-DKq36Aat.js} +1 -1
- package/dist/twilight/p-DSmjBlMI.js +5 -0
- package/dist/twilight/{p-Kqe2HSSB.js → p-H48_b2OW.js} +1 -1
- package/dist/twilight/{p-9ab10a2f.entry.js → p-abb407ae.entry.js} +1 -1
- package/dist/twilight/{p-1c75de1e.entry.js → p-ae44240d.entry.js} +1 -1
- package/dist/twilight/{p-da9b84ee.entry.js → p-ae6681e4.entry.js} +1 -1
- package/dist/twilight/{p-316be8a7.entry.js → p-b0c853b7.entry.js} +1 -1
- package/dist/twilight/{p-82430d31.entry.js → p-b0fee4fb.entry.js} +1 -1
- package/dist/twilight/{p-660271f5.entry.js → p-b3b5b350.entry.js} +1 -1
- package/dist/twilight/{p-62690afe.entry.js → p-b753bcde.entry.js} +1 -1
- package/dist/twilight/{p-2df4e63a.entry.js → p-b76f6fc0.entry.js} +1 -1
- package/dist/twilight/{p-3b45e21a.entry.js → p-b8dcc622.entry.js} +1 -1
- package/dist/twilight/{p-8f1789f7.entry.js → p-b90cc416.entry.js} +1 -1
- package/dist/twilight/{p-22fc1505.entry.js → p-b996fb98.entry.js} +1 -1
- package/dist/twilight/{p-90765c65.entry.js → p-b9c70014.entry.js} +1 -1
- package/dist/twilight/{p-9a7da6d0.entry.js → p-bcdcd436.entry.js} +1 -1
- package/dist/twilight/{p-b2da9ea7.entry.js → p-bdc6aaf3.entry.js} +1 -1
- package/dist/twilight/{p-46334bbe.entry.js → p-c0990882.entry.js} +1 -1
- package/dist/twilight/{p-9b9c2adf.entry.js → p-c4e8176e.entry.js} +1 -1
- package/dist/twilight/{p-6339c31f.entry.js → p-c884d66b.entry.js} +1 -1
- package/dist/twilight/{p-157873ee.entry.js → p-d385497e.entry.js} +1 -1
- package/dist/twilight/{p-73189ed2.entry.js → p-d960fb5d.entry.js} +1 -1
- package/dist/twilight/{p-132d9742.entry.js → p-d9eb567c.entry.js} +1 -1
- package/dist/twilight/{p-b59eab4f.entry.js → p-dc2ec98d.entry.js} +1 -1
- package/dist/twilight/{p-e8f7ed7b.entry.js → p-de8ff550.entry.js} +1 -1
- package/dist/twilight/{p-87feddeb.entry.js → p-deea89b5.entry.js} +1 -1
- package/dist/twilight/{p-94f18d97.entry.js → p-e345dcc6.entry.js} +1 -1
- package/dist/twilight/{p-c7728312.entry.js → p-ed565db7.entry.js} +1 -1
- package/dist/twilight/{p-84ee1884.entry.js → p-ee8320af.entry.js} +1 -1
- package/dist/twilight/{p-ccd75cf6.entry.js → p-eee8f72b.entry.js} +1 -1
- package/dist/twilight/{p-60e920c6.entry.js → p-f0812a46.entry.js} +1 -1
- package/dist/twilight/{p-d897273e.entry.js → p-f0deaa3e.entry.js} +1 -1
- package/dist/twilight/{p-02946cf5.entry.js → p-f17570e7.entry.js} +1 -1
- package/dist/twilight/{p-f52c49c8.entry.js → p-f220b5b5.entry.js} +1 -1
- package/dist/twilight/{p-2d8d9829.entry.js → p-f5b6fa9b.entry.js} +1 -1
- package/dist/twilight/{p-36ddb8db.entry.js → p-f77eb8de.entry.js} +1 -1
- package/dist/twilight/{p-af525459.entry.js → p-f7d7ffa2.entry.js} +1 -1
- package/dist/twilight/{p-c840c67c.entry.js → p-f8dab034.entry.js} +1 -1
- package/dist/twilight/{p-6cffd732.entry.js → p-f94f0b87.entry.js} +1 -1
- package/dist/twilight/{p-1ea04494.entry.js → p-fc601cb7.entry.js} +1 -1
- package/dist/twilight/{p-DYkb22mH.js → p-kJZlJJjc.js} +1 -1
- package/dist/twilight/{p-D-pGRpnm.js → p-lcuQmP0A.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-apps-icons/salla-apps-icons.d.ts +2 -0
- package/dist/types/components/salla-contacts/salla-contacts.d.ts +2 -0
- package/package.json +5 -5
- package/dist/twilight/p-8d119291.entry.js +0 -4
- package/dist/twilight/p-C670SYee.js +0 -5
- package/dist/twilight/p-bf95f806.entry.js +0 -4
- package/dist/twilight/p-de0ce00a.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,H as s}from"./p-C670SYee.js";var i='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';const r=class{constructor(t){e(this,t),this.otpInputs=[],this.isDeleteAccountEnabled=!!salla.config.get("store.features",[])?.includes("customer-account-deletion"),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.deletePendingDays=null,this.currentStep="confirm",this.isDeletePending=!1,this.otpType="email",this.otpHasError=!1,this.otpErrorMessage="",this.isSubmitting=!1,this.isVerifyingOtp=!1,this.isSwitchingChannel=!1,this.resendAfter=30,this.showResendLink=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.translationDefaults={"pages.profile.delete_account":{ar:"حذف الحساب",en:"Delete account"},"pages.profile.delete_account_description":{ar:"سيُحذف حسابك وبياناتك من المتجر نهائيًا، بما في ذلك سجل طلباتك.",en:"Your account and data will be permanently deleted from the store, including your order history."},"pages.profile.delete_account_confirm_title":{ar:"هل تريد حذف حسابك؟",en:"Do you want to delete your account?"},"pages.profile.delete_account_warning":{ar:"بعد الحذف، ستفقد الوصول إلى بياناتك، بما في ذلك سجل الطلبات، وقائمة الأمنيات، وأي نقاط ولاء أو رصيد متاح في المحفظة.",en:"After deletion, you will lose access to your data, including order history, wishlist, and any loyalty points or wallet balance."},"pages.profile.cancel":{ar:"إلغاء",en:"Cancel"},"pages.profile.delete_account_otp_title":{ar:"تأكيد حذف الحساب",en:"Confirm account deletion"},"pages.profile.delete_account_otp_instruction":{ar:"للمتابعة، أدخل رمز التحقٌّق المرسل إلى:",en:"To continue, enter the verification code sent to:"},"pages.profile.delete_account_confirm_otp":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.profile.delete_account_otp_required":{ar:"يرجى إدخال رمز التحقٌّق",en:"Please enter the verification code"},"pages.profile.delete_account_send_via_phone":{ar:"إرسال عبر الهاتف",en:"Send via phone"},"pages.profile.delete_account_send_via_email":{ar:"إرسال عبر البريد الإلكتروني",en:"Send via email"},"pages.profile.delete_account_success_title":{ar:"أُرسل طلب حذف الحساب",en:"Account deletion request submitted"},"pages.profile.delete_account_success_message":{ar:"سيُحذف حسابك خلال 30 يومًا. يمكنك إلغاء الطلب بتسجيل الدخول مرة أخرى قبل اكتمال الحذف.",en:"Your account will be deleted within 30 days. You can cancel the request by signing in again before deletion is complete."},"pages.profile.ok":{ar:"موافق",en:"OK"},"pages.profile.cancel_deletion_request":{ar:"تراجع عن الحذف",en:"Withdraw deletion"},"pages.profile.delete_account_pending":{ar:"حسابك مجدول للحذف نهائيًا من المتجر خلال :days يومًا. يمكنك التراجع عن الحذف قبل انقضاء المدة.",en:"Your account will be deleted permanently from the store within :days days. You can withdraw the deletion before the deadline."},"pages.profile.delete_request_cancelled":{ar:"تم إلغاء طلب الحذف",en:"Deletion request cancelled"}},this.registerTranslationDefaults(),this.loadTranslations(),salla.onReady((()=>{this.isHiddenName=salla.config.get("user.is_hidden_name"),this.isNotifiable=salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.isDeleteAccountEnabled&&this.fetchDeleteRequestStatus(),this.isNotifiable&&this.isHiddenName||salla.event.on("profile::info.fetched",(e=>{this.isHiddenName=e.data.is_hidden_name,this.isNotifiable=e.data.is_notifiable}))}))}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{this.registerTranslationDefaults(),this.loadTranslations()}))}disconnectedCallback(){this.langUnsubscribe?.()}getDaysUntilExecution(e){return Math.max(0,Math.ceil(((e>1e12?e:1e3*e)-Date.now())/864e5))}applyPendingMessage(){const e=salla.lang.get("pages.profile.delete_account_pending");this.deleteAccountPending=null!=this.deletePendingDays?e.replace(/:days/g,String(salla.helpers.number(this.deletePendingDays))):e}async fetchDeleteRequestStatus(){try{const e=await salla.profile.getDeleteRequest(),t=e?.data??null,s=t?.data_request||t,i=s?.status;this.isDeletePending="pending"===i;const r=s?.execution_at;this.deletePendingDays=null==r||Number.isNaN(Number(r))?null:this.getDaysUntilExecution(Number(r)),this.applyPendingMessage()}catch{}}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const e=Object.entries(this.translationDefaults).reduce(((e,[t,s])=>(salla.lang.get(t)===t&&(e[t]=s),e)),{});Object.keys(e).length&&salla.lang.addBulk(e)}loadTranslations(){this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.deleteAccount=salla.lang.get("pages.profile.delete_account"),this.deleteAccountDesc=salla.lang.get("pages.profile.delete_account_description"),this.deleteConfirmTitle=salla.lang.get("pages.profile.delete_account_confirm_title"),this.deleteAccountWarning=salla.lang.get("pages.profile.delete_account_warning"),this.cancelLabel=salla.lang.get("pages.profile.cancel"),this.deleteOtpTitle=salla.lang.get("pages.profile.delete_account_otp_title"),this.deleteOtpInstruction=salla.lang.get("pages.profile.delete_account_otp_instruction"),this.deleteConfirmOtp=salla.lang.get("pages.profile.delete_account_confirm_otp"),this.sendViaPhone=salla.lang.get("pages.profile.delete_account_send_via_phone"),this.sendViaEmail=salla.lang.get("pages.profile.delete_account_send_via_email"),this.deleteSuccessTitle=salla.lang.get("pages.profile.delete_account_success_title"),this.deleteSuccessMessage=salla.lang.get("pages.profile.delete_account_success_message"),this.okLabel=salla.lang.get("pages.profile.ok"),this.cancelDeletionRequest=salla.lang.get("pages.profile.cancel_deletion_request"),this.applyPendingMessage(),this.resendAfterLabel=salla.lang.get("blocks.header.resend_after"),this.resendLabel=salla.lang.get("blocks.comments.submit"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description")}toggleSetting(e,t){salla.profile.updateSettings({name:e,value:t.target.checked})}capitalizeText(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}getOtpTarget(){return"email"===this.otpType?salla.config.get("user.email")||"":salla.config.get("user.mobile")||""}updateModalForStep(){if(this.confirmationModal)switch(this.currentStep){case"confirm":this.confirmationModal.setTitle(this.capitalizeText(this.deleteConfirmTitle));break;case"otp":this.confirmationModal.setTitle(this.capitalizeText(this.deleteOtpTitle));break;case"success":this.confirmationModal.setTitle(this.capitalizeText(this.deleteSuccessTitle))}}openDeleteModal(){this.currentStep="confirm",this.otpType="email",this.resetOtpInputs(),this.clearResendTimer(),this.updateModalForStep(),this.confirmationModal.open()}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async confirmDeactivateAccount(){this.buttonLoading=!0,await salla.profile.delete().finally((()=>{this.buttonLoading=!1,this.confirmationModal.close()}))}closeDeleteModal(){this.clearResendTimer(),this.confirmationModal?.close()}goBackFromOtp(){this.clearResendTimer(),this.resetOtpInputs(),this.resetOtpError(),this.currentStep="confirm",this.updateModalForStep()}async handleModalVisibilityChanged(e){if(e.detail)return;this.clearResendTimer();const t="success"===this.currentStep;t&&(this.isDeletePending=!0),this.currentStep="confirm",this.resetOtpInputs(),t&&await this.fetchDeleteRequestStatus()}formatResendTimer(e){return"00 : "+(e>=10?`${e}`:`0${e}`)}updateResendTimerDisplay(){this.timerEl&&(this.timerEl.innerHTML=this.formatResendTimer(this.resendAfter))}isDeleteRequestInFlight(){return this.isSubmitting||this.isSwitchingChannel||this.isVerifyingOtp}async initiateDeleteRequest(e="confirm"){if(!this.isDeleteRequestInFlight()){"switch"===e||"resend"===e?this.isSwitchingChannel=!0:this.isSubmitting=!0;try{await salla.profile.initiateDeleteRequest(this.otpType),this.currentStep="otp",this.updateModalForStep(),this.resetOtpInputs(),this.startResendTimer(),setTimeout((()=>this.otpInputs[0]?.focus()),100)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{"switch"===e||"resend"===e?this.isSwitchingChannel=!1:this.isSubmitting=!1}}}async switchOtpChannel(){this.isDeleteRequestInFlight()||(this.otpType="email"===this.otpType?"mobile":"email",await this.initiateDeleteRequest("switch"))}async resendOtp(){this.showResendLink&&!this.isDeleteRequestInFlight()&&await this.initiateDeleteRequest("resend")}collectOtpCode(){const e=salla.helpers.number(this.otpInputs.map((e=>e?.value||"")).join(""),!0).replace(/[^0-9]/g,"");return this.hiddenCodeInput&&(this.hiddenCodeInput.value=e),e}resetOtpError(){this.otpHasError=!1,this.otpErrorMessage=""}setOtpError(e){this.otpHasError=!0,this.otpErrorMessage=e}async verifyDeleteOtp(){if(this.isVerifyingOtp||this.isSwitchingChannel)return;const e=this.collectOtpCode();if(e.length<4)return this.setOtpError(salla.lang.get("pages.profile.delete_account_otp_required")),void this.otpInputs[e.length]?.focus();this.resetOtpError(),this.isVerifyingOtp=!0;try{const t=await salla.profile.verifyDeleteRequest({type:this.otpType,code:e});this.deleteSuccessMessage=t?.data?.message||salla.lang.get("pages.profile.delete_account_success_message"),this.clearResendTimer(),this.resetOtpInputs(),this.otpInputs=[],this.currentStep="success",this.updateModalForStep()}catch(e){this.setOtpError(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred")),this.resetOtpInputs()}finally{this.isVerifyingOtp=!1}}async confirmSuccess(){this.isDeletePending=!0,this.closeDeleteModal(),this.currentStep="confirm",await this.fetchDeleteRequestStatus()}async cancelDeleteRequest(){if(!this.isSubmitting){this.isSubmitting=!0;try{const e=(await salla.profile.cancelDeleteRequest()).message||salla.lang.get("pages.profile.delete_request_cancelled");this.isDeletePending=!1,salla.notify?.success?.(e)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{this.isSubmitting=!1}}}resetOtpInputs(){this.otpInputs.forEach((e=>{e&&(e.value="")})),this.hiddenCodeInput&&(this.hiddenCodeInput.value="")}modifyNextOtpInput(e,t){e.value=t[0],t=t.substring(1),e.nextElementSibling&&t.length?this.modifyNextOtpInput(e.nextElementSibling,t):e.nextElementSibling||0!==t.length?e.nextElementSibling&&0===t.length&&e.nextElementSibling.focus():e.focus()}splitOtpNumber(e){const t=salla.helpers.number(e.data||e.target.value||"",!0).replace(/[^0-9]/g,"");t&&1!==t.length&&this.modifyNextOtpInput(e.target,t)}allOtpInputsFilled(){return this.otpInputs.every((e=>e?.value))}handleOtpInput(e){this.resetOtpError(),e.target.value=salla.helpers.number(e.target.value||"",!0),salla.helpers.inputDigitsOnly(e.target),this.allOtpInputsFilled()&&setTimeout((()=>this.verifyDeleteOtp()),100)}handleOtpKeyUp(e){if(this.resetOtpError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(e.key))return;const t=e.keyCode||e.charCode;e.target.value?(e.target.nextElementSibling?.focus(),e.target.nextElementSibling?.select()):[8,46].includes(t)&&(e.target.previousElementSibling?.focus(),e.target.previousElementSibling?.select()),e.target.value.length>1&&this.splitOtpNumber(e)}handleOtpPaste(e){this.resetOtpError();const t=salla.helpers.number(e.clipboardData.getData("text")||"",!0).replace(/[^0-9]/g,"").substring(0,this.otpInputs.length);this.otpInputs.forEach((e=>e.value="")),this.otpInputs[0]&&this.modifyNextOtpInput(this.otpInputs[0],t)}handleOtpFocus(e){e.target!==this.otpInputs[0]&&(""===this.otpInputs[0]?.value&&this.otpInputs[0].focus(),""===e.target.previousElementSibling?.value&&e.target.previousElementSibling.focus())}startResendTimer(){this.clearResendTimer(),this.resendAfter=30,this.showResendLink=!1,this.updateResendTimerDisplay(),this.resendTimerId=setInterval((()=>{if(this.resendAfter--,this.resendAfter<=0)return this.clearResendTimer(),void(this.showResendLink=!0);this.updateResendTimerDisplay()}),1e3)}clearResendTimer(){this.resendTimerId&&(clearInterval(this.resendTimerId),this.resendTimerId=null),this.showResendLink=!1}renderUserDeleteIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",color:"currentColor",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M14.5 8C14.5 5.23858 12.2614 3 9.5 3C6.73858 3 4.5 5.23858 4.5 8C4.5 10.7614 6.73858 13 9.5 13C12.2614 13 14.5 10.7614 14.5 8Z"}),t("path",{d:"M15.5 21L18.5 18M18.5 18L21.5 15M18.5 18L15.5 15M18.5 18L21.5 21"}),t("path",{d:"M2.5 20C2.5 16.134 5.63401 13 9.5 13C10.775 13 11.9704 13.3409 13 13.9365"}))}renderConfirmStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-warning"},this.deleteAccountWarning),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--row"},t("salla-button",{width:"wide",fill:"outline",color:"danger",onClick:()=>this.closeDeleteModal()},this.capitalizeText(this.cancelLabel)),t("salla-button",{width:"wide",color:"primary",loading:this.isSubmitting,onClick:()=>this.initiateDeleteRequest()},this.capitalizeText(this.deleteAccount))))}renderOtpStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-otp-instruction"},this.deleteOtpInstruction),t("p",{class:"s-user-settings-delete-otp-target"},this.getOtpTarget()),t("input",{type:"hidden",name:"code",maxlength:"4",ref:e=>this.hiddenCodeInput=e}),t("div",{class:{"s-user-settings-delete-otp-codes":!0,"has-error":this.otpHasError},dir:"ltr"},[1,2,3,4].map((e=>t("input",{type:"text",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",id:`delete-otp-${e}`,class:{"s-user-settings-delete-otp-input":!0,"s-has-error":this.otpHasError},onInput:e=>this.handleOtpInput(e),onPaste:e=>this.handleOtpPaste(e),onKeyUp:e=>this.handleOtpKeyUp(e),onFocus:e=>this.handleOtpFocus(e),ref:t=>this.otpInputs[e-1]=t,required:!0})))),this.otpHasError&&this.otpErrorMessage?t("span",{class:"s-user-settings-delete-otp-error"},this.otpErrorMessage):"",t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{width:"wide",color:"primary",disabled:this.isSwitchingChannel,onClick:()=>this.verifyDeleteOtp()},this.capitalizeText(this.deleteConfirmOtp)),t("salla-button",{width:"wide",fill:"outline",color:"primary",disabled:this.isVerifyingOtp,onClick:()=>this.switchOtpChannel()},this.capitalizeText("email"===this.otpType?this.sendViaPhone:this.sendViaEmail))),t("p",{class:"s-user-settings-delete-otp-resend",style:{display:this.showResendLink?"none":"block"}},this.resendAfterLabel,t("b",{class:"s-user-settings-delete-otp-timer mx-1 font-bold",ref:e=>this.timerEl=e})),t("a",{href:"#",class:"s-user-settings-delete-otp-resend-link",style:{display:this.showResendLink?"block":"none"},onClick:e=>{e.preventDefault(),this.resendOtp()}},this.resendLabel))}renderSuccessStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-success-body"},this.deleteSuccessMessage),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{class:"s-user-settings-delete-success-btn",width:"wide",color:"primary",onClick:()=>this.confirmSuccess()},this.capitalizeText(this.okLabel))))}renderDeleteStep(){switch(this.currentStep){case"otp":return this.renderOtpStep();case"success":return this.renderSuccessStep();default:return this.renderConfirmStep()}}renderDeleteSectionAction(){return this.isDeletePending?t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",loading:this.isSubmitting,onClick:()=>this.cancelDeleteRequest()},this.capitalizeText(this.cancelDeletionRequest)):t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeleteModal()},this.capitalizeText(this.deleteAccount))}render(){return t(s,{key:"371350c4fcfd92a9434000b1390cb5ab01a92cc5",class:"s-user-settings-wrapper"},this.canHideName&&t("div",{key:"4e4ade371cc81d7e4c5750f5341f30bfcfc082a6",class:"s-user-settings-section"},t("salla-list-tile",{key:"fd23340814c525c686f9c94e17bc6a3d2182ac1e"},t("div",{key:"d0cfc9df3a6072335133ac2817ed9afa34ea489e",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"17546bf4c7931fafdb769168c6cb1788303a6312",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),t("div",{key:"09ec636514d69b741a3cd1a91d5599d0ff34cca1",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),t("div",{key:"f69abae297492ed509475590b2623745efb30f03",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),t("div",{key:"17c0191aae2401b8a1cd22942a5acecc0dfe1c62",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"6b55ddc3ec0a01767f870e279ae7bfad9f43663e",class:"s-toggle"},t("input",{key:"18af334c71b48528543de61a9c3a71a73dc054b5",class:"s-toggle-input",checked:this.isHiddenName,onChange:e=>this.toggleSetting("is_hidden_name",e),type:"checkbox"}),t("div",{key:"c90548df6ff7dc5beceeb2347545923ea4de096e",class:"s-toggle-switcher"}))))),t("div",{key:"c471b3a73abbfbc1a894e5f2c9fcb8af4ea085f5",class:"s-user-settings-section"},t("salla-list-tile",{key:"a906c43c0b227d6f757ec919047cfade9192cdc4"},t("div",{key:"7e4c1375e64883c3465393f855a9faa987137bc1",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"5d8ee4cb69ddf765ddb6c108594c7de4cbedd078",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),t("div",{key:"4e0e5b84822e98234be621eab4150c48581e104b",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),t("div",{key:"ac8521a039e4e869cb1aeea7213df8b70ce87bb7",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),t("div",{key:"6caa3b3d1fe8eadc194ad44a4e2299f9a95018ea",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"37a26623047ef4cb98f7bbdb8715b515488c5ac0",class:"s-toggle"},t("input",{key:"f74fbb125afb8743fc981672ffa56b129c4ed2ed",class:"s-toggle-input",checked:this.isNotifiable,onChange:e=>this.toggleSetting("is_notifiable",e),type:"checkbox"}),t("div",{key:"45b367693d63424e859d4dce5538a2ee37ff76a7",class:"s-toggle-switcher"}))))),this.isDeleteAccountEnabled?t("div",{class:"s-user-settings-section s-user-settings-section-delete-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},this.renderUserDeleteIcon()),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deleteAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.isDeletePending?this.deleteAccountPending:this.deleteAccountDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},this.renderDeleteSectionAction()))):t("div",{class:"s-user-settings-section s-user-settings-section-deactivate-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},t("span",{innerHTML:i})),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),this.isDeleteAccountEnabled?t("salla-modal",{id:"salla-user-settings-delete-modal",width:"xs",centered:!0,showBack:"otp"===this.currentStep,isClosable:"success"!==this.currentStep,iconStyle:"success"===this.currentStep?"success":void 0,onModalVisibilityChanged:e=>this.handleModalVisibilityChanged(e),onModalBack:()=>this.goBackFromOtp(),ref:e=>this.confirmationModal=e},"success"!==this.currentStep?t("span",{slot:"icon",class:"s-user-settings-delete-icon"},this.renderUserDeleteIcon()):null,t("div",{key:this.currentStep,class:"s-user-settings-delete-step"},this.renderDeleteStep())):t("salla-modal",{width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:e=>this.confirmationModal=e},t("span",{slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:i}),t("div",{class:"s-user-settings-confirmation"},t("div",{class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),t("div",{class:"s-user-settings-confirmation-actions"},t("salla-button",{width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),t("salla-button",{fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.confirmDeactivateAccount()},this.capitalizeText(this.deactivateAccount))))))}};r.style='/*!twlt*/.s-modal-header-inner{display:flex;flex-direction:column !important;align-items:center !important;justify-content:center !important}.s-modal-header-content{text-align:center !important}.s-user-settings-delete-body{text-align:center}.s-user-settings-delete-icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;border-radius:9999px;border:1px solid var(--infinte-color);color:var(--infinte-color);margin:0 auto 1rem}.s-user-settings-delete-icon svg{width:1.5rem;height:1.5rem}.s-user-settings-delete-warning{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-actions--row{display:flex;gap:0.75rem;justify-content:center}.s-user-settings-delete-actions--row salla-button{flex:1}.s-user-settings-delete-actions--stack{display:flex;flex-direction:column;gap:0.75rem;margin-top:1.25rem}.s-user-settings-delete-otp-instruction{color:#6b7280;font-size:0.875rem}.s-user-settings-delete-otp-target{color:#6b7280;direction:ltr;margin-bottom:1.25rem}.s-user-settings-delete-otp-codes{display:flex;justify-content:stretch;gap:0.75rem;direction:ltr;margin-bottom:0.75rem;width:100%}.s-user-settings-delete-otp-codes.has-error{margin-bottom:0}.s-user-settings-delete-otp-input{flex:1 1 0;min-width:0;width:100%;height:3.5rem;text-align:center;border:1px solid #d1d5db;border-radius:0.5rem;font-size:1.25rem;font-weight:600;color:#111827;outline:none}.s-user-settings-delete-otp-input:focus{border-color:#004956;box-shadow:0 0 0 1px #004956}.s-user-settings-delete-otp-input.s-has-error{border-color:#ef4444 !important}.s-user-settings-delete-otp-input.s-has-error:focus{border-color:#ef4444 !important;box-shadow:0 0 0 1px #ef4444}.s-user-settings-delete-otp-input::-webkit-outer-spin-button,.s-user-settings-delete-otp-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-user-settings-delete-otp-input[type=text]{-moz-appearance:textfield}.s-user-settings-delete-otp-error{display:block;color:#ef4444;font-size:0.75rem;text-align:center;padding-top:0.75rem;margin-bottom:1.25rem}.s-user-settings-delete-otp-resend{color:#6b7280;font-size:0.75rem;margin-top:1rem;text-align:center}.s-user-settings-delete-otp-timer{font-weight:600;direction:ltr;display:inline-block}.s-user-settings-delete-otp-resend-link{display:block;color:#004956;font-size:0.875rem;margin-top:1rem;text-align:center;text-decoration:underline;cursor:pointer}.s-user-settings-delete-success-body{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-success-btn{--s-button-color:#004956}.mx-1{margin-left:0.25rem;margin-right:0.25rem}.block{display:block}.hidden{display:none}.font-bold{font-weight:700}.outline{outline-style:solid}.s-has-error{--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.s-has-error:focus{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.has-error .s-form-label{color:#ff443a}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-has-error{--tw-border-opacity:1 !important;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1)) !important;--tw-text-opacity:1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1)) !important}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}.s-user-settings-section{border-bottom-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))}.s-user-settings-section:first-child{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-top-left-radius:0.375rem;border-top-right-radius:0.375rem}.s-user-settings-section:last-child{border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-width:0px}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}.s-user-settings-section-title{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-user-settings-section-subtitle{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-user-settings-section-icon svg{height:1.25rem;width:1.25rem}.s-user-settings-confirmation{text-align:center}.s-user-settings-confirmation svg{text-align:center}.s-user-settings-confirmation-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-user-settings-confirmation-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-user-settings-confirmation-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-user-settings-confirmation-warning{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-user-settings-confirmation-actions{margin-top:1.25rem;display:flex;align-items:center;justify-content:space-between}.s-user-settings-confirmation-actions>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-user-settings-confirmation-actions:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}';export{r as salla_user_settings}
|
|
4
|
+
import{r as e,h as t,H as s}from"./p-DSmjBlMI.js";var i='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n';const r=class{constructor(t){e(this,t),this.otpInputs=[],this.isDeleteAccountEnabled=!!salla.config.get("store.features",[])?.includes("customer-account-deletion"),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.deletePendingDays=null,this.currentStep="confirm",this.isDeletePending=!1,this.otpType="email",this.otpHasError=!1,this.otpErrorMessage="",this.isSubmitting=!1,this.isVerifyingOtp=!1,this.isSwitchingChannel=!1,this.resendAfter=30,this.showResendLink=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.translationDefaults={"pages.profile.delete_account":{ar:"حذف الحساب",en:"Delete account"},"pages.profile.delete_account_description":{ar:"سيُحذف حسابك وبياناتك من المتجر نهائيًا، بما في ذلك سجل طلباتك.",en:"Your account and data will be permanently deleted from the store, including your order history."},"pages.profile.delete_account_confirm_title":{ar:"هل تريد حذف حسابك؟",en:"Do you want to delete your account?"},"pages.profile.delete_account_warning":{ar:"بعد الحذف، ستفقد الوصول إلى بياناتك، بما في ذلك سجل الطلبات، وقائمة الأمنيات، وأي نقاط ولاء أو رصيد متاح في المحفظة.",en:"After deletion, you will lose access to your data, including order history, wishlist, and any loyalty points or wallet balance."},"pages.profile.cancel":{ar:"إلغاء",en:"Cancel"},"pages.profile.delete_account_otp_title":{ar:"تأكيد حذف الحساب",en:"Confirm account deletion"},"pages.profile.delete_account_otp_instruction":{ar:"للمتابعة، أدخل رمز التحقٌّق المرسل إلى:",en:"To continue, enter the verification code sent to:"},"pages.profile.delete_account_confirm_otp":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.profile.delete_account_otp_required":{ar:"يرجى إدخال رمز التحقٌّق",en:"Please enter the verification code"},"pages.profile.delete_account_send_via_phone":{ar:"إرسال عبر الهاتف",en:"Send via phone"},"pages.profile.delete_account_send_via_email":{ar:"إرسال عبر البريد الإلكتروني",en:"Send via email"},"pages.profile.delete_account_success_title":{ar:"أُرسل طلب حذف الحساب",en:"Account deletion request submitted"},"pages.profile.delete_account_success_message":{ar:"سيُحذف حسابك خلال 30 يومًا. يمكنك إلغاء الطلب بتسجيل الدخول مرة أخرى قبل اكتمال الحذف.",en:"Your account will be deleted within 30 days. You can cancel the request by signing in again before deletion is complete."},"pages.profile.ok":{ar:"موافق",en:"OK"},"pages.profile.cancel_deletion_request":{ar:"تراجع عن الحذف",en:"Withdraw deletion"},"pages.profile.delete_account_pending":{ar:"حسابك مجدول للحذف نهائيًا من المتجر خلال :days يومًا. يمكنك التراجع عن الحذف قبل انقضاء المدة.",en:"Your account will be deleted permanently from the store within :days days. You can withdraw the deletion before the deadline."},"pages.profile.delete_request_cancelled":{ar:"تم إلغاء طلب الحذف",en:"Deletion request cancelled"}},this.registerTranslationDefaults(),this.loadTranslations(),salla.onReady((()=>{this.isHiddenName=salla.config.get("user.is_hidden_name"),this.isNotifiable=salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.isDeleteAccountEnabled&&this.fetchDeleteRequestStatus(),this.isNotifiable&&this.isHiddenName||salla.event.on("profile::info.fetched",(e=>{this.isHiddenName=e.data.is_hidden_name,this.isNotifiable=e.data.is_notifiable}))}))}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{this.registerTranslationDefaults(),this.loadTranslations()}))}disconnectedCallback(){this.langUnsubscribe?.()}getDaysUntilExecution(e){return Math.max(0,Math.ceil(((e>1e12?e:1e3*e)-Date.now())/864e5))}applyPendingMessage(){const e=salla.lang.get("pages.profile.delete_account_pending");this.deleteAccountPending=null!=this.deletePendingDays?e.replace(/:days/g,String(salla.helpers.number(this.deletePendingDays))):e}async fetchDeleteRequestStatus(){try{const e=await salla.profile.getDeleteRequest(),t=e?.data??null,s=t?.data_request||t,i=s?.status;this.isDeletePending="pending"===i;const r=s?.execution_at;this.deletePendingDays=null==r||Number.isNaN(Number(r))?null:this.getDaysUntilExecution(Number(r)),this.applyPendingMessage()}catch{}}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const e=Object.entries(this.translationDefaults).reduce(((e,[t,s])=>(salla.lang.get(t)===t&&(e[t]=s),e)),{});Object.keys(e).length&&salla.lang.addBulk(e)}loadTranslations(){this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.deleteAccount=salla.lang.get("pages.profile.delete_account"),this.deleteAccountDesc=salla.lang.get("pages.profile.delete_account_description"),this.deleteConfirmTitle=salla.lang.get("pages.profile.delete_account_confirm_title"),this.deleteAccountWarning=salla.lang.get("pages.profile.delete_account_warning"),this.cancelLabel=salla.lang.get("pages.profile.cancel"),this.deleteOtpTitle=salla.lang.get("pages.profile.delete_account_otp_title"),this.deleteOtpInstruction=salla.lang.get("pages.profile.delete_account_otp_instruction"),this.deleteConfirmOtp=salla.lang.get("pages.profile.delete_account_confirm_otp"),this.sendViaPhone=salla.lang.get("pages.profile.delete_account_send_via_phone"),this.sendViaEmail=salla.lang.get("pages.profile.delete_account_send_via_email"),this.deleteSuccessTitle=salla.lang.get("pages.profile.delete_account_success_title"),this.deleteSuccessMessage=salla.lang.get("pages.profile.delete_account_success_message"),this.okLabel=salla.lang.get("pages.profile.ok"),this.cancelDeletionRequest=salla.lang.get("pages.profile.cancel_deletion_request"),this.applyPendingMessage(),this.resendAfterLabel=salla.lang.get("blocks.header.resend_after"),this.resendLabel=salla.lang.get("blocks.comments.submit"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description")}toggleSetting(e,t){salla.profile.updateSettings({name:e,value:t.target.checked})}capitalizeText(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}getOtpTarget(){return"email"===this.otpType?salla.config.get("user.email")||"":salla.config.get("user.mobile")||""}updateModalForStep(){if(this.confirmationModal)switch(this.currentStep){case"confirm":this.confirmationModal.setTitle(this.capitalizeText(this.deleteConfirmTitle));break;case"otp":this.confirmationModal.setTitle(this.capitalizeText(this.deleteOtpTitle));break;case"success":this.confirmationModal.setTitle(this.capitalizeText(this.deleteSuccessTitle))}}openDeleteModal(){this.currentStep="confirm",this.otpType="email",this.resetOtpInputs(),this.clearResendTimer(),this.updateModalForStep(),this.confirmationModal.open()}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async confirmDeactivateAccount(){this.buttonLoading=!0,await salla.profile.delete().finally((()=>{this.buttonLoading=!1,this.confirmationModal.close()}))}closeDeleteModal(){this.clearResendTimer(),this.confirmationModal?.close()}goBackFromOtp(){this.clearResendTimer(),this.resetOtpInputs(),this.resetOtpError(),this.currentStep="confirm",this.updateModalForStep()}async handleModalVisibilityChanged(e){if(e.detail)return;this.clearResendTimer();const t="success"===this.currentStep;t&&(this.isDeletePending=!0),this.currentStep="confirm",this.resetOtpInputs(),t&&await this.fetchDeleteRequestStatus()}formatResendTimer(e){return"00 : "+(e>=10?`${e}`:`0${e}`)}updateResendTimerDisplay(){this.timerEl&&(this.timerEl.innerHTML=this.formatResendTimer(this.resendAfter))}isDeleteRequestInFlight(){return this.isSubmitting||this.isSwitchingChannel||this.isVerifyingOtp}async initiateDeleteRequest(e="confirm"){if(!this.isDeleteRequestInFlight()){"switch"===e||"resend"===e?this.isSwitchingChannel=!0:this.isSubmitting=!0;try{await salla.profile.initiateDeleteRequest(this.otpType),this.currentStep="otp",this.updateModalForStep(),this.resetOtpInputs(),this.startResendTimer(),setTimeout((()=>this.otpInputs[0]?.focus()),100)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{"switch"===e||"resend"===e?this.isSwitchingChannel=!1:this.isSubmitting=!1}}}async switchOtpChannel(){this.isDeleteRequestInFlight()||(this.otpType="email"===this.otpType?"mobile":"email",await this.initiateDeleteRequest("switch"))}async resendOtp(){this.showResendLink&&!this.isDeleteRequestInFlight()&&await this.initiateDeleteRequest("resend")}collectOtpCode(){const e=salla.helpers.number(this.otpInputs.map((e=>e?.value||"")).join(""),!0).replace(/[^0-9]/g,"");return this.hiddenCodeInput&&(this.hiddenCodeInput.value=e),e}resetOtpError(){this.otpHasError=!1,this.otpErrorMessage=""}setOtpError(e){this.otpHasError=!0,this.otpErrorMessage=e}async verifyDeleteOtp(){if(this.isVerifyingOtp||this.isSwitchingChannel)return;const e=this.collectOtpCode();if(e.length<4)return this.setOtpError(salla.lang.get("pages.profile.delete_account_otp_required")),void this.otpInputs[e.length]?.focus();this.resetOtpError(),this.isVerifyingOtp=!0;try{const t=await salla.profile.verifyDeleteRequest({type:this.otpType,code:e});this.deleteSuccessMessage=t?.data?.message||salla.lang.get("pages.profile.delete_account_success_message"),this.clearResendTimer(),this.resetOtpInputs(),this.otpInputs=[],this.currentStep="success",this.updateModalForStep()}catch(e){this.setOtpError(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred")),this.resetOtpInputs()}finally{this.isVerifyingOtp=!1}}async confirmSuccess(){this.isDeletePending=!0,this.closeDeleteModal(),this.currentStep="confirm",await this.fetchDeleteRequestStatus()}async cancelDeleteRequest(){if(!this.isSubmitting){this.isSubmitting=!0;try{const e=(await salla.profile.cancelDeleteRequest()).message||salla.lang.get("pages.profile.delete_request_cancelled");this.isDeletePending=!1,salla.notify?.success?.(e)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{this.isSubmitting=!1}}}resetOtpInputs(){this.otpInputs.forEach((e=>{e&&(e.value="")})),this.hiddenCodeInput&&(this.hiddenCodeInput.value="")}modifyNextOtpInput(e,t){e.value=t[0],t=t.substring(1),e.nextElementSibling&&t.length?this.modifyNextOtpInput(e.nextElementSibling,t):e.nextElementSibling||0!==t.length?e.nextElementSibling&&0===t.length&&e.nextElementSibling.focus():e.focus()}splitOtpNumber(e){const t=salla.helpers.number(e.data||e.target.value||"",!0).replace(/[^0-9]/g,"");t&&1!==t.length&&this.modifyNextOtpInput(e.target,t)}allOtpInputsFilled(){return this.otpInputs.every((e=>e?.value))}handleOtpInput(e){this.resetOtpError(),e.target.value=salla.helpers.number(e.target.value||"",!0),salla.helpers.inputDigitsOnly(e.target),this.allOtpInputsFilled()&&setTimeout((()=>this.verifyDeleteOtp()),100)}handleOtpKeyUp(e){if(this.resetOtpError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(e.key))return;const t=e.keyCode||e.charCode;e.target.value?(e.target.nextElementSibling?.focus(),e.target.nextElementSibling?.select()):[8,46].includes(t)&&(e.target.previousElementSibling?.focus(),e.target.previousElementSibling?.select()),e.target.value.length>1&&this.splitOtpNumber(e)}handleOtpPaste(e){this.resetOtpError();const t=salla.helpers.number(e.clipboardData.getData("text")||"",!0).replace(/[^0-9]/g,"").substring(0,this.otpInputs.length);this.otpInputs.forEach((e=>e.value="")),this.otpInputs[0]&&this.modifyNextOtpInput(this.otpInputs[0],t)}handleOtpFocus(e){e.target!==this.otpInputs[0]&&(""===this.otpInputs[0]?.value&&this.otpInputs[0].focus(),""===e.target.previousElementSibling?.value&&e.target.previousElementSibling.focus())}startResendTimer(){this.clearResendTimer(),this.resendAfter=30,this.showResendLink=!1,this.updateResendTimerDisplay(),this.resendTimerId=setInterval((()=>{if(this.resendAfter--,this.resendAfter<=0)return this.clearResendTimer(),void(this.showResendLink=!0);this.updateResendTimerDisplay()}),1e3)}clearResendTimer(){this.resendTimerId&&(clearInterval(this.resendTimerId),this.resendTimerId=null),this.showResendLink=!1}renderUserDeleteIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",color:"currentColor",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M14.5 8C14.5 5.23858 12.2614 3 9.5 3C6.73858 3 4.5 5.23858 4.5 8C4.5 10.7614 6.73858 13 9.5 13C12.2614 13 14.5 10.7614 14.5 8Z"}),t("path",{d:"M15.5 21L18.5 18M18.5 18L21.5 15M18.5 18L15.5 15M18.5 18L21.5 21"}),t("path",{d:"M2.5 20C2.5 16.134 5.63401 13 9.5 13C10.775 13 11.9704 13.3409 13 13.9365"}))}renderConfirmStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-warning"},this.deleteAccountWarning),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--row"},t("salla-button",{width:"wide",fill:"outline",color:"danger",onClick:()=>this.closeDeleteModal()},this.capitalizeText(this.cancelLabel)),t("salla-button",{width:"wide",color:"primary",loading:this.isSubmitting,onClick:()=>this.initiateDeleteRequest()},this.capitalizeText(this.deleteAccount))))}renderOtpStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-otp-instruction"},this.deleteOtpInstruction),t("p",{class:"s-user-settings-delete-otp-target"},this.getOtpTarget()),t("input",{type:"hidden",name:"code",maxlength:"4",ref:e=>this.hiddenCodeInput=e}),t("div",{class:{"s-user-settings-delete-otp-codes":!0,"has-error":this.otpHasError},dir:"ltr"},[1,2,3,4].map((e=>t("input",{type:"text",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",id:`delete-otp-${e}`,class:{"s-user-settings-delete-otp-input":!0,"s-has-error":this.otpHasError},onInput:e=>this.handleOtpInput(e),onPaste:e=>this.handleOtpPaste(e),onKeyUp:e=>this.handleOtpKeyUp(e),onFocus:e=>this.handleOtpFocus(e),ref:t=>this.otpInputs[e-1]=t,required:!0})))),this.otpHasError&&this.otpErrorMessage?t("span",{class:"s-user-settings-delete-otp-error"},this.otpErrorMessage):"",t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{width:"wide",color:"primary",disabled:this.isSwitchingChannel,onClick:()=>this.verifyDeleteOtp()},this.capitalizeText(this.deleteConfirmOtp)),t("salla-button",{width:"wide",fill:"outline",color:"primary",disabled:this.isVerifyingOtp,onClick:()=>this.switchOtpChannel()},this.capitalizeText("email"===this.otpType?this.sendViaPhone:this.sendViaEmail))),t("p",{class:"s-user-settings-delete-otp-resend",style:{display:this.showResendLink?"none":"block"}},this.resendAfterLabel,t("b",{class:"s-user-settings-delete-otp-timer mx-1 font-bold",ref:e=>this.timerEl=e})),t("a",{href:"#",class:"s-user-settings-delete-otp-resend-link",style:{display:this.showResendLink?"block":"none"},onClick:e=>{e.preventDefault(),this.resendOtp()}},this.resendLabel))}renderSuccessStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-success-body"},this.deleteSuccessMessage),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{class:"s-user-settings-delete-success-btn",width:"wide",color:"primary",onClick:()=>this.confirmSuccess()},this.capitalizeText(this.okLabel))))}renderDeleteStep(){switch(this.currentStep){case"otp":return this.renderOtpStep();case"success":return this.renderSuccessStep();default:return this.renderConfirmStep()}}renderDeleteSectionAction(){return this.isDeletePending?t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",loading:this.isSubmitting,onClick:()=>this.cancelDeleteRequest()},this.capitalizeText(this.cancelDeletionRequest)):t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeleteModal()},this.capitalizeText(this.deleteAccount))}render(){return t(s,{key:"371350c4fcfd92a9434000b1390cb5ab01a92cc5",class:"s-user-settings-wrapper"},this.canHideName&&t("div",{key:"4e4ade371cc81d7e4c5750f5341f30bfcfc082a6",class:"s-user-settings-section"},t("salla-list-tile",{key:"fd23340814c525c686f9c94e17bc6a3d2182ac1e"},t("div",{key:"d0cfc9df3a6072335133ac2817ed9afa34ea489e",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"17546bf4c7931fafdb769168c6cb1788303a6312",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),t("div",{key:"09ec636514d69b741a3cd1a91d5599d0ff34cca1",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),t("div",{key:"f69abae297492ed509475590b2623745efb30f03",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),t("div",{key:"17c0191aae2401b8a1cd22942a5acecc0dfe1c62",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"6b55ddc3ec0a01767f870e279ae7bfad9f43663e",class:"s-toggle"},t("input",{key:"18af334c71b48528543de61a9c3a71a73dc054b5",class:"s-toggle-input",checked:this.isHiddenName,onChange:e=>this.toggleSetting("is_hidden_name",e),type:"checkbox"}),t("div",{key:"c90548df6ff7dc5beceeb2347545923ea4de096e",class:"s-toggle-switcher"}))))),t("div",{key:"c471b3a73abbfbc1a894e5f2c9fcb8af4ea085f5",class:"s-user-settings-section"},t("salla-list-tile",{key:"a906c43c0b227d6f757ec919047cfade9192cdc4"},t("div",{key:"7e4c1375e64883c3465393f855a9faa987137bc1",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"5d8ee4cb69ddf765ddb6c108594c7de4cbedd078",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),t("div",{key:"4e0e5b84822e98234be621eab4150c48581e104b",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),t("div",{key:"ac8521a039e4e869cb1aeea7213df8b70ce87bb7",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),t("div",{key:"6caa3b3d1fe8eadc194ad44a4e2299f9a95018ea",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"37a26623047ef4cb98f7bbdb8715b515488c5ac0",class:"s-toggle"},t("input",{key:"f74fbb125afb8743fc981672ffa56b129c4ed2ed",class:"s-toggle-input",checked:this.isNotifiable,onChange:e=>this.toggleSetting("is_notifiable",e),type:"checkbox"}),t("div",{key:"45b367693d63424e859d4dce5538a2ee37ff76a7",class:"s-toggle-switcher"}))))),this.isDeleteAccountEnabled?t("div",{class:"s-user-settings-section s-user-settings-section-delete-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},this.renderUserDeleteIcon()),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deleteAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.isDeletePending?this.deleteAccountPending:this.deleteAccountDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},this.renderDeleteSectionAction()))):t("div",{class:"s-user-settings-section s-user-settings-section-deactivate-user"},t("salla-list-tile",null,t("div",{slot:"icon",class:"s-user-settings-section-icon"},t("span",{innerHTML:i})),t("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),t("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),t("div",{slot:"action",class:"s-user-settings-section-action"},t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),this.isDeleteAccountEnabled?t("salla-modal",{id:"salla-user-settings-delete-modal",width:"xs",centered:!0,showBack:"otp"===this.currentStep,isClosable:"success"!==this.currentStep,iconStyle:"success"===this.currentStep?"success":void 0,onModalVisibilityChanged:e=>this.handleModalVisibilityChanged(e),onModalBack:()=>this.goBackFromOtp(),ref:e=>this.confirmationModal=e},"success"!==this.currentStep?t("span",{slot:"icon",class:"s-user-settings-delete-icon"},this.renderUserDeleteIcon()):null,t("div",{key:this.currentStep,class:"s-user-settings-delete-step"},this.renderDeleteStep())):t("salla-modal",{width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:e=>this.confirmationModal=e},t("span",{slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:i}),t("div",{class:"s-user-settings-confirmation"},t("div",{class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),t("div",{class:"s-user-settings-confirmation-actions"},t("salla-button",{width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),t("salla-button",{fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.confirmDeactivateAccount()},this.capitalizeText(this.deactivateAccount))))))}};r.style='/*!twlt*/.s-modal-header-inner{display:flex;flex-direction:column !important;align-items:center !important;justify-content:center !important}.s-modal-header-content{text-align:center !important}.s-user-settings-delete-body{text-align:center}.s-user-settings-delete-icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;border-radius:9999px;border:1px solid var(--infinte-color);color:var(--infinte-color);margin:0 auto 1rem}.s-user-settings-delete-icon svg{width:1.5rem;height:1.5rem}.s-user-settings-delete-warning{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-actions--row{display:flex;gap:0.75rem;justify-content:center}.s-user-settings-delete-actions--row salla-button{flex:1}.s-user-settings-delete-actions--stack{display:flex;flex-direction:column;gap:0.75rem;margin-top:1.25rem}.s-user-settings-delete-otp-instruction{color:#6b7280;font-size:0.875rem}.s-user-settings-delete-otp-target{color:#6b7280;direction:ltr;margin-bottom:1.25rem}.s-user-settings-delete-otp-codes{display:flex;justify-content:stretch;gap:0.75rem;direction:ltr;margin-bottom:0.75rem;width:100%}.s-user-settings-delete-otp-codes.has-error{margin-bottom:0}.s-user-settings-delete-otp-input{flex:1 1 0;min-width:0;width:100%;height:3.5rem;text-align:center;border:1px solid #d1d5db;border-radius:0.5rem;font-size:1.25rem;font-weight:600;color:#111827;outline:none}.s-user-settings-delete-otp-input:focus{border-color:#004956;box-shadow:0 0 0 1px #004956}.s-user-settings-delete-otp-input.s-has-error{border-color:#ef4444 !important}.s-user-settings-delete-otp-input.s-has-error:focus{border-color:#ef4444 !important;box-shadow:0 0 0 1px #ef4444}.s-user-settings-delete-otp-input::-webkit-outer-spin-button,.s-user-settings-delete-otp-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-user-settings-delete-otp-input[type=text]{-moz-appearance:textfield}.s-user-settings-delete-otp-error{display:block;color:#ef4444;font-size:0.75rem;text-align:center;padding-top:0.75rem;margin-bottom:1.25rem}.s-user-settings-delete-otp-resend{color:#6b7280;font-size:0.75rem;margin-top:1rem;text-align:center}.s-user-settings-delete-otp-timer{font-weight:600;direction:ltr;display:inline-block}.s-user-settings-delete-otp-resend-link{display:block;color:#004956;font-size:0.875rem;margin-top:1rem;text-align:center;text-decoration:underline;cursor:pointer}.s-user-settings-delete-success-body{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-success-btn{--s-button-color:#004956}.mx-1{margin-left:0.25rem;margin-right:0.25rem}.block{display:block}.hidden{display:none}.font-bold{font-weight:700}.outline{outline-style:solid}.s-has-error{--tw-border-opacity:1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.s-has-error:focus{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.has-error .s-form-label{color:#ff443a}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.toggle-checkbox .s-toggle-input{position:absolute;visibility:hidden}.toggle-checkbox .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.toggle-checkbox .s-toggle-switcher:before,.toggle-checkbox .s-toggle-switcher:after{content:""}.toggle-checkbox .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.toggle-checkbox .s-toggle-input:checked+div{background:#30D158}.toggle-checkbox .s-toggle-input:checked+div:before{left:18px}.s-has-error{--tw-border-opacity:1 !important;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1)) !important;--tw-text-opacity:1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1)) !important}.s-toggle{cursor:pointer;display:inline-block}.s-toggle .s-toggle-input{position:absolute;visibility:hidden}.s-toggle .s-toggle-label{margin-left:5px;position:relative;top:2px}.s-toggle .s-toggle-switcher{display:inline-block;background:#ccc;border-radius:16px;width:40px;height:25px;position:relative;vertical-align:middle;transition:background 0.25s}.s-toggle .s-toggle-switcher:before,.s-toggle .s-toggle-switcher:after{content:""}.s-toggle .s-toggle-switcher:before{display:block;background:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.25);width:20px;height:21px;position:absolute;top:2.2px;left:1px;transition:left 0.25s}.s-toggle .s-toggle-input:checked+div{background:#30D158}.s-toggle .s-toggle-input:checked+div:before{left:18px}.s-user-settings-section{border-bottom-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))}.s-user-settings-section:first-child{border-bottom-right-radius:0px;border-bottom-left-radius:0px;border-top-left-radius:0.375rem;border-top-right-radius:0.375rem}.s-user-settings-section:last-child{border-bottom-right-radius:0.375rem;border-bottom-left-radius:0.375rem;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-width:0px}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}.s-user-settings-section-title{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-user-settings-section-subtitle{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-user-settings-section-icon svg{height:1.25rem;width:1.25rem}.s-user-settings-confirmation{text-align:center}.s-user-settings-confirmation svg{text-align:center}.s-user-settings-confirmation-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-user-settings-confirmation-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-user-settings-confirmation-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-user-settings-confirmation-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-user-settings-confirmation-warning{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-user-settings-confirmation-actions{margin-top:1.25rem;display:flex;align-items:center;justify-content:space-between}.s-user-settings-confirmation-actions>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-user-settings-confirmation-actions:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}';export{r as salla_user_settings}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,H as i}from"./p-
|
|
4
|
+
import{r as t,h as e,H as i}from"./p-DSmjBlMI.js";const s=class{constructor(e){t(this,e),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return e(i,{key:"859bfbc8049ae8391ac35db575f9eac29651d45d"},e("a",{key:"94cfc3500071ef1b45d5120cc0b3f2234978d089",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},e("div",{key:"dcf0437211174d449ef381f96103e3661a0373ae",class:"s-list-tile-item-icon"},e("slot",{key:"e446499ef938c4c6017c57ebf6df800d0324aee0",name:"icon"})),e("div",{key:"87403147cde0cab458181c36d797f85ee9390d8a",class:"s-list-tile-item-content"},e("div",{key:"b585f7f0f23d83cb8b128d7a225d6561430bf81e",class:"s-list-tile-item-title"},e("slot",{key:"756b1d8edbc9272a4aae4fa1e63c8531ca8851f5",name:"title"})),e("div",{key:"1ce5eae34219802f67eea914efb1d2300ea7e896",class:"s-list-tile-item-subtitle"},e("slot",{key:"8bac18580d009d7d910f4e92b798ff3338ce6632",name:"subtitle"}))),e("div",{key:"2477624cd43d6c0292d40395e38a0a4fe6d07be4",class:"s-list-tile-item-action"},e("slot",{key:"b51e25e3f127e39289dd4d8949fc72d1b9cbd044",name:"action"}))))}};s.style='/*!twlt*/.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-gifting-widget .s-list-tile-item-icon{display:none}.s-gifting-widget-vertical .s-list-tile-item-icon{display:block}.s-gifting-widget-vertical .s-list-tile-item-title svg{fill:var(--color-primary)}.s-gifting-widget-vertical .s-list-tile-item-subtitle{padding-right:3.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-gifting-widget-vertical .s-list-tile-item{flex-wrap:wrap;padding:0px}@media (min-width: 1024px){.s-gifting-widget-vertical .s-list-tile-item-action{flex:1 1 0%}}.s-gifting-widget .s-list-tile-item{flex-direction:column;justify-content:space-between;gap:1rem;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1.25rem;text-align:center}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item{text-align:left}}@media (min-width: 1024px){.s-gifting-widget .s-list-tile-item{flex-direction:row}}@media (min-width: 768px){.s-gifting-widget .s-list-tile-item:where([dir="rtl"],[dir="rtl"] *){text-align:right}}.s-list-tile-item{position:relative;display:flex;align-items:center;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));text-decoration-line:none}.s-list-tile-item-href{cursor:pointer}.s-list-tile-item-icon{margin-right:1rem;flex-shrink:0}.s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:1rem;margin-right:0px}.s-list-tile-item-title{font-size:1rem;line-height:1.5rem}.s-list-tile-item-subtitle{font-size:0.875rem;line-height:1.25rem}.s-loyalty-skeleton .s-list-tile-item-content{display:block;width:100%}.s-loyalty-widget .s-list-tile-item{padding:0px !important}.s-loyalty-after-exchange .s-list-tile-item{position:relative;justify-content:space-between;overflow:hidden;border-radius:var(--s-radius, 0.25rem);padding-top:0.75rem;padding-bottom:0.75rem}.s-loyalty-after-exchange .s-list-tile-item::after{pointer-events:none;position:absolute;inset:0px;display:block;height:100%;width:100%;background-color:var(--color-primary);opacity:.08;--tw-content:\'\';content:var(--tw-content)}.s-loyalty-after-exchange .s-list-tile-item .s-list-tile-item-title{font-size:15px}.s-loyalty-program-after-exchange .s-list-tile-item{position:relative;justify-content:space-between;overflow:hidden;border-radius:var(--s-radius, 0.25rem);background-color:var(--color-primary);padding-top:0.75rem;padding-bottom:0.75rem}.s-loyalty-program-after-exchange .s-list-tile-item .s-list-tile-item-title{font-size:0.875rem;line-height:1.25rem}.s-loyalty-program-panel-widget .s-list-tile-item{padding:0px !important}.s-scopes-skeleton .s-list-tile-item-content{display:block;width:100%}.s-scopes-skeleton .s-list-tile-item-icon{margin-right:2rem}.s-scopes-skeleton .s-list-tile-item-icon:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:2rem}.s-user-settings-section .s-list-tile-item{align-items:flex-start;background-color:transparent;padding:1.25rem}@media (min-width: 768px){.s-user-settings-section .s-list-tile-item{align-items:center}}.s-user-settings-section .s-list-tile-item-action{margin-left:auto}.s-user-settings-section .s-list-tile-item-action:where([dir="rtl"],[dir="rtl"] *){margin-right:auto;margin-left:0px}.s-user-settings-section .s-list-tile-item-action button{width:100%;padding:10px}.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:wrap}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item{flex-wrap:nowrap}}.s-user-settings-section-delete-user .s-list-tile-item-icon{position:relative;top:5px}@media (min-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-icon{top:0px}}@media (max-width: 768px){.s-user-settings-section-delete-user .s-list-tile-item-content{flex:1 0 85%}.s-user-settings-section-delete-user .s-list-tile-item-action{flex:1 1 100%;margin-top:1rem}}';export{s as salla_list_tile}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as i,H as e,a as o}from"./p-C670SYee.js";var r,n;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product",t.FREE_SHIPPING="free_shipping"}(r||(r={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(n||(n={}));const s=Object.freeze([]);let a,l=null,c=null,d=!1,f=null,h=null,u=0;function g(t){return"CartNotCreated"===t?.name}function m(){try{const t=salla.api?.cart?.getStoredCartId?salla.api.cart.getStoredCartId():salla.storage?.get?.("cart.id");return null==t||""===t?null:String(t)}catch(t){return null}}function p(){const t=m();void 0!==a&&a!==t&&(u++,l=null,c=null,d=!1,f=null),a=t}function b(t){return null==t?0:"number"==typeof t?isFinite(t)?t:0:"string"==typeof t&&parseFloat(t)||0}function w(t){if(null==t||""===t)return null;const i=b(t);return isFinite(i)?i:null}function y(t,i){if(null!==i)return i.length;const e=w(t?.data?.cart?.count??t?.data?.count??t?.cart?.count??t?.count);return null!==e&&e>=0?e:null}function x(t){for(const i of[t?.original_price,t?.product_price,t?.price]){const t=w(i&&"object"==typeof i?i.amount:i);if(null!==t&&t>0)return t}return null}function v(t,i){const e=t?.free_gift_quantity;return null!=e&&""!==e?b(e):i>0?i:0}function k(t){const i=[];for(const e of t){if(null==e?.id)continue;if(!e.added_by_offer)continue;const t=b(e.quantity),o=v(e,t);o<=0||i.push({id:String(e.id),offerId:w(e.offer_id),quantity:o,freeQuantity:o,lineQuantity:t,name:String(e.product_name??e.name??""),imageUrl:String(e.product_image?.url??e.product_image??e.image?.url??""),imageAlt:String(e.product_image?.alt??e.image?.alt??e.product_name??""),url:String(e.url??""),originalPrice:x(e)})}return i}function _(){if(f)return f;const t=u,i=Promise.resolve().then((()=>salla.api?.cart?.details?.())).then((t=>{const i=function(t){const i=t?.data?.cart?.items??t?.data?.items??t?.cart?.items??t?.items;return Array.isArray(i)?i:null}(t);return{gifts:k(i??[]),count:y(t,i),ok:!0}})).catch((t=>({gifts:l??[],count:g(t)?0:c,ok:!1}))).then((({gifts:i,count:e,ok:o})=>{t===u&&(l=i,c=e,d=o)})).finally((()=>{f===i&&(f=null)}));return f=i,i}const C=-1;var M,T;function z(t){const i="number"==typeof t?t:parseFloat(t);return Number.isFinite(i)?i:null}function S(t){return"boolean"==typeof t?t:1===t||0===t?1===t:"true"===t||"1"===t||"false"!==t&&"0"!==t&&void 0}function L(t){return z(t)??0}function I(t,i,e){return Math.max(i,Math.min(t,e))}function V(t){const i="number"==typeof t?t:parseFloat(t);if(!Number.isFinite(i))return null;const e=Math.trunc(i);return e>=0&&e<=4?e:null}!function(t){t.LOCKED="locked",t.CURRENT="current",t.COMPLETED="completed"}(M||(M={})),function(t){t.CURRENCY="currency",t.COUNT="count"}(T||(T={}));const F=[1e3,2e3,4e3],R='[data-testid^="store-cart-item-"], form[id^="item-"]';let $=0;const P={badges_summary:":completed of :total offers unlocked",congrats:"Congratulations! You’ve unlocked all rewards in this promotion",details_title:"Offer details",free_gift:"Free Gift",free_products_title:"Free products selected from the offer",guidance_conditions_unmet:"Your cart doesn’t meet the conditions for the next reward yet",guidance_next:"Add :remaining and get :reward",guidance_next_generic:"Add :remaining to unlock the next reward",manage_offer:"Manage offer",tier_requirement:"Spend :threshold and get :reward",tier_requirement_count:"Buy :threshold and get :reward",tier_requirement_count_generic:"Buy :threshold to unlock this offer",tier_requirement_generic:"Spend :threshold to unlock this offer",tier_title:"Offer (:number)"},j="pages.checkout.free_charge";function H(t){const i=document.createElement("div");return i.textContent=t??"",i.innerHTML}const O=(t={})=>i("svg",{class:t.class,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M5.00016 9.16634C2.69898 9.16634 0.833496 7.30084 0.833496 4.99967C0.833496 2.69849 2.69898 0.833008 5.00016 0.833008C7.30133 0.833008 9.16683 2.69849 9.16683 4.99967C9.16683 7.30084 7.30133 9.16634 5.00016 9.16634ZM4.58458 6.66634L7.53087 3.72006L6.94162 3.13081L4.58458 5.48784L3.40608 4.3093L2.81683 4.89859L4.58458 6.66634Z",fill:"currentColor"})),q=(t={})=>i("svg",{class:t.class,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M12.6667 6.66683H13.3333C13.7015 6.66683 14 6.9653 14 7.3335V14.0002C14 14.3684 13.7015 14.6668 13.3333 14.6668H2.66667C2.29848 14.6668 2 14.3684 2 14.0002V7.3335C2 6.9653 2.29848 6.66683 2.66667 6.66683H3.33333V6.00016C3.33333 3.42284 5.42267 1.3335 8 1.3335C10.5773 1.3335 12.6667 3.42284 12.6667 6.00016V6.66683ZM11.3333 6.66683V6.00016C11.3333 4.15922 9.84093 2.66683 8 2.66683C6.15905 2.66683 4.66667 4.15922 4.66667 6.00016V6.66683H11.3333ZM7.33333 9.3335V12.0002H8.66667V9.3335H7.33333Z",fill:"currentColor"})),N=(t={})=>i("svg",{class:t.class,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M7.00033 12.8337C3.77866 12.8337 1.16699 10.222 1.16699 7.00033C1.16699 3.77866 3.77866 1.16699 7.00033 1.16699C10.222 1.16699 12.8337 3.77866 12.8337 7.00033C12.8337 10.222 10.222 12.8337 7.00033 12.8337ZM6.41699 6.41699V9.91699H7.58366V6.41699H6.41699ZM6.41699 4.08366V5.25033H7.58366V4.08366H6.41699Z",fill:"currentColor"})),B=class{constructor(i){t(this,i),this.offer=null,this.isLoading=!1,this.canRender=!0,this.gifts=[],this.cartItemCount=null,this.isTooltipHovered=!1,this.isTooltipPinned=!1,this.isGiftsOpen=!0,this.instanceId=++$,this.refreshGeneration=0,this.giftsGeneration=0,this.cartRefreshTimer=null,this.cartRefreshPending=!1,this.wantsCartUpdates=!1,this.isListeningToCartUpdates=!1,this.cartLookupRetryTimer=null,this.cartLookupRetries=0,this.cartLookupRetryPending=!1,this.deferredByEmptyCart=!1,this.isDisconnected=!1,this.skeletonWatchdog=null,this.skeletonDeadline=0,this.hasRelocated=!1,this.hasLoaded=!1,this.relocationObserver=null,this.relocationWatchTimer=null,this.relocationWatchExpired=!1,this.relocationLogged=!1,this.cartUpdatedHandler=t=>{this.readCartCountFromEvent(t),this.clearCartLookupRetry(),this.scheduleCartRefresh()}}componentWillLoad(){this.ensureSkeletonIsWatched();try{this.isEnabled()&&this.startLoading(),this.load().catch((t=>{this.stopLoading(),this.safeLog("load() failed",t)}))}catch(t){this.stopLoading(),this.safeLog("componentWillLoad threw synchronously",t)}}safeLog(t,i){try{salla.logger.warn("salla-conditional-offer::",t,i)}catch(t){}}connectedCallback(){this.isDisconnected=!1,this.ensureSkeletonIsWatched(),this.wantsCartUpdates&&!this.isListeningToCartUpdates&&this.subscribeToCartUpdates()&&(this.cartRefreshPending=!0),this.cartRefreshPending&&this.scheduleCartRefresh(),this.cartLookupRetryPending&&this.scheduleCartLookupRetry()}disconnectedCallback(){this.isDisconnected=!0,null!==this.cartRefreshTimer&&(clearTimeout(this.cartRefreshTimer),this.cartRefreshTimer=null),null!==this.cartLookupRetryTimer&&(clearTimeout(this.cartLookupRetryTimer),this.cartLookupRetryTimer=null),Promise.resolve().then((()=>{this.isDisconnected&&this.unsubscribeFromCartUpdates()})),null!==this.skeletonWatchdog&&(clearTimeout(this.skeletonWatchdog),this.skeletonWatchdog=null),this.stopWatchingForItemsColumn()}componentDidLoad(){this.hasLoaded=!0,this.relocateIntoItemsColumn()}isShowingSomething(){return this.canRender&&this.hasCartItems()}componentDidRender(){this.hasLoaded&&this.relocateIntoItemsColumn(),this.positionTooltip(),this.ensureSkeletonIsWatched()}relocateIntoItemsColumn(){if(!this.hasRelocated&&this.isShowingSomething())try{const t=this.hostEl;if(!t?.parentElement)return;const i=this.findItemsColumn(t);if(!i)return void this.watchForItemsColumn();if(this.hasRelocated=!0,this.stopWatchingForItemsColumn(),i===t.parentElement&&i.firstElementChild===t)return;i.insertBefore(t,i.firstChild)}catch(t){this.hasRelocated=!0,this.stopWatchingForItemsColumn(),this.safeLog("relocating the banner into the cart items column failed",t)}}findItemsColumn(t){let i=t;for(let e=0;i&&e<=3;e++){for(const e of this.getFollowingSiblings(i)){if(i===t&&this.matches(e,R))return t.parentElement;const o=this.findColumnWithin(e,t);if(o)return o}if(i=i.parentElement,!i||i===document.body||i===document.documentElement)break}return null}getFollowingSiblings(t){const i=[];for(let e=t.nextElementSibling;e;e=e.nextElementSibling)i.push(e);return i}findColumnWithin(t,i){const e=t.querySelector(R),o=(e?this.climbToChildOf(e,t):null)??t.querySelector(".main-content, [data-cart-items]");return!o||o===i||o.contains(i)?null:o}climbToChildOf(t,i){let e=t;for(;e&&e.parentElement&&e.parentElement!==i;)e=e.parentElement;return e?.parentElement===i?e:null}matches(t,i){return"function"==typeof t.matches&&t.matches(i)}watchForItemsColumn(){this.hasRelocated||this.relocationWatchExpired||this.relocationObserver||("undefined"!=typeof MutationObserver?(this.relocationObserver=new MutationObserver((()=>this.relocateIntoItemsColumn())),this.relocationObserver.observe(document.documentElement,{childList:!0,subtree:!0}),this.relocationWatchTimer=setTimeout((()=>{this.relocationWatchTimer=null,this.relocationWatchExpired=!0,this.stopWatchingForItemsColumn(),this.logNoItemsColumn()}),5e3)):this.logNoItemsColumn())}stopWatchingForItemsColumn(){if(this.relocationObserver){try{this.relocationObserver.disconnect()}catch(t){}this.relocationObserver=null}null!==this.relocationWatchTimer&&(clearTimeout(this.relocationWatchTimer),this.relocationWatchTimer=null)}logNoItemsColumn(){this.relocationLogged||(this.relocationLogged=!0,this.safeLog("no cart items column found — leaving the banner at full page width"))}ensureSkeletonIsWatched(){if(!this.isLoading)return;if(null!==this.skeletonWatchdog)return;const t=Date.now();0===this.skeletonDeadline&&(this.skeletonDeadline=t+8e3);const i=Math.max(0,this.skeletonDeadline-t);this.skeletonWatchdog=setTimeout((()=>{this.skeletonWatchdog=null,this.isLoading&&(Date.now()<this.skeletonDeadline?this.ensureSkeletonIsWatched():(this.isLoading=!1,this.skeletonDeadline=0,this.safeLog("still loading after 8000ms — dropping the skeleton")))}),i)}clearSkeletonWatchdog(){this.skeletonDeadline=0,null!==this.skeletonWatchdog&&(clearTimeout(this.skeletonWatchdog),this.skeletonWatchdog=null)}startLoading(){this.isLoading=!0,this.ensureSkeletonIsWatched()}stopLoading(){this.isLoading=!1,this.clearSkeletonWatchdog()}async load(){this.wantsCartUpdates=!0,this.subscribeToCartUpdates()||this.subscribeWhenSdkIsReady(),this.loadCart(),await this.waitForSdk(),await this.refresh()}waitForSdk(){let t,i;try{t=Promise.resolve(salla.onReady?.())}catch(t){return this.safeLog("salla.onReady() threw",t),Promise.resolve()}const e=new Promise((t=>{i=setTimeout(t,3e3)}));return Promise.race([t.catch((t=>this.safeLog("salla.onReady() rejected",t))),e]).then((()=>{clearTimeout(i)}))}subscribeToCartUpdates(){if(this.isListeningToCartUpdates)return!0;try{salla.event.on("cart::updated",this.cartUpdatedHandler),this.isListeningToCartUpdates=!0}catch(t){this.safeLog("cart::updated subscription failed",t)}return this.isListeningToCartUpdates}unsubscribeFromCartUpdates(){if(this.isListeningToCartUpdates){this.isListeningToCartUpdates=!1;try{salla.event.off("cart::updated",this.cartUpdatedHandler)}catch(t){this.safeLog("cart::updated unsubscription failed",t)}}}subscribeWhenSdkIsReady(){let t;try{t=Promise.resolve(salla.onReady?.())}catch(t){return}const i=()=>{this.isDisconnected||this.subscribeToCartUpdates()};t.then(i,i)}scheduleCartRefresh(){this.cartRefreshPending=!0,null!==this.cartRefreshTimer&&clearTimeout(this.cartRefreshTimer),this.cartRefreshTimer=null,this.isDisconnected||(this.cartRefreshTimer=setTimeout((()=>{this.cartRefreshTimer=null,this.runCartRefresh()}),200))}runCartRefresh(){this.isDisconnected||(this.cartRefreshPending=!1,this.refresh(),function(){if(h)return h;u++,l=null,c=null,d=!1,a=m();const t=()=>(h===i&&(h=null),_()),i=(f??Promise.resolve()).then(t,t).finally((()=>{h===i&&(h=null)}));return h=i,i}().then((()=>this.loadCart()),(()=>this.loadCart())))}readCartCountFromEvent(t){const i=this.toCartCount(t?.count)??this.readCartCountFromStorage();null!==i&&(this.cartItemCount=i)}readCartCountFromStorage(){try{return this.toCartCount(salla.storage?.get?.("cart.summary.count"))}catch(t){return null}}toCartCount(t){return"number"==typeof t&&Number.isFinite(t)&&t>=0?t:null}getFreeLabel(){const t=salla.lang.get(j);return t&&t!==j?t:"Free"}trans(t,i){const e=`blocks.cart_offer.${t}`,o=salla.lang.get(e,i);return o&&o!==e?o:Object.entries(i??{}).reduce(((t,[i,e])=>t.split(`:${i}`).join(e)),P[t])}isEnabled(){try{return!!salla.config.get("store.features")?.includes("conditional-offer")}catch(t){return!1}}async fetchOffer(){const{data:t}=await salla.api.cart.offers(),i=(t||[]).find((t=>"conditional"===t.type));return i?.details?.discounts?.length?i:null}async refresh(){const t=++this.refreshGeneration;if(!this.isEnabled())return this.stopLoading(),void(this.canRender=!1);if(0===this.cartItemCount)return this.stopLoading(),p(),void(d||(this.deferredByEmptyCart=!0,this.loadCart()));this.deferredByEmptyCart=!1,this.offer?this.stopLoading():this.startLoading();try{const i=await this.fetchOffer();if(this.isSuperseded(t))return;if(!i)return this.offer=null,void(this.canRender=!1);this.offer=i,this.canRender=!0,this.loadCart()}catch(i){if(this.isSuperseded(t))return;this.safeLog("offers() failed",i)}finally{t===this.refreshGeneration&&this.stopLoading()}}hasCartItems(){return"number"==typeof this.cartItemCount&&this.cartItemCount>=1}isSuperseded(t){return t!==this.refreshGeneration||this.isDisconnected}loadCart(){const t=++this.giftsGeneration;return Promise.all([(p(),d&&l?Promise.resolve(l):_().then((()=>l??s))),(p(),d&&l?Promise.resolve(c):_().then((()=>c)))]).then((([i,e])=>{t!==this.giftsGeneration||this.isDisconnected||this.cartRefreshPending||(null!==e&&(this.cartItemCount=e),null!==e?this.clearCartLookupRetry():null===this.cartItemCount&&this.scheduleCartLookupRetry(),this.deferredByEmptyCart&&this.hasCartItems()&&(this.deferredByEmptyCart=!1,this.refresh()),this.gifts=this.offer?this.selectOwnGifts(i):[])})).catch((t=>{this.safeLog("cart lookup failed",t)}))}scheduleCartLookupRetry(){this.cartLookupRetries>=F.length||(this.cartLookupRetryPending=!0,null!==this.cartLookupRetryTimer||this.isDisconnected||(this.cartLookupRetryTimer=setTimeout((()=>{this.cartLookupRetryTimer=null,this.cartLookupRetryPending=!1,this.canRender&&(this.cartLookupRetries++,this.loadCart())}),F[this.cartLookupRetries])))}clearCartLookupRetry(){this.cartLookupRetries=0,this.cartLookupRetryPending=!1,null!==this.cartLookupRetryTimer&&(clearTimeout(this.cartLookupRetryTimer),this.cartLookupRetryTimer=null)}selectOwnGifts(t){const i=Number(this.offer?.id);if(!Number.isFinite(i))return t;const e=t.filter((t=>null!==t.offerId&&Number(t.offerId)===i));return e.length?e:t.filter((t=>null===t.offerId))}getStages(){const t=(this.offer?.details?.discounts??[]).filter((({min_spend:t})=>null!==z(t)));return i=({min_spend:t})=>t,e=({id:t})=>t,(t??[]).map(((t,o)=>({item:t,index:o,threshold:L(i(t)),identity:e?z(e(t)):null}))).sort(((t,i)=>t.threshold!==i.threshold?t.threshold-i.threshold:null!==t.identity&&null!==i.identity&&t.identity!==i.identity?t.identity-i.identity:t.index-i.index)).map((({item:t})=>t));var i,e}getProgress(t){return function(t,i,e=0,o=[],r=[]){const n=(i??[]).map(((t,i)=>({index:i,threshold:z(t),applied:S(o?.[i]),tierValue:z(r?.[i])}))).filter((t=>null!==t.threshold)).sort(((t,i)=>t.threshold-i.threshold||t.index-i.index)),s=n.map((t=>t.threshold)),a=n.map((t=>t.applied)),l=a.some((t=>void 0!==t)),c=L(e);if(!s.length)return{thresholds:s,met:[],applied:a,appliedIndex:C,hasEngineVerdict:l,metCount:0,nextUnmetIndex:C,allMet:!1,lastReachedIndex:C,currentIndex:C,isComplete:!1,value:Math.max(0,L(t)),values:[],startValue:c,fills:[],overallPercentage:0};const d=s[s.length-1],f=I(L(t),0,Math.max(0,d)),h=n.map((({tierValue:t})=>null===t?f:I(t,0,Math.max(0,d))));let u=C;for(let t=0;t<s.length;t++)h[t]>=s[t]&&(u=t);const g=u===s.length-1,m=g?C:u+1,p=s.map(((t,i)=>function(t,i,e){return e<=i?t>=e?100:0:I((t-i)/(e-i)*100,0,100)}(h[i],0===i?c:s[i-1],t))),b=g?100:I((u+1+(p[m]??0)/100)/s.length*100,0,100);let w=C;for(let t=0;t<a.length;t++)!0===a[t]&&(w=t);const y=s.map(l?(t,i)=>i<=w:(t,i)=>i<=u),x=y.filter(Boolean).length,v=y.findIndex((t=>!t));return{thresholds:s,met:y,applied:a,appliedIndex:w,hasEngineVerdict:l,metCount:x,nextUnmetIndex:v,allMet:v===C,lastReachedIndex:u,currentIndex:m,isComplete:g,value:f,values:h,startValue:c,fills:p,overallPercentage:b}}(this.offer?.details?.current_value,t.map((({min_spend:t})=>t)),this.offer?.details?.start_value,t.map((({is_applied:t})=>t)),t.map((({current_value:t})=>t)))}tierKey(t,i){const e=Number(t?.id);return Number.isFinite(e)?`tier-${e}`:`pos-${i}`}stageMeasure(){return this.offer?.details?.based_on===n.PRODUCT_COUNT?T.COUNT:T.CURRENCY}formatRequirement(t){const i=this.offer?.details?.based_on;if(i===n.PRODUCT_COUNT)try{return salla.lang.choice("blocks.header.products_count",t)}catch(i){return this.safeLog("invalid products_count interval",i),`${t}`}return i===n.PRODUCT_PURCHASE?salla.money(t):(this.safeLog(`unexpected offer detail's based_on value: ${i}`),`${t}`)}getRewardText(t){return(t?.reward_label??"").trim()}getGuidanceMessage(t,i){if(i.nextUnmetIndex===C)return"";const e=function(t,i,e=T.CURRENCY){const o=i.thresholds[t];if(void 0===o)return 0;const r=Math.max(0,o-(i.values?.[t]??i.value));if(0===r)return 0;const n=e===T.COUNT?0:function(){try{const t="undefined"!=typeof salla?salla:void 0,i=V(t?.config?.currency?.()?.decimals);if(null!==i)return i;const e=V(t?.config?.get?.("store.currency.decimals"));if(null!==e)return e}catch(t){}return 2}(),s=Math.pow(10,n),a=Math.ceil(r*s-1e-6)/s;return a>0?a:1/s}(i.nextUnmetIndex,i,this.stageMeasure());if(e<=0)return this.trans("guidance_conditions_unmet");const o=this.formatRequirement(e),r=this.getRewardText(t[i.nextUnmetIndex]);return r?this.trans("guidance_next",{remaining:o,reward:H(r)}):this.trans("guidance_next_generic",{remaining:o})}getTierSentence(t,i,e){const o=this.formatRequirement(e.thresholds[i]),r=this.getRewardText(t),n=this.stageMeasure()===T.COUNT;return r?this.trans(n?"tier_requirement_count":"tier_requirement",{threshold:o,reward:H(r)}):this.trans(n?"tier_requirement_count_generic":"tier_requirement_generic",{threshold:o})}getRewardIcon(t){switch(t?.type){case r.PERCENTAGE:return"sicon-percentage";case r.FREE_PRODUCT:return"sicon-gift";case r.FIXED:return this.usesSarSymbol()?"sicon-sar":"sicon-banknote";default:return"sicon-tag"}}usesSarSymbol(){try{const t=salla.config.currency?.()?.symbol;return["SAR","ر.س"].includes(t)&&!!salla.config.get("store.settings.use_sar_symbol")}catch(t){return!1}}get isTooltipOpen(){return this.isTooltipHovered||this.isTooltipPinned}toggleTooltip(){this.isTooltipPinned=!this.isTooltipPinned}closeTooltip(t=!1){this.isTooltipOpen&&(this.isTooltipPinned=!1,this.isTooltipHovered=!1,t&&this.infoTriggerEl?.focus?.())}positionTooltip(){const t=this.tooltipEl,i=this.infoTriggerEl;if(this.isTooltipOpen&&t&&i)try{this.setTooltipOffsets(t,0,0);const e=window.innerWidth||document.documentElement?.clientWidth||0,o=t.getBoundingClientRect(),r=i.getBoundingClientRect(),n=o?.width||0;if(n<=0||e<=0)return;const s=r.left+r.width/2-n/2,a=8,l=Math.min(Math.max(s,a),Math.max(a,e-a-n))-s,c=Math.max(0,n/2-16),d=Math.min(Math.max(-l,-c),c);this.setTooltipOffsets(t,l,d)}catch(t){this.safeLog("positioning the offer details popover failed",t)}}setTooltipOffsets(t,i,e){t.style?.setProperty?.("--s-conditional-offer-tooltip-shift",`${Math.round(i)}px`),t.style?.setProperty?.("--s-conditional-offer-tooltip-caret",`${Math.round(e)}px`)}handleWindowResize(){this.positionTooltip()}handleDocumentKeydown(t){"Escape"!==t.key&&"Esc"!==t.key||this.closeTooltip(!0)}handleDocumentClick(t){if(!this.isTooltipPinned||!this.infoAnchorEl)return;const i="function"==typeof t.composedPath?t.composedPath():[];(i.length?i.includes(this.infoAnchorEl):this.infoAnchorEl.contains(t.target))||this.closeTooltip()}elementId(t){return`s-conditional-offer-${t}-${this.instanceId}`}renderBadges(t,e){return i("div",{class:"s-conditional-offer-badges",role:"img","aria-label":this.trans("badges_summary",{completed:`${e.metCount}`,total:`${t.length}`})},t.map(((t,o)=>{const r=e.met[o],n=this.tierKey(t,o);return[o>0?i("span",{key:`${n}-link`,class:{"s-conditional-offer-badge-link":!0,"s-conditional-offer-badge-link-met":r,"s-conditional-offer-badge-link-unmet":!r},"aria-hidden":"true"}):null,i("span",{key:n,class:{"s-conditional-offer-badge":!0,"s-conditional-offer-badge-met":r,"s-conditional-offer-badge-unmet":!r},"data-tier-state":r?"met":"unmet","data-tier-id":t?.id??void 0},i(r?O:q,{class:"s-conditional-offer-badge-icon"}))]})))}renderTooltip(t,e){const o=function(t){const i=t?.details?.rules;if("string"==typeof i){const t=i.trim();return""===t?null:t}if(Array.isArray(i)){const t=i.filter((t=>"string"==typeof t)).map((t=>t.trim())).filter((t=>""!==t)).join(" ");return""===t?null:t}return null}(this.offer);return i("div",{class:"s-conditional-offer-tooltip",id:this.elementId("tooltip"),role:"tooltip",ref:t=>this.tooltipEl=t},i("div",{class:"s-conditional-offer-tooltip-title"},this.offer?.title),o?i("div",{class:"s-conditional-offer-tooltip-description"},o):null,i("ul",{class:"s-conditional-offer-tooltip-list"},t.map(((t,o)=>{const r=e.met[o];return i("li",{key:this.tierKey(t,o),class:"s-conditional-offer-tier","data-tier-state":r?"met":"unmet","data-tier-id":t?.id??void 0},i("span",{class:{"s-conditional-offer-tier-icon":!0,"s-conditional-offer-tier-icon-met":r,"s-conditional-offer-tier-icon-unmet":!r}},i("i",{class:this.getRewardIcon(t),"aria-hidden":"true"}),i("span",{class:{"s-conditional-offer-tier-status":!0,"s-conditional-offer-tier-status-met":r,"s-conditional-offer-tier-status-unmet":!r},"aria-hidden":"true"},r?i(O,{class:"s-conditional-offer-tier-status-check"}):i(q,{class:"s-conditional-offer-tier-status-lock"}))),i("div",{class:"s-conditional-offer-tier-body"},i("div",{class:"s-conditional-offer-tier-title"},this.trans("tier_title",{number:`${o+1}`})),i("div",{class:{"s-conditional-offer-tier-text":!0,"s-conditional-offer-tier-text-met":r},innerHTML:this.getTierSentence(t,o,e)})))}))))}renderGiftsToggle(t){return i("button",{type:"button",id:this.elementId(`toggle-${t}`),class:{"s-conditional-offer-toggle":!0,"s-conditional-offer-toggle-inline":"inline"===t,"s-conditional-offer-toggle-bar":"bar"===t},"aria-expanded":this.isGiftsOpen?"true":"false","aria-controls":this.elementId("gifts"),onClick:()=>this.isGiftsOpen=!this.isGiftsOpen},i("span",null,this.trans("manage_offer")),i("i",{class:{"sicon-keyboard_arrow_down":!0,"s-conditional-offer-toggle-icon":!0,"s-conditional-offer-toggle-icon-open":this.isGiftsOpen},"aria-hidden":"true"}))}renderGiftsCard(){return i("div",{class:"s-conditional-offer-panel",id:this.elementId("gifts")},i("div",{class:"s-conditional-offer-gifts-header"},i("span",{class:"s-conditional-offer-gifts-icon"},i("i",{class:"sicon-gift","aria-hidden":"true"})),i("span",{class:"s-conditional-offer-gifts-title"},this.trans("free_products_title"))),i("ul",{class:"s-conditional-offer-gifts-list"},this.gifts.map((t=>this.renderGiftRow(t)))))}renderGiftRow(t){return i("li",{class:"s-conditional-offer-gift","data-item-id":t.id},i("span",{class:"s-conditional-offer-gift-thumb"},t.imageUrl?i("img",{class:"s-conditional-offer-gift-image",src:t.imageUrl,alt:t.imageAlt||t.name,loading:"lazy",decoding:"async"}):i("i",{class:"sicon-gift","aria-hidden":"true"})),i("div",{class:"s-conditional-offer-gift-body"},i("span",{class:"s-conditional-offer-gift-name"},t.name||this.trans("free_gift")),i("span",{class:"s-conditional-offer-gift-prices"},i("span",{class:"s-conditional-offer-gift-free"},this.getFreeLabel()),null!==t.originalPrice?i("span",{class:"s-conditional-offer-gift-price",innerHTML:salla.money(t.originalPrice)}):null)))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-root"},i("div",{class:"s-conditional-offer-banner"},i("div",{class:"s-conditional-offer-lead"},i("salla-skeleton",{height:"24px",width:"80px"}),i("div",{class:"s-conditional-offer-skeleton-text"},i("salla-skeleton",{height:"12px",width:"35%"}),i("salla-skeleton",{height:"16px",width:"60%"})))))}render(){if(!this.canRender)return null;if(!this.hasCartItems())return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;const t=this.getStages(),o=this.getProgress(t),r=this.getGuidanceMessage(t,o),n=this.trans("details_title"),s=this.gifts.length>0;return i(e,{class:"s-conditional-offer-root"},i("div",{class:"s-conditional-offer-banner"},i("div",{class:"s-conditional-offer-lead"},this.renderBadges(t,o),i("div",{class:"s-conditional-offer-text"},i("div",{class:"s-conditional-offer-heading",onMouseEnter:()=>this.isTooltipHovered=!0,onMouseLeave:()=>this.isTooltipHovered=!1},i("span",{class:"s-conditional-offer-name"},this.offer.title),i("span",{class:"s-conditional-offer-info",ref:t=>this.infoAnchorEl=t},i("button",{type:"button",class:"s-conditional-offer-info-trigger",ref:t=>this.infoTriggerEl=t,"aria-label":n,title:n,"aria-expanded":this.isTooltipOpen?"true":"false","aria-describedby":this.elementId("tooltip"),onClick:()=>this.toggleTooltip()},i(N,{class:"s-conditional-offer-info-icon"})),this.isTooltipOpen?this.renderTooltip(t,o):null)),o.allMet?i("div",{class:"s-conditional-offer-message",role:"status"},this.trans("congrats")):r?i("div",{class:"s-conditional-offer-message",innerHTML:r}):null)),s?this.renderGiftsToggle("inline"):null),s&&this.isGiftsOpen?this.renderGiftsCard():null,s?this.renderGiftsToggle("bar"):null)}get hostEl(){return o(this)}};B.style='/*!twlt*/:host{display:block}.s-conditional-offer-root{background-color:rgba(0, 137, 123, 0.06);background-color:color-mix(in srgb, var(--color-primary, #00897b) 7%, transparent)}.s-conditional-offer-badges::-webkit-scrollbar{height:3px}.s-conditional-offer-badges::-webkit-scrollbar-thumb{border-radius:9999px;background-color:rgba(0, 0, 0, 0.15)}.s-conditional-offer-badges::-webkit-scrollbar-track{background-color:transparent}.s-conditional-offer-tooltip{--s-conditional-offer-tooltip-shift:0px;--s-conditional-offer-tooltip-caret:0px;transform:translateX(calc(-50% + var(--s-conditional-offer-tooltip-shift)))}.s-conditional-offer-tooltip::before{content:"";position:absolute;bottom:100%;left:50%;transform:translateX(calc(-50% + var(--s-conditional-offer-tooltip-caret)));border:8px solid transparent;border-bottom-color:#fff}.s-conditional-offer-tier-icon-met,.s-conditional-offer-tier-icon-unmet{color:var(--color-primary-dark, #00695c);background-color:rgba(0, 137, 123, 0.12);background-color:color-mix(in srgb, var(--color-primary, #00897b) 14%, transparent)}.s-conditional-offer-tier:not(:last-child)::before{content:"";position:absolute;top:2.5rem;bottom:-1rem;inset-inline-start:1.125rem;width:1px;background-color:#d1d5db}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.w-6{width:1.5rem}.resize{resize:both}.gap-1{gap:0.25rem}.rounded{border-radius:var(--s-radius, 0.25rem)}.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-conditional-offer-root{margin-bottom:1.25rem;display:block;width:100%;min-width:0px;max-width:100%;border-radius:0.375rem;padding:0.75rem}@media (min-width: 768px){.s-conditional-offer-root{padding:1rem}}.s-conditional-offer-banner{display:flex;width:100%;min-width:0px;align-items:center;justify-content:space-between;gap:0.75rem}@media (min-width: 768px){.s-conditional-offer-banner{gap:1rem}}.s-conditional-offer-lead{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.5rem}@media (min-width: 768px){.s-conditional-offer-lead{gap:0.75rem}}.s-conditional-offer-badges{display:flex;max-width:45%;flex-shrink:0;flex-wrap:nowrap;align-items:center;gap:0.25rem;overflow-x:auto;overscroll-behavior-x:contain;scroll-behavior:smooth;scrollbar-width:thin}.s-conditional-offer-badge{display:inline-flex;height:1.5rem;width:1.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;font-size:11px;line-height:1;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-conditional-offer-badge-met{background-color:var(--color-primary)}.s-conditional-offer-badge-unmet{--tw-bg-opacity:1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.s-conditional-offer-badge-link{width:0.5rem;flex-shrink:0;border-top-width:1px}.s-conditional-offer-badge-link-met{border-color:var(--color-primary)}.s-conditional-offer-badge-link-unmet{border-style:dashed;--tw-border-opacity:1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.s-conditional-offer-badge-icon{height:0.75rem;width:0.75rem;flex-shrink:0}.s-conditional-offer-text{display:flex;min-width:0px;flex-direction:column;gap:0.125rem;text-align:start}.s-conditional-offer-heading{display:flex;min-width:0px;align-items:center;gap:0.375rem}.s-conditional-offer-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-info{position:relative;display:inline-flex;flex-shrink:0;align-items:center}.s-conditional-offer-info-trigger{display:inline-flex;height:1rem;width:1rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-text-opacity:1;color:rgb(115 115 115 / 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:300ms}.s-conditional-offer-info-trigger:hover{color:var(--color-primary-dark)}.s-conditional-offer-info-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-conditional-offer-message{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}@media (min-width: 768px){.s-conditional-offer-message{font-size:1rem;line-height:1.5rem}}.s-conditional-offer-toggle{align-items:center;justify-content:center;gap:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(38 38 38 / 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:300ms}.s-conditional-offer-toggle:hover{color:var(--color-primary-dark)}.s-conditional-offer-toggle-inline{display:none;flex-shrink:0}@media (min-width: 768px){.s-conditional-offer-toggle-inline{display:inline-flex}}.s-conditional-offer-toggle-bar{margin-top:0.5rem;display:inline-flex;width:100%;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-left:0.75rem;padding-right:0.75rem;padding-top:0.625rem;padding-bottom:0.625rem}@media (min-width: 768px){.s-conditional-offer-toggle-bar{display:none}}.s-conditional-offer-toggle-icon{font-size:1rem;line-height:1.5rem;line-height:1;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-conditional-offer-toggle-icon-open{--tw-rotate:180deg;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-conditional-offer-panel{margin-top:0.75rem;width:100%;min-width:0px;border-radius:0.375rem;border-width:1px;--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.75rem}.s-conditional-offer-gifts-header{margin-bottom:0.75rem;display:flex;align-items:center;gap:0.5rem}.s-conditional-offer-gifts-icon{display:inline-flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-primary);font-size:1rem;line-height:1.5rem;line-height:1;color:var(--color-primary)}.s-conditional-offer-gifts-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-gifts-list{margin:0px;display:flex;list-style-type:none;flex-direction:column;gap:0.5rem;padding:0px}.s-conditional-offer-gift{display:flex;align-items:center;gap:0.75rem;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.5rem}.s-conditional-offer-gift-thumb{display:inline-flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.375rem;border-width:1px;--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));font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-image{height:100%;width:100%;object-fit:contain}.s-conditional-offer-gift-body{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.125rem;text-align:start}.s-conditional-offer-gift-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-prices{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem}.s-conditional-offer-gift-free{font-weight:700;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-price{--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-conditional-offer-tooltip{position:absolute;top:calc(100% + 0.75rem);left:50%;z-index:10;width:min(22rem, calc(100vw - 2rem));border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem;text-align:start;--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px 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-conditional-offer-tooltip-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-tooltip-description{margin-top:0.25rem;font-size:0.75rem;line-height:1rem;line-height:1.625;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-tooltip-list{margin:0px;margin-top:0.75rem;display:flex;list-style-type:none;flex-direction:column;gap:1rem;padding:0px}.s-conditional-offer-tier{position:relative;display:flex;align-items:flex-start;gap:0.75rem}.s-conditional-offer-tier-icon{position:relative;display:inline-flex;height:2.25rem;width:2.25rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;font-size:1rem;line-height:1.5rem;line-height:1}.s-conditional-offer-tier-icon-unmet{color:var(--color-primary-dark)}.s-conditional-offer-tier-status{position:absolute;bottom:-0.125rem;display:inline-flex;height:1rem;width:1rem;align-items:center;justify-content:center;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));inset-inline-start:-2px}.s-conditional-offer-tier-status-met{color:var(--color-primary-dark)}.s-conditional-offer-tier-status-unmet{--tw-text-opacity:1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.s-conditional-offer-tier-status-check{height:0.75rem;width:0.75rem;flex-shrink:0}.s-conditional-offer-tier-status-lock{height:0.625rem;width:0.625rem;flex-shrink:0}.s-conditional-offer-tier-body{display:flex;min-width:0px;flex-direction:column;gap:0.125rem}.s-conditional-offer-tier-title{font-size:0.75rem;line-height:1rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-tier-text{font-size:0.75rem;line-height:1rem;line-height:1.625;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-tier-text-met{text-decoration-line:line-through}.s-conditional-offer-skeleton-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.375rem}';export{B as salla_conditional_offer}
|
|
4
|
+
import{r as t,h as i,H as e,a as o}from"./p-DSmjBlMI.js";var r,n;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product",t.FREE_SHIPPING="free_shipping"}(r||(r={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(n||(n={}));const s=Object.freeze([]);let a,l=null,c=null,d=!1,f=null,h=null,u=0;function m(t){return"CartNotCreated"===t?.name}function g(){try{const t=salla.api?.cart?.getStoredCartId?salla.api.cart.getStoredCartId():salla.storage?.get?.("cart.id");return null==t||""===t?null:String(t)}catch(t){return null}}function p(){const t=g();void 0!==a&&a!==t&&(u++,l=null,c=null,d=!1,f=null),a=t}function b(t){return null==t?0:"number"==typeof t?isFinite(t)?t:0:"string"==typeof t&&parseFloat(t)||0}function w(t){if(null==t||""===t)return null;const i=b(t);return isFinite(i)?i:null}function y(t,i){if(null!==i)return i.length;const e=w(t?.data?.cart?.count??t?.data?.count??t?.cart?.count??t?.count);return null!==e&&e>=0?e:null}function x(t){for(const i of[t?.original_price,t?.product_price,t?.price]){const t=w(i&&"object"==typeof i?i.amount:i);if(null!==t&&t>0)return t}return null}function v(t,i){const e=t?.free_gift_quantity;return null!=e&&""!==e?b(e):i>0?i:0}function k(t){const i=[];for(const e of t){if(null==e?.id)continue;if(!e.added_by_offer)continue;const t=b(e.quantity),o=v(e,t);o<=0||i.push({id:String(e.id),offerId:w(e.offer_id),quantity:o,freeQuantity:o,lineQuantity:t,name:String(e.product_name??e.name??""),imageUrl:String(e.product_image?.url??e.product_image??e.image?.url??""),imageAlt:String(e.product_image?.alt??e.image?.alt??e.product_name??""),url:String(e.url??""),originalPrice:x(e)})}return i}function _(){if(f)return f;const t=u,i=Promise.resolve().then((()=>salla.api?.cart?.details?.())).then((t=>{const i=function(t){const i=t?.data?.cart?.items??t?.data?.items??t?.cart?.items??t?.items;return Array.isArray(i)?i:null}(t);return{gifts:k(i??[]),count:y(t,i),ok:!0}})).catch((t=>({gifts:l??[],count:m(t)?0:c,ok:!1}))).then((({gifts:i,count:e,ok:o})=>{t===u&&(l=i,c=e,d=o)})).finally((()=>{f===i&&(f=null)}));return f=i,i}const C=-1;var M,T;function z(t){const i="number"==typeof t?t:parseFloat(t);return Number.isFinite(i)?i:null}function S(t){return"boolean"==typeof t?t:1===t||0===t?1===t:"true"===t||"1"===t||"false"!==t&&"0"!==t&&void 0}function I(t){return z(t)??0}function L(t,i,e){return Math.max(i,Math.min(t,e))}function V(t){const i="number"==typeof t?t:parseFloat(t);if(!Number.isFinite(i))return null;const e=Math.trunc(i);return e>=0&&e<=4?e:null}!function(t){t.LOCKED="locked",t.CURRENT="current",t.COMPLETED="completed"}(M||(M={})),function(t){t.CURRENCY="currency",t.COUNT="count"}(T||(T={}));const F=[1e3,2e3,4e3],R='[data-testid^="store-cart-item-"], form[id^="item-"]';let $=0;const j={badges_summary:":completed of :total offers unlocked",congrats:"Congratulations! You’ve unlocked all rewards in this promotion",details_title:"Offer details",free_gift:"Free Gift",free_products_title:"Free products selected from the offer",guidance_conditions_unmet:"Your cart doesn’t meet the conditions for the next reward yet",guidance_next:"Add :remaining and get :reward",guidance_next_generic:"Add :remaining to unlock the next reward",manage_offer:"Manage offer",tier_requirement:"Spend :threshold and get :reward",tier_requirement_count:"Buy :threshold and get :reward",tier_requirement_count_generic:"Buy :threshold to unlock this offer",tier_requirement_generic:"Spend :threshold to unlock this offer",tier_title:"Offer (:number)"},P="pages.checkout.free_charge";function H(t){const i=document.createElement("div");return i.textContent=t??"",i.innerHTML}const O=(t={})=>i("svg",{class:t.class,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M5.00016 9.16634C2.69898 9.16634 0.833496 7.30084 0.833496 4.99967C0.833496 2.69849 2.69898 0.833008 5.00016 0.833008C7.30133 0.833008 9.16683 2.69849 9.16683 4.99967C9.16683 7.30084 7.30133 9.16634 5.00016 9.16634ZM4.58458 6.66634L7.53087 3.72006L6.94162 3.13081L4.58458 5.48784L3.40608 4.3093L2.81683 4.89859L4.58458 6.66634Z",fill:"currentColor"})),q=(t={})=>i("svg",{class:t.class,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M12.6667 6.66683H13.3333C13.7015 6.66683 14 6.9653 14 7.3335V14.0002C14 14.3684 13.7015 14.6668 13.3333 14.6668H2.66667C2.29848 14.6668 2 14.3684 2 14.0002V7.3335C2 6.9653 2.29848 6.66683 2.66667 6.66683H3.33333V6.00016C3.33333 3.42284 5.42267 1.3335 8 1.3335C10.5773 1.3335 12.6667 3.42284 12.6667 6.00016V6.66683ZM11.3333 6.66683V6.00016C11.3333 4.15922 9.84093 2.66683 8 2.66683C6.15905 2.66683 4.66667 4.15922 4.66667 6.00016V6.66683H11.3333ZM7.33333 9.3335V12.0002H8.66667V9.3335H7.33333Z",fill:"currentColor"})),N=(t={})=>i("svg",{class:t.class,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},i("path",{d:"M7.00033 12.8337C3.77866 12.8337 1.16699 10.222 1.16699 7.00033C1.16699 3.77866 3.77866 1.16699 7.00033 1.16699C10.222 1.16699 12.8337 3.77866 12.8337 7.00033C12.8337 10.222 10.222 12.8337 7.00033 12.8337ZM6.41699 6.41699V9.91699H7.58366V6.41699H6.41699ZM6.41699 4.08366V5.25033H7.58366V4.08366H6.41699Z",fill:"currentColor"})),B=class{constructor(i){t(this,i),this.offer=null,this.isLoading=!1,this.canRender=!0,this.gifts=[],this.cartItemCount=null,this.isTooltipHovered=!1,this.isTooltipPinned=!1,this.isGiftsOpen=!0,this.instanceId=++$,this.refreshGeneration=0,this.giftsGeneration=0,this.cartRefreshTimer=null,this.cartRefreshPending=!1,this.wantsCartUpdates=!1,this.isListeningToCartUpdates=!1,this.cartLookupRetryTimer=null,this.cartLookupRetries=0,this.cartLookupRetryPending=!1,this.deferredByEmptyCart=!1,this.isDisconnected=!1,this.skeletonWatchdog=null,this.skeletonDeadline=0,this.hasRelocated=!1,this.hasLoaded=!1,this.relocationObserver=null,this.relocationWatchTimer=null,this.relocationWatchExpired=!1,this.relocationLogged=!1,this.cartUpdatedHandler=t=>{this.readCartCountFromEvent(t),this.clearCartLookupRetry(),this.scheduleCartRefresh()}}componentWillLoad(){this.ensureSkeletonIsWatched();try{this.isEnabled()&&this.startLoading(),this.load().catch((t=>{this.stopLoading(),this.safeLog("load() failed",t)}))}catch(t){this.stopLoading(),this.safeLog("componentWillLoad threw synchronously",t)}}safeLog(t,i){try{salla.logger.warn("salla-conditional-offer::",t,i)}catch(t){}}connectedCallback(){this.isDisconnected=!1,this.ensureSkeletonIsWatched(),this.wantsCartUpdates&&!this.isListeningToCartUpdates&&this.subscribeToCartUpdates()&&(this.cartRefreshPending=!0),this.cartRefreshPending&&this.scheduleCartRefresh(),this.cartLookupRetryPending&&this.scheduleCartLookupRetry()}disconnectedCallback(){this.isDisconnected=!0,null!==this.cartRefreshTimer&&(clearTimeout(this.cartRefreshTimer),this.cartRefreshTimer=null),null!==this.cartLookupRetryTimer&&(clearTimeout(this.cartLookupRetryTimer),this.cartLookupRetryTimer=null),Promise.resolve().then((()=>{this.isDisconnected&&this.unsubscribeFromCartUpdates()})),null!==this.skeletonWatchdog&&(clearTimeout(this.skeletonWatchdog),this.skeletonWatchdog=null),this.stopWatchingForItemsColumn()}componentDidLoad(){this.hasLoaded=!0,this.relocateIntoItemsColumn()}isShowingSomething(){return this.canRender&&this.hasCartItems()}componentDidRender(){this.hasLoaded&&this.relocateIntoItemsColumn(),this.positionTooltip(),this.ensureSkeletonIsWatched()}relocateIntoItemsColumn(){if(!this.hasRelocated&&this.isShowingSomething())try{const t=this.hostEl;if(!t?.parentElement)return;const i=this.findItemsColumn(t);if(!i)return void this.watchForItemsColumn();if(this.hasRelocated=!0,this.stopWatchingForItemsColumn(),i===t.parentElement&&i.firstElementChild===t)return;i.insertBefore(t,i.firstChild)}catch(t){this.hasRelocated=!0,this.stopWatchingForItemsColumn(),this.safeLog("relocating the banner into the cart items column failed",t)}}findItemsColumn(t){let i=t;for(let e=0;i&&e<=3;e++){for(const e of this.getFollowingSiblings(i)){if(i===t&&this.matches(e,R))return t.parentElement;const o=this.findColumnWithin(e,t);if(o)return o}if(i=i.parentElement,!i||i===document.body||i===document.documentElement)break}return null}getFollowingSiblings(t){const i=[];for(let e=t.nextElementSibling;e;e=e.nextElementSibling)i.push(e);return i}findColumnWithin(t,i){const e=t.querySelector(R),o=(e?this.climbToChildOf(e,t):null)??t.querySelector(".main-content, [data-cart-items]");return!o||o===i||o.contains(i)?null:o}climbToChildOf(t,i){let e=t;for(;e&&e.parentElement&&e.parentElement!==i;)e=e.parentElement;return e?.parentElement===i?e:null}matches(t,i){return"function"==typeof t.matches&&t.matches(i)}watchForItemsColumn(){this.hasRelocated||this.relocationWatchExpired||this.relocationObserver||("undefined"!=typeof MutationObserver?(this.relocationObserver=new MutationObserver((()=>this.relocateIntoItemsColumn())),this.relocationObserver.observe(document.documentElement,{childList:!0,subtree:!0}),this.relocationWatchTimer=setTimeout((()=>{this.relocationWatchTimer=null,this.relocationWatchExpired=!0,this.stopWatchingForItemsColumn(),this.logNoItemsColumn()}),5e3)):this.logNoItemsColumn())}stopWatchingForItemsColumn(){if(this.relocationObserver){try{this.relocationObserver.disconnect()}catch(t){}this.relocationObserver=null}null!==this.relocationWatchTimer&&(clearTimeout(this.relocationWatchTimer),this.relocationWatchTimer=null)}logNoItemsColumn(){this.relocationLogged||(this.relocationLogged=!0,this.safeLog("no cart items column found — leaving the banner at full page width"))}ensureSkeletonIsWatched(){if(!this.isLoading)return;if(null!==this.skeletonWatchdog)return;const t=Date.now();0===this.skeletonDeadline&&(this.skeletonDeadline=t+8e3);const i=Math.max(0,this.skeletonDeadline-t);this.skeletonWatchdog=setTimeout((()=>{this.skeletonWatchdog=null,this.isLoading&&(Date.now()<this.skeletonDeadline?this.ensureSkeletonIsWatched():(this.isLoading=!1,this.skeletonDeadline=0,this.safeLog("still loading after 8000ms — dropping the skeleton")))}),i)}clearSkeletonWatchdog(){this.skeletonDeadline=0,null!==this.skeletonWatchdog&&(clearTimeout(this.skeletonWatchdog),this.skeletonWatchdog=null)}startLoading(){this.isLoading=!0,this.ensureSkeletonIsWatched()}stopLoading(){this.isLoading=!1,this.clearSkeletonWatchdog()}async load(){this.wantsCartUpdates=!0,this.subscribeToCartUpdates()||this.subscribeWhenSdkIsReady(),this.loadCart(),await this.waitForSdk(),await this.refresh()}waitForSdk(){let t,i;try{t=Promise.resolve(salla.onReady?.())}catch(t){return this.safeLog("salla.onReady() threw",t),Promise.resolve()}const e=new Promise((t=>{i=setTimeout(t,3e3)}));return Promise.race([t.catch((t=>this.safeLog("salla.onReady() rejected",t))),e]).then((()=>{clearTimeout(i)}))}subscribeToCartUpdates(){if(this.isListeningToCartUpdates)return!0;try{salla.event.on("cart::updated",this.cartUpdatedHandler),this.isListeningToCartUpdates=!0}catch(t){this.safeLog("cart::updated subscription failed",t)}return this.isListeningToCartUpdates}unsubscribeFromCartUpdates(){if(this.isListeningToCartUpdates){this.isListeningToCartUpdates=!1;try{salla.event.off("cart::updated",this.cartUpdatedHandler)}catch(t){this.safeLog("cart::updated unsubscription failed",t)}}}subscribeWhenSdkIsReady(){let t;try{t=Promise.resolve(salla.onReady?.())}catch(t){return}const i=()=>{this.isDisconnected||this.subscribeToCartUpdates()};t.then(i,i)}scheduleCartRefresh(){this.cartRefreshPending=!0,null!==this.cartRefreshTimer&&clearTimeout(this.cartRefreshTimer),this.cartRefreshTimer=null,this.isDisconnected||(this.cartRefreshTimer=setTimeout((()=>{this.cartRefreshTimer=null,this.runCartRefresh()}),200))}runCartRefresh(){this.isDisconnected||(this.cartRefreshPending=!1,this.refresh(),function(){if(h)return h;u++,l=null,c=null,d=!1,a=g();const t=()=>(h===i&&(h=null),_()),i=(f??Promise.resolve()).then(t,t).finally((()=>{h===i&&(h=null)}));return h=i,i}().then((()=>this.loadCart()),(()=>this.loadCart())))}readCartCountFromEvent(t){const i=this.toCartCount(t?.count)??this.readCartCountFromStorage();null!==i&&(this.cartItemCount=i)}readCartCountFromStorage(){try{return this.toCartCount(salla.storage?.get?.("cart.summary.count"))}catch(t){return null}}toCartCount(t){return"number"==typeof t&&Number.isFinite(t)&&t>=0?t:null}getFreeLabel(){const t=salla.lang.get(P);return t&&t!==P?t:"Free"}trans(t,i){const e=`blocks.cart_offer.${t}`,o=salla.lang.get(e,i);return o&&o!==e?o:Object.entries(i??{}).reduce(((t,[i,e])=>t.split(`:${i}`).join(e)),j[t])}isEnabled(){try{return!!salla.config.get("store.features")?.includes("conditional-offer")}catch(t){return!1}}async fetchOffer(){const{data:t}=await salla.api.cart.offers(),i=(t||[]).find((t=>"conditional"===t.type));return i?.details?.discounts?.length?i:null}async refresh(){const t=++this.refreshGeneration;if(!this.isEnabled())return this.stopLoading(),void(this.canRender=!1);if(0===this.cartItemCount)return this.stopLoading(),p(),void(d||(this.deferredByEmptyCart=!0,this.loadCart()));this.deferredByEmptyCart=!1,this.offer?this.stopLoading():this.startLoading();try{const i=await this.fetchOffer();if(this.isSuperseded(t))return;if(!i)return this.offer=null,void(this.canRender=!1);this.offer=i,this.canRender=!0,this.loadCart()}catch(i){if(this.isSuperseded(t))return;this.safeLog("offers() failed",i)}finally{t===this.refreshGeneration&&this.stopLoading()}}hasCartItems(){return"number"==typeof this.cartItemCount&&this.cartItemCount>=1}isSuperseded(t){return t!==this.refreshGeneration||this.isDisconnected}loadCart(){const t=++this.giftsGeneration;return Promise.all([(p(),d&&l?Promise.resolve(l):_().then((()=>l??s))),(p(),d&&l?Promise.resolve(c):_().then((()=>c)))]).then((([i,e])=>{t!==this.giftsGeneration||this.isDisconnected||this.cartRefreshPending||(null!==e&&(this.cartItemCount=e),null!==e?this.clearCartLookupRetry():null===this.cartItemCount&&this.scheduleCartLookupRetry(),this.deferredByEmptyCart&&this.hasCartItems()&&(this.deferredByEmptyCart=!1,this.refresh()),this.gifts=this.offer?this.selectOwnGifts(i):[])})).catch((t=>{this.safeLog("cart lookup failed",t)}))}scheduleCartLookupRetry(){this.cartLookupRetries>=F.length||(this.cartLookupRetryPending=!0,null!==this.cartLookupRetryTimer||this.isDisconnected||(this.cartLookupRetryTimer=setTimeout((()=>{this.cartLookupRetryTimer=null,this.cartLookupRetryPending=!1,this.canRender&&(this.cartLookupRetries++,this.loadCart())}),F[this.cartLookupRetries])))}clearCartLookupRetry(){this.cartLookupRetries=0,this.cartLookupRetryPending=!1,null!==this.cartLookupRetryTimer&&(clearTimeout(this.cartLookupRetryTimer),this.cartLookupRetryTimer=null)}selectOwnGifts(t){const i=Number(this.offer?.id);if(!Number.isFinite(i))return t;const e=t.filter((t=>null!==t.offerId&&Number(t.offerId)===i));return e.length?e:t.filter((t=>null===t.offerId))}getStages(){const t=(this.offer?.details?.discounts??[]).filter((({min_spend:t})=>null!==z(t)));return i=({min_spend:t})=>t,e=({id:t})=>t,(t??[]).map(((t,o)=>({item:t,index:o,threshold:I(i(t)),identity:e?z(e(t)):null}))).sort(((t,i)=>t.threshold!==i.threshold?t.threshold-i.threshold:null!==t.identity&&null!==i.identity&&t.identity!==i.identity?t.identity-i.identity:t.index-i.index)).map((({item:t})=>t));var i,e}getProgress(t){return function(t,i,e=0,o=[],r=[]){const n=(i??[]).map(((t,i)=>({index:i,threshold:z(t),applied:S(o?.[i]),tierValue:z(r?.[i])}))).filter((t=>null!==t.threshold)).sort(((t,i)=>t.threshold-i.threshold||t.index-i.index)),s=n.map((t=>t.threshold)),a=n.map((t=>t.applied)),l=a.some((t=>void 0!==t)),c=I(e);if(!s.length)return{thresholds:s,met:[],applied:a,appliedIndex:C,hasEngineVerdict:l,metCount:0,nextUnmetIndex:C,allMet:!1,lastReachedIndex:C,currentIndex:C,isComplete:!1,value:Math.max(0,I(t)),values:[],startValue:c,fills:[],overallPercentage:0};const d=s[s.length-1],f=L(I(t),0,Math.max(0,d)),h=n.map((({tierValue:t})=>null===t?f:L(t,0,Math.max(0,d))));let u=C;for(let t=0;t<s.length;t++)h[t]>=s[t]&&(u=t);const m=u===s.length-1,g=m?C:u+1,p=s.map(((t,i)=>function(t,i,e){return e<=i?t>=e?100:0:L((t-i)/(e-i)*100,0,100)}(h[i],0===i?c:s[i-1],t))),b=m?100:L((u+1+(p[g]??0)/100)/s.length*100,0,100);let w=C;for(let t=0;t<a.length;t++)!0===a[t]&&(w=t);const y=s.map(l?(t,i)=>i<=w:(t,i)=>i<=u),x=y.filter(Boolean).length,v=y.findIndex((t=>!t));return{thresholds:s,met:y,applied:a,appliedIndex:w,hasEngineVerdict:l,metCount:x,nextUnmetIndex:v,allMet:v===C,lastReachedIndex:u,currentIndex:g,isComplete:m,value:f,values:h,startValue:c,fills:p,overallPercentage:b}}(this.offer?.details?.current_value,t.map((({min_spend:t})=>t)),this.offer?.details?.start_value,t.map((({is_applied:t})=>t)),t.map((({current_value:t})=>t)))}tierKey(t,i){const e=Number(t?.id);return Number.isFinite(e)?`tier-${e}`:`pos-${i}`}stageMeasure(){return this.offer?.details?.based_on===n.PRODUCT_COUNT?T.COUNT:T.CURRENCY}formatRequirement(t){const i=this.offer?.details?.based_on;if(i===n.PRODUCT_COUNT)try{return salla.lang.choice("blocks.header.products_count",t)}catch(i){return this.safeLog("invalid products_count interval",i),`${t}`}return i===n.PRODUCT_PURCHASE?salla.money(t):(this.safeLog(`unexpected offer detail's based_on value: ${i}`),`${t}`)}getRewardText(t){return(t?.reward_label??"").trim()}getGuidanceMessage(t,i){if(i.nextUnmetIndex===C)return"";const e=function(t,i,e=T.CURRENCY){const o=i.thresholds[t];if(void 0===o)return 0;const r=Math.max(0,o-(i.values?.[t]??i.value));if(0===r)return 0;const n=e===T.COUNT?0:function(){try{const t="undefined"!=typeof salla?salla:void 0,i=V(t?.config?.currency?.()?.decimals);if(null!==i)return i;const e=V(t?.config?.get?.("store.currency.decimals"));if(null!==e)return e}catch(t){}return 2}(),s=Math.pow(10,n),a=Math.ceil(r*s-1e-6)/s;return a>0?a:1/s}(i.nextUnmetIndex,i,this.stageMeasure());if(e<=0)return this.trans("guidance_conditions_unmet");const o=this.formatRequirement(e),r=this.getRewardText(t[i.nextUnmetIndex]);return r?this.trans("guidance_next",{remaining:o,reward:H(r)}):this.trans("guidance_next_generic",{remaining:o})}getTierSentence(t,i,e){const o=this.formatRequirement(e.thresholds[i]),r=this.getRewardText(t),n=this.stageMeasure()===T.COUNT;return r?this.trans(n?"tier_requirement_count":"tier_requirement",{threshold:o,reward:H(r)}):this.trans(n?"tier_requirement_count_generic":"tier_requirement_generic",{threshold:o})}getRewardIcon(t){switch(t?.type){case r.PERCENTAGE:return"sicon-percentage";case r.FREE_PRODUCT:return"sicon-gift";case r.FIXED:return this.usesSarSymbol()?"sicon-sar":"sicon-banknote";default:return"sicon-tag"}}usesSarSymbol(){try{const t=salla.config.currency?.()?.symbol;return["SAR","ر.س"].includes(t)&&!!salla.config.get("store.settings.use_sar_symbol")}catch(t){return!1}}get isTooltipOpen(){return this.isTooltipHovered||this.isTooltipPinned}toggleTooltip(){this.isTooltipPinned=!this.isTooltipPinned}closeTooltip(t=!1){this.isTooltipOpen&&(this.isTooltipPinned=!1,this.isTooltipHovered=!1,t&&this.infoTriggerEl?.focus?.())}positionTooltip(){const t=this.tooltipEl,i=this.infoTriggerEl;if(this.isTooltipOpen&&t&&i)try{this.setTooltipOffsets(t,0,0);const e=window.innerWidth||document.documentElement?.clientWidth||0,o=t.getBoundingClientRect(),r=i.getBoundingClientRect(),n=o?.width||0;if(n<=0||e<=0)return;const s=r.left+r.width/2-n/2,a=8,l=Math.min(Math.max(s,a),Math.max(a,e-a-n))-s,c=Math.max(0,n/2-16),d=Math.min(Math.max(-l,-c),c);this.setTooltipOffsets(t,l,d)}catch(t){this.safeLog("positioning the offer details popover failed",t)}}setTooltipOffsets(t,i,e){t.style?.setProperty?.("--s-conditional-offer-tooltip-shift",`${Math.round(i)}px`),t.style?.setProperty?.("--s-conditional-offer-tooltip-caret",`${Math.round(e)}px`)}handleWindowResize(){this.positionTooltip()}handleDocumentKeydown(t){"Escape"!==t.key&&"Esc"!==t.key||this.closeTooltip(!0)}handleDocumentClick(t){if(!this.isTooltipPinned||!this.infoAnchorEl)return;const i="function"==typeof t.composedPath?t.composedPath():[];(i.length?i.includes(this.infoAnchorEl):this.infoAnchorEl.contains(t.target))||this.closeTooltip()}elementId(t){return`s-conditional-offer-${t}-${this.instanceId}`}renderBadges(t,e){return i("div",{class:"s-conditional-offer-badges",role:"img","aria-label":this.trans("badges_summary",{completed:`${e.metCount}`,total:`${t.length}`})},t.map(((t,o)=>{const r=e.met[o],n=this.tierKey(t,o);return[o>0?i("span",{key:`${n}-link`,class:{"s-conditional-offer-badge-link":!0,"s-conditional-offer-badge-link-met":r,"s-conditional-offer-badge-link-unmet":!r},"aria-hidden":"true"}):null,i("span",{key:n,class:{"s-conditional-offer-badge":!0,"s-conditional-offer-badge-met":r,"s-conditional-offer-badge-unmet":!r},"data-tier-state":r?"met":"unmet","data-tier-id":t?.id??void 0},i(r?O:q,{class:"s-conditional-offer-badge-icon"}))]})))}renderTooltip(t,e){const o=function(t){const i=t?.details?.rules;if("string"==typeof i){const t=i.trim();return""===t?null:t}if(Array.isArray(i)){const t=i.filter((t=>"string"==typeof t)).map((t=>t.trim())).filter((t=>""!==t)).join(" ");return""===t?null:t}return null}(this.offer);return i("div",{class:"s-conditional-offer-tooltip",id:this.elementId("tooltip"),role:"tooltip",ref:t=>this.tooltipEl=t},i("div",{class:"s-conditional-offer-tooltip-title"},this.offer?.title),o?i("div",{class:"s-conditional-offer-tooltip-description"},o):null,i("ul",{class:"s-conditional-offer-tooltip-list"},t.map(((t,o)=>{const r=e.met[o];return i("li",{key:this.tierKey(t,o),class:"s-conditional-offer-tier","data-tier-state":r?"met":"unmet","data-tier-id":t?.id??void 0},i("span",{class:{"s-conditional-offer-tier-icon":!0,"s-conditional-offer-tier-icon-met":r,"s-conditional-offer-tier-icon-unmet":!r}},i("i",{class:this.getRewardIcon(t),"aria-hidden":"true"}),i("span",{class:{"s-conditional-offer-tier-status":!0,"s-conditional-offer-tier-status-met":r,"s-conditional-offer-tier-status-unmet":!r},"aria-hidden":"true"},r?i(O,{class:"s-conditional-offer-tier-status-check"}):i(q,{class:"s-conditional-offer-tier-status-lock"}))),i("div",{class:"s-conditional-offer-tier-body"},i("div",{class:"s-conditional-offer-tier-title"},this.trans("tier_title",{number:`${o+1}`})),i("div",{class:{"s-conditional-offer-tier-text":!0,"s-conditional-offer-tier-text-met":r},innerHTML:this.getTierSentence(t,o,e)})))}))))}renderGiftsToggle(t){return i("button",{type:"button",id:this.elementId(`toggle-${t}`),class:{"s-conditional-offer-toggle":!0,"s-conditional-offer-toggle-inline":"inline"===t,"s-conditional-offer-toggle-bar":"bar"===t},"aria-expanded":this.isGiftsOpen?"true":"false","aria-controls":this.elementId("gifts"),onClick:()=>this.isGiftsOpen=!this.isGiftsOpen},i("span",null,this.trans("manage_offer")),i("i",{class:{"sicon-keyboard_arrow_down":!0,"s-conditional-offer-toggle-icon":!0,"s-conditional-offer-toggle-icon-open":this.isGiftsOpen},"aria-hidden":"true"}))}renderGiftsCard(){return i("div",{class:"s-conditional-offer-panel",id:this.elementId("gifts")},i("div",{class:"s-conditional-offer-gifts-header"},i("span",{class:"s-conditional-offer-gifts-icon"},i("i",{class:"sicon-gift","aria-hidden":"true"})),i("span",{class:"s-conditional-offer-gifts-title"},this.trans("free_products_title"))),i("ul",{class:"s-conditional-offer-gifts-list"},this.gifts.map((t=>this.renderGiftRow(t)))))}renderGiftRow(t){return i("li",{class:"s-conditional-offer-gift","data-item-id":t.id},i("span",{class:"s-conditional-offer-gift-thumb"},t.imageUrl?i("img",{class:"s-conditional-offer-gift-image",src:t.imageUrl,alt:t.imageAlt||t.name,loading:"lazy",decoding:"async"}):i("i",{class:"sicon-gift","aria-hidden":"true"})),i("div",{class:"s-conditional-offer-gift-body"},i("span",{class:"s-conditional-offer-gift-name"},t.name||this.trans("free_gift")),i("span",{class:"s-conditional-offer-gift-prices"},i("span",{class:"s-conditional-offer-gift-free"},this.getFreeLabel()),null!==t.originalPrice?i("span",{class:"s-conditional-offer-gift-price",innerHTML:salla.money(t.originalPrice)}):null)))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-root"},i("div",{class:"s-conditional-offer-banner"},i("div",{class:"s-conditional-offer-lead"},i("salla-skeleton",{height:"24px",width:"80px"}),i("div",{class:"s-conditional-offer-skeleton-text"},i("salla-skeleton",{height:"12px",width:"35%"}),i("salla-skeleton",{height:"16px",width:"60%"})))))}render(){if(!this.canRender)return null;if(!this.hasCartItems())return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;const t=this.getStages(),o=this.getProgress(t),r=this.getGuidanceMessage(t,o),n=this.trans("details_title"),s=this.gifts.length>0;return i(e,{class:"s-conditional-offer-root"},i("div",{class:"s-conditional-offer-banner"},i("div",{class:"s-conditional-offer-lead"},this.renderBadges(t,o),i("div",{class:"s-conditional-offer-text"},i("div",{class:"s-conditional-offer-heading",onMouseEnter:()=>this.isTooltipHovered=!0,onMouseLeave:()=>this.isTooltipHovered=!1},i("span",{class:"s-conditional-offer-name"},this.offer.title),i("span",{class:"s-conditional-offer-info",ref:t=>this.infoAnchorEl=t},i("button",{type:"button",class:"s-conditional-offer-info-trigger",ref:t=>this.infoTriggerEl=t,"aria-label":n,title:n,"aria-expanded":this.isTooltipOpen?"true":"false","aria-describedby":this.elementId("tooltip"),onClick:()=>this.toggleTooltip()},i(N,{class:"s-conditional-offer-info-icon"})),this.isTooltipOpen?this.renderTooltip(t,o):null)),o.allMet?i("div",{class:"s-conditional-offer-message",role:"status"},this.trans("congrats")):r?i("div",{class:"s-conditional-offer-message",innerHTML:r}):null)),s?this.renderGiftsToggle("inline"):null),s&&this.isGiftsOpen?this.renderGiftsCard():null,s?this.renderGiftsToggle("bar"):null)}get hostEl(){return o(this)}};B.style='/*!twlt*/:host{display:block}.s-conditional-offer-root{background-color:rgba(0, 137, 123, 0.06);background-color:color-mix(in srgb, var(--color-primary, #00897b) 7%, transparent)}.s-conditional-offer-badges::-webkit-scrollbar{height:3px}.s-conditional-offer-badges::-webkit-scrollbar-thumb{border-radius:9999px;background-color:rgba(0, 0, 0, 0.15)}.s-conditional-offer-badges::-webkit-scrollbar-track{background-color:transparent}.s-conditional-offer-tooltip{--s-conditional-offer-tooltip-shift:0px;--s-conditional-offer-tooltip-caret:0px;transform:translateX(calc(-50% + var(--s-conditional-offer-tooltip-shift)))}.s-conditional-offer-tooltip::before{content:"";position:absolute;bottom:100%;left:50%;transform:translateX(calc(-50% + var(--s-conditional-offer-tooltip-caret)));border:8px solid transparent;border-bottom-color:#fff}.s-conditional-offer-tier-icon-met,.s-conditional-offer-tier-icon-unmet{color:var(--color-primary-dark, #00695c);background-color:rgba(0, 137, 123, 0.12);background-color:color-mix(in srgb, var(--color-primary, #00897b) 14%, transparent)}.s-conditional-offer-tier:not(:last-child)::before{content:"";position:absolute;top:2.5rem;bottom:-1rem;inset-inline-start:1.125rem;width:1px;background-color:#d1d5db}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.w-6{width:1.5rem}.resize{resize:both}.gap-1{gap:0.25rem}.rounded{border-radius:var(--s-radius, 0.25rem)}.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-conditional-offer-root{margin-bottom:1.25rem;display:block;width:100%;min-width:0px;max-width:100%;border-radius:0.375rem;padding:0.75rem}@media (min-width: 768px){.s-conditional-offer-root{padding:1rem}}.s-conditional-offer-banner{display:flex;width:100%;min-width:0px;align-items:center;justify-content:space-between;gap:0.75rem}@media (min-width: 768px){.s-conditional-offer-banner{gap:1rem}}.s-conditional-offer-lead{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.5rem}@media (min-width: 768px){.s-conditional-offer-lead{gap:0.75rem}}.s-conditional-offer-badges{display:flex;max-width:45%;flex-shrink:0;flex-wrap:nowrap;align-items:center;gap:0.25rem;overflow-x:auto;overscroll-behavior-x:contain;scroll-behavior:smooth;scrollbar-width:thin}.s-conditional-offer-badge{display:inline-flex;height:1.5rem;width:1.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;font-size:11px;line-height:1;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-conditional-offer-badge-met{background-color:var(--color-primary)}.s-conditional-offer-badge-unmet{--tw-bg-opacity:1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.s-conditional-offer-badge-link{width:0.5rem;flex-shrink:0;border-top-width:1px}.s-conditional-offer-badge-link-met{border-color:var(--color-primary)}.s-conditional-offer-badge-link-unmet{border-style:dashed;--tw-border-opacity:1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.s-conditional-offer-badge-icon{height:0.75rem;width:0.75rem;flex-shrink:0}.s-conditional-offer-text{display:flex;min-width:0px;flex-direction:column;gap:0.125rem;text-align:start}.s-conditional-offer-heading{display:flex;min-width:0px;align-items:center;gap:0.375rem}.s-conditional-offer-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-info{position:relative;display:inline-flex;flex-shrink:0;align-items:center}.s-conditional-offer-info-trigger{display:inline-flex;height:1rem;width:1rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-text-opacity:1;color:rgb(115 115 115 / 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:300ms}.s-conditional-offer-info-trigger:hover{color:var(--color-primary-dark)}.s-conditional-offer-info-icon{height:0.875rem;width:0.875rem;flex-shrink:0}.s-conditional-offer-message{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}@media (min-width: 768px){.s-conditional-offer-message{font-size:1rem;line-height:1.5rem}}.s-conditional-offer-toggle{align-items:center;justify-content:center;gap:0.375rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(38 38 38 / 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:300ms}.s-conditional-offer-toggle:hover{color:var(--color-primary-dark)}.s-conditional-offer-toggle-inline{display:none;flex-shrink:0}@media (min-width: 768px){.s-conditional-offer-toggle-inline{display:inline-flex}}.s-conditional-offer-toggle-bar{margin-top:0.5rem;display:inline-flex;width:100%;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-left:0.75rem;padding-right:0.75rem;padding-top:0.625rem;padding-bottom:0.625rem}@media (min-width: 768px){.s-conditional-offer-toggle-bar{display:none}}.s-conditional-offer-toggle-icon{font-size:1rem;line-height:1.5rem;line-height:1;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-conditional-offer-toggle-icon-open{--tw-rotate:180deg;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-conditional-offer-panel{margin-top:0.75rem;width:100%;min-width:0px;border-radius:0.375rem;border-width:1px;--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.75rem}.s-conditional-offer-gifts-header{margin-bottom:0.75rem;display:flex;align-items:center;gap:0.5rem}.s-conditional-offer-gifts-icon{display:inline-flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-color:var(--color-primary);font-size:1rem;line-height:1.5rem;line-height:1;color:var(--color-primary)}.s-conditional-offer-gifts-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-gifts-list{margin:0px;display:flex;list-style-type:none;flex-direction:column;gap:0.5rem;padding:0px}.s-conditional-offer-gift{display:flex;align-items:center;gap:0.75rem;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.5rem}.s-conditional-offer-gift-thumb{display:inline-flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.375rem;border-width:1px;--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));font-size:1.25rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-image{height:100%;width:100%;object-fit:contain}.s-conditional-offer-gift-body{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.125rem;text-align:start}.s-conditional-offer-gift-name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-prices{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem}.s-conditional-offer-gift-free{font-weight:700;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-conditional-offer-gift-price{--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-conditional-offer-tooltip{position:absolute;top:calc(100% + 0.75rem);left:50%;z-index:10;width:min(22rem, calc(100vw - 2rem));border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:1rem;text-align:start;--tw-shadow:5px 10px 30px #2B2D340D;--tw-shadow-colored:5px 10px 30px 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-conditional-offer-tooltip-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-tooltip-description{margin-top:0.25rem;font-size:0.75rem;line-height:1rem;line-height:1.625;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-tooltip-list{margin:0px;margin-top:0.75rem;display:flex;list-style-type:none;flex-direction:column;gap:1rem;padding:0px}.s-conditional-offer-tier{position:relative;display:flex;align-items:flex-start;gap:0.75rem}.s-conditional-offer-tier-icon{position:relative;display:inline-flex;height:2.25rem;width:2.25rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;font-size:1rem;line-height:1.5rem;line-height:1}.s-conditional-offer-tier-icon-unmet{color:var(--color-primary-dark)}.s-conditional-offer-tier-status{position:absolute;bottom:-0.125rem;display:inline-flex;height:1rem;width:1rem;align-items:center;justify-content:center;border-radius:9999px;border-width:2px;--tw-border-opacity:1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));inset-inline-start:-2px}.s-conditional-offer-tier-status-met{color:var(--color-primary-dark)}.s-conditional-offer-tier-status-unmet{--tw-text-opacity:1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.s-conditional-offer-tier-status-check{height:0.75rem;width:0.75rem;flex-shrink:0}.s-conditional-offer-tier-status-lock{height:0.625rem;width:0.625rem;flex-shrink:0}.s-conditional-offer-tier-body{display:flex;min-width:0px;flex-direction:column;gap:0.125rem}.s-conditional-offer-tier-title{font-size:0.75rem;line-height:1rem;font-weight:700;color:var(--color-primary-dark)}.s-conditional-offer-tier-text{font-size:0.75rem;line-height:1rem;line-height:1.625;--tw-text-opacity:1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.s-conditional-offer-tier-text-met{text-decoration-line:line-through}.s-conditional-offer-skeleton-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.375rem}';export{B as salla_conditional_offer}
|