@salla.sa/twilight-components 3.0.16 → 3.0.18
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/{Helper-BV6HUQzI.js → Helper-D2VNt6eb.js} +1 -1
- package/dist/cjs/{filepond-hJcaHnfM.js → filepond-DkCudLhG.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DDkDXFOe.js → filepond-plugin-file-poster-C-uxFWfW.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BBZimb8J.js → filepond-plugin-file-validate-size-BikXTQW2.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-B5VDnf33.js → filepond-plugin-file-validate-type-Drs7PouU.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-Cmuqwdn1.js → filepond-plugin-image-edit-hxr0h9kt.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BFjHgWMS.js → filepond-plugin-image-exif-orientation-CVZmWU_4.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-C7Ow81pR.js → filepond-plugin-image-preview-CBjPKx-d.js} +1 -1
- package/dist/cjs/free-shipping-timer-6QBe5BNS.js +156 -0
- package/dist/cjs/{index-PB4iLztN.js → index-CTYg2zC6.js} +8 -8
- package/dist/cjs/{intlTelInput-Ds-AW6H6.js → intlTelInput-C9X0hKXV.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
- 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 +166 -16
- 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 +2 -2
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +95 -9
- package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +18 -5
- 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 +13 -6
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/salla-offer-modal.cjs.entry.js +8 -4
- package/dist/cjs/salla-offer.cjs.entry.js +7 -3
- 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-items.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-rewards.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 +2 -2
- 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 +6 -5
- package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +7 -4
- package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
- 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 +2 -2
- 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-thank-you-header.cjs.entry.js +1 -1
- package/dist/cjs/salla-thank-you-page.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 +2 -2
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-ZsewI4gd.js → vanilla-picker-BsLm8rHT.js} +1 -1
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +72 -16
- package/dist/collection/components/salla-bullet-delivery/selector-tracker.js +106 -0
- package/dist/collection/components/salla-free-shipping-banner/salla-free-shipping-banner.css +18 -4
- package/dist/collection/components/salla-free-shipping-banner/salla-free-shipping-banner.js +94 -11
- package/dist/collection/components/salla-free-shipping-tag/salla-free-shipping-tag.css +6 -0
- package/dist/collection/components/salla-free-shipping-tag/salla-free-shipping-tag.js +18 -2
- package/dist/collection/components/salla-gifting/salla-gifting.css +16 -1
- package/dist/collection/components/salla-gifting/salla-gifting.js +11 -4
- package/dist/collection/components/salla-offer/salla-offer.js +6 -2
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +7 -3
- package/dist/collection/components/salla-products-list/salla-products-list.js +4 -3
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +5 -2
- package/dist/collection/shared/free-shipping-timer.js +130 -0
- package/dist/components/free-shipping-timer.js +150 -0
- package/dist/components/index.js +8 -8
- package/dist/components/salla-bullet-delivery.js +165 -15
- package/dist/components/salla-free-shipping-banner.js +95 -8
- package/dist/components/salla-free-shipping-tag.js +17 -3
- package/dist/components/salla-gifting.js +12 -5
- package/dist/components/salla-offer-modal.js +7 -3
- package/dist/components/salla-offer.js +6 -2
- package/dist/components/salla-products-list2.js +4 -3
- package/dist/components/salla-rating-modal-v22.js +5 -2
- package/dist/docs.json +25 -5
- package/dist/esm/{Helper-CsyfMJLx.js → Helper-C1T-oD4J.js} +1 -1
- package/dist/esm/{filepond-Cla3ae_2.js → filepond-BoWJzHeN.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-BO0nARSu.js → filepond-plugin-file-poster-B6MkMtuC.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CrcZ7P5c.js → filepond-plugin-file-validate-size-Dds_462B.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-Cci8f5e3.js → filepond-plugin-file-validate-type-DrfGXNay.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-y0q-Gkyo.js → filepond-plugin-image-edit-CN7eGg-7.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-WYrkP26J.js → filepond-plugin-image-exif-orientation-CyhxK_6R.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-Bz0ZRBQp.js → filepond-plugin-image-preview-DdKqAzT9.js} +1 -1
- package/dist/esm/free-shipping-timer-CnTwkF6y.js +150 -0
- package/dist/esm/{index-DJuBNP7w.js → index-DgUQRYr2.js} +8 -8
- package/dist/esm/{intlTelInput-Dcl0COqn.js → intlTelInput-SwlavcFB.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +11 -11
- 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 +166 -16
- 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 +2 -2
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +2 -2
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-free-shipping-banner.entry.js +94 -8
- package/dist/esm/salla-free-shipping-tag.entry.js +17 -4
- 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 +13 -6
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/salla-offer-modal.entry.js +8 -4
- package/dist/esm/salla-offer.entry.js +7 -3
- 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-items.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +1 -1
- package/dist/esm/salla-order-payment.entry.js +1 -1
- package/dist/esm/salla-order-rewards.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 +2 -2
- 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 +6 -5
- package/dist/esm/salla-products-slider.entry.js +2 -2
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +7 -4
- package/dist/esm/salla-rating-modal.entry.js +2 -2
- 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 +2 -2
- 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-thank-you-header.entry.js +1 -1
- package/dist/esm/salla-thank-you-page.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 +2 -2
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-DPvEywPm.js → vanilla-picker-Buy50D7t.js} +1 -1
- package/dist/twilight/{p-134692f5.entry.js → p-027cbda6.entry.js} +1 -1
- package/dist/twilight/{p-48fb615e.entry.js → p-0418c2df.entry.js} +1 -1
- package/dist/twilight/{p-792f1e05.entry.js → p-071aa0e7.entry.js} +1 -1
- package/dist/twilight/{p-be203bd9.entry.js → p-08a15c81.entry.js} +1 -1
- package/dist/twilight/{p-5f5c4f3c.entry.js → p-0ba159db.entry.js} +1 -1
- package/dist/twilight/{p-c657883d.entry.js → p-0d795b58.entry.js} +1 -1
- package/dist/twilight/{p-9f9ab89c.entry.js → p-0f25fedd.entry.js} +1 -1
- package/dist/twilight/{p-15098cb1.entry.js → p-12a25415.entry.js} +1 -1
- package/dist/twilight/p-1960020c.entry.js +4 -0
- package/dist/twilight/{p-f1037da9.entry.js → p-1af9db24.entry.js} +1 -1
- package/dist/twilight/p-23772523.entry.js +4 -0
- package/dist/twilight/{p-67bb5e0c.entry.js → p-254cff9a.entry.js} +1 -1
- package/dist/twilight/{p-a8f88ea6.entry.js → p-259c995a.entry.js} +1 -1
- package/dist/twilight/{p-3f701181.entry.js → p-26d2b28a.entry.js} +1 -1
- package/dist/twilight/{p-8a7bce99.entry.js → p-34148827.entry.js} +1 -1
- package/dist/twilight/{p-8e6bc10e.entry.js → p-361f6033.entry.js} +1 -1
- package/dist/twilight/{p-43700093.entry.js → p-37192614.entry.js} +1 -1
- package/dist/twilight/{p-1e7a0a4f.entry.js → p-3a632c69.entry.js} +1 -1
- package/dist/twilight/{p-b90d0e51.entry.js → p-3d8b77f7.entry.js} +1 -1
- package/dist/twilight/{p-615edf90.entry.js → p-3f842f32.entry.js} +1 -1
- package/dist/twilight/{p-788c0264.entry.js → p-419d6d71.entry.js} +1 -1
- package/dist/twilight/{p-b891f863.entry.js → p-481f52b1.entry.js} +1 -1
- package/dist/twilight/{p-343f57ea.entry.js → p-487b4411.entry.js} +1 -1
- package/dist/twilight/{p-19bf11c5.entry.js → p-4891c565.entry.js} +1 -1
- package/dist/twilight/{p-cfe523ab.entry.js → p-4a3fa153.entry.js} +1 -1
- package/dist/twilight/{p-33689489.entry.js → p-4ab5ee99.entry.js} +1 -1
- package/dist/twilight/{p-558f8ee0.entry.js → p-4b70e6c4.entry.js} +1 -1
- package/dist/twilight/{p-96be66eb.entry.js → p-516e4edc.entry.js} +1 -1
- package/dist/twilight/{p-9f920812.entry.js → p-53735934.entry.js} +1 -1
- package/dist/twilight/{p-e66f1b70.entry.js → p-5694edf1.entry.js} +1 -1
- package/dist/twilight/{p-9e8c583a.entry.js → p-5bbf17dd.entry.js} +1 -1
- package/dist/twilight/{p-43a4e000.entry.js → p-5e8d019e.entry.js} +1 -1
- package/dist/twilight/{p-8278e31a.entry.js → p-5f6fee0e.entry.js} +1 -1
- package/dist/twilight/{p-1436b465.entry.js → p-66ad7a30.entry.js} +1 -1
- package/dist/twilight/p-6af8a7b6.entry.js +4 -0
- package/dist/twilight/{p-96e16a6b.entry.js → p-6b5de500.entry.js} +1 -1
- package/dist/twilight/{p-951f1af4.entry.js → p-6ba3808a.entry.js} +1 -1
- package/dist/twilight/{p-ebb756bc.entry.js → p-6c3084c9.entry.js} +1 -1
- package/dist/twilight/{p-72092eff.entry.js → p-6dccd40f.entry.js} +1 -1
- package/dist/twilight/{p-70d5d802.entry.js → p-6e52b649.entry.js} +1 -1
- package/dist/twilight/{p-caac5694.entry.js → p-70dfb2b4.entry.js} +1 -1
- package/dist/twilight/{p-75015061.entry.js → p-76584a5b.entry.js} +1 -1
- package/dist/twilight/{p-f46da712.entry.js → p-78a56dc6.entry.js} +1 -1
- package/dist/twilight/{p-aa210c8a.entry.js → p-79822d99.entry.js} +1 -1
- package/dist/twilight/{p-5aa8ec0a.entry.js → p-7b5f97e7.entry.js} +1 -1
- package/dist/twilight/{p-9e24dec9.entry.js → p-7f97335a.entry.js} +1 -1
- package/dist/twilight/{p-3cbcec7c.entry.js → p-7fd9dc36.entry.js} +1 -1
- package/dist/twilight/p-84b0e7a9.entry.js +4 -0
- package/dist/twilight/p-8766e236.entry.js +4 -0
- package/dist/twilight/{p-a9a8a819.entry.js → p-8c1d14f0.entry.js} +1 -1
- package/dist/twilight/{p-a92e5068.entry.js → p-8c40278d.entry.js} +1 -1
- package/dist/twilight/{p-5b52ef24.entry.js → p-92fd20a0.entry.js} +1 -1
- package/dist/twilight/{p-f24a477c.entry.js → p-9cf1cfd4.entry.js} +1 -1
- package/dist/twilight/{p-f2062f34.entry.js → p-9d15f22d.entry.js} +1 -1
- package/dist/twilight/{p-8907ef61.entry.js → p-9e042cce.entry.js} +1 -1
- package/dist/twilight/{p-74238c01.entry.js → p-9e0a9a5a.entry.js} +1 -1
- package/dist/twilight/{p-8cb6dfd9.entry.js → p-9e65451e.entry.js} +1 -1
- package/dist/twilight/{p-BgGU8BXX.js → p-BK9YeXWp.js} +1 -1
- package/dist/twilight/{p-Do-w5Os8.js → p-BxQMWsr9.js} +1 -1
- package/dist/twilight/{p-DCUZjQXX.js → p-CBLWEyM9.js} +1 -1
- package/dist/twilight/{p-pOFi82Pb.js → p-CCwsxMbZ.js} +1 -1
- package/dist/twilight/{p-DliR9Sp1.js → p-Ca_SZn0u.js} +1 -1
- package/dist/twilight/{p-CqENl4Wm.js → p-CgNJWeaK.js} +1 -1
- package/dist/twilight/p-CnTwkF6y.js +4 -0
- package/dist/twilight/{p-DHk7-wXk.js → p-DMvhNbgN.js} +1 -1
- package/dist/twilight/{p-BPjqOy84.js → p-De1tLqQF.js} +1 -1
- package/dist/twilight/p-DgUQRYr2.js +5 -0
- package/dist/twilight/{p-CRYD9K0S.js → p-NqQdbGu6.js} +1 -1
- package/dist/twilight/{p-C9eNuCn7.js → p-Y2ZIN9Ok.js} +1 -1
- package/dist/twilight/{p-3b3f1838.entry.js → p-a44670a9.entry.js} +1 -1
- package/dist/twilight/{p-2ce991e8.entry.js → p-a5b732b3.entry.js} +1 -1
- package/dist/twilight/{p-5e8b7483.entry.js → p-a95b0dc1.entry.js} +1 -1
- package/dist/twilight/{p-20642013.entry.js → p-aa35cf98.entry.js} +1 -1
- package/dist/twilight/{p-1267d95a.entry.js → p-ac736b30.entry.js} +1 -1
- package/dist/twilight/{p-e651c3ee.entry.js → p-af49191f.entry.js} +1 -1
- package/dist/twilight/{p-82d50064.entry.js → p-b0d2e31f.entry.js} +1 -1
- package/dist/twilight/{p-8b72b7a2.entry.js → p-b1f808f5.entry.js} +1 -1
- package/dist/twilight/{p-b798788b.entry.js → p-b3ada3d0.entry.js} +1 -1
- package/dist/twilight/{p-03e6d42b.entry.js → p-b5a45f87.entry.js} +1 -1
- package/dist/twilight/p-b9d67694.entry.js +4 -0
- package/dist/twilight/{p-dcfd3688.entry.js → p-ba6dd59c.entry.js} +1 -1
- package/dist/twilight/p-bac25e34.entry.js +4 -0
- package/dist/twilight/{p-05e1fc6a.entry.js → p-bb8b2c85.entry.js} +1 -1
- package/dist/twilight/{p-b1aa33f3.entry.js → p-be6f8551.entry.js} +1 -1
- package/dist/twilight/{p-91ef7c89.entry.js → p-bed54154.entry.js} +1 -1
- package/dist/twilight/{p-4a3d4c28.entry.js → p-bed68e52.entry.js} +1 -1
- package/dist/twilight/{p-a7d2613b.entry.js → p-bfd5e263.entry.js} +1 -1
- package/dist/twilight/{p-63053048.entry.js → p-c4cf0b4d.entry.js} +1 -1
- package/dist/twilight/{p-189fa3c4.entry.js → p-cb48a5ef.entry.js} +1 -1
- package/dist/twilight/{p-370924c0.entry.js → p-cdeb9bcc.entry.js} +1 -1
- package/dist/twilight/{p-9b46c1ab.entry.js → p-d0aeeb7f.entry.js} +1 -1
- package/dist/twilight/{p-537748de.entry.js → p-d0ff9a3e.entry.js} +1 -1
- package/dist/twilight/{p-86db3fe8.entry.js → p-d1093a59.entry.js} +1 -1
- package/dist/twilight/{p-4be6e307.entry.js → p-d1121b3f.entry.js} +1 -1
- package/dist/twilight/{p-be84879f.entry.js → p-d1204965.entry.js} +1 -1
- package/dist/twilight/p-d346dabd.entry.js +4 -0
- package/dist/twilight/{p-3b6efc6e.entry.js → p-d4fb9921.entry.js} +1 -1
- package/dist/twilight/{p-52749db7.entry.js → p-d8955835.entry.js} +1 -1
- package/dist/twilight/{p-1c2d9885.entry.js → p-d9a1bf08.entry.js} +1 -1
- package/dist/twilight/{p-e67fdc9d.entry.js → p-da0df10b.entry.js} +1 -1
- package/dist/twilight/p-e24fbbb4.entry.js +4 -0
- package/dist/twilight/{p-a16f2376.entry.js → p-e38a6793.entry.js} +1 -1
- package/dist/twilight/{p-4a843e15.entry.js → p-e457e68f.entry.js} +1 -1
- package/dist/twilight/{p-382dc313.entry.js → p-e9b03e9c.entry.js} +1 -1
- package/dist/twilight/{p-c33be542.entry.js → p-eaf0c514.entry.js} +1 -1
- package/dist/twilight/{p-5b60ebdf.entry.js → p-ee479819.entry.js} +1 -1
- package/dist/twilight/p-ee65c489.entry.js +4 -0
- package/dist/twilight/{p-a6ba5168.entry.js → p-eefced26.entry.js} +1 -1
- package/dist/twilight/{p-a36e2dcf.entry.js → p-f7a58656.entry.js} +1 -1
- package/dist/twilight/{p-4a07e070.entry.js → p-f7ab5825.entry.js} +1 -1
- package/dist/twilight/{p-927d1967.entry.js → p-f9587127.entry.js} +1 -1
- package/dist/twilight/{p-09c651a2.entry.js → p-f9e5ed10.entry.js} +1 -1
- package/dist/twilight/{p-5f1b28e3.entry.js → p-fcb1009f.entry.js} +1 -1
- package/dist/twilight/{p-de458068.entry.js → p-fddf1997.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +9 -1
- package/dist/types/components/salla-bullet-delivery/selector-tracker.d.ts +30 -0
- package/dist/types/components/salla-free-shipping-banner/salla-free-shipping-banner.d.ts +19 -5
- package/dist/types/components/salla-free-shipping-tag/salla-free-shipping-tag.d.ts +6 -1
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +1 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +1 -0
- package/dist/types/components.d.ts +11 -25
- package/dist/types/shared/free-shipping-timer.d.ts +36 -0
- package/package.json +5 -5
- package/dist/cjs/free-shipping-DkIKD6ch.js +0 -31
- package/dist/components/free-shipping.js +0 -29
- package/dist/esm/free-shipping-Brg4wsgg.js +0 -29
- package/dist/twilight/p-0c292c9a.entry.js +0 -4
- package/dist/twilight/p-1a7b0a2b.entry.js +0 -4
- package/dist/twilight/p-3b4aa865.entry.js +0 -4
- package/dist/twilight/p-3f713fc0.entry.js +0 -4
- package/dist/twilight/p-6a8d04d9.entry.js +0 -4
- package/dist/twilight/p-86ade991.entry.js +0 -4
- package/dist/twilight/p-9b02e779.entry.js +0 -4
- package/dist/twilight/p-Brg4wsgg.js +0 -4
- package/dist/twilight/p-DJuBNP7w.js +0 -5
- package/dist/twilight/p-bf12f616.entry.js +0 -4
- package/dist/twilight/p-d5b394c9.entry.js +0 -4
- package/dist/twilight/p-def7b9c4.entry.js +0 -4
|
@@ -12,6 +12,110 @@ import { d as defineCustomElement$4 } from './salla-placeholder2.js';
|
|
|
12
12
|
import { d as defineCustomElement$3 } from './salla-searchable-dropdown2.js';
|
|
13
13
|
import { d as defineCustomElement$2 } from './salla-skeleton2.js';
|
|
14
14
|
|
|
15
|
+
const SESSION_STORAGE_NAME = "sc_selector_session";
|
|
16
|
+
const TRACKING_TIMEOUT_MS = 5000;
|
|
17
|
+
const CLOSE_REASONS = {
|
|
18
|
+
closeButtonClick: "close_button",
|
|
19
|
+
backdropClick: "backdrop",
|
|
20
|
+
};
|
|
21
|
+
const toCloseReason = (reason) => CLOSE_REASONS[reason ?? ""] ?? "escape";
|
|
22
|
+
const uuid = () => typeof crypto.randomUUID === "function"
|
|
23
|
+
? crypto.randomUUID()
|
|
24
|
+
: "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (Number(c) ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (Number(c) / 4)))).toString(16));
|
|
25
|
+
const allocatedBranchIds = (intent) => {
|
|
26
|
+
const value = intent?.allocation_headers?.["s-scope-allocation-id"] ?? intent?.branch_id;
|
|
27
|
+
const ids = String(value ?? "")
|
|
28
|
+
.split(",")
|
|
29
|
+
.map(Number)
|
|
30
|
+
.filter((id) => Number.isSafeInteger(id) && id > 0);
|
|
31
|
+
return [...new Set(ids)].sort((a, b) => a - b);
|
|
32
|
+
};
|
|
33
|
+
const sameIds = (a, b) => a.length === b.length && a.every((id) => b.includes(id));
|
|
34
|
+
class SelectorTracker {
|
|
35
|
+
constructor() {
|
|
36
|
+
this.impressionId = null;
|
|
37
|
+
this.visibleAt = 0;
|
|
38
|
+
}
|
|
39
|
+
viewed(context) {
|
|
40
|
+
this.guarded(() => {
|
|
41
|
+
this.impressionId = uuid();
|
|
42
|
+
this.visibleAt = Date.now();
|
|
43
|
+
this.send("Branch Selector Viewed", { ...context });
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
dismissed(context, reason, hadAcceptedSelection) {
|
|
47
|
+
this.guarded(() => this.send("Branch Selector Dismissed", {
|
|
48
|
+
...context,
|
|
49
|
+
close_reason: reason,
|
|
50
|
+
had_accepted_selection: hadAcceptedSelection,
|
|
51
|
+
elapsed_ms: this.visibleAt ? Date.now() - this.visibleAt : 0,
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
result(context, result) {
|
|
55
|
+
this.guarded(() => {
|
|
56
|
+
const session = this.session();
|
|
57
|
+
const seq = session.seq + 1;
|
|
58
|
+
const accepted = result.outcome === "accepted";
|
|
59
|
+
const firstAccepted = session.first_accepted_branch_ids ?? (accepted ? result.new_branch_ids : null);
|
|
60
|
+
// A draft or a failed attempt replaces the stored intent, so the last accepted branches live here.
|
|
61
|
+
const previous = session.last_accepted_branch_ids ?? result.previous_branch_ids;
|
|
62
|
+
this.save({
|
|
63
|
+
...session,
|
|
64
|
+
seq,
|
|
65
|
+
first_accepted_branch_ids: firstAccepted,
|
|
66
|
+
last_accepted_branch_ids: accepted ? result.new_branch_ids : previous,
|
|
67
|
+
});
|
|
68
|
+
this.send("Branch Selector Completed", {
|
|
69
|
+
...context,
|
|
70
|
+
...result,
|
|
71
|
+
previous_branch_ids: previous,
|
|
72
|
+
selection_attempt_id: uuid(),
|
|
73
|
+
selection_seq: seq,
|
|
74
|
+
first_accepted_branch_ids: firstAccepted,
|
|
75
|
+
changed: accepted && previous.length > 0 && !sameIds(previous, result.new_branch_ids),
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
guarded(track) {
|
|
80
|
+
try {
|
|
81
|
+
track();
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Tracking must never break the selector.
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
send(event, properties) {
|
|
88
|
+
const body = {
|
|
89
|
+
event,
|
|
90
|
+
session_id: this.session().id,
|
|
91
|
+
impression_id: this.impressionId,
|
|
92
|
+
...properties,
|
|
93
|
+
};
|
|
94
|
+
// Use the configured transport without the SDK's shared notification suppression.
|
|
95
|
+
// Tracking failures stay silent while concurrent customer requests keep their alerts.
|
|
96
|
+
// keepalive lets the request outlive the reload that follows a confirmed selection.
|
|
97
|
+
Promise.resolve(salla.api.axios.post("selector-events", body, {
|
|
98
|
+
timeout: TRACKING_TIMEOUT_MS,
|
|
99
|
+
adapter: ["fetch", "xhr"],
|
|
100
|
+
fetchOptions: { keepalive: true },
|
|
101
|
+
})).catch(() => undefined);
|
|
102
|
+
}
|
|
103
|
+
session() {
|
|
104
|
+
const stored = Salla.storage.session.get(this.storageName());
|
|
105
|
+
if (stored?.id)
|
|
106
|
+
return stored;
|
|
107
|
+
const fresh = { id: uuid(), seq: 0, first_accepted_branch_ids: null };
|
|
108
|
+
this.save(fresh);
|
|
109
|
+
return fresh;
|
|
110
|
+
}
|
|
111
|
+
storageName() {
|
|
112
|
+
return `${SESSION_STORAGE_NAME}:${Salla.config.get("store.id")}`;
|
|
113
|
+
}
|
|
114
|
+
save(session) {
|
|
115
|
+
Salla.storage.session.set(this.storageName(), session);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
15
119
|
var LocationIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 172 172" width="172" height="172">
|
|
16
120
|
<!-- White rounded background -->
|
|
17
121
|
<rect width="172" height="172" rx="64" fill="#FFFFFF"/>
|
|
@@ -271,6 +375,13 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
271
375
|
this.open();
|
|
272
376
|
};
|
|
273
377
|
this.closeHandler = null;
|
|
378
|
+
this.selectorTracker = new SelectorTracker();
|
|
379
|
+
this.openTrigger = "customer_requested";
|
|
380
|
+
this.pendingDismissReason = null;
|
|
381
|
+
this.modalCloseHandler = (detail) => {
|
|
382
|
+
this.pendingDismissReason = toCloseReason(detail?.reason);
|
|
383
|
+
queueMicrotask(() => (this.pendingDismissReason = null));
|
|
384
|
+
};
|
|
274
385
|
this.bulletDeliveryMobileSelectHandler = null;
|
|
275
386
|
/** True after saved addresses have been loaded (lazy: only when address tab is shown). */
|
|
276
387
|
this.savedAddressesLoaded = false;
|
|
@@ -537,6 +648,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
537
648
|
const details = this.buildIntentAddress();
|
|
538
649
|
if (!details)
|
|
539
650
|
return;
|
|
651
|
+
const previousIntent = this.getStoredIntent();
|
|
540
652
|
this.setStoredIntent({
|
|
541
653
|
type: "address",
|
|
542
654
|
country_id: Number(this.selectedCountry?.id) || 0,
|
|
@@ -545,7 +657,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
545
657
|
});
|
|
546
658
|
this.selectedSavedAddress = null;
|
|
547
659
|
this.selectedSessionAddress = true;
|
|
548
|
-
await this.handleConfirm();
|
|
660
|
+
await this.handleConfirm(previousIntent);
|
|
549
661
|
};
|
|
550
662
|
this.handleCountrySelected = (item) => {
|
|
551
663
|
const country = this.countries.find(c => String(c.id) === String(item.id)) || item;
|
|
@@ -630,9 +742,10 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
630
742
|
* successful auto-confirm never flashes the saved-addresses list; the caller is
|
|
631
743
|
* responsible for revealing the modal itself if it still needs the customer's input.
|
|
632
744
|
*/
|
|
633
|
-
async open(silent = false) {
|
|
745
|
+
async open(silent = false, trigger = "customer_requested") {
|
|
634
746
|
if (!this.isEnabled)
|
|
635
747
|
return; // feature disabled — never open
|
|
748
|
+
this.openTrigger = trigger;
|
|
636
749
|
// If mobile app, open the sheet
|
|
637
750
|
if (this.isMobileApp) {
|
|
638
751
|
Salla.event.dispatch('salla::bullet-delivery.open-sheet');
|
|
@@ -734,6 +847,33 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
734
847
|
this.bulletDeliveryClosed.emit();
|
|
735
848
|
return this.modal?.close();
|
|
736
849
|
}
|
|
850
|
+
selectorContext() {
|
|
851
|
+
return {
|
|
852
|
+
configured_required: this.isRequired,
|
|
853
|
+
effective_nonclosable: this.isRequired || this.shouldForceNonClosable(),
|
|
854
|
+
trigger_configured: this.openingType ?? null,
|
|
855
|
+
trigger_actual: this.openTrigger,
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
handleModalVisibility(visible) {
|
|
859
|
+
if (visible) {
|
|
860
|
+
this.selectorTracker.viewed(this.selectorContext());
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
if (!this.pendingDismissReason)
|
|
864
|
+
return;
|
|
865
|
+
this.selectorTracker.dismissed(this.selectorContext(), this.pendingDismissReason, !!this.getStoredIntent()?.scope_allocated);
|
|
866
|
+
this.pendingDismissReason = null;
|
|
867
|
+
}
|
|
868
|
+
trackSelectorResult(outcome, previousIntent, newBranchIds, scopeId) {
|
|
869
|
+
this.selectorTracker.result(this.selectorContext(), {
|
|
870
|
+
outcome,
|
|
871
|
+
fulfilment_method: this.activeTab === "branch" ? "pickup" : "delivery",
|
|
872
|
+
previous_branch_ids: previousIntent?.scope_allocated ? allocatedBranchIds(previousIntent) : [],
|
|
873
|
+
new_branch_ids: newBranchIds,
|
|
874
|
+
scope_id: scopeId ?? null,
|
|
875
|
+
});
|
|
876
|
+
}
|
|
737
877
|
resetState() {
|
|
738
878
|
this.viewMode = "main";
|
|
739
879
|
this.mapLocationData = null;
|
|
@@ -873,7 +1013,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
873
1013
|
if (!wasVisible) {
|
|
874
1014
|
// Load silently — a successful auto-confirm should never flash the
|
|
875
1015
|
// saved-addresses list; only reveal the modal below if it can't finish on its own.
|
|
876
|
-
await this.open(true);
|
|
1016
|
+
await this.open(true, "after_login");
|
|
877
1017
|
}
|
|
878
1018
|
// open() -> loadSavedAddresses() already sets selectedSessionAddress when a
|
|
879
1019
|
// session intent exists; bail if that didn't happen (e.g. address_id already set).
|
|
@@ -1936,7 +2076,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
1936
2076
|
if (await this.tryAutoConfirmAfterLogin())
|
|
1937
2077
|
return;
|
|
1938
2078
|
if (!this.modal?.hasAttribute?.("visible") || !this.isLoggedIn) {
|
|
1939
|
-
this.open();
|
|
2079
|
+
this.open(false, "after_login");
|
|
1940
2080
|
}
|
|
1941
2081
|
}
|
|
1942
2082
|
buildIntentAddress() {
|
|
@@ -2215,13 +2355,14 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2215
2355
|
}
|
|
2216
2356
|
return raw;
|
|
2217
2357
|
}
|
|
2218
|
-
async handleConfirm() {
|
|
2358
|
+
async handleConfirm(intentBeforeDraft) {
|
|
2219
2359
|
if (this.isConfirmDisabled() || this.confirming)
|
|
2220
2360
|
return;
|
|
2221
2361
|
this.allocationOutOfCoverageMessage = null;
|
|
2222
2362
|
this.confirming = true;
|
|
2223
2363
|
this.confirmBtn?.load();
|
|
2224
2364
|
let scheduledRedirect = false;
|
|
2365
|
+
const previousIntent = intentBeforeDraft === undefined ? this.getStoredIntent() : intentBeforeDraft;
|
|
2225
2366
|
try {
|
|
2226
2367
|
// A guest map pin uses the pin's own country; the IP/selected country may differ from it.
|
|
2227
2368
|
const country = this.activeTab === "address" && this.isGuestMapPick
|
|
@@ -2239,6 +2380,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2239
2380
|
const savedAddress = await this.saveSessionAddressToProfile();
|
|
2240
2381
|
if (!savedAddress) {
|
|
2241
2382
|
Salla.notify?.error(Salla.lang.get("common.errors.error_occurred"));
|
|
2383
|
+
this.trackSelectorResult("failed", previousIntent, []);
|
|
2242
2384
|
this.confirmBtn?.stop();
|
|
2243
2385
|
return;
|
|
2244
2386
|
}
|
|
@@ -2313,6 +2455,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2313
2455
|
? Salla.lang.get("pages.checkout.address_out_of_coverage")
|
|
2314
2456
|
: Salla.lang.get("pages.checkout.failed_to_set_pickup"));
|
|
2315
2457
|
this.allocationOutOfCoverageMessage = `${errorMessage}.`;
|
|
2458
|
+
this.trackSelectorResult("failed", previousIntent, []);
|
|
2316
2459
|
this.confirmBtn?.stop();
|
|
2317
2460
|
this.confirming = false;
|
|
2318
2461
|
return;
|
|
@@ -2349,6 +2492,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2349
2492
|
const scopeApplied = await bulletDeliveryAPI.setDeliveryScope(allocatedScopeId);
|
|
2350
2493
|
if (!scopeApplied) {
|
|
2351
2494
|
this.allocationOutOfCoverageMessage = `${Salla.lang.get("common.errors.error_occurred")}.`;
|
|
2495
|
+
this.trackSelectorResult("failed", previousIntent, [], allocatedScopeId);
|
|
2352
2496
|
this.confirmBtn?.stop();
|
|
2353
2497
|
this.confirming = false;
|
|
2354
2498
|
return;
|
|
@@ -2368,6 +2512,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2368
2512
|
// After allocation success: persist latest intent so switch UI can always reflect
|
|
2369
2513
|
// the selected address/branch once confirmed.
|
|
2370
2514
|
this.setStoredIntent({ ...result, scope_allocated: true });
|
|
2515
|
+
this.trackSelectorResult("accepted", previousIntent, allocatedBranchIds(result), allocatedScopeId);
|
|
2371
2516
|
const allocationConfirmedPayload = {
|
|
2372
2517
|
...result,
|
|
2373
2518
|
address: this.buildAllocationConfirmedAddressData(selectedAddress),
|
|
@@ -2887,7 +3032,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2887
3032
|
if (canOpenForIncompleteIntent) {
|
|
2888
3033
|
this.markIncompleteIntentPrompted();
|
|
2889
3034
|
}
|
|
2890
|
-
this.open();
|
|
3035
|
+
this.open(false, canOpenForIncompleteIntent ? "incomplete_intent" : "after_add_to_cart");
|
|
2891
3036
|
}
|
|
2892
3037
|
overrideScopeSwitchUI() {
|
|
2893
3038
|
const intent = this.getStoredIntent();
|
|
@@ -2940,7 +3085,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2940
3085
|
// silently awaiting with nothing visible.
|
|
2941
3086
|
if (!this.isGuestUser()) {
|
|
2942
3087
|
if (!this.modal?.hasAttribute?.("visible")) {
|
|
2943
|
-
this.open();
|
|
3088
|
+
this.open(false, "checkout_gate");
|
|
2944
3089
|
}
|
|
2945
3090
|
await this.pendingCartSubmitPromise;
|
|
2946
3091
|
return;
|
|
@@ -2969,7 +3114,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2969
3114
|
this.openGuestLogin();
|
|
2970
3115
|
return;
|
|
2971
3116
|
}
|
|
2972
|
-
this.open();
|
|
3117
|
+
this.open(false, "checkout_gate");
|
|
2973
3118
|
});
|
|
2974
3119
|
await this.pendingCartSubmitPromise;
|
|
2975
3120
|
};
|
|
@@ -2985,6 +3130,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
2985
3130
|
Salla.event.on("salla::bullet-delivery.modal.open.requested", this.bulletDeliveryOpenHandler);
|
|
2986
3131
|
this.closeHandler = this.close.bind(this);
|
|
2987
3132
|
Salla.event.on("salla::bullet-delivery.modal.close.requested", this.closeHandler);
|
|
3133
|
+
Salla.event.on("modal::close", this.modalCloseHandler);
|
|
2988
3134
|
this.isRTL = Salla.config.get("theme.is_rtl");
|
|
2989
3135
|
// Reading the permission never prompts, so it's safe to watch from here — the map view then
|
|
2990
3136
|
// renders the notice (or not) on its first paint instead of a frame later.
|
|
@@ -3009,7 +3155,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
3009
3155
|
return;
|
|
3010
3156
|
if (this.modal?.hasAttribute?.("visible"))
|
|
3011
3157
|
return;
|
|
3012
|
-
this.open();
|
|
3158
|
+
this.open(false, "after_login");
|
|
3013
3159
|
};
|
|
3014
3160
|
Salla.event.on("auth::logged.in", this.authLoggedInHandler);
|
|
3015
3161
|
this.authLoggedOutHandler = () => {
|
|
@@ -3041,7 +3187,10 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
3041
3187
|
return null; // no-op when disabled
|
|
3042
3188
|
return (h(Host, { class: "s-bullet-delivery" }, h("salla-modal", { ref: modal => {
|
|
3043
3189
|
this.modal = modal;
|
|
3044
|
-
}, isClosable: !this.isRequired && !this.shouldForceNonClosable(),
|
|
3190
|
+
}, isClosable: !this.isRequired && !this.shouldForceNonClosable(), onModalVisibilityChanged: (event) => {
|
|
3191
|
+
if (event.target === this.modal)
|
|
3192
|
+
this.handleModalVisibility(Boolean(event.detail));
|
|
3193
|
+
}, class: "s-bullet-delivery-modal", width: "sm", "data-testid": "salla-bullet-delivery-modal" }, h("div", { class: "s-bullet-delivery-inner" }, h("div", { class: "s-bullet-delivery-header" }, h("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address'
|
|
3045
3194
|
? Salla.lang.get('blocks.home.add_address_for_order_delivery')
|
|
3046
3195
|
: Salla.lang.get('blocks.home.choose_branch_for_order_pickup')), h("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address'
|
|
3047
3196
|
? Salla.lang.get('blocks.home.products_available_for_delivery_shown_while_shopping')
|
|
@@ -3077,7 +3226,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
3077
3226
|
// Handle pending open request (if event was emitted before component was ready)
|
|
3078
3227
|
if (this.pendingOpen) {
|
|
3079
3228
|
this.pendingOpen = false;
|
|
3080
|
-
this.open();
|
|
3229
|
+
this.open(false, this.openTrigger);
|
|
3081
3230
|
return;
|
|
3082
3231
|
}
|
|
3083
3232
|
// Strategy-based auto-open logic
|
|
@@ -3085,11 +3234,11 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
3085
3234
|
case "first_visit":
|
|
3086
3235
|
// Open once per session when component mounts (per-session behaviour)
|
|
3087
3236
|
if (!this.hasBeenShownThisSession()) {
|
|
3088
|
-
this.open();
|
|
3237
|
+
this.open(false, "first_visit");
|
|
3089
3238
|
}
|
|
3090
3239
|
else if (this.shouldPromptIncompleteIntentThisSession()) {
|
|
3091
3240
|
this.markIncompleteIntentPrompted();
|
|
3092
|
-
this.open();
|
|
3241
|
+
this.open(false, "incomplete_intent");
|
|
3093
3242
|
}
|
|
3094
3243
|
break;
|
|
3095
3244
|
case "on_cart_click":
|
|
@@ -3097,11 +3246,11 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
3097
3246
|
if (Salla.url.is_page("cart")) {
|
|
3098
3247
|
const shown = this.getShownStorage().get(this.sessionShownKey) === true;
|
|
3099
3248
|
if (!shown) {
|
|
3100
|
-
this.open();
|
|
3249
|
+
this.open(false, "on_cart_click");
|
|
3101
3250
|
}
|
|
3102
3251
|
else if (this.shouldPromptIncompleteIntentThisSession()) {
|
|
3103
3252
|
this.markIncompleteIntentPrompted();
|
|
3104
|
-
this.open();
|
|
3253
|
+
this.open(false, "incomplete_intent");
|
|
3105
3254
|
}
|
|
3106
3255
|
}
|
|
3107
3256
|
break;
|
|
@@ -3121,6 +3270,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
3121
3270
|
this.stopWatchingLocationPermission = null;
|
|
3122
3271
|
}
|
|
3123
3272
|
Salla.event.off("salla::bullet-delivery.modal.open.requested", this.bulletDeliveryOpenHandler);
|
|
3273
|
+
Salla.event.off("modal::close", this.modalCloseHandler);
|
|
3124
3274
|
if (this.closeHandler) {
|
|
3125
3275
|
Salla.event.off("salla::bullet-delivery.modal.close.requested", this.closeHandler);
|
|
3126
3276
|
this.closeHandler = null;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
-
import { i as isEligibleForFreeShipping } from './free-shipping.js';
|
|
5
|
+
import { i as isEligibleForFreeShipping, s as startTimerIfNeeded, a as isTimerEnabled, b as subscribeToFreeShippingTimer, g as getFreeShippingTimerState } from './free-shipping-timer.js';
|
|
6
6
|
|
|
7
|
-
const sallaFreeShippingBannerCss = "/*!twlt*/salla-free-shipping-banner{display:block}.s-free-shipping-banner{--s-fsb-tint:rgba(128, 128, 128, 0.1);--s-fsb-tint-2:rgba(128, 128, 128, 0.18);--s-fsb-shine:rgba(128, 128, 128, 0.35);color:inherit;font-size:13.5px;line-height:1.4;background:var(--s-fsb-tint);margin-block-start:1rem;margin-block-end:1rem;border-radius:12px;padding:8px 12px}@supports (color: color-mix(in srgb, red, blue)){.s-free-shipping-banner{--s-fsb-tint:color-mix(in srgb, currentColor 9%, transparent);--s-fsb-tint-2:color-mix(in srgb, currentColor 12%, transparent);--s-fsb-shine:color-mix(in srgb, currentColor 40%, transparent)}}.s-free-shipping-banner svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}.s-free-shipping-banner__inner{display:flex;align-items:center;gap:10px}.s-free-shipping-banner__icon{flex:none;inline-size:42px;block-size:28px;overflow:visible}.s-free-shipping-banner__icon .s-fsb-fill{fill:currentColor;stroke:none}.s-free-shipping-banner__icon .s-fsb-window{fill:#fff;stroke:none}.s-free-shipping-banner__icon .s-fsb-line{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}.s-free-shipping-banner__icon .s-fsb-wheel{fill:none;stroke:currentColor;stroke-width:2}.s-free-shipping-banner__icon .s-fsb-body{animation:s-fsb-bob 0.36s ease-in-out infinite alternate}.s-free-shipping-banner__icon .s-fsb-speed path{animation:s-fsb-speed 0.6s linear infinite}.s-free-shipping-banner__icon .s-fsb-speed path:nth-child(2){animation-delay:0.2s}.s-free-shipping-banner__icon .s-fsb-speed path:nth-child(3){animation-delay:0.4s}.s-free-shipping-banner__text{margin:0;flex:1 1 auto;min-inline-size:0}.s-free-shipping-banner__text strong{display:block;font-size:14.5px;font-weight:700;line-height:1.3}.s-free-shipping-banner__desc{display:block;font-size:12.5px;line-height:1.35;opacity:0.85;margin-block-start:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.s-free-shipping-
|
|
7
|
+
const sallaFreeShippingBannerCss = "/*!twlt*/salla-free-shipping-banner{display:block}.s-free-shipping-banner{--s-fsb-tint:rgba(128, 128, 128, 0.1);--s-fsb-tint-2:rgba(128, 128, 128, 0.18);--s-fsb-shine:rgba(128, 128, 128, 0.35);color:inherit;font-size:13.5px;line-height:1.4;background:var(--s-fsb-tint);margin-block-start:1rem;margin-block-end:1rem;border-radius:12px;padding:8px 12px}@supports (color: color-mix(in srgb, red, blue)){.s-free-shipping-banner{--s-fsb-tint:color-mix(in srgb, currentColor 9%, transparent);--s-fsb-tint-2:color-mix(in srgb, currentColor 12%, transparent);--s-fsb-shine:color-mix(in srgb, currentColor 40%, transparent)}}.s-free-shipping-banner svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}.s-free-shipping-banner__inner{display:flex;align-items:center;gap:10px}.s-free-shipping-banner__icon{flex:none;inline-size:42px;block-size:28px;overflow:visible}.s-free-shipping-banner__icon .s-fsb-fill{fill:currentColor;stroke:none}.s-free-shipping-banner__icon .s-fsb-window{fill:#fff;stroke:none}.s-free-shipping-banner__icon .s-fsb-line{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}.s-free-shipping-banner__icon .s-fsb-wheel{fill:none;stroke:currentColor;stroke-width:2}.s-free-shipping-banner__icon .s-fsb-body{animation:s-fsb-bob 0.36s ease-in-out infinite alternate}.s-free-shipping-banner__icon .s-fsb-speed path{animation:s-fsb-speed 0.6s linear infinite}.s-free-shipping-banner__icon .s-fsb-speed path:nth-child(2){animation-delay:0.2s}.s-free-shipping-banner__icon .s-fsb-speed path:nth-child(3){animation-delay:0.4s}.s-free-shipping-banner__text{margin:0;flex:1 1 auto;min-inline-size:0}.s-free-shipping-banner__text strong{display:block;font-size:14.5px;font-weight:700;line-height:1.3}.s-free-shipping-banner__desc{display:block;font-size:12.5px;line-height:1.35;opacity:0.85;margin-block-start:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.s-free-shipping-banner__timer{position:relative;overflow:hidden;flex:none;display:inline-flex;align-items:center;gap:6px;min-block-size:28px;padding-inline:10px;border-radius:999px;font-size:13px;font-weight:600;white-space:nowrap;background:var(--s-fsb-tint-2)}.s-free-shipping-banner__timer svg{inline-size:15px;block-size:15px}.s-free-shipping-banner__timer::after{content:\"\";position:absolute;top:0;bottom:0;left:0;inline-size:45%;background:linear-gradient(90deg, transparent, var(--s-fsb-shine), transparent);transform:translateX(-150%) skewX(-18deg);animation:s-fsb-shine 5s ease-in-out infinite;pointer-events:none}.s-free-shipping-banner__clock{font-size:13.5px;font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";direction:ltr;unicode-bidi:isolate}.s-free-shipping-banner.has-paper .s-free-shipping-banner__timer{background:var(--s-fsb-ink);color:var(--s-fsb-paper)}@media (prefers-reduced-motion: reduce){.s-free-shipping-banner *,.s-free-shipping-banner *::after{animation:none !important}}@media (max-width: 767px){.s-free-shipping-banner__desc{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.s-free-shipping-banner__label{display:none}.s-free-shipping-banner__timer{padding-inline:9px}}@media (min-width: 900px){.s-free-shipping-banner{padding:8px 14px}.s-free-shipping-banner__inner{gap:12px}.s-free-shipping-banner__icon{inline-size:48px;block-size:32px}.s-free-shipping-banner__text strong{font-size:15.5px}.s-free-shipping-banner__desc{font-size:13px}}@keyframes s-fsb-bob{from{transform:translateY(0)}to{transform:translateY(-0.8px)}}@keyframes s-fsb-speed{0%{transform:translateX(2px);opacity:0}30%{opacity:0.9}100%{transform:translateX(-7px);opacity:0}}@keyframes s-fsb-shine{0%{transform:translateX(-150%) skewX(-18deg)}26%,100%{transform:translateX(360%) skewX(-18deg)}}.visible{visibility:visible}.hidden{display:none}";
|
|
8
8
|
|
|
9
9
|
const LABELS = {
|
|
10
10
|
title: {
|
|
@@ -15,11 +15,27 @@ const LABELS = {
|
|
|
15
15
|
ar: 'لفترة محدودة! تسوّق واستفد من الشحن المجاني',
|
|
16
16
|
en: 'Shop now and save on delivery for a limited time.',
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
ar: '
|
|
20
|
-
en: '
|
|
18
|
+
ends_in: {
|
|
19
|
+
ar: 'ينتهي خلال',
|
|
20
|
+
en: 'Ends in',
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
|
+
const pad = (n) => (n < 10 ? '0' : '') + n;
|
|
24
|
+
function formatClock(ms) {
|
|
25
|
+
const seconds = Math.max(0, Math.floor(ms / 1000));
|
|
26
|
+
return `${pad(Math.floor(seconds / 3600))}:${pad(Math.floor((seconds % 3600) / 60))}:${pad(seconds % 60)}`;
|
|
27
|
+
}
|
|
28
|
+
function luminance(rgb) {
|
|
29
|
+
const m = /rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(rgb || '');
|
|
30
|
+
if (!m)
|
|
31
|
+
return null;
|
|
32
|
+
const f = (c) => {
|
|
33
|
+
c /= 255;
|
|
34
|
+
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
35
|
+
};
|
|
36
|
+
return 0.2126 * f(+m[1]) + 0.7152 * f(+m[2]) + 0.0722 * f(+m[3]);
|
|
37
|
+
}
|
|
38
|
+
const isTransparent = (bg) => !bg || bg === 'transparent' || /rgba\(\d+,\s*\d+,\s*\d+,\s*0\)/.test(bg);
|
|
23
39
|
const SallaFreeShippingBanner$1 = /*@__PURE__*/ proxyCustomElement(class SallaFreeShippingBanner extends HTMLElement {
|
|
24
40
|
constructor() {
|
|
25
41
|
super();
|
|
@@ -27,7 +43,19 @@ const SallaFreeShippingBanner$1 = /*@__PURE__*/ proxyCustomElement(class SallaFr
|
|
|
27
43
|
/** Where the banner is rendered: the home page or the product page. */
|
|
28
44
|
this.placement = 'home';
|
|
29
45
|
this.locale = 'ar';
|
|
46
|
+
/** Whether free shipping applies here (feature on and the eligibility check passed). */
|
|
30
47
|
this.visible = false;
|
|
48
|
+
this.timer = null;
|
|
49
|
+
this.onColorSchemeChange = () => this.measureInkAndPaper();
|
|
50
|
+
}
|
|
51
|
+
connectedCallback() {
|
|
52
|
+
this.colorScheme = window.matchMedia?.('(prefers-color-scheme: dark)');
|
|
53
|
+
this.colorScheme?.addEventListener?.('change', this.onColorSchemeChange);
|
|
54
|
+
}
|
|
55
|
+
disconnectedCallback() {
|
|
56
|
+
this.unsubscribe?.();
|
|
57
|
+
this.stopTick();
|
|
58
|
+
this.colorScheme?.removeEventListener?.('change', this.onColorSchemeChange);
|
|
31
59
|
}
|
|
32
60
|
async componentWillLoad() {
|
|
33
61
|
try {
|
|
@@ -43,27 +71,86 @@ const SallaFreeShippingBanner$1 = /*@__PURE__*/ proxyCustomElement(class SallaFr
|
|
|
43
71
|
// home: is the store offering free shipping; product page: is this product eligible
|
|
44
72
|
const productId = this.placement === 'product' ? salla.config.get('page.id') : undefined;
|
|
45
73
|
this.visible = await isEligibleForFreeShipping(productId);
|
|
74
|
+
if (this.visible) {
|
|
75
|
+
// The visitor sees the banner now: remember when, the first time only.
|
|
76
|
+
startTimerIfNeeded();
|
|
77
|
+
// Only a banner that can show, and has a timer, follows it (to hide at the end and come back after).
|
|
78
|
+
if (isTimerEnabled()) {
|
|
79
|
+
this.unsubscribe = subscribeToFreeShippingTimer(() => this.refreshTimer());
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
this.refreshTimer();
|
|
46
83
|
}
|
|
47
84
|
catch (e) {
|
|
48
85
|
salla?.logger?.warn?.('salla-free-shipping-banner: init failed', e);
|
|
49
86
|
}
|
|
50
87
|
}
|
|
88
|
+
refreshTimer() {
|
|
89
|
+
this.timer = getFreeShippingTimerState();
|
|
90
|
+
if (this.visible && this.timer?.visible) {
|
|
91
|
+
this.tick = this.tick ?? setInterval(() => this.refreshTimer(), 1000);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.stopTick();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
stopTick() {
|
|
98
|
+
clearInterval(this.tick);
|
|
99
|
+
this.tick = undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The timer chip is drawn from the theme's own colours: solid in the text colour ("ink")
|
|
103
|
+
* with the nearest opaque background behind the banner ("paper") as its text colour.
|
|
104
|
+
*/
|
|
105
|
+
measureInkAndPaper() {
|
|
106
|
+
const bar = this.host?.querySelector('.s-free-shipping-banner');
|
|
107
|
+
if (!bar)
|
|
108
|
+
return;
|
|
109
|
+
this.measuredBar = bar;
|
|
110
|
+
const ink = getComputedStyle(bar.parentElement || bar).color;
|
|
111
|
+
let paper = null;
|
|
112
|
+
for (let node = bar.parentElement; node; node = node.parentElement) {
|
|
113
|
+
const bg = getComputedStyle(node).backgroundColor;
|
|
114
|
+
if (!isTransparent(bg)) {
|
|
115
|
+
paper = bg;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (!paper) {
|
|
120
|
+
const l = luminance(ink);
|
|
121
|
+
paper = l != null && l > 0.5 ? '#111418' : '#ffffff';
|
|
122
|
+
}
|
|
123
|
+
bar.style.setProperty('--s-fsb-ink', ink);
|
|
124
|
+
bar.style.setProperty('--s-fsb-paper', paper);
|
|
125
|
+
bar.classList.add('has-paper');
|
|
126
|
+
}
|
|
127
|
+
componentDidRender() {
|
|
128
|
+
// The colours do not change with the countdown: measure once per banner element (it is a new
|
|
129
|
+
// element each time the banner comes back), and again on a colour scheme change.
|
|
130
|
+
const bar = this.host?.querySelector('.s-free-shipping-banner');
|
|
131
|
+
if (bar && bar !== this.measuredBar) {
|
|
132
|
+
this.measureInkAndPaper();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
51
135
|
/** Store translation wins, the built-in label is the fallback for the current language. */
|
|
52
136
|
label(name) {
|
|
53
137
|
const label = LABELS?.[name]?.[this.locale];
|
|
54
138
|
return salla.lang.getWithDefault?.(`blocks.free_shipping_banner.${name}`, label) || label;
|
|
55
139
|
}
|
|
56
140
|
render() {
|
|
57
|
-
|
|
141
|
+
const timer = this.timer;
|
|
142
|
+
if (!this.visible || !timer?.visible) {
|
|
58
143
|
return null;
|
|
59
144
|
}
|
|
60
|
-
return (h(Host, null, h("div", { class: "container" }, h("section", { class: "s-free-shipping-banner", "aria-label": this.label('title') }, h("div", { class: "s-free-shipping-banner__inner" }, h("svg", { class: "s-free-shipping-banner__icon", viewBox: "0 0 48 32", "aria-hidden": "true" }, h("g", { class: "s-fsb-speed" }, h("path", { class: "s-fsb-line", d: "M3 11h7" }), h("path", { class: "s-fsb-line", d: "M1 16h5" }), h("path", { class: "s-fsb-line", d: "M4 21h6" })), h("g", { class: "s-fsb-body" }, h("rect", { class: "s-fsb-fill", x: "12", y: "5", width: "21", height: "16", rx: "2.5" }), h("path", { class: "s-fsb-fill", d: "M33 10h6.5a2 2 0 0 1 1.6.8l4.1 5.5c.5.7.8 1.5.8 2.4V21H33z" }), h("rect", { class: "s-fsb-fill", x: "12", y: "20", width: "34", height: "3.5", rx: "1.2" }), h("rect", { class: "s-fsb-window", x: "35", y: "12", width: "5.5", height: "4", rx: "1" })), h("circle", { class: "s-fsb-wheel", cx: "19.5", cy: "25.5", r: "3" }), h("circle", { class: "s-fsb-wheel", cx: "38", cy: "25.5", r: "3" })), h("p", { class: "s-free-shipping-banner__text" }, h("strong", null, this.label('title')), h("span", { class: "s-free-shipping-banner__desc" }, this.label('description'))), h("span", { class: "s-free-shipping-
|
|
145
|
+
return (h(Host, null, h("div", { class: "container" }, h("section", { class: "s-free-shipping-banner", "aria-label": this.label('title') }, h("div", { class: "s-free-shipping-banner__inner" }, h("svg", { class: "s-free-shipping-banner__icon", viewBox: "0 0 48 32", "aria-hidden": "true" }, h("g", { class: "s-fsb-speed" }, h("path", { class: "s-fsb-line", d: "M3 11h7" }), h("path", { class: "s-fsb-line", d: "M1 16h5" }), h("path", { class: "s-fsb-line", d: "M4 21h6" })), h("g", { class: "s-fsb-body" }, h("rect", { class: "s-fsb-fill", x: "12", y: "5", width: "21", height: "16", rx: "2.5" }), h("path", { class: "s-fsb-fill", d: "M33 10h6.5a2 2 0 0 1 1.6.8l4.1 5.5c.5.7.8 1.5.8 2.4V21H33z" }), h("rect", { class: "s-fsb-fill", x: "12", y: "20", width: "34", height: "3.5", rx: "1.2" }), h("rect", { class: "s-fsb-window", x: "35", y: "12", width: "5.5", height: "4", rx: "1" })), h("circle", { class: "s-fsb-wheel", cx: "19.5", cy: "25.5", r: "3" }), h("circle", { class: "s-fsb-wheel", cx: "38", cy: "25.5", r: "3" })), h("p", { class: "s-free-shipping-banner__text" }, h("strong", null, this.label('title')), h("span", { class: "s-free-shipping-banner__desc" }, this.label('description'))), h("span", { class: "s-free-shipping-banner__timer" }, h("svg", { viewBox: "0 0 24 24", "aria-hidden": "true" }, h("circle", { cx: "12", cy: "12", r: "8" }), h("path", { d: "M12 8v4l3 2" })), h("span", { class: "s-free-shipping-banner__label" }, this.label('ends_in')), h("span", { class: "s-free-shipping-banner__clock", role: "timer" }, formatClock(timer.remainingMs))))))));
|
|
61
146
|
}
|
|
147
|
+
get host() { return this; }
|
|
62
148
|
static get style() { return sallaFreeShippingBannerCss; }
|
|
63
149
|
}, [0, "salla-free-shipping-banner", {
|
|
64
150
|
"placement": [1],
|
|
65
151
|
"locale": [32],
|
|
66
|
-
"visible": [32]
|
|
152
|
+
"visible": [32],
|
|
153
|
+
"timer": [32]
|
|
67
154
|
}]);
|
|
68
155
|
function defineCustomElement$1() {
|
|
69
156
|
if (typeof customElements === "undefined") {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
-
import { i as isEligibleForFreeShipping } from './free-shipping.js';
|
|
5
|
+
import { g as getFreeShippingTimerState, a as isTimerEnabled, b as subscribeToFreeShippingTimer, i as isEligibleForFreeShipping } from './free-shipping-timer.js';
|
|
6
6
|
|
|
7
|
-
const sallaFreeShippingTagCss = "/*!twlt*/salla-free-shipping-tag{display:block}.s-free-shipping-tag{display:inline-flex;align-items:center;gap:6px;margin-block-start:0.5rem;margin-bottom:1.25rem;padding:4px 10px;border-radius:8px;font-size:13px;line-height:1.4;color:#7a4b0c;background:rgba(245, 158, 11, 0.14)}.s-free-shipping-tag svg{inline-size:16px;block-size:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}";
|
|
7
|
+
const sallaFreeShippingTagCss = "/*!twlt*/salla-free-shipping-tag{display:block}.s-free-shipping-tag{display:inline-flex;align-items:center;gap:6px;margin-block-start:0.5rem;margin-bottom:1.25rem;padding:4px 10px;border-radius:8px;font-size:13px;line-height:1.4;color:#7a4b0c;background:rgba(245, 158, 11, 0.14)}.s-free-shipping-tag svg{inline-size:16px;block-size:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.visible{visibility:visible}.hidden{display:none}";
|
|
8
8
|
|
|
9
9
|
const SallaFreeShippingTag$1 = /*@__PURE__*/ proxyCustomElement(class SallaFreeShippingTag extends HTMLElement {
|
|
10
10
|
constructor() {
|
|
@@ -15,13 +15,26 @@ const SallaFreeShippingTag$1 = /*@__PURE__*/ proxyCustomElement(class SallaFreeS
|
|
|
15
15
|
/** With `fromProductCard`, whether the tag is shown. */
|
|
16
16
|
this.showFreeShipping = false;
|
|
17
17
|
this.isFree = false;
|
|
18
|
+
this.timerHidden = false;
|
|
18
19
|
this.label = '';
|
|
19
20
|
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
this.unsubscribe?.();
|
|
23
|
+
}
|
|
24
|
+
// The banner records when the visitor first saw it. Until then, or with the feature off, nothing hides the tag.
|
|
25
|
+
refreshTimer() {
|
|
26
|
+
this.timerHidden = getFreeShippingTimerState()?.visible === false;
|
|
27
|
+
}
|
|
20
28
|
async componentWillLoad() {
|
|
21
29
|
try {
|
|
22
30
|
await salla.onReady();
|
|
23
31
|
await salla.lang.onLoaded();
|
|
24
32
|
const fallback = salla.lang.getLocale?.() === 'en' ? 'Free shipping' : 'شحن مجاني';
|
|
33
|
+
// Only follow the timer when there is one (feature on and timer settings present).
|
|
34
|
+
if (isTimerEnabled()) {
|
|
35
|
+
this.unsubscribe = subscribeToFreeShippingTimer(() => this.refreshTimer());
|
|
36
|
+
}
|
|
37
|
+
this.refreshTimer();
|
|
25
38
|
this.label =
|
|
26
39
|
salla.lang.getWithDefault?.('pages.products.free_shipping', fallback) || fallback;
|
|
27
40
|
if (this.fromProductCard) {
|
|
@@ -36,7 +49,7 @@ const SallaFreeShippingTag$1 = /*@__PURE__*/ proxyCustomElement(class SallaFreeS
|
|
|
36
49
|
}
|
|
37
50
|
}
|
|
38
51
|
render() {
|
|
39
|
-
if (!this.isFree) {
|
|
52
|
+
if (!this.isFree || this.timerHidden) {
|
|
40
53
|
return null;
|
|
41
54
|
}
|
|
42
55
|
return (h(Host, null, h("div", { class: "s-free-shipping-tag" }, h("svg", { viewBox: "0 0 24 24", "aria-hidden": "true" }, h("path", { d: "M3 6.5h11v9H3zM14 9.5h3.6l2.9 3.2v2.8H14" }), h("circle", { cx: "7.5", cy: "17", r: "1.8" }), h("circle", { cx: "17", cy: "17", r: "1.8" })), h("span", { class: "s-free-shipping-tag-label" }, this.label))));
|
|
@@ -48,6 +61,7 @@ const SallaFreeShippingTag$1 = /*@__PURE__*/ proxyCustomElement(class SallaFreeS
|
|
|
48
61
|
"fromProductCard": [4, "from-product-card"],
|
|
49
62
|
"showFreeShipping": [4, "show-free-shipping"],
|
|
50
63
|
"isFree": [32],
|
|
64
|
+
"timerHidden": [32],
|
|
51
65
|
"label": [32]
|
|
52
66
|
}]);
|
|
53
67
|
function defineCustomElement$1() {
|