@salla.sa/twilight-components 2.14.507 → 2.14.509
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/catalog-recommendations-dtK9Dlfw.js +97 -0
- package/dist/cjs/{filepond-CvJ5cEog.js → filepond-Dn8WkI9_.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BaTGVcva.js → filepond-plugin-file-poster-mufjzLbD.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DLrFHUWL.js → filepond-plugin-file-validate-size-BC6t5UPj.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BU1HIA61.js → filepond-plugin-file-validate-type-CaQ5Kqok.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-CF5DJ9dM.js → filepond-plugin-image-edit-DvSmfnUl.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DLrU2VJ-.js → filepond-plugin-image-exif-orientation-Br5ovpCW.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-D_3BTg6j.js → filepond-plugin-image-preview-C71ogaak.js} +1 -1
- package/dist/cjs/{functions-Chjqknfu.js → functions-DgFPxTJv.js} +1 -1
- package/dist/cjs/{index-DDEOCBF1.js → index-CeEhEVDJ.js} +6 -6
- package/dist/cjs/{index-D4085yXe.js → index-DHuZTkix.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 +1 -1
- 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-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +2 -2
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +2 -2
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +12 -17
- 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_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-exchange-product-card_5.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- 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-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.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-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_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-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 +28 -8
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +10 -3
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/{tracked-promise-C69FwhCX.js → tracked-promise-DDnavSzb.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-BDDWkkNu.js → vanilla-picker-CyrLIKBL.js} +1 -1
- package/dist/collection/components/salla-comments/salla-comments.css +2 -5
- package/dist/collection/components/salla-comments/salla-comments.js +6 -3
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.css +7 -3
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +64 -9
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.css +15 -31
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +2 -11
- package/dist/collection/components/salla-social-share/salla-social-share.js +9 -2
- package/dist/collection/shared/catalog-recommendations.js +47 -41
- package/dist/components/catalog-recommendations.js +47 -41
- package/dist/components/index.js +2 -2
- package/dist/components/salla-comment-factors2.js +1 -1
- package/dist/components/salla-comment-item2.js +1 -1
- package/dist/components/salla-comments.js +29 -20
- package/dist/components/salla-review-factors-tags.js +1 -141
- package/dist/components/salla-review-factors-tags2.js +173 -0
- package/dist/components/salla-reviews-summary2.js +13 -16
- package/dist/components/salla-social-share2.js +9 -2
- package/dist/esm/catalog-recommendations-CL7OPpYS.js +94 -0
- package/dist/esm/{filepond-BfxOWgeR.js → filepond-Cu0hGP46.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-Dt5Vnuk4.js → filepond-plugin-file-poster-DBfLrjkx.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-D5WrsM0T.js → filepond-plugin-file-validate-size-Cq0e60aE.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-CjaeW32q.js → filepond-plugin-file-validate-type-CpRmNAFC.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BTzFile_.js → filepond-plugin-image-edit-C-7yhkPK.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-DSNjqS_v.js → filepond-plugin-image-exif-orientation-CTn5LeXC.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CCGiOVLr.js → filepond-plugin-image-preview-BsETbqVf.js} +1 -1
- package/dist/esm/{functions-D05iBLQe.js → functions-DtC2lEvS.js} +1 -1
- package/dist/esm/{index-DpTbeb50.js → index-BEjZOd--.js} +6 -6
- package/dist/esm/{index-BTUirq4N.js → index-DskkoO4T.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 +1 -1
- 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-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +2 -2
- package/dist/esm/salla-booking-field_7.entry.js +10 -10
- package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +2 -2
- package/dist/esm/salla-comment-form_8.entry.js +12 -17
- 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_2.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner.entry.js +2 -2
- package/dist/esm/salla-loyalty-exchange-product-card_5.entry.js +3 -3
- package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- 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-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_2.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.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-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_2.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-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 +28 -8
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +10 -3
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/{tracked-promise-DBueMSK5.js → tracked-promise-DzdT8znx.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-CWFpeA2O.js → vanilla-picker-DzKX2qA5.js} +1 -1
- package/dist/twilight/{p-C3eic20c.js → p--UKCKF-7.js} +1 -1
- package/dist/twilight/{p-a877a3df.entry.js → p-017a1a77.entry.js} +1 -1
- package/dist/twilight/p-03505fdd.entry.js +4 -0
- package/dist/twilight/{p-4448d43a.entry.js → p-05f01920.entry.js} +1 -1
- package/dist/twilight/{p-bf15f029.entry.js → p-0950cbbb.entry.js} +1 -1
- package/dist/twilight/{p-ed7de02d.entry.js → p-0959b41c.entry.js} +1 -1
- package/dist/twilight/{p-a00bc904.entry.js → p-09cd7f70.entry.js} +1 -1
- package/dist/twilight/{p-163f862d.entry.js → p-0a3e9f94.entry.js} +1 -1
- package/dist/twilight/{p-d5811dab.entry.js → p-113e7032.entry.js} +1 -1
- package/dist/twilight/{p-17682453.entry.js → p-12c571d7.entry.js} +1 -1
- package/dist/twilight/p-19388aef.entry.js +4 -0
- package/dist/twilight/{p-059447b5.entry.js → p-193cccd3.entry.js} +1 -1
- package/dist/twilight/{p-a67f9586.entry.js → p-1bec8b0a.entry.js} +1 -1
- package/dist/twilight/{p-2e16cb11.entry.js → p-1c03607d.entry.js} +1 -1
- package/dist/twilight/{p-4e82cbd2.entry.js → p-1df6827d.entry.js} +1 -1
- package/dist/twilight/p-21870458.entry.js +4 -0
- package/dist/twilight/{p-5adb2573.entry.js → p-25f8d253.entry.js} +1 -1
- package/dist/twilight/{p-374bbf0c.entry.js → p-2643952e.entry.js} +1 -1
- package/dist/twilight/{p-537127ba.entry.js → p-27252d50.entry.js} +1 -1
- package/dist/twilight/{p-7272b850.entry.js → p-27acb426.entry.js} +1 -1
- package/dist/twilight/{p-92f654cd.entry.js → p-296df4c6.entry.js} +1 -1
- package/dist/twilight/{p-4a367dba.entry.js → p-2c7e18c5.entry.js} +1 -1
- package/dist/twilight/{p-7c286ef2.entry.js → p-30d6436e.entry.js} +1 -1
- package/dist/twilight/{p-abc06135.entry.js → p-3350c805.entry.js} +1 -1
- package/dist/twilight/{p-629ce572.entry.js → p-33756c72.entry.js} +1 -1
- package/dist/twilight/{p-6e88b2ee.entry.js → p-37310557.entry.js} +1 -1
- package/dist/twilight/{p-61cac25a.entry.js → p-3791a8d0.entry.js} +1 -1
- package/dist/twilight/{p-a7f2a74c.entry.js → p-384febda.entry.js} +1 -1
- package/dist/twilight/{p-8dd123f2.entry.js → p-3ccbdb7a.entry.js} +1 -1
- package/dist/twilight/{p-818c83b3.entry.js → p-3d44e1e9.entry.js} +1 -1
- package/dist/twilight/{p-21fe599c.entry.js → p-41ac2dc0.entry.js} +1 -1
- package/dist/twilight/{p-9c2c481e.entry.js → p-42c57314.entry.js} +1 -1
- package/dist/twilight/{p-9f8b8f9b.entry.js → p-4317eeb9.entry.js} +1 -1
- package/dist/twilight/{p-e94e2b10.entry.js → p-47a7f1a5.entry.js} +1 -1
- package/dist/twilight/{p-ae778949.entry.js → p-48cf6b68.entry.js} +1 -1
- package/dist/twilight/{p-b25dc971.entry.js → p-4d76cd8f.entry.js} +1 -1
- package/dist/twilight/{p-5d8a987d.entry.js → p-516e9179.entry.js} +1 -1
- package/dist/twilight/{p-950cd62e.entry.js → p-518b6032.entry.js} +1 -1
- package/dist/twilight/{p-a9259c2c.entry.js → p-5201eb4f.entry.js} +1 -1
- package/dist/twilight/{p-f624f871.entry.js → p-52c0a1b5.entry.js} +1 -1
- package/dist/twilight/{p-2426ecc1.entry.js → p-557609aa.entry.js} +1 -1
- package/dist/twilight/{p-61c2bd59.entry.js → p-5958986c.entry.js} +1 -1
- package/dist/twilight/{p-5fa56bf3.entry.js → p-62a86556.entry.js} +1 -1
- package/dist/twilight/{p-1208db60.entry.js → p-62abd25a.entry.js} +1 -1
- package/dist/twilight/{p-9fed2cae.entry.js → p-6681db6a.entry.js} +1 -1
- package/dist/twilight/{p-4402fa6e.entry.js → p-69758093.entry.js} +1 -1
- package/dist/twilight/{p-c88bacf7.entry.js → p-6ba99048.entry.js} +1 -1
- package/dist/twilight/{p-7a4c9484.entry.js → p-6c3b50e2.entry.js} +1 -1
- package/dist/twilight/{p-43a205c5.entry.js → p-6d970be9.entry.js} +1 -1
- package/dist/twilight/{p-d5d143f8.entry.js → p-725eeeed.entry.js} +1 -1
- package/dist/twilight/{p-036bacea.entry.js → p-734dfd28.entry.js} +1 -1
- package/dist/twilight/{p-5b2a71b6.entry.js → p-74c84c67.entry.js} +1 -1
- package/dist/twilight/{p-2edbc237.entry.js → p-758894b7.entry.js} +1 -1
- package/dist/twilight/{p-609e9adc.entry.js → p-7e4fea4b.entry.js} +1 -1
- package/dist/twilight/{p-9029c370.entry.js → p-7edc5c88.entry.js} +1 -1
- package/dist/twilight/{p-789b3fd9.entry.js → p-804cfed5.entry.js} +1 -1
- package/dist/twilight/{p-3a18c5f0.entry.js → p-858f485b.entry.js} +1 -1
- package/dist/twilight/{p-1cb73a8f.entry.js → p-86df9649.entry.js} +1 -1
- package/dist/twilight/{p-d2698f9a.entry.js → p-8b9c8776.entry.js} +1 -1
- package/dist/twilight/{p-4bf27bdf.entry.js → p-8c03c0d2.entry.js} +1 -1
- package/dist/twilight/{p-4f78e05a.entry.js → p-8c6730a9.entry.js} +1 -1
- package/dist/twilight/{p-0d391a95.entry.js → p-8d199be5.entry.js} +1 -1
- package/dist/twilight/{p-d4338ca5.entry.js → p-8ddfe69e.entry.js} +1 -1
- package/dist/twilight/{p-c7dd7c0b.entry.js → p-8f982a91.entry.js} +1 -1
- package/dist/twilight/{p-948fb25a.entry.js → p-8fcc4bb0.entry.js} +1 -1
- package/dist/twilight/{p-7c0ffbd5.entry.js → p-925af19b.entry.js} +1 -1
- package/dist/twilight/{p-ee32d269.entry.js → p-9807935d.entry.js} +1 -1
- package/dist/twilight/{p-85df37ed.entry.js → p-9eade28d.entry.js} +1 -1
- package/dist/twilight/{p-Bo_bRDhK.js → p-BDLhoSt2.js} +1 -1
- package/dist/twilight/{p-DpTbeb50.js → p-BEjZOd--.js} +1 -1
- package/dist/twilight/{p-CnfHXyEu.js → p-BTVc7r-Z.js} +1 -1
- package/dist/twilight/{p-DjsKwETU.js → p-CCH8joDb.js} +1 -1
- package/dist/twilight/{p-yMm9FfsL.js → p-CGahPnsw.js} +1 -1
- package/dist/twilight/p-CL7OPpYS.js +4 -0
- package/dist/twilight/{p-RkvdV-0f.js → p-COwpiJQt.js} +1 -1
- package/dist/twilight/{p-M4ZqgDjz.js → p-CxQVHI3A.js} +1 -1
- package/dist/twilight/{p-COmDVrcC.js → p-D2_JplO8.js} +1 -1
- package/dist/twilight/{p-ucgX82B7.js → p-Da0xrmo3.js} +1 -1
- package/dist/twilight/{p-b3EkK54S.js → p-Dv2SelMn.js} +1 -1
- package/dist/twilight/p-Dw58JgkP.js +9 -0
- package/dist/twilight/{p-d243c5c6.entry.js → p-a476f7b2.entry.js} +1 -1
- package/dist/twilight/{p-65c395b2.entry.js → p-abd00b41.entry.js} +1 -1
- package/dist/twilight/{p-dced08eb.entry.js → p-ad8eda9d.entry.js} +1 -1
- package/dist/twilight/{p-69df3f0f.entry.js → p-b25fd5f0.entry.js} +1 -1
- package/dist/twilight/{p-249db53c.entry.js → p-b2789ab4.entry.js} +1 -1
- package/dist/twilight/{p-77e452bb.entry.js → p-b6322bba.entry.js} +1 -1
- package/dist/twilight/{p-c7a42493.entry.js → p-b847e008.entry.js} +1 -1
- package/dist/twilight/{p-1c0a22fc.entry.js → p-bbb48f58.entry.js} +1 -1
- package/dist/twilight/{p-fd208d08.entry.js → p-bec996fb.entry.js} +1 -1
- package/dist/twilight/{p-d9cb76fa.entry.js → p-c4f379a8.entry.js} +1 -1
- package/dist/twilight/{p-af2f5e14.entry.js → p-d53f9574.entry.js} +1 -1
- package/dist/twilight/{p-ac4fffc8.entry.js → p-d66af968.entry.js} +1 -1
- package/dist/twilight/{p-429fc3c7.entry.js → p-d6d8d12e.entry.js} +1 -1
- package/dist/twilight/{p-604317c4.entry.js → p-d6fbb91c.entry.js} +1 -1
- package/dist/twilight/{p-69850e8b.entry.js → p-d76f186c.entry.js} +1 -1
- package/dist/twilight/{p-a882a9df.entry.js → p-da441555.entry.js} +1 -1
- package/dist/twilight/p-de07b85c.entry.js +4 -0
- package/dist/twilight/{p-24c84285.entry.js → p-e1842675.entry.js} +1 -1
- package/dist/twilight/{p-518a0343.entry.js → p-e69c2c35.entry.js} +1 -1
- package/dist/twilight/{p-3a41ac1c.entry.js → p-e78fe137.entry.js} +1 -1
- package/dist/twilight/{p-70bad7c7.entry.js → p-e7b03751.entry.js} +1 -1
- package/dist/twilight/{p-1cac053d.entry.js → p-ed698e64.entry.js} +1 -1
- package/dist/twilight/{p-8e820727.entry.js → p-effae25c.entry.js} +1 -1
- package/dist/twilight/{p-59377e23.entry.js → p-f3f0ee9b.entry.js} +1 -1
- package/dist/twilight/{p-9d4f612c.entry.js → p-fa7c213b.entry.js} +1 -1
- package/dist/twilight/{p-743c3869.entry.js → p-fc18bd83.entry.js} +1 -1
- package/dist/twilight/{p-3c8e7fa5.entry.js → p-fef39c48.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-comments/salla-comments.d.ts +1 -1
- package/dist/types/components/salla-review-factors-tags/salla-review-factors-tags.d.ts +8 -2
- package/dist/types/components/salla-reviews-summary/salla-reviews-summary.d.ts +0 -2
- package/dist/types/components/salla-social-share/salla-social-share.d.ts +1 -0
- package/dist/types/components.d.ts +12 -2
- package/dist/types/shared/catalog-recommendations.d.ts +12 -0
- package/package.json +5 -5
- package/dist/cjs/catalog-recommendations-B_DRy6NT.js +0 -91
- package/dist/esm/catalog-recommendations-CehbSKTM.js +0 -88
- package/dist/twilight/p-5e85ab72.entry.js +0 -4
- package/dist/twilight/p-6d6faf9e.entry.js +0 -4
- package/dist/twilight/p-6f74c650.entry.js +0 -4
- package/dist/twilight/p-91969734.entry.js +0 -4
- package/dist/twilight/p-C4y1c3K3.js +0 -9
- package/dist/twilight/p-CehbSKTM.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as e}from"./p-
|
|
4
|
+
import{r as s,h as t,H as e}from"./p-BEjZOd--.js";import{S as l}from"./p-BscTeWDc.js";var i;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(i||(i={}));const a=class{constructor(t){s(this,t),this.loadedScopes={[i.DEFAULT]:null,[i.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=i.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{if(this.originalScopesList?.length<2)return"";const s=salla.config.get("store.features")?.includes("multi-countries");return this.mode===i.DEFAULT?salla.lang.get(s?"blocks.scope.shopping_from_another_market":"blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:s=null,product_id:t=null}={})=>{this.open(s,t)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}get isNativeApp(){return!!salla.mobile?.isSpaWebview?.()}async close(){return await(this.modal?.close())}async open(s=i.DEFAULT,t=null){return this.isNativeApp?(salla.log("SallaScope:: delegated open to native app"),void salla.mobile?.openScopes?.()):(this.hasError=!1,this.mode=[i.AVAILABILITY,i.DEFAULT].includes(s)?s:i.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>s==i.AVAILABILITY?salla.scope.getProductAvailability(t):salla.scope.get())).then((t=>{if(s==i.AVAILABILITY)return this.setScopeValues(this.loadedScopes[i.AVAILABILITY]=t.data);this.setScopeValues(this.loadedScopes[this.mode]=t.data.scopes)})).catch((s=>{console.log(s),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading()))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),salla.cart.reset(),window.location.replace(salla.helpers.addParamToUrl("scope",this.current_scope.id))})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s?.length?(this.current_scope=s[0],this.selected_scope=s[0],this.scopes=[s[0]]):(this.current_scope=s?.find((s=>s.selected)),this.selected_scope=s?.find((s=>s.selected)))}handleSearchFieldTyping(s){let t=s.target.value.toLocaleLowerCase();this.scopes=t?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(t))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes?.find((t=>t.id==s.target.value))}placeholderContent(){return t("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},t("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),t("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[t("div",{class:"s-scopes-container s-scrollbar"},this.scopes?.map((s=>t("div",{class:"s-scopes-input-wrap","data-selection":this.selection},t("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),t("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},t("span",null,s.name)))))),this.footerContent()]}availabilityContent(){return t("div",{class:"s-scopes-container"},this.scopes?.map((s=>t("div",{class:"s-scopes-input-wrap","data-selection":this.selection},t("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===i.DEFAULT}},t("span",null,s.name)),t("h2",{style:{color:s?.availability?.color},class:`s-scopes-${s?.availability?.key}`},s?.availability?.label)))))}footerContent(){return t("div",{class:"s-scopes-footer"},t("slot",{name:"footer"},t("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}componentWillLoad(){return salla.onReady()}render(){return this.isNativeApp?null:t(e,null,t("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?t("div",{slot:"loading"},t("div",{class:"s-scopes-skeleton"},t("salla-list-tile",{class:"s-scopes-header"},t("div",{slot:"icon",class:"s-scopes-header-icon"},t("salla-skeleton",{type:"circle"})),t("div",{slot:"title",class:"s-scopes-header-title mb-5"},t("salla-skeleton",{height:"15px",width:"50%"})),t("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},t("salla-skeleton",{height:"10px"}),t("salla-skeleton",{height:"10px",width:"75%"}))),t("div",{class:"s-scopes-skeleton-search"},t("salla-skeleton",{height:"10px",width:"50%"}),t("salla-skeleton",{height:"30px",width:"100%"})),t("div",{class:"s-scopes-skeleton-scopes"},t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"})),t("div",{class:"s-scopes-skeleton-btn"},t("salla-skeleton",{height:"40px",width:"100%"})))):[t("salla-list-tile",{class:this.originalScopesList?.length?"s-scopes-header block":"s-hidden"},t("div",{slot:"icon",class:"s-scopes-header-icon",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>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),t("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),t("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),t("div",{class:"s-scopes-wrap"},!!this.originalScopesList?.length&&t("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList?.length>this.searchDisplayLimit?t("div",{class:"s-scopes-search-wrapper"},t("div",{class:"s-scopes-search-icon",innerHTML:l}),t("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||!this.originalScopesList?.length&&this.mode!==i.AVAILABILITY?this.placeholderContent():this.mode===i.DEFAULT?this.defaultContent():this.availabilityContent())]))}async componentDidLoad(){await Salla.hooks.registerComponent("salla-scopes",this),salla.config.isMobileApp()||this.isNativeApp||this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};a.style=".s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}";export{a as salla_scopes}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as a,a as i}from"./p-DpTbeb50.js";const r=[{label:"100px",value:"56px"},{label:"72px",value:"64px"},{label:"96px",value:"48px"}],h=class{constructor(t){s(this,t),this.validateForms=!0,this.cartCount=0,this.cartTotal=0,this.cartTotalDiscount=0,this.cartSubTotal=0,this.cartOptionsTotal=0,this.cartShippingCost=0,this.cartTaxAmount=0,this.cartHasShipping=!1,this.isOpen=!1,this.isDesktop=!1,this.isLoading=!0,this.originalParent=null,this.originalNextSibling=null,this.bodyObserver=null,this.mediaQueryList=null,this.submitObserver=null,this.isSubmitting=!1,this.mqlChangeHandler=s=>{this.isDesktop=s.matches,this.applyMode()},this.cartEventNames=["cart::details.fetched","cart::updated","cart::latest.fetched","cart::coupon.added","cart::coupon.deleted"],this.cartEventHandler=s=>this.applyCartData(this.extractCart(s)),this.toggleSheet=()=>{this.isDesktop||(this.isOpen=!this.isOpen)},this.handleSubmit=async s=>{if(this.isSubmitting)return void s.preventDefault();if(this.isSubmitting=!0,this.validateForms&&!await this.validateCartForms())return s.preventDefault(),salla.notify?.error?.(salla.lang?.get?.("common.messages.required_fields")),void(this.isSubmitting=!1);const t=this.host.querySelector("#s-cart-summary-card-submit");"undefined"!=typeof salla&&"guest"!==salla.config?.get?.("user.type")&&t&&(t.load?.(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&clearTimeout(this.submitObserverTimeout),this.submitObserver=new MutationObserver((()=>{t.hasAttribute("loading")||t.setAttribute("loading","")})),this.submitObserver.observe(t,{attributes:!0,attributeFilter:["loading"]}),this.submitObserverTimeout=window.setTimeout((()=>{this.submitObserver?.disconnect(),this.submitObserver=null,t.removeAttribute?.("loading")}),1e4)),salla.cart?.submit?.(),window.setTimeout((()=>{this.isSubmitting=!1}),1500)}}componentWillLoad(){this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches,this.isDesktop&&(this.isOpen=!0),this.init()}async init(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.cartEventNames.forEach((s=>salla.event.on(s,this.cartEventHandler))),this.fetchCart()}loadTranslations(){this.summaryLabel=salla.lang.get("pages.cart.summary"),this.itemsTotalLabel=salla.lang.get("pages.cart.items_total"),this.itemsTotalNoTaxLabel=salla.lang.get("pages.cart.items_total_without_tax"),this.optionsTotalLabel=salla.lang.get("pages.cart.order_options_total"),this.shippingCostLabel=salla.lang.get("pages.cart.shipping_cost"),this.vatTaxLabel=salla.lang.get("pages.cart.VAT_tax_amount"),this.savedLabel=salla.lang.get("pages.cart.discount"),this.discountBadge=salla.lang.get("pages.cart.saved"),this.finalTotalLabel=salla.lang.get("pages.cart.final_total"),this.pricesTaxedLabel=salla.lang.get("pages.cart.prices_taxed"),this.completeOrderLabel=salla.lang.get("pages.cart.complete_order"),this.openSummaryLabel=salla.lang.get("pages.cart.open_summary"),this.closeSummaryLabel=salla.lang.get("pages.cart.close_summary"),this.itemsCountTemplate=salla.lang.get("pages.cart.items_with_count")}num(s){if(null==s)return 0;if("number"==typeof s)return isFinite(s)?s:0;if("string"==typeof s)return parseFloat(s)||0;if("object"==typeof s){if("amount"in s)return this.num(s.amount);if("value"in s)return this.num(s.value);if("formatted"in s)return this.num(s.formatted)}return 0}breakpointPx(){return 1024}desktopMediaQuery(){return`(min-width: ${this.breakpointPx()}px)`}componentDidLoad(){this.originalParent=this.host.parentElement,this.originalNextSibling=this.host.nextSibling,this.mediaQueryList||(this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches),this.applyMode(),this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener(this.mqlChangeHandler)}applyMode(){this.isDesktop?(this.isOpen=!0,this.bodyObserver?.disconnect(),this.bodyObserver=null,this.originalParent&&this.host.parentElement!==this.originalParent&&this.originalParent.insertBefore(this.host,this.originalNextSibling?.parentNode===this.originalParent?this.originalNextSibling:null)):this.pinToBodyEnd()}pinToBodyEnd(){this.host.parentElement===document.body&&document.body.lastElementChild===this.host||document.body.appendChild(this.host),this.bodyObserver||(this.bodyObserver=new MutationObserver((()=>{this.isDesktop||document.body.lastElementChild===this.host||document.body.appendChild(this.host)})),this.bodyObserver.observe(document.body,{childList:!0}))}disconnectedCallback(){Promise.resolve().then((()=>{this.host.isConnected||(this.bodyObserver?.disconnect(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener(this.mqlChangeHandler),this.mediaQueryList=null,this.cartEventNames.forEach((s=>salla.event.off(s,this.cartEventHandler))))}))}fetchCart(){const s=salla.config?.get?.("page.id"),t=salla.cart?.api?.details?.(s);t&&"function"==typeof t.then?t.then((s=>this.applyCartData(this.extractCart(s)))).catch((()=>this.applyCachedSummary())):this.applyCachedSummary()}applyCachedSummary(){const s=salla.storage?.get?.("cart.summary");s&&"object"==typeof s&&this.applyCartData(s),this.isLoading=!1}extractCart(s){return s?s.data?.cart?s.data.cart:s.cart?s.cart:s:null}applyCartData(s){if(!s)return;this.isLoading=!1,void 0!==s.count&&(this.cartCount=this.num(s.count)),void 0!==s.total&&(this.cartTotal=this.num(s.total));const t=s.total_discount??s.discount;void 0!==t&&(this.cartTotalDiscount=this.num(t)),void 0!==s.sub_total&&(this.cartSubTotal=this.num(s.sub_total)),void 0!==s.options_total&&(this.cartOptionsTotal=this.num(s.options_total)),void 0!==s.tax_amount&&(this.cartTaxAmount=this.num(s.tax_amount));const a=!!s.free_shipping_bar?.has_free_shipping;void 0!==s.shipping_cost?this.cartShippingCost=this.num(s.shipping_cost):void 0!==s.real_shipping_cost&&(this.cartShippingCost=a?0:this.num(s.real_shipping_cost)),this.cartHasShipping=this.cartShippingCost>0||!!s.has_shipping}async validateCartForms(){let s=!0;document.querySelectorAll('form[id^="item-"]').forEach((t=>{t.reportValidity()||(s=!1)}));const t=Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));for(const a of t)"function"!=typeof a.reportValidity||await a.reportValidity()||(s=!1);return s}money(s){try{if("undefined"!=typeof salla&&"function"==typeof salla.money)return salla.money(s)}catch(s){}return String(s??0)}getItemsLabel(){return this.itemsCountTemplate?.replace(":count",String(this.cartCount))??""}renderSkeleton(){return t(a,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--loading":!0,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},this.isDesktop&&t("div",{class:"s-cart-summary-card-sheet-wrap s-cart-summary-card-sheet-wrap--open"},t("div",{class:"s-cart-summary-card-sheet"},t("header",{class:"s-cart-summary-card-sheet-header"},t("h3",{class:"s-cart-summary-card-sheet-title"},t("salla-skeleton",{width:"140px",height:"16px"}))),r.map((({label:s,value:a},i)=>t("div",{class:"s-cart-summary-card-line",key:i},t("salla-skeleton",{width:s,height:"16px"}),t("salla-skeleton",{width:a,height:"16px"})))))),t("div",{class:"s-cart-summary-card-bar"},t("div",{class:"s-cart-summary-card-bar-label"},t("div",{class:"s-cart-summary-card-bar-label-main"},t("salla-skeleton",{width:"90px",height:"16px"}),t("salla-skeleton",{width:"48px",height:"12px"}))),t("div",{class:"s-cart-summary-card-bar-totals"},t("div",{class:"s-cart-summary-card-bar-totals-row"},t("salla-skeleton",{width:"80px",height:"20px"})))),t("div",{class:"s-cart-summary-card-action"},t("salla-skeleton",{width:"100%",height:"44px"})))}render(){if(this.isLoading)return this.renderSkeleton();const s=this.cartTotalDiscount>0,i=this.cartTaxAmount?this.itemsTotalNoTaxLabel:this.itemsTotalLabel;return t(a,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--open":this.isOpen,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},t("div",{class:{"s-cart-summary-card-sheet-wrap":!0,"s-cart-summary-card-sheet-wrap--open":this.isOpen},"aria-hidden":this.isOpen?"false":"true"},t("div",{class:"s-cart-summary-card-sheet",style:this.isDesktop?{}:{transform:this.isOpen?"translateY(0)":"translateY(100%)",transition:"transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)"}},t("header",{class:"s-cart-summary-card-sheet-header"},t("h3",{class:"s-cart-summary-card-sheet-title"},this.summaryLabel)),t("div",{class:"s-cart-summary-card-line"},t("span",null,i),t("b",{innerHTML:this.money(this.cartSubTotal)})),this.cartOptionsTotal>0&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.optionsTotalLabel),t("b",{innerHTML:this.money(this.cartOptionsTotal)})),this.cartHasShipping&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.shippingCostLabel),t("b",{innerHTML:this.money(this.cartShippingCost)})),this.cartTaxAmount>0&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.vatTaxLabel),t("b",{innerHTML:this.money(this.cartTaxAmount)})),s&&t("div",{class:"s-cart-summary-card-line s-cart-summary-card-line--discount"},t("span",null,this.savedLabel),t("b",null,"− ",t("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),t("div",{class:"s-cart-summary-card-bar"},t("div",{class:"s-cart-summary-card-bar-label"},t("div",{class:"s-cart-summary-card-bar-label-main"},t("span",{class:"s-cart-summary-card-bar-label-text"},this.finalTotalLabel),t("span",{class:"s-cart-summary-card-bar-count"},this.getItemsLabel())),this.cartTaxAmount>0&&t("div",{class:"s-cart-summary-card-bar-label-sub"},this.pricesTaxedLabel)),t("div",{class:"s-cart-summary-card-bar-totals"},t("div",{class:"s-cart-summary-card-bar-totals-row"},s&&t("s",{class:"s-cart-summary-card-bar-original"},salla.helpers.number(this.cartTotal+this.cartTotalDiscount)),t("b",{class:"s-cart-summary-card-bar-total",innerHTML:this.money(this.cartTotal)}),!this.isDesktop&&t("button",{type:"button",class:"s-cart-summary-card-chevron","aria-label":this.isOpen?this.closeSummaryLabel:this.openSummaryLabel,"aria-expanded":this.isOpen?"true":"false",onClick:this.toggleSheet},t("i",{class:"sicon-keyboard_arrow_up s-cart-summary-card-chevron-icon"}))),s&&t("div",{class:"s-cart-summary-card-bar-savings-badge"},t("span",{"aria-hidden":"true"},"🎉"),t("span",null,this.discountBadge," ",t("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),t("div",{class:"s-cart-summary-card-action"},t("salla-button",{id:"s-cart-summary-card-submit",width:"wide","loader-position":"center",onClick:this.handleSubmit},this.completeOrderLabel)))}get host(){return i(this)}};export{h as salla_cart_summary_card}
|
|
4
|
+
import{r as s,h as t,H as a,a as i}from"./p-BEjZOd--.js";const r=[{label:"100px",value:"56px"},{label:"72px",value:"64px"},{label:"96px",value:"48px"}],h=class{constructor(t){s(this,t),this.validateForms=!0,this.cartCount=0,this.cartTotal=0,this.cartTotalDiscount=0,this.cartSubTotal=0,this.cartOptionsTotal=0,this.cartShippingCost=0,this.cartTaxAmount=0,this.cartHasShipping=!1,this.isOpen=!1,this.isDesktop=!1,this.isLoading=!0,this.originalParent=null,this.originalNextSibling=null,this.bodyObserver=null,this.mediaQueryList=null,this.submitObserver=null,this.isSubmitting=!1,this.mqlChangeHandler=s=>{this.isDesktop=s.matches,this.applyMode()},this.cartEventNames=["cart::details.fetched","cart::updated","cart::latest.fetched","cart::coupon.added","cart::coupon.deleted"],this.cartEventHandler=s=>this.applyCartData(this.extractCart(s)),this.toggleSheet=()=>{this.isDesktop||(this.isOpen=!this.isOpen)},this.handleSubmit=async s=>{if(this.isSubmitting)return void s.preventDefault();if(this.isSubmitting=!0,this.validateForms&&!await this.validateCartForms())return s.preventDefault(),salla.notify?.error?.(salla.lang?.get?.("common.messages.required_fields")),void(this.isSubmitting=!1);const t=this.host.querySelector("#s-cart-summary-card-submit");"undefined"!=typeof salla&&"guest"!==salla.config?.get?.("user.type")&&t&&(t.load?.(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&clearTimeout(this.submitObserverTimeout),this.submitObserver=new MutationObserver((()=>{t.hasAttribute("loading")||t.setAttribute("loading","")})),this.submitObserver.observe(t,{attributes:!0,attributeFilter:["loading"]}),this.submitObserverTimeout=window.setTimeout((()=>{this.submitObserver?.disconnect(),this.submitObserver=null,t.removeAttribute?.("loading")}),1e4)),salla.cart?.submit?.(),window.setTimeout((()=>{this.isSubmitting=!1}),1500)}}componentWillLoad(){this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches,this.isDesktop&&(this.isOpen=!0),this.init()}async init(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.cartEventNames.forEach((s=>salla.event.on(s,this.cartEventHandler))),this.fetchCart()}loadTranslations(){this.summaryLabel=salla.lang.get("pages.cart.summary"),this.itemsTotalLabel=salla.lang.get("pages.cart.items_total"),this.itemsTotalNoTaxLabel=salla.lang.get("pages.cart.items_total_without_tax"),this.optionsTotalLabel=salla.lang.get("pages.cart.order_options_total"),this.shippingCostLabel=salla.lang.get("pages.cart.shipping_cost"),this.vatTaxLabel=salla.lang.get("pages.cart.VAT_tax_amount"),this.savedLabel=salla.lang.get("pages.cart.discount"),this.discountBadge=salla.lang.get("pages.cart.saved"),this.finalTotalLabel=salla.lang.get("pages.cart.final_total"),this.pricesTaxedLabel=salla.lang.get("pages.cart.prices_taxed"),this.completeOrderLabel=salla.lang.get("pages.cart.complete_order"),this.openSummaryLabel=salla.lang.get("pages.cart.open_summary"),this.closeSummaryLabel=salla.lang.get("pages.cart.close_summary"),this.itemsCountTemplate=salla.lang.get("pages.cart.items_with_count")}num(s){if(null==s)return 0;if("number"==typeof s)return isFinite(s)?s:0;if("string"==typeof s)return parseFloat(s)||0;if("object"==typeof s){if("amount"in s)return this.num(s.amount);if("value"in s)return this.num(s.value);if("formatted"in s)return this.num(s.formatted)}return 0}breakpointPx(){return 1024}desktopMediaQuery(){return`(min-width: ${this.breakpointPx()}px)`}componentDidLoad(){this.originalParent=this.host.parentElement,this.originalNextSibling=this.host.nextSibling,this.mediaQueryList||(this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches),this.applyMode(),this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener(this.mqlChangeHandler)}applyMode(){this.isDesktop?(this.isOpen=!0,this.bodyObserver?.disconnect(),this.bodyObserver=null,this.originalParent&&this.host.parentElement!==this.originalParent&&this.originalParent.insertBefore(this.host,this.originalNextSibling?.parentNode===this.originalParent?this.originalNextSibling:null)):this.pinToBodyEnd()}pinToBodyEnd(){this.host.parentElement===document.body&&document.body.lastElementChild===this.host||document.body.appendChild(this.host),this.bodyObserver||(this.bodyObserver=new MutationObserver((()=>{this.isDesktop||document.body.lastElementChild===this.host||document.body.appendChild(this.host)})),this.bodyObserver.observe(document.body,{childList:!0}))}disconnectedCallback(){Promise.resolve().then((()=>{this.host.isConnected||(this.bodyObserver?.disconnect(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener(this.mqlChangeHandler),this.mediaQueryList=null,this.cartEventNames.forEach((s=>salla.event.off(s,this.cartEventHandler))))}))}fetchCart(){const s=salla.config?.get?.("page.id"),t=salla.cart?.api?.details?.(s);t&&"function"==typeof t.then?t.then((s=>this.applyCartData(this.extractCart(s)))).catch((()=>this.applyCachedSummary())):this.applyCachedSummary()}applyCachedSummary(){const s=salla.storage?.get?.("cart.summary");s&&"object"==typeof s&&this.applyCartData(s),this.isLoading=!1}extractCart(s){return s?s.data?.cart?s.data.cart:s.cart?s.cart:s:null}applyCartData(s){if(!s)return;this.isLoading=!1,void 0!==s.count&&(this.cartCount=this.num(s.count)),void 0!==s.total&&(this.cartTotal=this.num(s.total));const t=s.total_discount??s.discount;void 0!==t&&(this.cartTotalDiscount=this.num(t)),void 0!==s.sub_total&&(this.cartSubTotal=this.num(s.sub_total)),void 0!==s.options_total&&(this.cartOptionsTotal=this.num(s.options_total)),void 0!==s.tax_amount&&(this.cartTaxAmount=this.num(s.tax_amount));const a=!!s.free_shipping_bar?.has_free_shipping;void 0!==s.shipping_cost?this.cartShippingCost=this.num(s.shipping_cost):void 0!==s.real_shipping_cost&&(this.cartShippingCost=a?0:this.num(s.real_shipping_cost)),this.cartHasShipping=this.cartShippingCost>0||!!s.has_shipping}async validateCartForms(){let s=!0;document.querySelectorAll('form[id^="item-"]').forEach((t=>{t.reportValidity()||(s=!1)}));const t=Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));for(const a of t)"function"!=typeof a.reportValidity||await a.reportValidity()||(s=!1);return s}money(s){try{if("undefined"!=typeof salla&&"function"==typeof salla.money)return salla.money(s)}catch(s){}return String(s??0)}getItemsLabel(){return this.itemsCountTemplate?.replace(":count",String(this.cartCount))??""}renderSkeleton(){return t(a,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--loading":!0,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},this.isDesktop&&t("div",{class:"s-cart-summary-card-sheet-wrap s-cart-summary-card-sheet-wrap--open"},t("div",{class:"s-cart-summary-card-sheet"},t("header",{class:"s-cart-summary-card-sheet-header"},t("h3",{class:"s-cart-summary-card-sheet-title"},t("salla-skeleton",{width:"140px",height:"16px"}))),r.map((({label:s,value:a},i)=>t("div",{class:"s-cart-summary-card-line",key:i},t("salla-skeleton",{width:s,height:"16px"}),t("salla-skeleton",{width:a,height:"16px"})))))),t("div",{class:"s-cart-summary-card-bar"},t("div",{class:"s-cart-summary-card-bar-label"},t("div",{class:"s-cart-summary-card-bar-label-main"},t("salla-skeleton",{width:"90px",height:"16px"}),t("salla-skeleton",{width:"48px",height:"12px"}))),t("div",{class:"s-cart-summary-card-bar-totals"},t("div",{class:"s-cart-summary-card-bar-totals-row"},t("salla-skeleton",{width:"80px",height:"20px"})))),t("div",{class:"s-cart-summary-card-action"},t("salla-skeleton",{width:"100%",height:"44px"})))}render(){if(this.isLoading)return this.renderSkeleton();const s=this.cartTotalDiscount>0,i=this.cartTaxAmount?this.itemsTotalNoTaxLabel:this.itemsTotalLabel;return t(a,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--open":this.isOpen,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},t("div",{class:{"s-cart-summary-card-sheet-wrap":!0,"s-cart-summary-card-sheet-wrap--open":this.isOpen},"aria-hidden":this.isOpen?"false":"true"},t("div",{class:"s-cart-summary-card-sheet",style:this.isDesktop?{}:{transform:this.isOpen?"translateY(0)":"translateY(100%)",transition:"transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)"}},t("header",{class:"s-cart-summary-card-sheet-header"},t("h3",{class:"s-cart-summary-card-sheet-title"},this.summaryLabel)),t("div",{class:"s-cart-summary-card-line"},t("span",null,i),t("b",{innerHTML:this.money(this.cartSubTotal)})),this.cartOptionsTotal>0&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.optionsTotalLabel),t("b",{innerHTML:this.money(this.cartOptionsTotal)})),this.cartHasShipping&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.shippingCostLabel),t("b",{innerHTML:this.money(this.cartShippingCost)})),this.cartTaxAmount>0&&t("div",{class:"s-cart-summary-card-line"},t("span",null,this.vatTaxLabel),t("b",{innerHTML:this.money(this.cartTaxAmount)})),s&&t("div",{class:"s-cart-summary-card-line s-cart-summary-card-line--discount"},t("span",null,this.savedLabel),t("b",null,"− ",t("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),t("div",{class:"s-cart-summary-card-bar"},t("div",{class:"s-cart-summary-card-bar-label"},t("div",{class:"s-cart-summary-card-bar-label-main"},t("span",{class:"s-cart-summary-card-bar-label-text"},this.finalTotalLabel),t("span",{class:"s-cart-summary-card-bar-count"},this.getItemsLabel())),this.cartTaxAmount>0&&t("div",{class:"s-cart-summary-card-bar-label-sub"},this.pricesTaxedLabel)),t("div",{class:"s-cart-summary-card-bar-totals"},t("div",{class:"s-cart-summary-card-bar-totals-row"},s&&t("s",{class:"s-cart-summary-card-bar-original"},salla.helpers.number(this.cartTotal+this.cartTotalDiscount)),t("b",{class:"s-cart-summary-card-bar-total",innerHTML:this.money(this.cartTotal)}),!this.isDesktop&&t("button",{type:"button",class:"s-cart-summary-card-chevron","aria-label":this.isOpen?this.closeSummaryLabel:this.openSummaryLabel,"aria-expanded":this.isOpen?"true":"false",onClick:this.toggleSheet},t("i",{class:"sicon-keyboard_arrow_up s-cart-summary-card-chevron-icon"}))),s&&t("div",{class:"s-cart-summary-card-bar-savings-badge"},t("span",{"aria-hidden":"true"},"🎉"),t("span",null,this.discountBadge," ",t("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),t("div",{class:"s-cart-summary-card-action"},t("salla-button",{id:"s-cart-summary-card-submit",width:"wide","loader-position":"center",onClick:this.handleSubmit},this.completeOrderLabel)))}get host(){return i(this)}};export{h as salla_cart_summary_card}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as i}from"./p-
|
|
4
|
+
import{r as s,h as t,H as i}from"./p-BEjZOd--.js";const r=class{constructor(t){s(this,t),this.placeholderImage=salla.url.cdn("images/s-empty.png")}getProductImage(){return this.productDetails?.image?"string"==typeof this.productDetails.image?this.productDetails.image:this.productDetails.image.url||this.placeholderImage||salla.url.cdn("images/s-empty.png"):this.placeholderImage}getProductImageAlt(){return this.productDetails?.image&&"string"!=typeof this.productDetails.image?this.productDetails.image.alt||this.productDetails?.name||"":this.productDetails?.name||""}getAccordionId(){return`accordion-${this.productDetails?.id||"default"}`}getAccordionKey(){return this.productDetails?.id||"default"}shouldBeCollapsible(){return void 0!==this.collapsible?this.collapsible:this.productDetails?.options?.length>0}renderOptions(){return this.productDetails?.options?.length?t("salla-accordion-body",null,t("div",{class:"s-order-details-options"},t("salla-order-details-options",{options:this.productDetails.options}))):null}render(){if(!this.productDetails)return null;const s=this.shouldBeCollapsible();return t(i,{class:"s-order-details-bundle-wrapper"},t("salla-accordion",{key:this.getAccordionKey(),collapsed:!1,bordered:!0,collapsible:s,id:this.getAccordionId(),size:"sm"},t("salla-accordion-head",null,t("div",{class:"s-order-details-product"},t("div",{class:"s-order-details-product-content"},t("div",{class:"s-order-details-product-info"},t("div",{class:"s-order-details-product-image"},t("img",{src:this.getProductImage(),alt:this.getProductImageAlt()})),t("div",{class:"s-order-details-product-details"},t("a",{href:this.productDetails?.url||"#",class:"s-order-details-product-name"},this.productDetails?.name||""),this.productDetails?.quantity&&t("span",{class:"s-order-details-product-quantity"},"×",this.productDetails.quantity)))))),this.renderOptions()))}};r.style="";export{r as salla_order_details_multiple_bundle_product}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r,h as s,H as n,F as t}from"./p-
|
|
4
|
+
import{r,h as s,H as n,F as t}from"./p-BEjZOd--.js";function a(r,s){if("string"!=typeof r)return r??s;const n=r.trim();if(!n)return s;try{return JSON.parse(n)}catch{return s}}function e(r){if(r)return"string"==typeof r?a(r,void 0):r}function c(r,s="ar"){const[n,t]=String(r).trim().split(":").map(Number);if(!Number.isFinite(n)||!Number.isFinite(t))return r;const a=new Date(2e3,0,1,n,t),e={hour:"numeric",minute:"2-digit",hour12:!0};try{return a.toLocaleTimeString(s,e)}catch{return a.toLocaleTimeString("ar",e)}}const o=class{constructor(s){r(this,s),this.stackCards=!1,this.isLoading=!1}componentWillLoad(){return this.getBranchData()}async getBranchData(){const r=salla.config.get("page.id");if(r){this.isLoading=!0;try{const s=await salla.order.api.getBranchDetails(r);this.branchData=this.parseBranchResponse(s)}catch(r){this.notifyApiError(r)}finally{this.isLoading=!1}}}parseBranchResponse(r){const s=r?.data?.data||r?.data||r;return s&&"object"==typeof s&&Object.prototype.hasOwnProperty.call(s,"branch")?s.branch?e(s.branch):void 0:e(s)}getApiErrorMessage(r){return r?.response?.data?.error?.message||r?.response?.data?.message}notifyApiError(r){const s=this.getApiErrorMessage(r);s&&salla.notify.error(s)}label(r,s){return salla.lang.getWithDefault(r,s)}get preparationText(){const r=this.branchData?.preparation_time_range;if(!r?.from||!r?.to)return"";const s=salla.helpers.number(r.from.value),n=salla.helpers.number(r.to.value),t=this.unitLabel(r.to.unit),a=s===n?s:`${s}-${n}`;return this.label("pages.orders.pickup_ready_after","جاهز للاستلام بعد :time").replace(":time",`${a} ${t}`)}unitLabel(r){const s=function(r){const s=String(r||"hour").toLowerCase();return s.startsWith("min")?"minute":s.startsWith("day")?"day":"hour"}(r);return"minute"===s?this.label("pages.checkout.minute","دقيقة"):"day"===s?this.label("pages.checkout.day","يوم"):this.label("pages.checkout.hour","ساعة")}get workingHoursItems(){const r=this.branchData;if(!r)return[];if(!0===r.always_open||1===r.always_open||"1"===r.always_open)return[this.label("pages.orders.branch_always_open","مفتوح على مدار الساعة")];const s=salla.lang.locale||"ar";return(r.working_hours||[]).filter((r=>r?.name&&r.times?.length)).map((r=>{const n=r.times[0];return`${r.name}: ${c(n.from,s)} - ${c(n.to,s)}`}))}get branchAddress(){return this.branchData?.address||""}get mapUrl(){const r=this.branchData?.location;if(null!=r?.lat&&null!=r?.lng)return`https://www.google.com/maps?q=${r.lat},${r.lng}`}get phone(){return function(r){const s=a(r,null),n=s&&"object"==typeof s?s.phone:"";return"string"==typeof n?n.trim():""}(this.branchData?.contacts)}renderDetailsColumn(){const r=this.phone;return r?s("div",{class:"s-order-branch-details"},s("div",{class:"s-order-branch-info-card"},s("span",{class:"s-order-branch-info-icon",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>phone-talking</title>\n<path d="M18.667 8c2.941 0 5.333 2.392 5.333 5.333 0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-4.412-3.588-8-8-8-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333zM18.667 2.667c5.881 0 10.667 4.785 10.667 10.667 0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333c0-7.352-5.981-13.333-13.333-13.333-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333zM26.939 17.831c-1.568-1.568-4.119-1.568-5.689 0l-2.567 2.568c-3.064-1.499-5.584-4.019-7.083-7.083l2.569-2.567c1.567-1.569 1.567-4.121-0.001-5.689l-3.88-3.881c-1.521-1.521-4.169-1.521-5.691 0l-1.847 1.847c-2.22 2.22-3.183 5.408-2.573 8.527 1.979 10.144 10.127 18.292 20.271 20.271 0.617 0.121 1.236 0.18 1.851 0.18 2.491 0 4.895-0.972 6.676-2.752l1.847-1.847c1.569-1.569 1.569-4.12 0-5.689zM28.936 25.517l-1.847 1.847c-1.591 1.591-3.876 2.281-6.131 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.597-0.397 0.959-0.397s0.701 0.14 0.959 0.397l3.883 3.883c0.528 0.528 0.528 1.389 0 1.917l-3.22 3.219c-0.383 0.384-0.496 0.959-0.288 1.457 1.815 4.34 5.344 7.868 9.684 9.684 0.5 0.205 1.075 0.095 1.457-0.288l3.219-3.219c0.528-0.531 1.389-0.529 1.917-0.001l3.883 3.883c0.529 0.529 0.529 1.389 0 1.919z"></path>\n</svg>\n'}),s("div",{class:"s-order-branch-info-text"},s("span",{class:"s-order-branch-info-label"},this.label("pages.orders.branch_contacts","ارقام التواصل")),s("span",{class:"s-order-branch-info-value",dir:"ltr"},r)))):null}renderWorkingHoursCard(){const r=this.workingHoursItems;return r.length?s("div",{class:"s-order-branch-info-card s-order-branch-hours-card"},s("span",{class:"s-order-branch-info-icon","aria-hidden":"true"},s("i",{class:"sicon-calendar-alt"})),s("div",{class:"s-order-branch-info-text"},s("span",{class:"s-order-branch-info-label"},this.label("pages.checkout.working_hours","ساعات العمل")),s("div",{class:"s-order-branch-hours-list"},r.map((r=>s("span",{class:"s-order-branch-hours-item"},r)))))):null}renderBranchIdentityCard(){const r=this.branchData,n=this.branchAddress,t=this.preparationText;return s("section",{class:"s-order-branch-card"},s("div",{class:"s-order-branch-location"},s("div",{class:"s-order-branch-identity"},s("span",{class:"s-order-branch-store-icon"},s("i",{class:"sicon-store","aria-hidden":"true"})),s("div",{class:"s-order-branch-text"},s("div",{class:"s-order-branch-name-row"},r?.name?s("span",{class:"s-order-branch-name"},r.name):null,t?s("span",{class:"s-order-branch-ready"},t):null),n?s("span",{class:"s-order-branch-address"},n):null)),this.mapUrl?s("div",{class:"s-order-branch-actions"},s("a",{href:this.mapUrl,target:"_blank",rel:"noopener noreferrer",class:"s-order-branch-map-link"},s("span",null,this.label("pages.orders.branch_map","موقع الفرع علي الخريطة")),s("span",{class:"s-order-branch-action-icon",innerHTML:'<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.95448 2.79419C9.7395 1.84477 11.132 1.37005 11.881 2.11902C12.6299 2.86799 12.1552 4.2605 11.2058 7.04551L10.5593 8.94203C9.83014 11.0809 9.46556 12.1503 8.8646 12.2388C8.70303 12.2626 8.53577 12.2483 8.37592 12.197C7.78135 12.0061 7.46705 10.8785 6.83846 8.62339C6.69903 8.12319 6.62932 7.87308 6.47057 7.68206C6.4245 7.62662 6.37338 7.5755 6.31794 7.52943C6.12692 7.37068 5.87681 7.30097 5.37661 7.16154C3.12148 6.53295 1.99391 6.21865 1.80302 5.62408C1.7517 5.46423 1.73738 5.29698 1.76117 5.1354C1.84968 4.53444 2.91911 4.16986 5.05797 3.44072L6.95448 2.79419Z" stroke="currentColor" stroke-width="1.5"/>\n</svg>\n'}))):null))}render(){return this.isLoading||!this.branchData?s(n,{class:"s-order-branch-wrapper"}):s(n,{class:"s-order-branch-wrapper"},this.stackCards?s(t,null,this.renderBranchIdentityCard(),this.renderDetailsColumn()):s("div",{class:"s-order-branch-container"},this.renderBranchIdentityCard(),this.renderDetailsColumn()),this.renderWorkingHoursCard())}};o.style=":host{display:block}.s-order-branch-ready{background-color:color-mix(in srgb, var(--color-primary) 30%, transparent)}";export{o as salla_order_branch}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as l,H as s,a as n}from"./p-
|
|
4
|
+
import{r as a,h as l,H as s,a as n}from"./p-BEjZOd--.js";const t=class{constructor(l){a(this,l),this.pointsData=null,this.productId=null}async componentWillLoad(){try{if(await salla.onReady(),await salla.lang.onLoaded(),this.productId=this.host.dataset.productId||salla.config.get("page.id"),!this.productId)return;const a=await salla.api.request(`/loyalty/products/${this.productId}/points`).catch((()=>null));this.pointsData=a?.data||null}catch(a){salla?.logger?.warn?.("salla-loyalty-points-banner: init failed",a)}}render(){return this.productId&&this.pointsData?.points?l(s,null,l("div",{class:"s-loyalty-points-banner-container"},l("div",{class:"s-loyalty-points-banner-icon"},l("span",{class:"s-loyalty-points-banner-inner-icon",innerHTML:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.76604 2.86201C9.31804 2.61001 9.93304 2.41501 10.611 2.27701C11.289 2.13901 12 2.07001 12.744 2.07001C13.572 2.07001 14.364 2.15401 15.12 2.32201C15.84 2.49001 16.356 2.81401 16.668 3.29401C16.932 3.70201 17.064 4.26001 17.064 4.96801V13.032C17.064 13.416 16.95 13.752 16.722 14.04C16.506 14.304 16.227 14.493 15.885 14.607C15.543 14.721 15.204 14.742 14.868 14.67C14.196 14.514 13.488 14.436 12.744 14.436C12.084 14.436 11.442 14.502 10.818 14.634C10.23 14.754 9.70204 14.922 9.23404 15.138C8.68204 15.39 8.06704 15.585 7.38904 15.723C6.71104 15.861 6.00004 15.93 5.25604 15.93C4.42804 15.93 3.63604 15.846 2.88004 15.678C2.18404 15.522 1.68004 15.21 1.36804 14.742C1.08004 14.322 0.936035 13.752 0.936035 13.032V4.96801C0.936035 4.58401 1.05004 4.24801 1.27804 3.96001C1.49404 3.69601 1.77304 3.50701 2.11504 3.39301C2.45704 3.27901 2.79604 3.25801 3.13204 3.33001C3.80404 3.48601 4.51204 3.56401 5.25604 3.56401C5.91604 3.56401 6.55804 3.49801 7.18204 3.36601C7.77004 3.24601 8.29804 3.07801 8.76604 2.86201ZM11.25 9.00001C11.25 8.59201 11.148 8.21701 10.944 7.87501C10.74 7.53301 10.467 7.26001 10.125 7.05601C9.78304 6.85201 9.40804 6.75001 9.00004 6.75001C8.59204 6.75001 8.21704 6.85201 7.87504 7.05601C7.53304 7.26001 7.26004 7.53301 7.05604 7.87501C6.85204 8.21701 6.75004 8.59201 6.75004 9.00001C6.75004 9.40801 6.85204 9.78301 7.05604 10.125C7.26004 10.467 7.53304 10.74 7.87504 10.944C8.21704 11.148 8.59204 11.25 9.00004 11.25C9.40804 11.25 9.78304 11.148 10.125 10.944C10.467 10.74 10.74 10.467 10.944 10.125C11.148 9.78301 11.25 9.40801 11.25 9.00001ZM14.328 7.79401C14.076 7.75801 13.812 7.73401 13.536 7.72201C13.38 7.71001 13.245 7.75501 13.131 7.85701C13.017 7.95901 12.954 8.08801 12.942 8.24401C12.93 8.40001 12.975 8.53501 13.077 8.64901C13.179 8.76301 13.308 8.82601 13.464 8.83801C13.704 8.85001 13.938 8.87401 14.166 8.91001C14.322 8.93401 14.463 8.90101 14.589 8.81101C14.715 8.72101 14.787 8.59801 14.805 8.44201C14.823 8.28601 14.787 8.14501 14.697 8.01901C14.607 7.89301 14.484 7.81801 14.328 7.79401ZM4.53604 9.16201C4.29604 9.15001 4.06204 9.12601 3.83404 9.09001C3.67804 9.06601 3.53704 9.09901 3.41104 9.18901C3.28504 9.27901 3.21304 9.40201 3.19504 9.55801C3.17704 9.71401 3.21304 9.85501 3.30304 9.98101C3.39304 10.107 3.51604 10.182 3.67204 10.206C3.92404 10.242 4.18804 10.266 4.46404 10.278C4.62004 10.29 4.75504 10.245 4.86904 10.143C4.98304 10.041 5.04604 9.91201 5.05804 9.75601C5.07004 9.60001 5.02504 9.46501 4.92304 9.35101C4.82104 9.23701 4.69204 9.17401 4.53604 9.16201Z" fill="white"/>\n</svg>\n'})),l("p",null,l("span",{class:"s-loyalty-points-banner-label"},salla.lang.get("pages.loyalty_program.earn")," "),l("span",{class:"s-loyalty-points-banner-label"},`+${this.pointsData.points}`," "),l("span",{class:"s-loyalty-points-banner-label"},salla.lang.get("pages.loyalty_program.loyalty_point")," "),l("span",{class:"s-loyalty-points-banner-description"},salla.lang.get("pages.loyalty_program.on_order_total_when_purchase"))))):null}get host(){return n(this)}};t.style="";export{t as salla_loyalty_points_banner}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,a}from"./p-
|
|
4
|
+
import{r as s,h as t,a}from"./p-BEjZOd--.js";import{a as i}from"./p-CgtvEd63.js";const e=class{constructor(t){s(this,t),this.currentSlug=salla.config.get("page.slug"),salla.onReady((()=>{this.currentSlug=salla.config.get("page.slug")})),this.advSlot=this.host.querySelector('[slot="adv"]')?.innerHTML||'<div class="s-advertisement-content"><span class="s-advertisement-content-main">{iconElem}{urlElem}</span>{closeElem}</div>\n '}isNotVisible(s){return!(salla.config.isDebug()||salla.helpers.isPreview()||!salla.storage.get(`statusAd-${s.id}`))}setCanDisplayFlag(s,t){t||(salla.storage.set(`statusAd-${s.id}`,"dismissed"),i({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"}))}render(){if((!Array.isArray(this.advertisements)||this.advertisements.length)&&this.advertisements)return this.advertisements.map((s=>t("div",{class:{"s-hidden":this.isNotVisible(s),"s-advertisement":!0},"data-id":s.id,style:{"background-color":s.colors.bg,color:s.colors.text}},t("div",{id:"adv-slot",innerHTML:this.advSlot.replace("{iconElem}",`<i class="s-advertisement-content-icon ${s.icon}"></i>`).replace("{urlElem}",s.url?`<a href="${s.url}" target="${s.target}">${s.description}</a>`:s.description).replace("{closeElem}",'<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>').replace("{icon}",s.icon).replace("{url}",s.url).replace("{target}",s.target).replace("{description}",s.description).replace("{bg_color}",s.colors.bg).replace("{text_color}",s.colors.text)}))))}componentWillLoad(){return(async()=>{if(salla.config.isMobileApp())return[];const s=salla.config.isDebug()||salla.helpers.isPreview();await new Promise((s=>salla.onReady(s)));const t=s?null:this.currentSlug,a=await salla.api.advertisement.fetch(t);if(Array.isArray(a.data)){const t=a.data;this.advertisements=s?t:t.filter((s=>!salla.storage.get(`statusAd-${s.id}`)))}else this.advertisements=[];return this.advertisements})()}componentDidRender(){Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements||(setTimeout((()=>{let s=this.host.querySelector(".s-advertisement-action");s&&s.addEventListener("click",(()=>this.setCanDisplayFlag(this.advertisements[0],!1)))})),this.host.querySelectorAll("#adv-slot").forEach((s=>s?.replaceWith(s?.firstChild))),this.host.querySelector('[slot="adv"]')?.remove(),i({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"}))}get host(){return a(this)}};e.style=":host{display:block}";export{e as salla_advertisement}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as a,a as s}from"./p-
|
|
4
|
+
import{r as e,h as a,a as s}from"./p-BEjZOd--.js";const l=class{constructor(a){e(this,a),this.hasError=!1,salla.event.on("size-guide::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}async open(e){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(e))).then((e=>{this.guides=e.data})).catch((e=>{console.log(e),this.hasError=!0,this.placeholder_description=e.response?.data?.error?.message||e.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return a("salla-placeholder",{alignment:"center",iconSize:"xl"},a("div",{slot:"title"},this.placeholder_title),a("div",{slot:"description"},this.placeholder_description))}render(){return a("salla-modal",{key:"063a407b20a58cd485aab5545bc36ef7bcf97bda",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},a("span",{key:"f3020bc65b716269d77e46bf28a6ff610ebff117",slot:"icon",class:"s-product-size-guide-header-icon",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>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.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.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.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.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),a("div",{key:"588de84c8b24de3331ff825a29e8332c1c426752",slot:"loading"},a("div",{key:"be0c2882631109efd8099d96cc9c8b22ff266893",class:"s-product-size-guide-skeleton"},a("salla-skeleton",{key:"04030e4cb75e1f49d939d1c87b97eb0fe73eff0f",height:"15px",width:"25%"}),a("div",{key:"1576c0a47284315aa3ec408d75bcbb261f230b3f",class:"s-product-size-guide-skeleton-header"},a("salla-skeleton",{key:"4edba887e3a631d1fccaa4379c3f7b9ebc8e3fb9",height:"40px"}),a("salla-skeleton",{key:"da6c9bdf9eb7cb8cd6366b9dc954055ed3f79607",height:"40px"}),a("salla-skeleton",{key:"322e2e5d0f05949a6a957b695c6f557512acc689",height:"40px"}),a("salla-skeleton",{key:"4914a613bf190d2fc7029098ba7c7fd54bdace4c",height:"40px"})),a("div",{key:"209144302d7127ffc6933519db28d9cba949827f",class:"s-product-size-guide-skeleton-content"},a("salla-skeleton",{key:"cca674f6d7fe8a88c240b38df567f2980efdb9e1",height:"15px",width:"25%"}),a("salla-skeleton",{key:"9754e50822954fa6a333634a40d4414cc1785c04",height:"10px",width:"75%"}),a("salla-skeleton",{key:"b18e8d9fb7d1ddb9766fb9b24285480dbeb6d678",height:"10px",width:"50%"}),a("salla-skeleton",{key:"6904a849b03278f8a99aa5056772f58d14ecc10e",height:"10px",width:"75%"}),a("salla-skeleton",{key:"357446cfbab8c5b5062ef582dabc5a41b987a2d6",height:"10px",width:"100%"}),a("salla-skeleton",{key:"b8d2ab21d3c68f1f7c325aac46c6574b8f62878c",height:"10px",width:"25%"}),a("salla-skeleton",{key:"578de2e17060b4b8f1d8e18e77e423b8a2ca746f",height:"10px",width:"60%"}),a("salla-skeleton",{key:"442da0c1997e968f77ef7d5ea14b507387004814",height:"10px",width:"45%"}),a("salla-skeleton",{key:"0ff2e33c0f931e577b020e83f5704454169c697a",height:"10px",width:"30%"})))),a("slot",{key:"83f7baaa539d8084e6efb898a865723fab3552ff",name:"header"}),!this.hasError&&this.guides?[a("salla-tabs",null,this.guides.map((e=>a("salla-tab-header",{slot:"header",name:e.name},a("span",null,e.name)))),this.guides.map((e=>a("salla-tab-content",{slot:"content",name:e.name},a("div",{innerHTML:e.description})))))]:this.showPlaceholder(),a("slot",{key:"598c8e9603633bbb4d89f767237eda21282b4e04",name:"footer"}))}get host(){return s(this)}};l.style="";export{l as salla_product_size_guide}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as o,a as r}from"./p-
|
|
4
|
+
import{r as t,h as o,a as r}from"./p-BEjZOd--.js";const i=class{constructor(o){t(this,o),this.theme="default",this.show=!1,this.targetElement=null}handleMouseOver(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!0)}handleMouseOut(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!1)}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){const t=["default","dark"].includes(this.theme)?this.theme:"default";return o("div",{key:"84dfb23d4eb2689ff71b65c4a8b24dd36f8cb6ca",class:"s-tooltip-container"},o("div",{key:"59d3bac320e20f99de1c4bf49531a61962190efc",class:`s-tooltip-item s-tooltip-item--${t}`,style:{display:this.show?"block":"none"}},this.text?o("span",null,this.text):o("slot",null)))}get el(){return r(this)}};i.style='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}';export{i as salla_tooltip}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as e,h as s,H as i,a as l}from"./p-
|
|
4
|
+
import{r as t,c as e,h as s,H as i,a as l}from"./p-BEjZOd--.js";import{F as a}from"./p-DL4h2bc3.js";import{H as r}from"./p-XnA1YTjA.js";import"./p-CgtvEd63.js";const o=class{constructor(s){t(this,s),this.changed=e(this,"changed"),this.isReady=!1,this.isInitialFetch=!0,this.filtersData={},this.appliedOpen=!0,salla.event.on("filters::hidden",(()=>this.host.style.display="none")),salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply"),this.reset=salla.lang.get("pages.categories.filters_reset"),this.selectedTitle=salla.lang.getWithDefault("pages.categories.selected_filters","لقد اخترت")})),salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let e={};this.filters=t.map((t=>{if(t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label,"rating"==t.key){t.type=a.VALUES;let{max:e,min:s}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=s||t<=e))}this.filtersData.variants&&t.type==a.VARIANTS&&(e.variants=this.filtersData.variants),this.filtersData[t.key]&&t.type!==a.VARIANTS&&(e[t.key]=this.filtersData[t.key]);let s=new URLSearchParams(window.location.search),i=!1;for(let t of s.keys())if(t.includes("filters")){i=!0;break}if(this.isInitialFetch&&"product.index"==salla.config.get("page.slug")&&0==Object.keys(e).length&&!i){let t=window.location.href,s=salla.config.get("page.id"),i=-1!==t.indexOf("?")?"&":"?",l=t+i+"filters[category_id]="+s;e.category_id=s,window.history.pushState({path:l},"",l)}return t})),this.isInitialFetch=!1,this.filtersData=e,this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady)return;let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{if(t){let t=new URL(window.location.href);for(const[e]of t.searchParams.entries())e.startsWith("filters")&&t.searchParams.delete(e);let e=this.encodeFilters(this.filtersData),s=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");t.search=s?t.search.split("&filters")[0]+"&"+e:`?${e}`,window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);t.searchParams?.delete("filters"),window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData),this.changed.emit(this.filtersData)}),300)}encodeFilters(t,e="filters"){const s=[];for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const l=t[i],a=e?`${e}[${i}]`:i;Array.isArray(l)?l.forEach((t=>s.push(`${a}[]=${t}`))):s.push("object"==typeof l&&null!==l?this.encodeFilters(l,a):`${a}=${l}`)}return s.join("&")}async resetFilters(){return this.removeFiltersQueryParams(),this.filtersData={},this.host.childNodes.forEach((t=>t.reset&&t.reset())),salla.event.emit("salla-filters::reset"),this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search),e=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t.get(e))}`)).join("&"),s=e?`${window.location.pathname}?${e}`:window.location.pathname;window.history.pushState({},"",s)}handleOptionChange(t,e,s){e.type===a.RANGE&&(this.filtersData[e.key]=s);let i=t.target.checked;if(e.type===a.VARIANTS)this.filtersData.variants=this.filtersData.variants||{},i&&(this.filtersData.variants[e.key]=s),i||delete this.filtersData.variants[e.key];else if("radio"==t.target.type)i&&(this.filtersData[e.key]=s),i||delete this.filtersData[e.key];else if("checkbox"==t.target.type){const t=this.filtersData[e.key];this.filtersData[e.key]=Array.isArray(t)?t:null!=t?[t]:[],i?this.filtersData[e.key].push(s):this.filtersData[e.key]=this.filtersData[e.key].filter((t=>t!=s)),this.filtersData[e.key].length||delete this.filtersData[e.key]}this.filtersData={...this.filtersData},this.applyFilters()}getAppliedFilters(){const t=[],e=this.filtersData||{};for(const s of Object.keys(e)){if("variants"===s){const i=this.filters?.find((t=>t.type===a.VARIANTS));for(const l of Object.keys(e.variants||{})){const r=e.variants[l],o=i?.values?.find((t=>(t.key||t.value)==r));o&&t.push({key:s,variantKey:l,value:r,type:a.VARIANTS,groupLabel:i?.label,optionLabel:o.value})}continue}const i=this.filters?.find((t=>t.key===s));if(!i)continue;const l=e[s];if(i.type===a.RANGE||l&&"object"==typeof l&&!Array.isArray(l)){t.push({key:s,value:l,type:a.RANGE,groupLabel:i.label,optionLabel:`${l.min} - ${l.max}`});continue}if("category_id"===s&&!Array.isArray(l)&&"product.index"==salla.config.get("page.slug")&&l==salla.config.get("page.id"))continue;const r=Array.isArray(l)?l:[l];for(const e of r){const l=i.values?.find((t=>("number"==typeof t?t:t.key||t.value)==e)),a="rating"===i.key?`${e}`:l&&"number"!=typeof l?l.value:void 0;null!=a&&t.push({key:s,value:e,type:i.type,groupLabel:i.label,optionLabel:a})}}return t}removeFilter(t){if(t.type===a.VARIANTS)this.filtersData.variants&&(delete this.filtersData.variants[t.variantKey],Object.keys(this.filtersData.variants).length||delete this.filtersData.variants);else if(t.type===a.RANGE)delete this.filtersData[t.key];else{const e=this.filtersData[t.key];Array.isArray(e)?(this.filtersData[t.key]=e.filter((e=>e!=t.value)),this.filtersData[t.key].length||delete this.filtersData[t.key]):delete this.filtersData[t.key]}this.filtersData={...this.filtersData},this.applyFilters()}render(){const t=this.getAppliedFilters(),e=salla.lang.getWithDefault("common.elements.delete","Remove");return s(i,{key:"f0493d0e85ebb9e6612a1edc6cd7f45e7473017e"},t.length?s("div",{class:"s-filters-applied s-filters-widget-container"},s("h3",{class:"s-filters-widget-title",onClick:()=>this.appliedOpen=!this.appliedOpen},s("span",null,this.selectedTitle),s("span",{class:"s-filters-widget-plusminus "+(this.appliedOpen?"s-filters-widget-plusminus-active":"")})),s("div",{class:"s-filters-widget-content "+(this.appliedOpen?"s-filters-widget-opened":"s-filters-widget-closed")},s("div",{class:"s-filters-widget-values"},t.map((t=>s("div",{class:"s-filters-label s-filters-applied-item"},s("span",{class:"s-filters-option-name"},t.groupLabel,": ",t.optionLabel),s("button",{type:"button",class:"s-filters-applied-remove","aria-label":`${e} ${t.groupLabel}: ${t.optionLabel}`,onClick:()=>this.removeFilter(t)},s("i",{class:"sicon-cancel","aria-hidden":"true"})))))),s("div",{class:"s-filters-footer"},s("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)))):"",this.filters?.map((t=>s("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:e,value:s}})=>{this.handleOptionChange(t,e,s)}}))))}componentDidLoad(){this.isReady=!0}get host(){return l(this)}};o.style=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}.s-filters-applied-remove{pointer-events:auto !important;cursor:pointer}";export{o as salla_filters}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r,h as e}from"./p-
|
|
4
|
+
import{r,h as e}from"./p-BEjZOd--.js";function t(r){var e,s,a="";if("string"==typeof r||"number"==typeof r)a+=r;else if("object"==typeof r)if(Array.isArray(r))for(e=0;e<r.length;e++)r[e]&&(s=t(r[e]))&&(a&&(a+=" "),a+=s);else for(e in r)r[e]&&(a&&(a+=" "),a+=e);return a}const s=r=>"boolean"==typeof r?"".concat(r):0===r?"0":r,a=function(){for(var r,e,s=0,a="";s<arguments.length;)(r=arguments[s++])&&(e=t(r))&&(a&&(a+=" "),a+=e);return a},l=(n="s-badge-base",i={variants:{size:{xs:"s-badge-xs",sm:"s-badge-sm",md:"s-badge-md"},bg:{transparent:"s-badge-transparent",light:"s-badge-light","primary-100":"s-badge-primary-100"},color:{black:"s-badge-black","primary-900":"s-badge-color-primary-900"}}},r=>{var e;if(null==(null==i?void 0:i.variants))return a(n,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:t,defaultVariants:l}=i,o=Object.keys(t).map((e=>{const a=null==r?void 0:r[e],n=null==l?void 0:l[e];if(null===a)return null;const i=s(a)||s(n);return t[e][i]})),d=r&&Object.entries(r).reduce(((r,e)=>{let[t,s]=e;return void 0===s||(r[t]=s),r}),{}),b=null==i||null===(e=i.compoundVariants)||void 0===e?void 0:e.reduce(((r,e)=>{let{class:t,className:s,...a}=e;return Object.entries(a).every((r=>{let[e,t]=r;return Array.isArray(t)?t.includes({...l,...d}[e]):{...l,...d}[e]===t}))?[...r,t,s]:r}),[]);return a(n,o,b,null==r?void 0:r.class,null==r?void 0:r.className)});var n,i;const o=class{constructor(e){r(this,e),this.size="sm",this.color="black",this.bg="light"}render(){return e("div",{key:"54d35eb76a59251edb581786e5e89a83b6f8fbf0",class:l({size:this.size,bg:this.bg,color:this.color})},e("slot",{key:"4641cb434a2c0a6d7c004e3384848a200cb79dff"}))}};o.style="";export{o as salla_badge}
|