@salla.sa/twilight-components 2.14.496 → 2.14.497
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{filepond-zQshInIB.js → filepond-DErDeNJL.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-C6xhv1DQ.js → filepond-plugin-file-poster-DP-qSTqi.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-CigA_BnT.js → filepond-plugin-file-validate-size-CxxCTzzB.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BtH2tLUy.js → filepond-plugin-file-validate-type-icvQ9svt.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-CznwvNr8.js → filepond-plugin-image-edit-ktFv8Tf2.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DGO2ZOza.js → filepond-plugin-image-exif-orientation-DksoAq8B.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CV576sdr.js → filepond-plugin-image-preview-i02h2aEY.js} +1 -1
- package/dist/cjs/{functions-DA2d2rbh.js → functions-BCYPCXJI.js} +1 -1
- package/dist/cjs/{index-DWIYwou4.js → index-Bn__n3ZJ.js} +1 -1
- package/dist/cjs/{index-XRHN1V13.js → index-DS4dX6or.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down_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 +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/{tracked-promise-DQs6ZNFr.js → tracked-promise-CBgXWUFW.js} +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/cjs/{vanilla-picker-BRlIU_Uz.js → vanilla-picker-BoxJGmUn.js} +1 -1
- package/dist/components/index.js +2 -2
- package/dist/esm/{filepond-Dkn7TEZc.js → filepond-BymBt7p6.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-C0cYQPqD.js → filepond-plugin-file-poster-C4Baeib9.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-SWVDxAPk.js → filepond-plugin-file-validate-size-DXZcj2C2.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DuGTzF6-.js → filepond-plugin-file-validate-type-DH16JPOU.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-D-5BNiOn.js → filepond-plugin-image-edit-I2IzHMim.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CCk-WK1A.js → filepond-plugin-image-exif-orientation-CKxBiXiR.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DocF0WfI.js → filepond-plugin-image-preview-DYyvgWbZ.js} +1 -1
- package/dist/esm/{functions-I2-piBEL.js → functions-Cq4n2BZc.js} +1 -1
- package/dist/esm/{index-DN92uBcr.js → index-FnULDL2t.js} +2 -2
- package/dist/esm/{index-GAuhzXCO.js → index-ai5FT1Ia.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/salla-comment-form_8.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down_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 +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/{tracked-promise-CgZs2nmS.js → tracked-promise-Cnv73nmt.js} +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm/{vanilla-picker-5bosfbxK.js → vanilla-picker-BFSg1Nr6.js} +1 -1
- package/dist/twilight/{p-20c7d30c.entry.js → p-02442f0b.entry.js} +1 -1
- package/dist/twilight/{p-fbd96426.entry.js → p-04b263b9.entry.js} +1 -1
- package/dist/twilight/{p-d148fdc2.entry.js → p-058ff1a6.entry.js} +1 -1
- package/dist/twilight/{p-f78bc8b4.entry.js → p-064deb7d.entry.js} +1 -1
- package/dist/twilight/{p-6fc7ba45.entry.js → p-067d9396.entry.js} +1 -1
- package/dist/twilight/{p-06781253.entry.js → p-06d62441.entry.js} +1 -1
- package/dist/twilight/{p-0635695d.entry.js → p-082f25c6.entry.js} +1 -1
- package/dist/twilight/{p-c3d7e371.entry.js → p-0ee2ddfe.entry.js} +1 -1
- package/dist/twilight/{p-ef10524b.entry.js → p-124dbb09.entry.js} +1 -1
- package/dist/twilight/{p-eea63686.entry.js → p-12757fe0.entry.js} +1 -1
- package/dist/twilight/{p-07b0176a.entry.js → p-13326b78.entry.js} +1 -1
- package/dist/twilight/{p-196bdb70.entry.js → p-18635297.entry.js} +1 -1
- package/dist/twilight/{p-2a22b469.entry.js → p-1e6fe08f.entry.js} +1 -1
- package/dist/twilight/{p-4384feb0.entry.js → p-214cc6c7.entry.js} +1 -1
- package/dist/twilight/{p-f5775b4b.entry.js → p-22efb663.entry.js} +1 -1
- package/dist/twilight/{p-b8f69ded.entry.js → p-2657d260.entry.js} +1 -1
- package/dist/twilight/{p-61881597.entry.js → p-2d47d8e8.entry.js} +1 -1
- package/dist/twilight/p-2f4dd631.entry.js +4 -0
- package/dist/twilight/{p-c234545f.entry.js → p-31da9001.entry.js} +1 -1
- package/dist/twilight/{p-047c559e.entry.js → p-32e0cc15.entry.js} +1 -1
- package/dist/twilight/p-330b471f.entry.js +4 -0
- package/dist/twilight/{p-cc474d2f.entry.js → p-34127a4c.entry.js} +1 -1
- package/dist/twilight/{p-06a82570.entry.js → p-343d973d.entry.js} +1 -1
- package/dist/twilight/{p-36e9104c.entry.js → p-351c8647.entry.js} +1 -1
- package/dist/twilight/{p-6d79ff57.entry.js → p-36b5f53b.entry.js} +1 -1
- package/dist/twilight/{p-f6f54929.entry.js → p-399e214e.entry.js} +1 -1
- package/dist/twilight/{p-f0968317.entry.js → p-3a5c0f05.entry.js} +1 -1
- package/dist/twilight/{p-aca10d68.entry.js → p-3b768351.entry.js} +1 -1
- package/dist/twilight/{p-217266de.entry.js → p-3b7de9ae.entry.js} +1 -1
- package/dist/twilight/{p-cbfb7278.entry.js → p-3bfdc310.entry.js} +1 -1
- package/dist/twilight/{p-3fe332fa.entry.js → p-3dcb0180.entry.js} +1 -1
- package/dist/twilight/{p-4ebb4e09.entry.js → p-3f55c554.entry.js} +1 -1
- package/dist/twilight/{p-0ba109d0.entry.js → p-40880d36.entry.js} +1 -1
- package/dist/twilight/{p-ba76c93b.entry.js → p-494e1fde.entry.js} +1 -1
- package/dist/twilight/{p-5a1e1360.entry.js → p-4992f0d6.entry.js} +1 -1
- package/dist/twilight/{p-abece8f8.entry.js → p-4ce0a2bf.entry.js} +1 -1
- package/dist/twilight/{p-89c59baf.entry.js → p-4e4ceeb7.entry.js} +1 -1
- package/dist/twilight/{p-455155aa.entry.js → p-4f3a481e.entry.js} +1 -1
- package/dist/twilight/{p-7fb062f9.entry.js → p-4fa345d0.entry.js} +1 -1
- package/dist/twilight/{p-bec9710e.entry.js → p-4ffab00a.entry.js} +1 -1
- package/dist/twilight/{p-134e5c8a.entry.js → p-50df6706.entry.js} +1 -1
- package/dist/twilight/{p-29633b82.entry.js → p-50e26423.entry.js} +1 -1
- package/dist/twilight/{p-6dfa5c15.entry.js → p-5807e9d2.entry.js} +1 -1
- package/dist/twilight/{p-68cebecd.entry.js → p-5de98f1b.entry.js} +1 -1
- package/dist/twilight/{p-b27d3a06.entry.js → p-65e0628c.entry.js} +1 -1
- package/dist/twilight/{p-eb80e52a.entry.js → p-672aac64.entry.js} +1 -1
- package/dist/twilight/{p-9e166c23.entry.js → p-6952ea9c.entry.js} +1 -1
- package/dist/twilight/{p-e4b5ff29.entry.js → p-6a97ffb5.entry.js} +1 -1
- package/dist/twilight/{p-11ea8515.entry.js → p-6ae72470.entry.js} +1 -1
- package/dist/twilight/{p-431142f2.entry.js → p-6aeec736.entry.js} +1 -1
- package/dist/twilight/{p-e5e4b576.entry.js → p-6e78b33b.entry.js} +1 -1
- package/dist/twilight/{p-f2f9332c.entry.js → p-707603d8.entry.js} +1 -1
- package/dist/twilight/{p-d4b0e27e.entry.js → p-718398c9.entry.js} +1 -1
- package/dist/twilight/{p-9de0b4ed.entry.js → p-72b5fbf6.entry.js} +1 -1
- package/dist/twilight/{p-2a96174e.entry.js → p-76d6e2f4.entry.js} +1 -1
- package/dist/twilight/{p-5fb3e389.entry.js → p-76ece955.entry.js} +1 -1
- package/dist/twilight/{p-492c82ab.entry.js → p-77ec4730.entry.js} +1 -1
- package/dist/twilight/{p-80ec36a1.entry.js → p-77f4e4ad.entry.js} +1 -1
- package/dist/twilight/{p-8dfb53a3.entry.js → p-784eb31b.entry.js} +1 -1
- package/dist/twilight/{p-SgvqVb7w.js → p-7F6H0nZU.js} +1 -1
- package/dist/twilight/{p-422941d9.entry.js → p-8338451e.entry.js} +1 -1
- package/dist/twilight/{p-e8c46731.entry.js → p-83488cfc.entry.js} +1 -1
- package/dist/twilight/{p-091a9441.entry.js → p-88074dda.entry.js} +1 -1
- package/dist/twilight/{p-76f92ebb.entry.js → p-88b7fcd3.entry.js} +1 -1
- package/dist/twilight/{p-9e0505cc.entry.js → p-910fe36b.entry.js} +1 -1
- package/dist/twilight/{p-76596156.entry.js → p-94e73f12.entry.js} +1 -1
- package/dist/twilight/{p-fcb0b00d.entry.js → p-9d33bbdc.entry.js} +1 -1
- package/dist/twilight/{p-tAiLdZvC.js → p-BcUzfTrF.js} +1 -1
- package/dist/twilight/{p-DXSqOg95.js → p-BxPYvpZf.js} +1 -1
- package/dist/twilight/{p-VnxV3DAP.js → p-C2hNuZwS.js} +1 -1
- package/dist/twilight/{p-Bcj1f2fX.js → p-CL-G_TPA.js} +1 -1
- package/dist/twilight/{p-CJKQnkfE.js → p-ChuwCWPk.js} +1 -1
- package/dist/twilight/{p-D4DLPMFM.js → p-CqBmv6v6.js} +1 -1
- package/dist/twilight/{p-C7pTdk-_.js → p-Dx8OUo-j.js} +1 -1
- package/dist/twilight/{p-DN92uBcr.js → p-FnULDL2t.js} +1 -1
- package/dist/twilight/{p-TyDsdXfo.js → p-_ZITr3Db.js} +2 -2
- package/dist/twilight/{p-e3645153.entry.js → p-a6146d2f.entry.js} +1 -1
- package/dist/twilight/{p-551da5f4.entry.js → p-a8a231e6.entry.js} +1 -1
- package/dist/twilight/{p-3a64ed82.entry.js → p-a93f75bf.entry.js} +1 -1
- package/dist/twilight/{p-d290357e.entry.js → p-ac71ae0d.entry.js} +1 -1
- package/dist/twilight/{p-18320f76.entry.js → p-ad002097.entry.js} +1 -1
- package/dist/twilight/{p-4b9186a3.entry.js → p-b4ea2d1c.entry.js} +1 -1
- package/dist/twilight/{p-952fd300.entry.js → p-b6271a53.entry.js} +1 -1
- package/dist/twilight/{p-0e1037e4.entry.js → p-ba311107.entry.js} +1 -1
- package/dist/twilight/{p-d00445bc.entry.js → p-bbc8f803.entry.js} +1 -1
- package/dist/twilight/{p-833868bc.entry.js → p-bd8344da.entry.js} +1 -1
- package/dist/twilight/{p-375b186f.entry.js → p-c298b331.entry.js} +1 -1
- package/dist/twilight/{p-04ef12b8.entry.js → p-c3f7e5fb.entry.js} +1 -1
- package/dist/twilight/{p-50ef6401.entry.js → p-c437fff8.entry.js} +1 -1
- package/dist/twilight/p-c55a7a16.entry.js +4 -0
- package/dist/twilight/{p-1d2f111c.entry.js → p-cf5cb750.entry.js} +1 -1
- package/dist/twilight/{p-044c2cd8.entry.js → p-d02456f2.entry.js} +1 -1
- package/dist/twilight/{p-9c0d9feb.entry.js → p-d08c671a.entry.js} +1 -1
- package/dist/twilight/{p-4bbcf444.entry.js → p-d5a3b837.entry.js} +1 -1
- package/dist/twilight/{p-36abb604.entry.js → p-d5bd0f68.entry.js} +1 -1
- package/dist/twilight/{p-8c18b758.entry.js → p-e06790da.entry.js} +1 -1
- package/dist/twilight/{p-4a477d48.entry.js → p-e07bc0ab.entry.js} +1 -1
- package/dist/twilight/{p-BmjE8NyH.js → p-e2eeyWVF.js} +1 -1
- package/dist/twilight/{p-caebca8d.entry.js → p-e4ddbe57.entry.js} +1 -1
- package/dist/twilight/{p-62d47196.entry.js → p-e8d73b6c.entry.js} +1 -1
- package/dist/twilight/{p-87979a51.entry.js → p-f0d0d5a2.entry.js} +1 -1
- package/dist/twilight/{p-b51380b2.entry.js → p-f1ef4bd3.entry.js} +1 -1
- package/dist/twilight/{p-edd69c37.entry.js → p-f7f67e9d.entry.js} +1 -1
- package/dist/twilight/{p-0bef0c0b.entry.js → p-fbea2ff7.entry.js} +1 -1
- package/dist/twilight/{p-7rFUuSCm.js → p-yRTobCvI.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-620c1454.entry.js +0 -4
- package/dist/twilight/p-b3974923.entry.js +0 -4
- package/dist/twilight/p-ba7a688e.entry.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight-components",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.497",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"author": "Salla Team <support@salla.dev> (https://salla.dev)",
|
|
6
6
|
"bugs": {
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@googlemaps/markerclusterer": "2.6.2",
|
|
84
|
-
"@salla.sa/applepay": "2.14.
|
|
85
|
-
"@salla.sa/twilight": "2.14.
|
|
86
|
-
"@salla.sa/twilight-tailwind-theme": "2.14.
|
|
84
|
+
"@salla.sa/applepay": "2.14.497",
|
|
85
|
+
"@salla.sa/twilight": "2.14.497",
|
|
86
|
+
"@salla.sa/twilight-tailwind-theme": "2.14.497",
|
|
87
87
|
"@salla.sa/ui-address-autocomplete-widget": "1.2.1",
|
|
88
88
|
"@salla.sa/ui-google-map-render": "1.2.1",
|
|
89
89
|
"@types/node": "^20.4.8",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"vanilla-lazyload": "^17.8.5",
|
|
105
105
|
"vanilla-picker": "^2.12.2"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "f4ac762e74bda0cfcd0945a0e8a26d79f7a6a5e0"
|
|
108
108
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r,h as t,H as a}from"./p-DN92uBcr.js";import{S as s}from"./p-D4oPi1Ov.js";const e=new Map,i=new Map;function o(r){return r?Array.isArray(r)?r:Object.values(r):[]}const c=class{constructor(t){r(this,t),this.factors=[]}async componentWillLoad(){await salla.onReady(),await this.loadFactors()}async loadFactors(){if(this.orderId)try{const r=await async function(r){if(!r)return null;const t=e.get(r);if(t&&Date.now()-t.timestamp<=3e5)return t.data;const a=i.get(r);if(a)return a;const s=(async()=>{try{const t=await salla.api.request(`orders/${r}`,"","get"),a=t?.data??t;return e.set(r,{data:a,timestamp:Date.now()}),a}catch(t){throw e.delete(r),t}finally{i.delete(r)}})();return i.set(r,s),s}(this.orderId);this.factors=function(r,t,a,s){var e;const i=function(r,t,a,s){return r.find((r=>!(!t||Number(r.id??r.feedback_id)!==Number(t))||!(!s||Number(r.order_item_id)!==Number(s))||!(!a||Number(r.product_id??r.product?.id)!==Number(a))))}((e=r?.rating,e?[...o(e.product),...o(e.products)]:[]),t,a,s);return function(r){if(!r)return[];for(const t of["factor_reviews","review_factors","factors"]){const a=r[t];if(Array.isArray(a)&&a.length)return a}return[]}(i)}(r,this.ratingId,this.productId,this.itemId)}catch(r){console.error("[salla-review-factors-tags] failed to load order rating factors",r),this.factors=[]}else this.factors=[]}renderFactorTags(){const r=this.factors||[];return r.length?t("div",{class:"s-review-factors-tags-factors"},r.map((r=>t("div",{class:"s-review-factors-tags-factor-tag"},t("span",{class:"s-review-factors-tags-factor-name"},r.name),t("span",{class:"s-review-factors-tags-factor-star",innerHTML:s}),t("span",{class:"s-review-factors-tags-factor-rating"},r.rating||""))))):null}render(){return t(a,{key:"2645f00c58f3ecbd3b486756dd9977edc9ae66fd",class:"s-review-factors-tags-wrapper"},this.renderFactorTags())}};c.style=":host{display:inline-flex}.s-review-factors-tags-factors{display:flex;flex-wrap:wrap;gap:0.5rem;justify-content:flex-start;margin-bottom:0.6rem}.s-review-factors-tags-factor-tag{display:inline-flex;align-items:center;gap:0.25rem;border-radius:999px;border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);color:#374151;font-size:0.85rem;line-height:1;padding:0.4rem 0.65rem}.s-review-factors-tags-factor-rating{font-weight:600;color:#0f6a7c}.s-review-factors-tags-factor-star{display:inline-flex;width:0.8rem;height:0.8rem;fill:#0f6a7c}.s-review-factors-tags-factor-star svg{width:100%;height:100%}";export{c as salla_review_factors_tags}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as a,h as t,H as s,a as i}from"./p-DN92uBcr.js";import{a as e}from"./p-CgtvEd63.js";import{C as l}from"./p-BV4kqbdL.js";import{I as r}from"./p-C-tzSDxw.js";import{e as n}from"./p-DzAIgzdz.js";import{S as o}from"./p-lMgMt31Q.js";import{S as d}from"./p-CeFAfcTv.js";import{W as h}from"./p-CgR-T_ZS.js";import{H as g}from"./p-XnA1YTjA.js";const m=class{constructor(t){a(this,t),this.hasError=!1,this.showContactWidget=!0,this.images=[],this.productImages={},this.editItemImages=[],this.contact_body=(a,t,s)=>salla.lang.get("pages.rating.contact_subject",{store:a,id:t,customer:s}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.loyaltyImageRatingPoints=0,this.enableNewPopUp=!1,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.allowContactSupport=salla.config.get("store.settings.rating.allow_contact_support"),this.contentRefs=[],this.hiddenInputs=[],this.isOpen=[],this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.MAX_UPLOAD_LIMIT=3,this.onOpen=a=>new Promise((t=>{e({targets:this.contentRefs[a],duration:100,height:this.contentRefs[a].scrollHeight,opacity:[0,1],easing:"easeOutQuart",complete:()=>t()})})),this.onClose=a=>new Promise((t=>{e({targets:this.contentRefs[a],duration:100,height:0,opacity:[1,0],easing:"easeOutQuart",complete:()=>t()})})),this.toggleUploader=async a=>{this.isOpen[a]=!this.isOpen[a],g.toggleElementClassIf(this.contentRefs[a],"is-closed","is-opened",(()=>!this.isOpen[a])),await(this.isOpen[a]?this.onOpen(a):this.onClose(a)),await new Promise((a=>setTimeout(a,101))),this.body&&this.currentTab&&setTimeout((()=>this.body.setAttribute("style",`height:${this.currentTab.offsetHeight+(this.editMode?60:0)}px`)))},salla.onReady((()=>{this.orderId=salla.config.get("page.id")})),salla.lang.onLoaded((()=>{this.contactUsLabel=salla.lang.get("blocks.footer.social");const a=(a,t,s)=>new Promise((i=>{salla.helpers.setNested(salla.lang.messages[a],t,s),i(!0)}));(async()=>{await a("ar.trans","common.uploader.drag_and_drop_files","اسحب الملفات وأفلتها هنا"),await a("en.trans","common.uploader.drag_and_drop_files","Drag and drop files here"),await a("ar.trans","common.uploader.allowed_images_types"," .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة"),await a("en.trans","common.uploader.allowed_images_types","Images in jpg, jpeg, or png format are allowed."),await a("ar.trans","pages.rating.add_images","اضافة صور"),await a("en.trans","pages.rating.add_images","Add Images"),await a("ar.trans","pages.rating.edit_images","تعديل الصور"),await a("en.trans","pages.rating.edit_images","Edit Images"),await a("ar.trans","pages.rating.edit_review","تعديل التقييم"),await a("en.trans","pages.rating.edit_review","Edit review"),await a("ar.trans","pages.rating.confirm_deletion","تأكيد حذف التقييم"),await a("en.trans","pages.rating.confirm_deletion","Confirm review deletion"),await a("ar.trans","pages.rating.are_you_sure_you_want_to_delete_review","هل أنت متأكد من حذف تقييمك؟"),await a("en.trans","pages.rating.are_you_sure_you_want_to_delete_review","Are you sure you want to delete your review?"),await a("ar.trans","pages.rating.review_updated_successfully","تم تعديل التقييم بنجاح"),await a("en.trans","pages.rating.review_updated_successfully","The review has been successfully updated."),await a("ar.trans","pages.rating.review_deleted_successfully","تم حذف التقييم بنجاح"),await a("en.trans","pages.rating.review_deleted_successfully","The review has been successfully deleted."),await a("ar.trans","pages.rating.images_count","الصور ( :current من أصل :total )"),await a("en.trans","pages.rating.images_count","Images ( :current of :total )"),await a("ar.trans","pages.rating.loyalty_points_for_images","اكسب :points نقطة ولاء عند إضافة صور لتقييمك!"),await a("en.trans","pages.rating.loyalty_points_for_images","Earn :points loyalty points when adding photos to your review!"),await a("ar.trans","common.uploader.max_three_images",`.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`),await a("en.trans","common.uploader.max_three_images",`Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`),await a("ar.trans","common.elements.confirm_delete","تأكيد الحذف"),await a("en.trans","common.elements.confirm_delete","Confirm deletion"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contact_body=(a,t,s)=>salla.lang.get("pages.rating.contact_body",{store:a,id:t,customer:s})})()}))}getV2Ref(){return this.v2Ref??this.host.querySelector("salla-rating-modal-v2")}syncNewPopUpFlag(){this.enableNewPopUp=!!salla.config.get("store.features")?.includes("new_popup_rating")}async open(){return await salla.onReady(),this.syncNewPopUpFlag(),this.enableNewPopUp?this.getV2Ref()?.open():(this.defaultMode=!0,new Promise((a=>{setTimeout((()=>{this.modal.open().then((()=>this.order||salla.api.withoutNotifier((()=>salla.rating.api.order(this.orderId?this.orderId:salla.config.get("page.id")))).then((a=>this.order=a.data)))).then((()=>this.readyUpLoyaltyPoints())).then((()=>this.modal.setTitle(`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order.id})</span>`))).then((()=>{const a={};if(this.order?.products)for(const t of this.order.products)a[t.product.id]=[];this.productImages=a})).then((()=>this.modal.stopLoading())).then((()=>this.stepsCount=[this.order.testimonials_enabled,this.order.products_enabled,this.order.shipping_enabled].filter((a=>a)).length)).then((()=>setTimeout((()=>this.handleWizard()),100))).catch((t=>{a(!1),this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data,this.modal.stopLoading()})),a(!0)}),50)})))}async openEditModal(a){if(await salla.onReady(),this.syncNewPopUpFlag(),this.enableNewPopUp)return this.getV2Ref()?.openEditModal(a);this.defaultMode=!1,this.editMode=!0,this.editType=a.type,this.editFeedbackId=a.feedback_id;try{await this.fetchEditItem(a.feedback_id),await this.readyUpLoyaltyPoints(),this.editModal.open()}catch(a){this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data}}async fetchEditItem(a){const t=`rating/${a}/show`,s=await salla.api.request(t);this.editItem=s.data,this.allowAttachImages&&"product"==this.editType&&this.editItem.images.length&&(this.editItemImages=this.editItem.images.map((a=>({id:`${Math.floor(100+900*Math.random())}`,url:a}))))}async editReview(){const a={};this.editModal.querySelectorAll("[name]").forEach((t=>{const s=salla.helpers.inputData(t.name,t.value,a);a[s.name]=s.value})),a.images&&(a.images=a.images.split(","));const t=`rating/${this.editFeedbackId}`;await salla.api.request(t,a,"put").then((a=>{this.editModal.close(),salla.notify.success(a.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(a){return await salla.onReady(),this.syncNewPopUpFlag(),this.enableNewPopUp?this.getV2Ref()?.openDeleteModal(a):(this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=a.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((a=>{setTimeout((()=>{this.deleteModal.open().then((()=>a(!0)))}),50)})))}async deleteReview(){const a=`rating/${this.deleteFeedbackId}`;await salla.api.request(a,null,"delete").then((()=>{this.deleteModal.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.enableNewPopUp?this.getV2Ref()?.close():this.modal.close()}handleWizard(){this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"),this.showActiveStep()}showActiveStep(a=null){this.currentTab=a||this.steps[this.currentIndex],g.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(a=>a!=this.dots[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(a=>a==this.currentTab)),0!==this.currentIndex&&(g.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>g.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const t=this.steps[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(t?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${t}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.body?.setAttribute("style",`height:${this.currentTab?.offsetHeight}px`)))}previousTab(){this.currentIndex>0&&this.currentIndex--,g.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}submit(){this.submittedBefore()||this.validate(),salla.config.canLeave=!1,this.nextBtn.load().then((()=>this.submittedBefore()||this.sendFeedback())).then((()=>this.currentTab.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((a=>a.setAttribute("disabled",""))))).then((()=>this.currentIndex<this.stepsCount&&this.currentIndex++)).then((()=>this.showActiveStep())).then((()=>g.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)))).finally((()=>{this.nextBtn.stop(),salla.config.canLeave=!0,this.currentIndex==this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}))}submittedBefore(){return this.submitted.includes(this.currentIndex)}validate(a=null,t=null){if(!a&&"products"===this.currentTab.dataset.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((a=>this.validate(a,"product")));const s=(a=a||this.currentTab).querySelector(".rating_hidden_input").value,i=a.querySelector(".s-rating-modal-validation-msg");if(t=t||a.dataset.type,!s)throw i.innerHTML=salla.lang.get(`pages.rating.rate_${t}_stars`).replace(" (:item)",""),new Error(i.innerHTML);i.innerHTML=""}sendFeedback(){const a={};if(this.currentTab.querySelectorAll("[name]").forEach((t=>{const s=salla.helpers.inputData(t.name,t.value,a);a[s.name]=s.value})),this.allowAttachImages&&a.products)for(let t in a.products)a.products[t].images&&(a.products[t].images=a.products[t].images.split(","));if(0!=Object.keys(a).length)return a.order_id=this.orderId,a.type=this.currentTab.dataset.type,salla.rating.api[this.currentTab.dataset.type](a).then((a=>(this.submitted.push(this.currentIndex),a)))}showThankYou(){let a=10,t=setInterval((()=>{this.thanksTime.innerHTML="00:0"+a--,a>0||(clearInterval(t),this.thanksTime.remove(),this.close().then((()=>window.location.reload())))}),1e3);this.modal.querySelector(".s-rating-modal-footer").classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${r}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}handleSendEmail(){const a=`${this.contactSubjectLabel} #${this.order.id}`,t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),s=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(a)}&body=${encodeURIComponent(t)}`;window.open(s,"_blank")}handleSendWhatsApp(){const a=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),t=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(a)}`;window.open(t,"_blank")}resetData(a){a.detail||(this.modal?.close(),this.editItem=null,this.editItemImages=[],this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.deleteFeedbackId=null,this.editFeedbackId=null,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1,this.loyaltyImageRatingPoints=0)}async readyUpLoyaltyPoints(){const a=salla.loyalty?.isFeatureEnabled?.();if(!a)return void(this.loyaltyImageRatingPoints=0);const t=salla.config.get("store.settings.rating.rating_product_points")||0,s=salla.config.get("store.settings.rating.rating_product_with_image_points")||0;this.loyaltyImageRatingPoints=Number(s)+Number(t)}loyaltyPointsNote(){if(!this.loyaltyImageRatingPoints||!this.loyaltyPointsForImagesLabel)return null;const a=t("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z",fill:"#008C56"}));return t("div",{class:"s-rating-modal-loyalty-points-note-container"},t("span",{class:"s-rating-modal-loyalty-points-note-icon"},a),t("p",{class:"s-rating-modal-loyalty-points-note-text"},this.loyaltyPointsForImagesLabel.replace(":points",String(this.loyaltyImageRatingPoints))))}getDeleteModal(){return t("salla-modal",{ref:a=>this.deleteModal=a,width:"xs",onModalVisibilityChanged:a=>this.resetData(a)},t("div",{class:"s-rating-modal-delete-wrapper",ref:a=>this.body=a},t("h3",null,this.confirmDeletionLabel),t("p",null,this.areYouSureLabel),t("div",{class:"s-rating-modal-delete-actions"},t("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),t("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal.close()},this.cancelLabel))))}renderUploadedImagesCount(a){const s=this.editMode?this.editItemImages.length:(this.productImages[a]||[]).length;return t("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",s,{current:s,total:this.MAX_UPLOAD_LIMIT}))}getEditModal(){return t("salla-modal",{ref:a=>this.editModal=a,width:"md",onModalVisibilityChanged:a=>this.resetData(a)},t("div",{class:"s-rating-modal-edit-wrapper",ref:a=>this.body=a},"store"===this.editType&&this.editItem?t("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:a=>this.currentTab=a},t("div",{class:"s-rating-modal-rounded-icon"},t("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),t("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),t("div",{class:"s-rating-modal-stars-company"},t("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),t("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),t("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?t("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:a=>this.currentTab=a},this.editItem.shipping.logo?t("div",{class:"s-rating-modal-rounded-icon"},t("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):t("span",{class:"s-rating-modal-icon",innerHTML:o}),t("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),t("div",{class:"s-rating-modal-stars-company"},t("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),t("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),t("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?t("section",{class:"s-rating-modal-step","data-type":"products",ref:a=>this.currentTab=a},t("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),t("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},t("div",{class:"s-rating-modal-product-img-wrap"},t("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),t("div",{class:"s-rating-modal-product-details"},t("div",{class:"s-rating-modal-product-details-main"},t("div",null,t("h3",{class:"s-rating-modal-product-title"}," ",this.editItem.product.name),t("div",{class:"s-rating-modal-stars-product"},t("salla-rating-stars",{withLabel:!0,size:"small",editable:!0,value:this.editItem.stars}))),this.allowAttachImages&&t("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(1)},t("span",null,this.editItemImages.length?this.editImagesLabel:this.addImagesLabel),t("span",{innerHTML:r}))),t("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"content",class:"s-rating-modal-comment"}),t("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&t("div",{class:"s-rating-modal-uploader is-closed",ref:a=>this.contentRefs[1]=a},t("salla-file-upload",{name:"images",allowMultiple:!0,maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,filePosterHeight:117,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:a=>{this.editItemImages=[...this.editItemImages,a.detail],this.hiddenInputs[1].value=this.editItemImages.map((a=>a.url)).join()},onRemoved:a=>{const t=a.detail;t&&(this.editItemImages=this.editItemImages.filter((a=>a.id!==t)),this.hiddenInputs[1].value=this.editItemImages.map((a=>a.url)).join())},labelIdle:this.getFilepondPlaceholder()}),t("input",{type:"hidden",name:"images",value:this.editItem.images.join(","),ref:a=>this.hiddenInputs[1]=a}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,t("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},t("salla-button",{"loader-position":"center",onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.enableNewPopUp?t(s,{class:"s-rating-modal"},t("salla-rating-modal-v2",{ref:a=>this.v2Ref=a,orderId:this.orderId})):this.deleteMode?t(s,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?t(s,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?t(s,{class:"s-rating-modal"},t("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:a=>this.resetData(a),isLoading:!0,width:"md",ref:a=>this.modal=a},t("div",{slot:"loading"},t("div",{class:"s-rating-modal-skeleton"},t("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),t("salla-skeleton",{height:"15px",width:"60%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((a=>t("div",{key:a,innerHTML:d})))),t("salla-skeleton",{height:"100px",width:"100%"}),t("div",{class:"s-rating-modal-skeleton-footer"},t("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[t("div",{class:"s-rating-modal-wrapper",ref:a=>this.body=a},this.order?.testimonials_enabled?t("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},t("div",{class:"s-rating-modal-rounded-icon"},t("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),t("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),t("div",{class:"s-rating-modal-stars-company"},t("salla-rating-stars",{withLabel:!0,size:"large"})),t("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),t("small",{class:"s-rating-modal-validation-msg"})):"",this.order.products_enabled?t("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products"},this.allowAttachImages&&this.loyaltyPointsNote(),this.order.products.map(((a,s)=>t("div",{class:"s-rating-modal-product",key:s},t("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},t("div",{class:"s-rating-modal-product-img-wrap"},t("img",{src:a.product.thumbnail,alt:a.product.name,class:"s-rating-modal-product-img"})),t("div",{class:"s-rating-modal-product-details"},t("div",{class:"s-rating-modal-product-details-main"},t("div",null,t("h3",{class:"s-rating-modal-product-title"}," ",a.product.name),t("div",{class:"s-rating-modal-stars-product"},t("salla-rating-stars",{withLabel:!0,size:"small",name:`products[${s}][rating]`}))),this.allowAttachImages&&t("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(s)},t("span",null,this.addImagesLabel),t("span",{innerHTML:r}))),t("input",{type:"hidden",name:`products[${s}][product_id]`,value:a.product.id}),t("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:`products[${s}][comment]`,class:"s-rating-modal-comment"}),t("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&t("div",{class:"s-rating-modal-uploader is-closed",ref:a=>this.contentRefs[s]=a},t("salla-file-upload",{name:"image",maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${a.product.id}`,title:a.product.name,allowMultiple:!0,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:t=>{this.productImages={...this.productImages,[a.product.id]:[...this.productImages[a.product.id]||[],t.detail]},this.hiddenInputs[s].value=this.productImages[a.product.id].map((a=>a.url)).join(",")},onRemoved:t=>{const i=t.detail;i&&this.productImages[a.product.id]&&(this.productImages={...this.productImages,[a.product.id]:this.productImages[a.product.id].filter((a=>a.id!==i))},this.hiddenInputs[s].value=this.productImages[a.product.id].map((a=>a.url)).join(","))},labelIdle:this.getFilepondPlaceholder()}),t("input",{type:"hidden",name:`products[${s}][images]`,value:(this.productImages[a.product.id]||[]).map((a=>a.url)).join(","),ref:a=>this.hiddenInputs[s]=a}),this.renderUploadedImagesCount(a.product.id)))))):"",this.order.shipping_enabled&&this.order.shipping?.company?t("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},t("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?t("div",{class:"s-rating-modal-rounded-icon"},t("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):t("span",{class:"s-rating-modal-icon",innerHTML:o}),t("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),t("div",{class:"s-rating-modal-stars-company"},t("salla-rating-stars",{withLabel:!0,size:"large"})),t("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),t("small",{class:"s-rating-modal-validation-msg"})):"",t("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:a=>this.thanksTab=a},t("span",{class:"s-rating-modal-icon",innerHTML:l}),t("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),t("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),t("time",{class:"s-rating-modal-thanks-time",ref:a=>this.thanksTime=a}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?t("div",{class:"s-rating-modal-contact"},t("p",null,this.contactUsLabel),t("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&t("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:h}),salla.config.get("store.contacts.email")&&t("span",{onClick:()=>this.handleSendEmail(),innerHTML:n}))):"",t("div",{class:"s-rating-modal-footer"},t("button",{ref:a=>this.backBtn=a,onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?t("ul",{class:"s-rating-modal-dots"},[0,1,2].slice(0,this.stepsCount).map((a=>t("li",{key:a,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",t("salla-button",{"loader-position":"center",ref:a=>this.nextBtn=a,onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:t("salla-placeholder",{alignment:"center"}))):void 0}async componentWillLoad(){salla.event.on("rating::open",(()=>this.open())),salla.event.on("rating::edit",(a=>this.openEditModal(a))),salla.event.on("rating::delete",(a=>this.openDeleteModal(a))),await salla.onReady(),this.syncNewPopUpFlag()}componentDidLoad(){salla.event.dispatch("rating::ready",this)}get host(){return i(this)}};m.style=".s-rating-modal-product-details{padding-bottom:0.5rem}.s-rating-modal-comment{margin-top:0.35rem}.s-rating-modal-product{margin-bottom:1rem}.s-rating-modal-product-img{display:block;width:100%;height:100%;object-fit:cover}.s-rating-modal-product-title{font-size:0.95rem;font-weight:600;line-height:1.5;margin:0}.s-rating-modal-stars-product{margin-top:0.5rem}.s-rating-modal-loyalty-points-note-container{display:flex;align-items:center;gap:0.625rem;width:100%;margin-top:1.5rem;margin-bottom:0.75rem;padding:0.75rem;border-radius:0.5rem;background-color:#E6F4EA}.s-rating-modal-loyalty-points-note-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:#1B7F5C}.s-rating-modal-loyalty-points-note-icon svg{width:1.5rem;height:1.5rem;fill:currentColor}.s-rating-modal-loyalty-points-note-text{flex:1;margin:0;font-size:0.875rem;line-height:1.25rem;color:#1f2937}.s-rating-modal-product-details-main{display:flex;align-items:center;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-info-row{display:flex;align-items:center;gap:0.6rem;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-main-review{width:100%;text-align:right}.s-rating-modal-product-rating-rows{display:grid;gap:0.45rem;margin:0.2rem 0 0.7rem}.s-rating-modal-product-rating-row{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;min-height:2rem}.s-rating-modal-product-rating-row salla-rating-stars{flex-shrink:0}.s-rating-modal-product-rating-row .s-rating-stars-wrapper{align-items:center;min-height:1.75rem}.s-rating-modal-product-rating-row .s-rating-stars-label,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag{min-width:auto;min-height:1.25rem;line-height:1.25rem;font-size:0.8rem;color:#5b6470;white-space:nowrap;text-align:end;transition:opacity 0.15s ease}.s-rating-modal-product-rating-row .s-rating-stars-label--empty,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag--empty{opacity:0}.s-rating-modal-product-rating-row-main{margin-bottom:0.35rem;padding:0.5rem 0.6rem;border:1px solid #d1d5db;border-radius:0.45rem;background:transparent}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-rating-row-main .s-rating-modal-product-factor-name{font-size:1rem;color:#5b6470}.s-rating-modal-product-factor-required{color:#f87171;margin-inline-start:0.2rem}.s-rating-modal-product-img-wrap{width:5rem;min-width:5rem;height:3.5rem;flex-shrink:0;overflow:hidden;border-radius:0.375rem;background:#f3f4f6}.s-rating-modal-uploader.is-opened{height:auto !important;opacity:1 !important;overflow:visible !important;pointer-events:auto !important;margin-bottom:1rem}";export{m as salla_rating_modal}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as s,h as e,a as t}from"./p-DN92uBcr.js";var o,i;!function(s){s.ProductDetail="product.single",s.Cart="cart"}(o||(o={})),function(s){s.Conditional="conditional",s.PercentageOrFixed="fixed",s.DiscountsTable="discounts_table",s.Bank="bank",s.BuyXGetY="buy_x_get_y",s.SpecialPrice="special_price",s.Percentage="percentage",s.FixedAmount="fixed_amount"}(i||(i={}));const r=class{constructor(e){s(this,e),this.productCardComponent="salla-product-card",this.offersList=[],this.canRender=!1,this.showOffer=salla.config.get("store.settings.product.show_special_offers"),this.showAllOffersModal=!1,this.showProductsModal=!1,this.selectedOfferProducts=[],this.collapsedOffers={},this.expandedCategories={},this.productsLoaded=!1,this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""}),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text=s=>salla.lang.get("pages.offer.buy_quantity",{quantity:s}),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=(s,e)=>salla.lang.get("pages.offer.min_spend_amount",{amount:s,currency:e},`بحد أدنى ${s} ${e} من مبلغ الشراء`),this.min_items_text=s=>salla.lang.get("pages.offer.min_items",{items:s},`بحد أدنى ${s} منتجات`),this.product_text=salla.lang.get("common.elements.product","منتج"),salla.lang.onLoaded((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_price"),this.with_discount_text=salla.lang.get("pages.products.with_a_discount"),this.product_discount_text=salla.lang.get("pages.products.discount"),this.special_offer_text=salla.lang.get("pages.products.special_offer"),this.buy_quantity_text(0),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=(s,e)=>salla.lang.get("pages.offer.min_spend_amount",{amount:s,currency:e},`بحد أدنى ${s} ${e} من مبلغ الشراء`),this.min_items_text=s=>salla.lang.get("pages.offer.min_items",{items:s},`بحد أدنى ${s} منتجات`),this.product_text=salla.lang.get("common.elements.product","منتج")})),salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");const s=salla.config.get("currencies")||{},e=salla.config.get("user.currency_code");this.userCurrency=s[e]||{symbol:"",code:e||"SAR",name:""}}))}async getEndpointByPageName(){return this.currentPage==o.Cart?`offers/cart/${await Salla.cart.getCurrentCartId()}`:this.currentPage==o.ProductDetail?`offers/product/${salla.config.get("page.id")}`:"offers"}emitPromotionViewed(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const s=this.offersList.slice(0,5).map(((s,e)=>({id:s.id,name:s.title,creative:s.description||"",position:e+1})));salla.event.emit("salla::offer.promotion.viewed",s)}emitPromotionClicked(s,e=1){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const t=s||this.offersList[0];salla.event.emit("salla::offer.promotion.clicked",[{id:t.id,name:t.title,creative:t.description||"",position:e}])}componentWillLoad(){return this.hasCustomComponent=!!customElements.get(this.productCardComponent),new Promise((s=>salla.onReady(s))).then((()=>{if(this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers"),!this.showOffer)throw new Error("Merchant disabled showing the offers on product page")})).then((async()=>this.currentPage==o.Cart?salla.api.cart.offers():salla.api.request(await this.getEndpointByPageName()))).then((async s=>{if(!(this.offersList=s.data).length)throw new Error("salla-offers:: There is no offers!");if(this.offersList=this.offersList.filter((s=>[i.SpecialPrice,i.Bank,i.BuyXGetY,i.DiscountsTable,i.PercentageOrFixed,i.Percentage,i.FixedAmount].includes(s.type))),!this.offersList.length)throw new Error("salla-offers:: No supported offer types found!");let e=null;this.offersList.some((s=>{const e=s.details;return"category"===e.apply_to&&e.targets||"categories"===e.apply_to&&e.targets||s.type===i.BuyXGetY&&("categories"===e.get?.source||"category"===e.get?.source)}))&&(e=(await salla.product.api.categories()).data);const t=new Set;for(const s of this.offersList){const e=s.details;"product"!==e.apply_to&&"products"!==e.apply_to||!e.targets||e.targets.forEach((s=>t.add(s))),s.type===i.BuyXGetY&&"products"===e.get?.source&&e.get?.source_value&&e.get.source_value.forEach((s=>t.add(s))),s.type!==i.BuyXGetY||"products"!==e.buy?.source&&"product"!==e.buy?.source||!e.buy?.source_value||e.buy.source_value.forEach((s=>t.add(s)))}let o={};if(t.size>0)try{const s=await salla.product.api.fetch({source:"selected",source_value:Array.from(t)});o=Object.fromEntries(s.data.map((s=>[s.id,s])))}catch(s){o={}}for(const s of this.offersList){const t=s.details;if(("category"===t.apply_to&&t.targets||"categories"===t.apply_to&&t.targets)&&e&&(t.categories=this.findCategories(e,t.targets)),"product"!==t.apply_to&&"products"!==t.apply_to||!t.targets||(t.products=t.targets.map((s=>o[s])).filter(Boolean)),"brand"===t.apply_to&&t.targets&&(t.brands=t.targets),"tag"===t.apply_to&&t.targets&&(t.tags=t.targets),s.type===i.BuyXGetY&&t.get){const s=t.get;"products"===s.source&&s.source_value?s.products=s.source_value.map((s=>o[s])).filter(Boolean):("categories"===s.source||"category"===s.source)&&e&&s.source_value&&(s.categories=this.findCategories(e,s.source_value),t.categories=s.categories)}if(s.type===i.BuyXGetY&&t.buy){const s=t.buy;"products"!==s.source&&"product"!==s.source||!s.source_value||(s.products=s.source_value.map((s=>o[s])).filter(Boolean))}}return this.offersList})).then((()=>{this.canRender=!0})).catch((s=>{salla.logger.warn(s)}))}componentDidLoad(){let s=this.host.querySelector(".s-slider-block__title-nav");s?.classList.add("s-offer-bank-payment-nav"),this.emitPromotionViewed()}findCategories(s,e){let t=[];for(const o of s)e.includes(o.id_||o.id)&&t.push(o),o.sub_categories?.length>0&&(t=t.concat(this.findCategories(o.sub_categories,e)));return t}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const s=salla.lang.get("pages.offer.offers_title","عروض المنتج"),t=salla.lang.get("pages.offer.offers_subtitle","احصل على المنتج بسعر مخفض مع أفضل العروض");return[e("div",{class:"s-offer-wrapper"},e("salla-slider",{type:"carousel",id:"offers-slider","block-title":s,"block-subTitle":t,"show-controls":this.offersList.length>1},e("div",{slot:"items"},this.offersList.slice(0,5).map(((s,e)=>this.renderOfferCard(s,e+1))),this.offersList.length>5&&this.renderShowMoreCard()))),this.renderAllOffersModal(),this.renderProductsModal()]}renderShowMoreCard(){return e("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:s=>{s.preventDefault(),s.stopPropagation(),this.openAllOffersModal()}},e("div",{class:"s-offer-card s-offer-show-more-card"},e("i",{class:"sicon-add s-offer-show-more-icon"}),e("h3",{class:"s-offer-show-more-title"},salla.lang.get("pages.offer.show_more_offers","عرض المزيد من العروض"))))}openAllOffersModal(){this.showAllOffersModal=!0}closeAllOffersModal(){this.showAllOffersModal=!1}closeProductsModal(){this.showProductsModal=!1,this.selectedOfferProducts=[],this.productsLoaded=!1}handleAccordionToggle(s,e){this.collapsedOffers={...this.collapsedOffers,[s]:e}}getOfferProducts(s){const e=s.details;return e.products&&e.products.length>0?e.products:s.type===i.BuyXGetY&&e.get?.products?e.get.products:[]}renderProductsLinkForModalCard(s,t){const o=this.getOfferProducts(s);return o&&0!==o.length?e("div",{class:"s-offer-products-link",onClick:s=>{s.stopPropagation(),this.selectedOfferProducts=o,this.showProductsModal=!0}},e("span",{class:"s-offer-products-link-text"},this.products_link_text),t&&e("i",{class:"sicon-keyboard_arrow_down s-offer-products-link-icon"})):null}renderAllOffersModal(){return e("salla-drawer",{visible:this.showAllOffersModal,position:"right",width:"md","no-padding":!0,"drawer-title":salla.lang.get("pages.offer.all_offers_title","جميع العروض"),onDrawerVisibilityChanged:s=>!s.detail&&this.closeAllOffersModal()},e("div",{class:"s-offer-drawer-content"},this.offersList.map(((s,e)=>this.renderModalOfferCard(s,e+1)))))}renderProductsModal(){return e("salla-drawer",{visible:this.showProductsModal,width:"md",position:"right","no-padding":!0,"drawer-title":this.products_link_text,onDrawerVisibilityChanged:s=>!s.detail&&this.closeProductsModal()},e("div",{class:"s-offer-products-drawer-content"},this.selectedOfferProducts?.length>0?e("div",null,!this.productsLoaded&&e("div",{class:"flex items-center justify-center p-8"},e("salla-loading",{size:"24"})),e("salla-products-list",{source:"selected","source-value":JSON.stringify(this.selectedOfferProducts.map((s=>s.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"],onProductsFetched:()=>this.productsLoaded=!0})):e("div",{class:"p-4 text-center text-gray-500"},salla.lang.get("blocks.products.no_products_found","لا توجد منتجات"))))}renderModalOfferCard(s,t=1){const o=this.getOfferProducts(s),r=o&&o.length>0,a=!1!==this.collapsedOffers[s.id];return e("div",{class:"s-offer-drawer-card"},e("div",{class:"s-offer-card-main",onClick:()=>this.emitPromotionClicked(s,t)},e("div",{class:"s-offer-card-icon"},this.getOfferIcon(s.type)),e("div",{class:"s-offer-card-content"},e("h3",{class:"s-offer-card-title",title:s.title},s.title),s.description&&e("p",{class:"s-offer-card-description"},s.description),s.type===i.DiscountsTable?e("div",{class:"s-offer-card-details"},this.renderDiscountTableOfferContent(s)):s.type===i.PercentageOrFixed||s.type===i.Percentage||s.type===i.FixedAmount?e("div",{class:"s-offer-card-details"},this.renderPercentageOrFixedOfferContent(s),this.renderOfferCategories(s),this.renderOfferBrands(s),this.renderOfferTags(s)):e("div",{class:"s-offer-card-details"},this.renderOfferCategories(s),this.renderOfferBrands(s),this.renderOfferTags(s)))),r&&e("salla-accordion",{collapsed:a,collapsible:!0,size:"sm",onClick:s=>s.stopPropagation(),onAccordionToggle:e=>this.handleAccordionToggle(s.id,e.detail.payload.collapsed)},e("salla-accordion-head",{collapsible:!0,collapsed:a},e("div",{slot:"title",class:"s-offer-products-thumbnails"},e("span",{class:"s-offer-products-title"},this.products_link_text,e("i",{class:`sicon-keyboard_arrow_${a?"down":"up"} s-offer-products-link-icon`})),e("div",{class:"s-offer-products-thumbnails-stack"},o.slice(0,3).map(((s,t)=>e("div",{class:"s-offer-product-thumbnail",style:{zIndex:`${t+1}`}},e("img",{src:s.thumbnail||s.image?.url||salla.url.cdn("images/s-empty.png"),alt:s.name})))),o.length>3&&e("div",{class:"s-offer-products-more-count",style:{zIndex:"7"}},"+",o.length-3)))),e("salla-accordion-body",null,e("div",{class:"s-offer-products-content"},e("salla-products-list",{source:"selected","source-value":JSON.stringify(o.map((s=>s.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"]})))))}renderOfferCard(s,t=1){return e("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:()=>this.emitPromotionClicked(s,t)},e("div",{class:"s-offer-card"},e("div",{class:"s-offer-card-icon"},this.getOfferIcon(s.type)),e("div",{class:"s-offer-card-content"},e("h3",{class:"s-offer-card-title",title:s.title},s.title),s.description&&e("p",{class:"s-offer-card-description"},s.description),e("div",{class:"s-offer-card-details"},s.type===i.DiscountsTable?this.renderDiscountTableOfferContent(s):s.type===i.PercentageOrFixed||s.type===i.Percentage||s.type===i.FixedAmount?[this.renderPercentageOrFixedOfferContent(s),this.renderOfferCategories(s),this.renderOfferBrands(s),this.renderOfferTags(s)]:[this.renderOfferCategories(s),this.renderOfferBrands(s),this.renderOfferTags(s)],this.renderProductsLinkForModalCard(s,!1)))))}getOfferIcon(s){return e("i",{class:{[i.DiscountsTable]:"sicon-discount-calculator",[i.Bank]:"sicon-bank",[i.SpecialPrice]:"sicon-fire",[i.BuyXGetY]:"sicon-gift",[i.PercentageOrFixed]:"sicon-special-discount",[i.Percentage]:"sicon-special-discount",[i.FixedAmount]:"sicon-special-discount"}[s]||"sicon-discount"})}renderDiscountTableOfferContent(s){const t=s.details.discounts||[];return t.length?e("div",null,e("div",{class:"s-offer-card-description"},salla.lang.get("pages.offer.discount_table_subtitle","وفر اكتر بشراء منتجات أكثر")),e("table",{class:"s-offer-discount-table"},e("tbody",null,this.groupDiscountsByRows(t,3).map(((s,t)=>e("tr",{key:t},s.map(((s,t)=>e("td",{key:t},e("div",{class:"s-offer-discount-percentage"},s.percentage,"%"),e("div",{class:"s-offer-discount-condition"},this.formatDiscountCondition(s))))))))))):null}renderPercentageOrFixedOfferContent(s){const t=s.details;return t.discount_value||t.min_spend>0||t.min_items>0?e("div",{class:"s-offer-percentage-fixed-content"},t.min_spend>0&&e("div",{class:"s-offer-min-spend"},this.min_spend_text(t.min_spend,this.userCurrency?.symbol||"")),t.min_items>0&&e("div",{class:"s-offer-min-items"},this.min_items_text(t.min_items))):null}groupDiscountsByRows(s,e){const t=[];for(let o=0;o<s.length;o+=e)t.push(s.slice(o,o+e));return t}formatDiscountCondition(s){return s.discounted_amount?`${s.discounted_amount} ${this.userCurrency?.symbol||""}`:null!=s.quantity?this.buy_quantity_text(s.quantity):`1 ${this.product_text}`}renderOfferCategories(s){const t=s.details;let o=t.categories||[];if(s.type===i.BuyXGetY&&t.get?.categories&&(o=t.get.categories),!o.length)return null;const r=this.expandedCategories[s.id],a=o.length>3,l=r?o:o.slice(0,3);return e("div",{class:"s-offer-categories"},e("div",{class:"s-offer-categories-list"},l.map(((s,t)=>e("a",{key:t,class:"s-offer-category-item",href:s.url||salla.url.create("categories",s.id||s.id_)},s.name))),a&&e("span",{class:"s-offer-categories-toggle",onClick:e=>{e.preventDefault(),e.stopPropagation(),this.toggleCategoryExpansion(s.id)}},r?e("span",null,e("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):e("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(o.length-3)," ",e("i",{class:"sicon-keyboard_arrow_down"})))))}renderOfferBrands(s){const t=s.details.brands||[];if(!t.length)return null;const o=this.expandedCategories[s.id],i=t.length>3,r=o?t:t.slice(0,3);return e("div",{class:"s-offer-categories"},e("div",{class:"s-offer-categories-list"},r.map(((s,t)=>e("a",{key:t,class:"s-offer-category-item",href:s.url},s.name))),i&&e("span",{class:"s-offer-categories-toggle",onClick:e=>{e.preventDefault(),e.stopPropagation(),this.toggleCategoryExpansion(s.id)}},o?e("span",null,e("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):e("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(t.length-3)," ",e("i",{class:"sicon-keyboard_arrow_down"})))))}renderOfferTags(s){const t=s.details.tags||[];if(!t.length)return null;const o=this.expandedCategories[s.id],i=t.length>3,r=o?t:t.slice(0,3);return e("div",{class:"s-offer-categories"},e("div",{class:"s-offer-categories-list"},r.map(((s,t)=>e("a",{key:t,class:"s-offer-category-item",href:s.url||salla.url.create("tags",s.id)},s.name))),i&&e("span",{class:"s-offer-categories-toggle",onClick:e=>{e.preventDefault(),e.stopPropagation(),this.toggleCategoryExpansion(s.id)}},o?e("span",null,e("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):e("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(t.length-3)," ",e("i",{class:"sicon-keyboard_arrow_down"})))))}toggleCategoryExpansion(s){this.expandedCategories={...this.expandedCategories,[s]:!this.expandedCategories[s]}}get host(){return t(this)}};r.style=":host .s-drawer-close:where([dir=rtl],[dir=rtl] *){left:0}";export{r as salla_offer}
|