@salla.sa/twilight-components 2.14.479 → 2.14.480
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-BPXa818W.js → filepond-kIwfFiY4.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-C8rBmqP1.js → filepond-plugin-file-poster-CbAmZLgn.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DHvexzHl.js → filepond-plugin-file-validate-size-iH_0ezqS.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-USfPHGU9.js → filepond-plugin-file-validate-type-B2YOvyGf.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-B6d-pTe7.js → filepond-plugin-image-edit-C5N-16uI.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BKXTMrN7.js → filepond-plugin-image-exif-orientation-aEzbNMDw.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-HeJn7Fzg.js → filepond-plugin-image-preview-RLbA7gqX.js} +1 -1
- package/dist/cjs/{functions-DnfHlsMt.js → functions-BVKjPPbN.js} +1 -1
- package/dist/cjs/{index-Bd4QLljc.js → index-DjrWrGKt.js} +1 -1
- package/dist/cjs/{index-BOSf94mJ.js → index-RKu7wZSM.js} +2 -2
- 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 +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-cashback-banner.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.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-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 +4 -2
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
- 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-B5_X6aTd.js → tracked-promise-B8pdpxb2.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-CibPXx03.js → vanilla-picker-B6Vd66w8.js} +1 -1
- package/dist/collection/components/salla-order-branch/salla-order-branch.js +28 -2
- package/dist/components/index.js +2 -2
- package/dist/components/salla-order-branch.js +5 -2
- package/dist/esm/{filepond-De6VkHet.js → filepond-BUxO340w.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CiCgn3Hw.js → filepond-plugin-file-poster-DPDWNTQe.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Cpb-5fe6.js → filepond-plugin-file-validate-size-DrF6W6HS.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-aHD8bS59.js → filepond-plugin-file-validate-type-ByNgdCcv.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-67aiG6wt.js → filepond-plugin-image-edit-D6lcie1e.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-Dz-18vfu.js → filepond-plugin-image-exif-orientation-CEGVilMd.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CXLxQkFQ.js → filepond-plugin-image-preview-BInmqvtQ.js} +1 -1
- package/dist/esm/{functions-PgaN9IW0.js → functions-CwbqVd0b.js} +1 -1
- package/dist/esm/{index-DOBNIJGF.js → index-BqFb60iF.js} +2 -2
- package/dist/esm/{index-COUOkGDQ.js → index-BrHfsf3-.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 +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-cashback-banner.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.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-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 +4 -2
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal_3.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-reward-action_4.entry.js +3 -3
- 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-vq6waoZ5.js → tracked-promise-DXr0erHx.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-CjLObECd.js → vanilla-picker-5UIlzk8V.js} +1 -1
- package/dist/twilight/{p-9b8a3570.entry.js → p-013dfb33.entry.js} +1 -1
- package/dist/twilight/{p-dc0dc251.entry.js → p-026f2d7b.entry.js} +1 -1
- package/dist/twilight/{p-401a440e.entry.js → p-07ab0bf0.entry.js} +1 -1
- package/dist/twilight/{p-aaf673c2.entry.js → p-09373418.entry.js} +1 -1
- package/dist/twilight/{p-bb320032.entry.js → p-0b9b72c0.entry.js} +1 -1
- package/dist/twilight/{p-1f539133.entry.js → p-0c77267c.entry.js} +1 -1
- package/dist/twilight/{p-71d488e6.entry.js → p-0f975c51.entry.js} +1 -1
- package/dist/twilight/{p-0894be06.entry.js → p-0fd430cd.entry.js} +1 -1
- package/dist/twilight/{p-965be874.entry.js → p-12eef889.entry.js} +1 -1
- package/dist/twilight/{p-f98d7adb.entry.js → p-1a719573.entry.js} +1 -1
- package/dist/twilight/{p-023064b5.entry.js → p-1c834218.entry.js} +1 -1
- package/dist/twilight/{p-88cbc0d9.entry.js → p-1f7b2325.entry.js} +1 -1
- package/dist/twilight/{p-2a98d199.entry.js → p-23fb752f.entry.js} +1 -1
- package/dist/twilight/{p-95b0afec.entry.js → p-248d1538.entry.js} +1 -1
- package/dist/twilight/{p-b43972bd.entry.js → p-29b491ae.entry.js} +1 -1
- package/dist/twilight/{p-50699d8a.entry.js → p-2a8797f7.entry.js} +1 -1
- package/dist/twilight/{p-fe518894.entry.js → p-2d5469e5.entry.js} +1 -1
- package/dist/twilight/{p-720ea46a.entry.js → p-2dbbfde8.entry.js} +1 -1
- package/dist/twilight/{p-7e30f305.entry.js → p-2e5bb4f4.entry.js} +1 -1
- package/dist/twilight/{p-ad4d06ce.entry.js → p-315593b0.entry.js} +1 -1
- package/dist/twilight/{p-682189e1.entry.js → p-328689cc.entry.js} +1 -1
- package/dist/twilight/{p-8f614d1c.entry.js → p-334df31d.entry.js} +1 -1
- package/dist/twilight/{p-80016acb.entry.js → p-3592fb4b.entry.js} +1 -1
- package/dist/twilight/{p-17610b7c.entry.js → p-3889f710.entry.js} +1 -1
- package/dist/twilight/{p-344a3000.entry.js → p-3d68c74d.entry.js} +1 -1
- package/dist/twilight/{p-5b0b7ec6.entry.js → p-3e263ad6.entry.js} +1 -1
- package/dist/twilight/{p-2bf6e4e5.entry.js → p-3fc7dfa2.entry.js} +1 -1
- package/dist/twilight/{p-4f68152c.entry.js → p-431fac85.entry.js} +1 -1
- package/dist/twilight/{p-40c46ea4.entry.js → p-43474ee2.entry.js} +1 -1
- package/dist/twilight/{p-2e1a171d.entry.js → p-46b9277f.entry.js} +1 -1
- package/dist/twilight/{p-8a184321.entry.js → p-5083bfcd.entry.js} +1 -1
- package/dist/twilight/{p-d9098501.entry.js → p-535aff1f.entry.js} +1 -1
- package/dist/twilight/{p-92705a9f.entry.js → p-53ce66a7.entry.js} +1 -1
- package/dist/twilight/{p-05b89acb.entry.js → p-57d40198.entry.js} +1 -1
- package/dist/twilight/{p-756bd7be.entry.js → p-5a57d395.entry.js} +1 -1
- package/dist/twilight/{p-9afdbf8c.entry.js → p-61e9018a.entry.js} +1 -1
- package/dist/twilight/{p-ca6d81c2.entry.js → p-63f568ad.entry.js} +1 -1
- package/dist/twilight/{p-ec368653.entry.js → p-67e934a3.entry.js} +1 -1
- package/dist/twilight/{p-4a794ffc.entry.js → p-6c4ab4ae.entry.js} +1 -1
- package/dist/twilight/{p-efabb238.entry.js → p-76196f47.entry.js} +1 -1
- package/dist/twilight/{p-85df1cda.entry.js → p-767822b5.entry.js} +1 -1
- package/dist/twilight/{p-c8b40772.entry.js → p-778a42dc.entry.js} +1 -1
- package/dist/twilight/{p-bf85a892.entry.js → p-7b8f78d8.entry.js} +1 -1
- package/dist/twilight/{p-f7dd548d.entry.js → p-7c95a27d.entry.js} +1 -1
- package/dist/twilight/{p-dfcafe54.entry.js → p-7cec181e.entry.js} +1 -1
- package/dist/twilight/{p-17da5f55.entry.js → p-81fc08bc.entry.js} +1 -1
- package/dist/twilight/{p-43e1459c.entry.js → p-8b366181.entry.js} +1 -1
- package/dist/twilight/{p-dc99fe2e.entry.js → p-91dc3de7.entry.js} +1 -1
- package/dist/twilight/{p-ed3cf4cd.entry.js → p-92b0481d.entry.js} +1 -1
- package/dist/twilight/p-95643680.entry.js +4 -0
- package/dist/twilight/{p-f15da397.entry.js → p-96d7b307.entry.js} +1 -1
- package/dist/twilight/{p-2dca07f4.entry.js → p-97f56b3e.entry.js} +1 -1
- package/dist/twilight/{p-263839f0.entry.js → p-9dc040ac.entry.js} +1 -1
- package/dist/twilight/{p-9d3efb90.entry.js → p-9f5105fc.entry.js} +1 -1
- package/dist/twilight/{p-DzkfQABi.js → p-BRP9wXBV.js} +1 -1
- package/dist/twilight/{p-DSQUWswr.js → p-BbiGVDjx.js} +1 -1
- package/dist/twilight/{p-3H1z72Ig.js → p-BnXdxK21.js} +1 -1
- package/dist/twilight/{p-DOBNIJGF.js → p-BqFb60iF.js} +1 -1
- package/dist/twilight/{p-IOauGdRQ.js → p-Bw6Lg6Nq.js} +1 -1
- package/dist/twilight/{p-B82O29Bj.js → p-CsHEfbM_.js} +1 -1
- package/dist/twilight/{p-Xta96Le1.js → p-DYL8LNIs.js} +1 -1
- package/dist/twilight/{p-CSsM5LBR.js → p-DlEXuybu.js} +1 -1
- package/dist/twilight/{p-BQ1TYsqI.js → p-DsHyM0bg.js} +1 -1
- package/dist/twilight/{p-yhdhOGMm.js → p-DsKnWz05.js} +1 -1
- package/dist/twilight/{p-D7_z7Jny.js → p-Kk0reIVI.js} +1 -1
- package/dist/twilight/{p-78300b4e.entry.js → p-a0855c31.entry.js} +1 -1
- package/dist/twilight/{p-ce4b3059.entry.js → p-a0ba26aa.entry.js} +1 -1
- package/dist/twilight/{p-dcf16537.entry.js → p-ac45f19d.entry.js} +1 -1
- package/dist/twilight/{p-8926d982.entry.js → p-b3f07535.entry.js} +1 -1
- package/dist/twilight/{p-915263c3.entry.js → p-b4301ee3.entry.js} +1 -1
- package/dist/twilight/{p-035e66ca.entry.js → p-b8812978.entry.js} +1 -1
- package/dist/twilight/{p-b5b39981.entry.js → p-c45ce221.entry.js} +1 -1
- package/dist/twilight/{p-2654de79.entry.js → p-c5662aa2.entry.js} +1 -1
- package/dist/twilight/{p-bca2db09.entry.js → p-cd3e9b52.entry.js} +1 -1
- package/dist/twilight/{p-8785f606.entry.js → p-cd40e650.entry.js} +1 -1
- package/dist/twilight/{p-a11469e3.entry.js → p-d0bb3653.entry.js} +1 -1
- package/dist/twilight/{p-f13dca85.entry.js → p-d652aaf4.entry.js} +1 -1
- package/dist/twilight/{p-4480e7a3.entry.js → p-d66338e0.entry.js} +1 -1
- package/dist/twilight/{p-56a7f0a7.entry.js → p-d9b7a9d1.entry.js} +1 -1
- package/dist/twilight/{p-8ba7ac8c.entry.js → p-daed6c53.entry.js} +1 -1
- package/dist/twilight/{p-efab7b0f.entry.js → p-dbd2a0de.entry.js} +1 -1
- package/dist/twilight/{p-e9ef05ea.entry.js → p-dec1388b.entry.js} +1 -1
- package/dist/twilight/{p-4ea27e52.entry.js → p-dfd88e06.entry.js} +1 -1
- package/dist/twilight/{p-8c0c2db6.entry.js → p-e23d218e.entry.js} +1 -1
- package/dist/twilight/{p-470f3283.entry.js → p-e7c12354.entry.js} +1 -1
- package/dist/twilight/{p-e1bff9ab.entry.js → p-e839d889.entry.js} +1 -1
- package/dist/twilight/{p-a7610c13.entry.js → p-ea9159eb.entry.js} +1 -1
- package/dist/twilight/{p-6e4ae2e3.entry.js → p-ec1fc331.entry.js} +1 -1
- package/dist/twilight/{p-b1c48c8b.entry.js → p-ee0e575e.entry.js} +1 -1
- package/dist/twilight/{p-a882e505.entry.js → p-f13103c6.entry.js} +1 -1
- package/dist/twilight/{p-b100263d.entry.js → p-f4531bfe.entry.js} +1 -1
- package/dist/twilight/{p-c5b25f69.entry.js → p-f5d7430f.entry.js} +1 -1
- package/dist/twilight/{p-75c79418.entry.js → p-f9142099.entry.js} +1 -1
- package/dist/twilight/{p-dfed6087.entry.js → p-fbd4f619.entry.js} +1 -1
- package/dist/twilight/p-fc337ff0.entry.js +4 -0
- package/dist/twilight/{p-4345c817.entry.js → p-fd4989e9.entry.js} +1 -1
- package/dist/twilight/{p-0ba4d1a9.entry.js → p-fd9754f2.entry.js} +1 -1
- package/dist/twilight/{p-3ab4d446.entry.js → p-fe86430c.entry.js} +1 -1
- package/dist/twilight/{p-3e9545d2.entry.js → p-ff1c723f.entry.js} +1 -1
- package/dist/twilight/{p-fW3MR5av.js → p-tJElNMug.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-order-branch/salla-order-branch.d.ts +2 -0
- package/dist/types/components.d.ts +10 -0
- package/package.json +5 -5
- package/dist/twilight/p-1c6f74be.entry.js +0 -4
- package/dist/twilight/p-98e78a0a.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as a,F as s,a as e}from"./p-
|
|
4
|
+
import{r as t,h as a,F as s,a as e}from"./p-BqFb60iF.js";const i=class{constructor(a){t(this,a),this.isMobileAllowed=!0,this.isEmailRequired=!1,this.supportWebAuth=!0,this.withoutReload=!1,this.source="",this.htmlElement=document.documentElement,this.messages=[],this.isClosable=!0,this.iframeLoaded=!1,this.scrolling="no",this.direction=document.dir,this.canRenderIframe=!1,salla.event.on("login::open",(t=>{this.isEmailAllowed||this.isMobileAllowed?(this.source=t?.source??!1,this.withoutReload=t?.withoutReload??this.withoutReload,this.open(t),this.openModal()):salla.logger.warn("Please enable atleast one login type to use this component.")})),salla.event.on("modal::close",(t=>{this.iframe&&this.sendMessageToIframe({source:"login",type:"modal_closed",data:t})})),salla.onReady((()=>{this.api=salla.config.get("store.api"),this.storeId=salla.config.get("store.id")}))}componentDidLoad(){window.addEventListener("message",(t=>{if(!this.isTrustedMessage(t)||"login"!=t.data?.source)return;if(!this.inline&&!this.canRenderIframe)return;salla.log("salla-account:: recived an event",t.data);let a=t.data?.type?.replace("iframe::",""),s=t.data.message;if("ready"==a)return s.isPasskeyPage?void this.createPassKey.postMessage({source:"login",type:"init_passkey_page",data:{token:salla.storage.get("token"),store_id:salla.config.get("store.id"),locale:salla.config.get("user.language_code"),redirect:salla.config.get("store.url")}},salla.config.get("login.url")):void this.handleIframeReadyAction();if("height"==a)return this.iframe.height=s?.height+"px";if("storage"==a)return this.handleIframeStorageAction(s);if("scrolling"==a)return this.scrolling=s,void(this.isClosable=!1);if("direction"==a)return document.dir=this.direction=s?"rtl":"ltr";if("notify"==a)return salla.notify[s.type](s.message);if("authenticated"==a||"authenticated_web_auth"==a)return!s?.withoutClose&&this.close(),salla.auth.api.handlAfterAuthenticatedResponse(s,this.supportWebAuth).then((()=>!(s?.withoutReload||this.withoutReload)&&setTimeout((()=>window.location.reload()),1e3)));if("dispatchEvent"!=a||"auth::verified"!=s.event){if("dispatchEvent"==a)return salla.event.emit(s.event,...s.payload);if("reload"==a)return s?.withClose&&this.modal.close(),window.location.reload();if("open_page"===a){if(!this.isSafeUrl(s?.url))return;return window.location.href=s.url}if("open_passkey_page"!==a)return"guest-checkout"===a?this.handleGuestCheckout():void("close"==a&&this.close());this.createPassKey=window.open(`${salla.config.get("login.url")}/create-passkey`)}else salla.log("Ignored dispatchEvent `auth::verified` from iframe")})),this.observeDarkModeChanges(),setTimeout((()=>Salla.event.emit("salla-login::ready")),1)}async open(t=null){return Salla.config.isGuest()?this.modal.open():this.withoutReload?void 0:location.reload()}close(){Salla.event.emit("salla-login::closing"),this.modal.close(),this.iframeLoaded=!1,this.canRenderIframe=!1,this.host.dispatchEvent(new CustomEvent("salla-login:closed",{cancelable:!0,bubbles:!0,detail:null})),Salla.event.emit("salla-login::closed")}handleIframeReadyAction(){this.sendInitMessage(),this.sendMessageToIframe({source:"login",type:"width",data:document.body.clientWidth})}observeDarkModeChanges(){new MutationObserver((t=>{t.forEach((t=>{"class"===t.attributeName&&this.sendMessageToIframe({source:"login",type:"darkMode",data:{isDark:!!this.htmlElement.classList.contains("dark")}})}))})).observe(this.htmlElement,{attributes:!0})}async handleIframeStorageAction(t){let a,s=salla.storage.get("cart.user_id"),e=!1;if(Object.entries(t).filter((t=>!Salla.storage.get(t[0]))).forEach((([t,i])=>{salla.log("Shared storage from accounts domain",t,i);let l="string"==typeof i?i?.replace(/^"|"$/g,""):i;salla.storage.set(t,l),"token"===t&&(a=l),"user"===t&&s&&l.id!==s&&(e=!0)})),a){this.modal.close(),Salla.auth.event.tokenFetched(a);try{await Salla.api.cart.assign()}catch(t){Salla.log("Error on assign after handle iframe",t)}e&&Salla.cart.reset();try{!Salla.auth.api.isSessionless()&&await Salla.auth.api.request("auth/jwt"),Salla.auth.api.canRedirect()?setTimeout((()=>window.location.reload()),100):await Salla.auth.event.loggedIn({data:{token:a}}).then((()=>Salla.auth.api.afterUserLogin()))}catch(t){this.modal.open(),Salla.log("Error on request auth/jwt after handle iframe",t)}}else e&&Salla.cart.reset()}isTrustedMessage(t){if(!(this.iframe&&t.source===this.iframe.contentWindow||this.createPassKey&&t.source===this.createPassKey))return!1;let a;try{a=new URL(salla.config.get("login.url","https://accounts.salla.com")).origin}catch(t){a="https://accounts.salla.com"}return t.origin===a}isSafeUrl(t){if("string"!=typeof t||!t)return!1;try{const{protocol:a}=new URL(t,location.href);return"https:"===a||"http:"===a}catch(t){return!1}}sendMessageToIframe(t){if(this.iframe)return this.iframe.contentWindow.postMessage(t,"*")}sendInitMessage(){let t=this.headers;try{t="string"==typeof t?JSON.parse(t):t}catch(a){console.error("Failed to parse headers!",this.headers,a),t=void 0}const a={user:salla.storage.get("user"),s_translations:salla.storage.get("s_translations"),token:salla.storage.get("token")};a.user||delete a.user,a.s_translations||delete a.s_translations,a.token||delete a.token,this.sendMessageToIframe({source:"login",type:"init",data:{id:this.storeId,lang:salla.lang.locale,isDark:!!this.htmlElement.classList.contains("dark"),apiUrl:this.api?.replace(/\/+$/,""),supportWebAuth:this.supportWebAuth,withoutReload:this.withoutReload,inline:this.inline,settings:salla.config.all(),headers:t,storage:a}})}async handleGuestCheckout(){if(this.modal.close(),salla.config.isGuest())return salla.cart.submit(!1,!0)}openModal(){this.canRenderIframe||(this.canRenderIframe=!0),this.modal.open()}render(){if(!Salla.config.isUser())return this.inline?this.getLoginDom():a("salla-modal",{class:"s-login-modal",ref:t=>this.modal=t,width:"xs"},this.getLoginDom())}getLoginDom(){if(this.canRenderIframe)return a(s,null,a("iframe",{src:`${salla.config.get("login.url","https://accounts.salla.com")}?src=${this.source}`,title:"Salla Login",class:"hide-scroll",loading:"lazy",ref:t=>{this.iframe=t},allow:"publickey-credentials-get; publickey-credentials-create",scrolling:this.scrolling,frameborder:"0",width:"100%"}))}get host(){return e(this)}};i.style="iframe{-moz-transition:height 0.3s;-ms-transition:height 0.3s;-o-transition:height 0.3s;-webkit-transition:height 0.3s;transition:height 0.3s;width:100%}";export{i as salla_login_modal}
|
|
@@ -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-BqFb60iF.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 o}from"./p-
|
|
4
|
+
import{r as s,h as t,H as o}from"./p-BqFb60iF.js";const e=class{constructor(t){s(this,t),this.bordered=!0,this.placeholderImage="images/placeholder.png",this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(this.options)if("string"==typeof this.options)try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}else this.optionsData=Array.isArray(this.options)?this.options:[];else this.optionsData=[]}renderOptionValue(s){return s.is_image?t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name}))):s.color?t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}}):s.is_file?t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},salla.lang.get("common.elements.attachments")):s.is_color_picker?t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-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>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n'}))):s.is_map&&s.latitude&&s.longitude?t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:!0,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},salla.lang.get("common.elements.show_location")))):t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault(),navigator.clipboard&&navigator.clipboard.writeText(t)}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);t&&t.open&&t.open()}render(){if(!this.optionsData.length)return null;const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(o,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};e.style="";export{e as salla_order_details_options}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s}from"./p-DOBNIJGF.js";import{a as i}from"./p-CgtvEd63.js";import{a as e}from"./p-BedNk7k1.js";import{S as a}from"./p-8Tsmrwno.js";import{S as h}from"./p-0-eTJXSD.js";const l=class{constructor(s){t(this,s),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.loadingRegions=!1,this.regions=[],this.selectedRegionId=void 0,this.isKSA=!1,this.selectedCountry=null,this.selectedRegion=null,this.displayedCities=[],this.selectedCity=null,this.searchingCities=!1,this.enableCityAjaxSearch=!1,this.citySearchQuery="",this.step2Animated=!1,this.citySearchTimer=null,this.citySearchCounter=0,this.locationRequestCounter=0,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.receiverCountryCode=salla.config.get("store.scope.countries")?.[0]||salla.config.get("store.store_country")||"SA",this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.formSelector="form.product-form, form.form--product-options",this.handleCitySearch=t=>{if(this.citySearchQuery=t,!this.enableCityAjaxSearch)return;this.citySearchTimer&&clearTimeout(this.citySearchTimer);const s=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=await this.fetchCities(t);s===this.citySearchCounter&&(this.displayedCities=i)}catch(t){s===this.citySearchCounter&&(this.displayedCities=[])}finally{s===this.citySearchCounter&&(this.searchingCities=!1)}}),l.CITY_SEARCH_DEBOUNCE_MS)},this.handleCitySelected=t=>{this.selectedCity=t,this.receiverCity=String(t.id),this.clearError("receiver.city_id")},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.gift?.cities??[],this.searchingCities=!1},this.handleCountryDropdownClosed=()=>{},this.handleRegionDropdownClosed=()=>{},salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftText=salla.lang.get("blocks.buy_as_gift.gift_text"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverRegionFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_region")||salla.lang.get("pages.checkout.region"),this.selectRegion=salla.lang.get("pages.checkout.select_region"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}isPhysical(){return this.physicalProducts||this.physical}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const t=document.querySelector(".s-quantity-input-input");this.quantity=t?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const t=document.querySelector(this.formSelector);return t?new FormData(t):null}mergeObjectToFormData(t,s,i){for(let e in t){if(!t.hasOwnProperty(e)||null==t[e])continue;const a=i?`${i}[${e}]`:e;"object"!=typeof t[e]||null===t[e]||t[e]instanceof File?s.set(a,t[e]):this.mergeObjectToFormData(t[e],s,a)}return s}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});this.resetStepsAnimation(),this.currentStep=1,this.parentClass="is-current-step-1",this.step2Animated=!1,this.stepsWrapper?.style.removeProperty("height"),await this.modal.open();const t=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(t).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.gift.show_texts||(this.selectedGiftTextOption=void 0,this.selectedText=void 0),this.gift.show_images||(this.selectedImage=void 0,this.uploadedImage=void 0),this.skipStep1()&&(this.currentStep=2,this.parentClass="is-current-step-2",this.step2Animated=!0)})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}skipStep1(){return!!this.gift&&!this.gift.show_images&&!this.gift.show_texts}resetStepsAnimation(){[this.step1Elems,this.step2Elems].forEach((t=>{t?.querySelectorAll(".anime-item").forEach((t=>t.removeAttribute("style")))})),this.step1Elems?.removeAttribute("style"),this.step2Elems&&!this.skipStep1()&&(this.step2Elems.style.removeProperty("opacity"),this.step2Elems.style.removeProperty("transform"))}async close(){return this.modal.close()}async setWrapperHeight(t=1,s=250,i=0,e=0){let a=document.querySelector(`#${this.hostId} .gift-step-${t}`);const h=()=>{this.stepsWrapper.style.height=e?`${e}px`:a.offsetHeight+i+"px"};this.step2Animated&&2===t?requestAnimationFrame(h):setTimeout(h,s)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let s=t.target.children[t.target.selectedIndex].getAttribute("data-id"),i="custom"==s;const e=this.showGiftText!==i;this.showGiftText=i,s?(this.selectedGiftTextOption=s,this.selectedText=i?void 0:t.target.value):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0),e&&this.setWrapperHeight(1,150,5)}async goToStep2(t=!0){this.step1Elems&&(t&&!this.validateStep1()||(this.stepsWrapper&&this.step1Elems&&(this.stepsWrapper.style.height=`${this.step1Elems.offsetHeight}px`),this.setWrapperHeight(2,50,0),(new i.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")})),this.step2Animated=!0}},"-=1200"),this.currentStep=2,this.parentClass=`is-current-step-${this.currentStep}`))}validateStep1(){return!(this.gift?.show_texts&&(this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),0):(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.add("s-form-has-error"),1):(this.textSelect?.classList.add("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),1)))}goToStep1(t){t.preventDefault();let s=new i.timeline({autoplay:!1});s.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),s.play(),this.step2Animated=!1,this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload&&this.gift.show_image_upload?this.selectImageOrUpload:this.selectImageForYourGift}</p></div>`}setPreview(t){this.uploader?.classList.add("has-bg");var s=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");s.classList.add("filepond-bg"),s.classList.remove("s-hidden"),s.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(s),this.uploadedImage=t.url,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(`#${this.hostId} .filepond-bg`);t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea?.classList.remove("s-form-has-error")}clearError(t){if(this.errors?.[t]){const{[t]:s,...i}=this.errors;this.errors=i}}handleSenderName(t){this.senderName=t.target.value,this.clearError("sender_name")}handleReceiverName(t){this.receiverName=t.target.value,this.clearError("receiver.name")}resetCityState(){this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.gift={...this.gift,cities:[]},this.displayedCities=[],this.receiverCity=void 0,this.selectedCity=null,this.citySearchQuery="",this.searchingCities=!1,this.enableCityAjaxSearch=!1}setInitialCities(t){this.gift={...this.gift,cities:t},this.displayedCities=t,this.enableCityAjaxSearch=t.length>=l.CITY_AJAX_THRESHOLD}async fetchCities(t=""){if(!this.selectedCountryId)return[];if(this.isKSA&&!this.selectedRegionId)return[];const s=["for_branch=0",`country_id=${this.selectedCountryId}`];this.isKSA&&this.selectedRegionId&&s.push(`region_id=${this.selectedRegionId}`),t?.trim()&&s.push(`query=${encodeURIComponent(t.trim())}`);const i=await salla.api.request(`shipping/cities?${s.join("&")}`);return i?.data??[]}async handleCountrySelected(t){const s=t?.id;this.selectedCountry=t??null,this.selectedCountryId=s,this.selectedCountryCode=t?.country_code,this.isKSA="SA"===t?.country_code,this.clearError("receiver.country"),this.regions=[],this.selectedRegionId=void 0,this.selectedRegion=null,this.resetCityState();const i=++this.locationRequestCounter;if(!s)return this.selectedCountryCode=void 0,this.isKSA=!1,void this.setWrapperHeight(2,0,0);if(this.isKSA){this.loadingRegions=!0,this.setWrapperHeight(2,0,0);try{const t=await salla.api.request(`shipping/countries/${s}/regions`);if(i!==this.locationRequestCounter)return;t&&t.data&&(this.regions=t.data)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching regions:",t)}finally{i===this.locationRequestCounter&&(this.loadingRegions=!1,this.setWrapperHeight(2,0,0))}}else{this.loadingCities=!0,this.setWrapperHeight(2,0,0);try{const t=await this.fetchCities();if(i!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{i===this.locationRequestCounter&&(this.loadingCities=!1)}}}async handleRegionSelected(t){const s=t?.id;this.selectedRegion=t??null,this.selectedRegionId=s,this.clearError("receiver.region"),this.resetCityState();const i=++this.locationRequestCounter;if(s){this.loadingCities=!0;try{const t=await this.fetchCities();if(i!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{i===this.locationRequestCounter&&(this.loadingCities=!1,this.setWrapperHeight(2,0,0))}}}handleUploadImage(t){this.uploadedImage=t,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let s=t.detail;this.receiverMobile=s.number,this.receiverCountryCode=s.country_code,this.clearError("receiver.mobile")}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const t=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");const s=[{key:"sender_name",value:this.senderName,label:this.senderNameLabel},{key:"receiver.name",value:this.receiverName,label:this.receiverNameFieldLabel},{key:"receiver.mobile",value:this.receiverMobile,label:this.receiverMobileFieldLabel},...this.isPhysical()?[{key:"receiver.country",value:this.selectedCountryId,label:this.receiverCountryFieldLabel},...this.isKSA?[{key:"receiver.region",value:this.selectedRegionId,label:this.receiverRegionFieldLabel}]:[],{key:"receiver.city_id",value:this.receiverCity,label:this.receiverCityFieldLabel}]:[]],i={};if(s.forEach((({key:t,value:s,label:e})=>{s||(i[t]=salla.lang.get("common.errors.field_required",{attribute:e}))})),Object.keys(i).length)return this.errors=i,void this.setWrapperHeight(2,150,0);const e="custom"===this.selectedGiftTextOption,a={text:e?this.selectedText:void 0,text_id:!e&&this.selectedGiftTextOption?Number(this.selectedGiftTextOption):void 0,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:t||null,receiver:{name:this.receiverName,mobile_country_code:this.receiverCountryCode,mobile:this.receiverMobile,...this.isPhysical()&&this.selectedCountryCode?{country_code:this.selectedCountryCode}:{},...this.isPhysical()&&this.selectedRegionId?{region_id:this.selectedRegionId}:{},...this.receiverCity&&this.isPhysical()?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let h;this.productId&&this.formSelector&&(h=this.getFormDataFromForm()||new FormData,h=this.mergeObjectToFormData(a,h));const l=this.productId?()=>salla.product.addProductGiftToCart(this.productId,h,!0):()=>salla.cart.addCartGiftToCart(a,!0);return await l().then((()=>this.modal.close())).catch((t=>{t.response&&422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}step2ItemClass(t=""){const s="anime-item"+(this.step2Animated?"":" opacity-0");return t?`${t} ${s}`:s}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const t=document.querySelector(this.formSelector);if(!t)return void console.error("SallaGifting:: Form not found in the document!");if(!(t instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!t.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!t||await t.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[s("div",{key:"a2798e968c7311c99560db0710559f8f518031fa"},s("salla-list-tile",{key:"5621984db45065e919fc647bf973b5fdb42e7c3f",class:this.generateClass()},s("div",{key:"3fea9220af764f5675b17005169ec5398fb0a1d3",slot:"title"},this.vertical?s("span",{innerHTML:h}):"",s("h3",{key:"6984f88fa5675edfddbc67d87fa69ee26ee40b98"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),s("div",{key:"64cb13fac30d6613af2c278593e45d59f2f8e791",slot:"subtitle"},s("div",{key:"578f47b7cc8242bbf6872cc670c37beeb7197c0e"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),s("div",{key:"54e56e74fcc1e3266395ad003369e47ea0b0c27b",slot:"action"},s("salla-button",{key:"7687a680041c1e5b431eb56d94262fb2defe0664",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},s("slot",{key:"9e466071aa0bf882962931f029e32d567390d9f2",name:"widget-btn-content"},s("div",{key:"f5b8a796dc3b7bb4e1094a7741944673e1ec6477",class:"s-gifting-widget-action-content"},s("span",{key:"037ea375a6904bf51d15c8d76f8b650031526a59",innerHTML:h})," ",s("span",{key:"490dceeaf5a7e0ec38dabd49182f74d4ea07d597"},this.sectionBtnText)))))),s("salla-modal",{key:"2914d9a5a0ae7fe555a73f993553165e4fb91b02",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},s("div",{key:"6d70fa91062f55adb3d0a6371ccb8afc271e949e",slot:"loading"},s("div",{key:"82a690b756eb1179c325416a33f66b9d726eb336",class:"s-gifting-skeleton"},s("div",{key:"8cedf269ee0caf39cbd9f39ab80e7dd3d65b7fde",class:"s-gifting-modal-header"},s("salla-skeleton",{key:"7cb2bfb3198c3096efa147348b2a6cdec21eb3d3",type:"circle",height:"5rem",width:"5rem"}),s("h2",{key:"36cb724cfe2f39a7eb94b779a67520a3bff75389",class:"s-gifting-modal-title"},s("div",{key:"2ef3bcb26f31cdc34725e9a87849a426bd9dfc72",class:"s-gifting-modal-badge-wrapper"},s("salla-skeleton",{key:"66f4148f367bc687982a06975e41c6865a530e88",height:"15px",width:"150px"})))),s("div",{key:"fda2fdc549cc6dfcb5f4cc9bfafe5dc686464e4c",class:"s-gifting-skeleton-content"},s("salla-skeleton",{key:"f0f64ab8b9d467c2cbe4707154a21bb952f45831",height:"10px",width:"150px"}),s("salla-skeleton",{key:"1b1950d9d333b4249aab267fdbb90ac380ac6175",height:"230px"}),s("salla-skeleton",{key:"3b3a2472851e63754804ceb68401bb56a9900061",height:"10px",width:"150px"}),s("salla-skeleton",{key:"d3f9ace5c8b12061ac94d929d926e8458fb66411",height:"30px"}),s("salla-skeleton",{key:"d0be03fc578e2559c0a5251875bac01519beb18f",height:"40px"})))),s("slot",{key:"86757c4d648dd818857aaee41c6df568724cbd1b",name:"header"}),this.hasError?s("salla-placeholder",{alignment:"center"},s("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),s("span",{slot:"description"}," ")):[s("div",{class:"s-gifting-modal-header"},s("span",{class:"s-gifting-modal-icon"},s("span",{innerHTML:h})),s("h2",{class:"s-gifting-modal-title"},s("div",{class:"s-gifting-modal-badge-wrapper"},!this.skipStep1()&&s("div",{class:"s-gifting-modal-badge"},s("span",null,s("span",null,this.currentStep),"/2")),s("span",null,this.giftDetails)))),s("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},!this.skipStep1()&&s("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},this.gift&&this.gift.show_images&&s("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),this.gift&&this.gift.show_images&&s("div",{class:"s-gifting-image-section"},s("div",{class:`s-gifting-modal-uploader anime-item ${this.disableClass}`,ref:t=>this.uploader=t},s("span",{class:"s-gifting-remove-preview pointer-events-auto",onClick:()=>this.removePreview(),innerHTML:a}),this.selectImageOrUpload&&this.gift&&s("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),s("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?s("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},s("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>s("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},s("img",{src:t.url,alt:`${t.id}`})))):"")):"")),this.gift&&this.gift.show_texts?s("div",{class:"anime-item"},s("div",{class:"s-gifting-modal-uploader-title s-gifting-text-title"},this.giftText),s("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},s("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},s("option",{"data-id":null,selected:!this.selectedGiftTextOption},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>s("option",{"data-id":t.id,value:t.text,key:t.id,selected:String(this.selectedGiftTextOption)===String(t.id)},t.text))):"",this.gift&&this.gift.show_custom_text?s("option",{"data-id":"custom",selected:"custom"===this.selectedGiftTextOption},this.giftCustomText):null)),s("div",{class:this.showGiftText&&this.gift&&this.gift.show_custom_text?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},s("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),s("div",{class:"mt-1"},s("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))):null,s("div",{class:"anime-item"},s("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2(!!this.gift?.show_texts)},s("span",null,this.nextStep)))),s("div",{class:"s-gifting-step-two gift-step-2",style:this.skipStep1()?{opacity:"1",transform:"translateX(0)",position:"relative"}:void 0,ref:t=>this.step2Elems=t},s("div",{class:this.step2ItemClass(this.errors?.sender_name?"s-form-group s-form-has-error":"s-form-group")},s("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),s("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?s("span",{class:"s-gifting-error"},this.errors.sender_name):""),s("div",{class:this.step2ItemClass(this.errors?.["receiver.name"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),s("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?s("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),s("div",{class:this.step2ItemClass(this.errors?.["receiver.mobile"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label"},this.receiverMobileFieldLabel),s("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?s("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.country"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-country`},this.receiverCountryFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectCountry,items:this.gift?.countries??[],selectedItem:this.selectedCountry,disabled:!this.gift?.countries?.length,required:!0,inputId:`${this.hostId}-country`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleCountrySelected(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}),this.errors&&this.errors["receiver.country"]?s("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),this.isPhysical()&&this.isKSA&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.region"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-region`},this.receiverRegionFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectRegion,items:this.regions??[],selectedItem:this.selectedRegion,loading:this.loadingRegions,disabled:this.loadingRegions||!this.regions?.length,required:!0,inputId:`${this.hostId}-region`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleRegionSelected(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()}),this.errors&&this.errors["receiver.region"]?s("span",{class:"s-gifting-error"},this.errors["receiver.region"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.city_id"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-city`},this.receiverCityFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectCity,items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:this.loadingCities||this.isKSA&&!this.selectedRegionId,required:!0,inputId:`${this.hostId}-city`,searchQuery:this.citySearchQuery,clientSearch:!this.enableCityAjaxSearch,dropUp:!0,keepParentScroll:!0,onItemSelected:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed()}),this.errors&&this.errors["receiver.city_id"]?s("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass("s-gifting-info")},s("span",{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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),s("span",null,this.selectCityInfo)),!this.isPhysical()&&s("div",{class:this.step2ItemClass()},s("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},s("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),s("span",{class:"s-form-label"}," ",this.sendLater," "))),s("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},s("label",{class:"s-form-label"},this.selectSendDateAndTime),s("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),s("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),s("div",{class:this.step2ItemClass("s-gifting-step-two-footer")},!this.skipStep1()&&s("a",{href:"#!",innerHTML:e,onClick:t=>this.goToStep1(t)}),s("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},s("span",null,this.sendGift)))))],s("slot",{key:"052bb080776d8d874da570b643345b95a40cd985",name:"footer"})))]}};l.CITY_AJAX_THRESHOLD=400,l.CITY_SEARCH_DEBOUNCE_MS=100,l.style=".s-gifting-steps-wrapper{transition:height 0.8s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}.s-gifting-modal .s-searchable-dropdown-trigger{border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger--open,.s-gifting-modal .s-searchable-dropdown-trigger:focus{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-gifting-modal .s-searchable-dropdown-trigger-placeholder{color:#000}.s-gifting-modal .s-gifting-image-section{margin-bottom:1.5rem}.s-gifting-modal .s-gifting-slider{margin-bottom:0.5rem}.s-gifting-modal .s-gifting-image{display:block}.s-gifting-modal .s-gifting-image img{display:block;width:auto;height:100px;object-fit:contain}.s-gifting-modal .s-gifting-image-section+.anime-item .s-gifting-text-title{margin-top:1rem}";export{l as salla_gifting}
|
|
4
|
+
import{r as t,h as s}from"./p-BqFb60iF.js";import{a as i}from"./p-CgtvEd63.js";import{a as e}from"./p-BedNk7k1.js";import{S as a}from"./p-8Tsmrwno.js";import{S as h}from"./p-0-eTJXSD.js";const l=class{constructor(s){t(this,s),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.loadingRegions=!1,this.regions=[],this.selectedRegionId=void 0,this.isKSA=!1,this.selectedCountry=null,this.selectedRegion=null,this.displayedCities=[],this.selectedCity=null,this.searchingCities=!1,this.enableCityAjaxSearch=!1,this.citySearchQuery="",this.step2Animated=!1,this.citySearchTimer=null,this.citySearchCounter=0,this.locationRequestCounter=0,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.receiverCountryCode=salla.config.get("store.scope.countries")?.[0]||salla.config.get("store.store_country")||"SA",this.hostId=`salla-gifting-${Math.random().toString(36).slice(2,10)}`,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.formSelector="form.product-form, form.form--product-options",this.handleCitySearch=t=>{if(this.citySearchQuery=t,!this.enableCityAjaxSearch)return;this.citySearchTimer&&clearTimeout(this.citySearchTimer);const s=++this.citySearchCounter;this.citySearchTimer=setTimeout((async()=>{this.searchingCities=!0;try{const i=await this.fetchCities(t);s===this.citySearchCounter&&(this.displayedCities=i)}catch(t){s===this.citySearchCounter&&(this.displayedCities=[])}finally{s===this.citySearchCounter&&(this.searchingCities=!1)}}),l.CITY_SEARCH_DEBOUNCE_MS)},this.handleCitySelected=t=>{this.selectedCity=t,this.receiverCity=String(t.id),this.clearError("receiver.city_id")},this.handleCityDropdownClosed=()=>{this.citySearchQuery="",this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.displayedCities=this.gift?.cities??[],this.searchingCities=!1},this.handleCountryDropdownClosed=()=>{},this.handleRegionDropdownClosed=()=>{},salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftText=salla.lang.get("blocks.buy_as_gift.gift_text"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverRegionFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_region")||salla.lang.get("pages.checkout.region"),this.selectRegion=salla.lang.get("pages.checkout.select_region"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}isPhysical(){return this.physicalProducts||this.physical}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const t=document.querySelector(".s-quantity-input-input");this.quantity=t?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const t=document.querySelector(this.formSelector);return t?new FormData(t):null}mergeObjectToFormData(t,s,i){for(let e in t){if(!t.hasOwnProperty(e)||null==t[e])continue;const a=i?`${i}[${e}]`:e;"object"!=typeof t[e]||null===t[e]||t[e]instanceof File?s.set(a,t[e]):this.mergeObjectToFormData(t[e],s,a)}return s}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});this.resetStepsAnimation(),this.currentStep=1,this.parentClass="is-current-step-1",this.step2Animated=!1,this.stepsWrapper?.style.removeProperty("height"),await this.modal.open();const t=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(t).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name,this.disableClass=this.gift?.show_image_upload?"":"pointer-events-none",this.gift.show_texts||(this.selectedGiftTextOption=void 0,this.selectedText=void 0),this.gift.show_images||(this.selectedImage=void 0,this.uploadedImage=void 0),this.skipStep1()&&(this.currentStep=2,this.parentClass="is-current-step-2",this.step2Animated=!0)})).catch((t=>{this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data})).finally((()=>this.modal.stopLoading()))}skipStep1(){return!!this.gift&&!this.gift.show_images&&!this.gift.show_texts}resetStepsAnimation(){[this.step1Elems,this.step2Elems].forEach((t=>{t?.querySelectorAll(".anime-item").forEach((t=>t.removeAttribute("style")))})),this.step1Elems?.removeAttribute("style"),this.step2Elems&&!this.skipStep1()&&(this.step2Elems.style.removeProperty("opacity"),this.step2Elems.style.removeProperty("transform"))}async close(){return this.modal.close()}async setWrapperHeight(t=1,s=250,i=0,e=0){let a=document.querySelector(`#${this.hostId} .gift-step-${t}`);const h=()=>{this.stepsWrapper.style.height=e?`${e}px`:a.offsetHeight+i+"px"};this.step2Animated&&2===t?requestAnimationFrame(h):setTimeout(h,s)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){this.textSelect?.classList.remove("s-form-has-error");let s=t.target.children[t.target.selectedIndex].getAttribute("data-id"),i="custom"==s;const e=this.showGiftText!==i;this.showGiftText=i,s?(this.selectedGiftTextOption=s,this.selectedText=i?void 0:t.target.value):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0),e&&this.setWrapperHeight(1,150,5)}async goToStep2(t=!0){this.step1Elems&&(t&&!this.validateStep1()||(this.stepsWrapper&&this.step1Elems&&(this.stepsWrapper.style.height=`${this.step1Elems.offsetHeight}px`),this.setWrapperHeight(2,50,0),(new i.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")})),this.step2Animated=!0}},"-=1200"),this.currentStep=2,this.parentClass=`is-current-step-${this.currentStep}`))}validateStep1(){return!(this.gift?.show_texts&&(this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),0):(this.textSelect?.classList.remove("s-form-has-error"),this.customTextArea?.classList.add("s-form-has-error"),1):(this.textSelect?.classList.add("s-form-has-error"),this.customTextArea?.classList.remove("s-form-has-error"),1)))}goToStep1(t){t.preventDefault();let s=new i.timeline({autoplay:!1});s.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:i.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:i.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),s.play(),this.step2Animated=!1,this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload&&this.gift.show_image_upload?this.selectImageOrUpload:this.selectImageForYourGift}</p></div>`}setPreview(t){this.uploader?.classList.add("has-bg");var s=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");s.classList.add("filepond-bg"),s.classList.remove("s-hidden"),s.style.backgroundImage="url('"+t.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(s),this.uploadedImage=t.url,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(`#${this.hostId} .filepond-bg`);t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea?.classList.remove("s-form-has-error")}clearError(t){if(this.errors?.[t]){const{[t]:s,...i}=this.errors;this.errors=i}}handleSenderName(t){this.senderName=t.target.value,this.clearError("sender_name")}handleReceiverName(t){this.receiverName=t.target.value,this.clearError("receiver.name")}resetCityState(){this.citySearchTimer&&(clearTimeout(this.citySearchTimer),this.citySearchTimer=null),++this.citySearchCounter,this.gift={...this.gift,cities:[]},this.displayedCities=[],this.receiverCity=void 0,this.selectedCity=null,this.citySearchQuery="",this.searchingCities=!1,this.enableCityAjaxSearch=!1}setInitialCities(t){this.gift={...this.gift,cities:t},this.displayedCities=t,this.enableCityAjaxSearch=t.length>=l.CITY_AJAX_THRESHOLD}async fetchCities(t=""){if(!this.selectedCountryId)return[];if(this.isKSA&&!this.selectedRegionId)return[];const s=["for_branch=0",`country_id=${this.selectedCountryId}`];this.isKSA&&this.selectedRegionId&&s.push(`region_id=${this.selectedRegionId}`),t?.trim()&&s.push(`query=${encodeURIComponent(t.trim())}`);const i=await salla.api.request(`shipping/cities?${s.join("&")}`);return i?.data??[]}async handleCountrySelected(t){const s=t?.id;this.selectedCountry=t??null,this.selectedCountryId=s,this.selectedCountryCode=t?.country_code,this.isKSA="SA"===t?.country_code,this.clearError("receiver.country"),this.regions=[],this.selectedRegionId=void 0,this.selectedRegion=null,this.resetCityState();const i=++this.locationRequestCounter;if(!s)return this.selectedCountryCode=void 0,this.isKSA=!1,void this.setWrapperHeight(2,0,0);if(this.isKSA){this.loadingRegions=!0,this.setWrapperHeight(2,0,0);try{const t=await salla.api.request(`shipping/countries/${s}/regions`);if(i!==this.locationRequestCounter)return;t&&t.data&&(this.regions=t.data)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching regions:",t)}finally{i===this.locationRequestCounter&&(this.loadingRegions=!1,this.setWrapperHeight(2,0,0))}}else{this.loadingCities=!0,this.setWrapperHeight(2,0,0);try{const t=await this.fetchCities();if(i!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{i===this.locationRequestCounter&&(this.loadingCities=!1)}}}async handleRegionSelected(t){const s=t?.id;this.selectedRegion=t??null,this.selectedRegionId=s,this.clearError("receiver.region"),this.resetCityState();const i=++this.locationRequestCounter;if(s){this.loadingCities=!0;try{const t=await this.fetchCities();if(i!==this.locationRequestCounter)return;this.setInitialCities(t)}catch(t){if(i!==this.locationRequestCounter)return;console.error("Error fetching cities:",t)}finally{i===this.locationRequestCounter&&(this.loadingCities=!1,this.setWrapperHeight(2,0,0))}}}handleUploadImage(t){this.uploadedImage=t,this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images?.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let s=t.detail;this.receiverMobile=s.number,this.receiverCountryCode=s.country_code,this.clearError("receiver.mobile")}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const t=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");const s=[{key:"sender_name",value:this.senderName,label:this.senderNameLabel},{key:"receiver.name",value:this.receiverName,label:this.receiverNameFieldLabel},{key:"receiver.mobile",value:this.receiverMobile,label:this.receiverMobileFieldLabel},...this.isPhysical()?[{key:"receiver.country",value:this.selectedCountryId,label:this.receiverCountryFieldLabel},...this.isKSA?[{key:"receiver.region",value:this.selectedRegionId,label:this.receiverRegionFieldLabel}]:[],{key:"receiver.city_id",value:this.receiverCity,label:this.receiverCityFieldLabel}]:[]],i={};if(s.forEach((({key:t,value:s,label:e})=>{s||(i[t]=salla.lang.get("common.errors.field_required",{attribute:e}))})),Object.keys(i).length)return this.errors=i,void this.setWrapperHeight(2,150,0);const e="custom"===this.selectedGiftTextOption,a={text:e?this.selectedText:void 0,text_id:!e&&this.selectedGiftTextOption?Number(this.selectedGiftTextOption):void 0,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:t||null,receiver:{name:this.receiverName,mobile_country_code:this.receiverCountryCode,mobile:this.receiverMobile,...this.isPhysical()&&this.selectedCountryCode?{country_code:this.selectedCountryCode}:{},...this.isPhysical()&&this.selectedRegionId?{region_id:this.selectedRegionId}:{},...this.receiverCity&&this.isPhysical()?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let h;this.productId&&this.formSelector&&(h=this.getFormDataFromForm()||new FormData,h=this.mergeObjectToFormData(a,h));const l=this.productId?()=>salla.product.addProductGiftToCart(this.productId,h,!0):()=>salla.cart.addCartGiftToCart(a,!0);return await l().then((()=>this.modal.close())).catch((t=>{t.response&&422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}step2ItemClass(t=""){const s="anime-item"+(this.step2Animated?"":" opacity-0");return t?`${t} ${s}`:s}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const t=document.querySelector(this.formSelector);if(!t)return void console.error("SallaGifting:: Form not found in the document!");if(!(t instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!t.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const t=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!t||await t.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[s("div",{key:"a2798e968c7311c99560db0710559f8f518031fa"},s("salla-list-tile",{key:"5621984db45065e919fc647bf973b5fdb42e7c3f",class:this.generateClass()},s("div",{key:"3fea9220af764f5675b17005169ec5398fb0a1d3",slot:"title"},this.vertical?s("span",{innerHTML:h}):"",s("h3",{key:"6984f88fa5675edfddbc67d87fa69ee26ee40b98"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),s("div",{key:"64cb13fac30d6613af2c278593e45d59f2f8e791",slot:"subtitle"},s("div",{key:"578f47b7cc8242bbf6872cc670c37beeb7197c0e"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),s("div",{key:"54e56e74fcc1e3266395ad003369e47ea0b0c27b",slot:"action"},s("salla-button",{key:"7687a680041c1e5b431eb56d94262fb2defe0664",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},s("slot",{key:"9e466071aa0bf882962931f029e32d567390d9f2",name:"widget-btn-content"},s("div",{key:"f5b8a796dc3b7bb4e1094a7741944673e1ec6477",class:"s-gifting-widget-action-content"},s("span",{key:"037ea375a6904bf51d15c8d76f8b650031526a59",innerHTML:h})," ",s("span",{key:"490dceeaf5a7e0ec38dabd49182f74d4ea07d597"},this.sectionBtnText)))))),s("salla-modal",{key:"2914d9a5a0ae7fe555a73f993553165e4fb91b02",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},s("div",{key:"6d70fa91062f55adb3d0a6371ccb8afc271e949e",slot:"loading"},s("div",{key:"82a690b756eb1179c325416a33f66b9d726eb336",class:"s-gifting-skeleton"},s("div",{key:"8cedf269ee0caf39cbd9f39ab80e7dd3d65b7fde",class:"s-gifting-modal-header"},s("salla-skeleton",{key:"7cb2bfb3198c3096efa147348b2a6cdec21eb3d3",type:"circle",height:"5rem",width:"5rem"}),s("h2",{key:"36cb724cfe2f39a7eb94b779a67520a3bff75389",class:"s-gifting-modal-title"},s("div",{key:"2ef3bcb26f31cdc34725e9a87849a426bd9dfc72",class:"s-gifting-modal-badge-wrapper"},s("salla-skeleton",{key:"66f4148f367bc687982a06975e41c6865a530e88",height:"15px",width:"150px"})))),s("div",{key:"fda2fdc549cc6dfcb5f4cc9bfafe5dc686464e4c",class:"s-gifting-skeleton-content"},s("salla-skeleton",{key:"f0f64ab8b9d467c2cbe4707154a21bb952f45831",height:"10px",width:"150px"}),s("salla-skeleton",{key:"1b1950d9d333b4249aab267fdbb90ac380ac6175",height:"230px"}),s("salla-skeleton",{key:"3b3a2472851e63754804ceb68401bb56a9900061",height:"10px",width:"150px"}),s("salla-skeleton",{key:"d3f9ace5c8b12061ac94d929d926e8458fb66411",height:"30px"}),s("salla-skeleton",{key:"d0be03fc578e2559c0a5251875bac01519beb18f",height:"40px"})))),s("slot",{key:"86757c4d648dd818857aaee41c6df568724cbd1b",name:"header"}),this.hasError?s("salla-placeholder",{alignment:"center"},s("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),s("span",{slot:"description"}," ")):[s("div",{class:"s-gifting-modal-header"},s("span",{class:"s-gifting-modal-icon"},s("span",{innerHTML:h})),s("h2",{class:"s-gifting-modal-title"},s("div",{class:"s-gifting-modal-badge-wrapper"},!this.skipStep1()&&s("div",{class:"s-gifting-modal-badge"},s("span",null,s("span",null,this.currentStep),"/2")),s("span",null,this.giftDetails)))),s("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},!this.skipStep1()&&s("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},this.gift&&this.gift.show_images&&s("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),this.gift&&this.gift.show_images&&s("div",{class:"s-gifting-image-section"},s("div",{class:`s-gifting-modal-uploader anime-item ${this.disableClass}`,ref:t=>this.uploader=t},s("span",{class:"s-gifting-remove-preview pointer-events-auto",onClick:()=>this.removePreview(),innerHTML:a}),this.selectImageOrUpload&&this.gift&&s("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),s("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?s("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},s("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((t=>s("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(t)},s("img",{src:t.url,alt:`${t.id}`})))):"")):"")),this.gift&&this.gift.show_texts?s("div",{class:"anime-item"},s("div",{class:"s-gifting-modal-uploader-title s-gifting-text-title"},this.giftText),s("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},s("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},s("option",{"data-id":null,selected:!this.selectedGiftTextOption},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((t=>s("option",{"data-id":t.id,value:t.text,key:t.id,selected:String(this.selectedGiftTextOption)===String(t.id)},t.text))):"",this.gift&&this.gift.show_custom_text?s("option",{"data-id":"custom",selected:"custom"===this.selectedGiftTextOption},this.giftCustomText):null)),s("div",{class:this.showGiftText&&this.gift&&this.gift.show_custom_text?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},s("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),s("div",{class:"mt-1"},s("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))):null,s("div",{class:"anime-item"},s("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2(!!this.gift?.show_texts)},s("span",null,this.nextStep)))),s("div",{class:"s-gifting-step-two gift-step-2",style:this.skipStep1()?{opacity:"1",transform:"translateX(0)",position:"relative"}:void 0,ref:t=>this.step2Elems=t},s("div",{class:this.step2ItemClass(this.errors?.sender_name?"s-form-group s-form-has-error":"s-form-group")},s("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),s("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?s("span",{class:"s-gifting-error"},this.errors.sender_name):""),s("div",{class:this.step2ItemClass(this.errors?.["receiver.name"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),s("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?s("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),s("div",{class:this.step2ItemClass(this.errors?.["receiver.mobile"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label"},this.receiverMobileFieldLabel),s("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?s("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.country"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-country`},this.receiverCountryFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectCountry,items:this.gift?.countries??[],selectedItem:this.selectedCountry,disabled:!this.gift?.countries?.length,required:!0,inputId:`${this.hostId}-country`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleCountrySelected(t.detail),onDropdownClosed:()=>this.handleCountryDropdownClosed()}),this.errors&&this.errors["receiver.country"]?s("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),this.isPhysical()&&this.isKSA&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.region"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-region`},this.receiverRegionFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectRegion,items:this.regions??[],selectedItem:this.selectedRegion,loading:this.loadingRegions,disabled:this.loadingRegions||!this.regions?.length,required:!0,inputId:`${this.hostId}-region`,searchable:!1,keepParentScroll:!0,onItemSelected:t=>this.handleRegionSelected(t.detail),onDropdownClosed:()=>this.handleRegionDropdownClosed()}),this.errors&&this.errors["receiver.region"]?s("span",{class:"s-gifting-error"},this.errors["receiver.region"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass(this.errors?.["receiver.city_id"]?"s-form-group s-form-has-error":"s-form-group")},s("label",{class:"s-form-label",htmlFor:`${this.hostId}-city`},this.receiverCityFieldLabel),s("salla-searchable-dropdown",{placeholder:this.selectCity,items:this.displayedCities,selectedItem:this.selectedCity,loading:this.loadingCities,searching:this.searchingCities,disabled:this.loadingCities||this.isKSA&&!this.selectedRegionId,required:!0,inputId:`${this.hostId}-city`,searchQuery:this.citySearchQuery,clientSearch:!this.enableCityAjaxSearch,dropUp:!0,keepParentScroll:!0,onItemSelected:t=>this.handleCitySelected(t.detail),onSearchInput:t=>this.handleCitySearch(t.detail),onDropdownClosed:()=>this.handleCityDropdownClosed()}),this.errors&&this.errors["receiver.city_id"]?s("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),this.isPhysical()&&s("div",{class:this.step2ItemClass("s-gifting-info")},s("span",{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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),s("span",null,this.selectCityInfo)),!this.isPhysical()&&s("div",{class:this.step2ItemClass()},s("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:`schedule-${this.hostId}`},s("input",{type:"checkbox",name:"schedule",id:`schedule-${this.hostId}`,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),s("span",{class:"s-form-label"}," ",this.sendLater," "))),s("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},s("label",{class:"s-form-label"},this.selectSendDateAndTime),s("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),s("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),s("div",{class:this.step2ItemClass("s-gifting-step-two-footer")},!this.skipStep1()&&s("a",{href:"#!",innerHTML:e,onClick:t=>this.goToStep1(t)}),s("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},s("span",null,this.sendGift)))))],s("slot",{key:"052bb080776d8d874da570b643345b95a40cd985",name:"footer"})))]}};l.CITY_AJAX_THRESHOLD=400,l.CITY_SEARCH_DEBOUNCE_MS=100,l.style=".s-gifting-steps-wrapper{transition:height 0.8s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}.s-gifting-modal .s-searchable-dropdown-trigger{border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger--open,.s-gifting-modal .s-searchable-dropdown-trigger:focus{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-gifting-modal .s-searchable-dropdown-trigger-placeholder{color:#000}.s-gifting-modal .s-gifting-image-section{margin-bottom:1.5rem}.s-gifting-modal .s-gifting-slider{margin-bottom:0.5rem}.s-gifting-modal .s-gifting-image{display:block}.s-gifting-modal .s-gifting-image img{display:block;width:auto;height:100px;object-fit:contain}.s-gifting-modal .s-gifting-image-section+.anime-item .s-gifting-text-title{margin-top:1rem}";export{l as salla_gifting}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,c as e,a}from"./p-
|
|
4
|
+
import{r as s,h as t,c as e,a}from"./p-BqFb60iF.js";const c=class{constructor(t){s(this,t),this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}render(){return t("div",{key:"f5cfa9676bc8314149cb78e103b9ef580c0d7559",class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},t("slot",{key:"1b86591377c09f1acb25cda20024b3af9c6a874d"}))}};c.style="";const i=class{constructor(t){s(this,t),this.tabSelected=e(this,"tabSelected"),this.id=Math.random().toString(36).slice(2,10),this.activeClass=void 0,this.height=void 0,this.centered=!1,this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name,id:this.id}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}onClick(){this.getChild().then((s=>{this.tabSelected.emit(s)}))}render(){return[t("div",{key:"a9548ed2a74d30e6fcf365dbe26aa5f7fdab2468",class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},t("slot",{key:"547edd40aab5843c6035bd3c36a34d9449dc12d3"}))]}};i.style="";const h=class{constructor(t){s(this,t),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[s]=this.tabGroup;this.selectGroup(s)}))}onSelectedTab(s){const t=this.tabGroup.find((t=>t.header.id===s.detail.id));this.selectGroup(t)}async createGroup(){const s=Array.from(this.host.querySelectorAll("salla-tab-header"));this.tabsHeader=await Promise.all(s.map((async s=>await s.getChild())));const t=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(t.map((async s=>await s.getChild()))),this.tabGroup=this.tabsHeader.map((s=>{const t=this.tabsContent.find((t=>t.name===s.name));return{header:s,content:t}}))}selectGroup(s){this.tabGroup.map((s=>{s.header.unselect(),s.content.unselect()})),s.header.selected(),s.content.selected()}render(){return[t("div",{key:"e9054cb114c2bd66940b6afa98d7c7c230353a74",class:"s-tabs"},t("div",{key:"d245f64aef9b7fd77c9c51eb1d86ddfd9202e5fb",class:"s-tabs-header"},t("slot",{key:"f1b9a982cd746d637db5d514cb691f188af0cb7e",name:"header"})),t("div",{key:"0ba8441707b087a8c4d068b1a72bf10c8efb41cc",class:"s-tabs-content-wrapper"},t("slot",{key:"afcee28724a5a9ce263fcc3a38d624a631069945",name:"content"})))]}get host(){return a(this)}};h.style=".s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}";export{c as salla_tab_content,i as salla_tab_header,h as salla_tabs}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as i,a as s}from"./p-
|
|
4
|
+
import{r as t,h as i,a as s}from"./p-BqFb60iF.js";import{H as n}from"./p-BcbKK1Xp.js";import"./p-CgtvEd63.js";const a=class{constructor(i){t(this,i),this.itemPerPage=10,this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications"),this.load_more_text_trans=salla.lang.get("common.elements.load_more"),salla.lang.onLoaded((()=>{this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications"),this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=!0){let i=this.status?.querySelector(".s-button-text");i&&(n.toggleElementClassIf(i,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}getNotificationCard(t){const i=document.createElement("salla-notification-item");return i.notification=t,i.classList.add("s-block"),i}render(){return this.showPlaceholder?i("div",{class:"s-notifications-no-content"},i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.no_notifications_trans))):i("div",{class:"s-notifications-wrapper"},i("div",{class:"s-notifications-container",ref:t=>this.wrapper=t}),this.nextPage&&i("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},i("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText??this.load_more_text_trans),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}isV2Response(t){return!!t.cursor}normalizeNotification(t){return{title:t.title,sub_title:t.body,date:t.time_ago,is_new:!t.is_read,url:t.url}}normalizePagination(t){return{count:t.count,currentPage:t.current,links:{next:null!=t.next?String(t.next):void 0}}}normalizeResponse(t){return this.isV2Response(t)?{data:(t.data||[]).map((t=>this.normalizeNotification(t))),pagination:this.normalizePagination(t.cursor)}:t}handleResponse(t){return t.map((t=>this.getNotificationCard(t)))}initiateInfiniteScroll(){this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!0,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(t=>{this.loading(!1);const i=this.normalizeResponse(t);this.pagination=i.pagination,this.nextPage=i.pagination.links?.next||null,this.handleResponse(i.data).forEach((t=>this.wrapper.append(t)));let s=this.host.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(s)})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.")}async loadInitialData(){await salla.api.notifications.fetch({per_page:this.itemPerPage}).then((t=>{const i=this.normalizeResponse(t);this.pagination=i.pagination,this.total=i.pagination.total,this.nextPage=i.pagination.links?.next||null,setTimeout((()=>{if(!i.data.length)return this.showPlaceholder=!0;this.handleResponse(i.data).forEach((t=>this.wrapper.append(t))),this.initiateInfiniteScroll();let t=this.wrapper.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(t)}),100)})).catch((t=>{salla.logger.error(t),this.showPlaceholder=!0,this.loading(!1)}))}async loadMore(){this.infiniteScroll?.loadNextPage()}async componentWillLoad(){await this.loadInitialData()}get host(){return s(this)}};a.style="";export{a as salla_notifications}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as s,H as l,a as e}from"./p-DOBNIJGF.js";import{c as o,f as t,i as r}from"./p-BQ1TYsqI.js";import{S as i}from"./p-CXRKXFgT.js";import{S as c}from"./p-D1s2kXqL.js";import{S as n}from"./p-QpH8MU22.js";import{S as p}from"./p-cgSL_BIo.js";import{e as y}from"./p-DzAIgzdz.js";import{S as d}from"./p-BkmanTR_.js";import{S as m}from"./p-CciN5Q_x.js";import{L as g}from"./p-BO5AoBAP.js";import{S as h}from"./p-CZRcMGA9.js";const _=class{constructor(s){a(this,s)}render(){return s(l,{key:"c0060bac9958abfd0fe8e60a9b24c48d3a44f808"},s("section",{key:"23529c848e4b44e10aef943457926d7fb4053e42",class:"s-loyalty-program-hero-container"},s("div",{key:"d2a7042e02f8a6a7a40f34f445fac4bed07c26e7",class:"s-loyalty-program-hero-background",style:{backgroundImage:`url(${this.image})`}},this.image?s("div",{class:"s-loyalty-program-hero-overlay"}):"",s("div",{key:"d8b5459d499161ee6c79e5c67dc7c50f4be241ff",class:{"s-loyalty-program-hero-content":!0,"s-loyalty-program-hero-white":!!this.image,"s-loyalty-program-hero-gray":!this.image}},s("div",{key:"26ef4c09f27d93b96c0e12f7998484fa73837b6c"},s("h1",{key:"2930af83fa736285c220fca7c241e08f7f67267a",class:"s-loyalty-program-hero-title"},this.name||s("span",{key:"c6a170b91e43f8321a350c95c85c4f0bf24e0d2d",style:{color:"transparent",backgroundColor:"#666",borderRadius:"12px"}},"name")),s("p",{key:"2558c1947c3cb1e78ddd396b596d72a9e62f408d",class:"s-loyalty-program-hero-description"},this.description||s("span",{key:"363b97050db887cd8c05db1feec3fb834d7f48bb",style:{color:"transparent",backgroundColor:"#666",borderRadius:"12px"}},"description"))),s("slot",{key:"27ca29dfcd2cd5d176f22a7cf43ef26343ccf2e8",name:"action"}))),s("div",{key:"a39534b8f093ff4e2373367a1e10bf2d9a986f37",class:"s-loyalty-program-hero-footer"},s("div",{key:"10ccbf09e4e643255df236cc0d2ad55894a420ea",class:"s-loyalty-program-hero-slot-container"},s("slot",{key:"33973737797d6f5303f0e1435768816eea7450c5",name:"crosspoint"})))))}};_.style="";var f='\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>link1</title>\n<path d="M16.541 19.873c-0.489 0.205-0.825 0.68-0.825 1.233 0 0.184 0.037 0.359 0.105 0.519l-0.003-0.009c0.064 0.151 0.101 0.326 0.101 0.51 0 0.368-0.149 0.702-0.391 0.943v0l-3.771 3.772c-0.483 0.482-1.149 0.781-1.885 0.781s-1.403-0.298-1.885-0.781l-2.829-2.828c-0.483-0.483-0.781-1.149-0.781-1.886s0.299-1.403 0.781-1.886l3.776-3.771c0.244-0.24 0.578-0.388 0.948-0.388 0.183 0 0.357 0.036 0.516 0.102l-0.009-0.003c0.15 0.064 0.325 0.101 0.509 0.101 0.736 0 1.334-0.597 1.334-1.334 0-0.553-0.337-1.027-0.816-1.229l-0.009-0.003c-0.449-0.187-0.97-0.295-1.517-0.295-1.107 0-2.11 0.445-2.841 1.165l0-0-3.776 3.771c-0.963 0.966-1.559 2.299-1.559 3.771s0.596 2.805 1.559 3.771l2.829 2.828c0.965 0.965 2.298 1.562 3.771 1.562s2.806-0.597 3.771-1.562l3.772-3.771c0.723-0.725 1.171-1.726 1.171-2.832 0-0.551-0.111-1.076-0.312-1.555l0.010 0.026c-0.206-0.488-0.68-0.824-1.232-0.824-0.184 0-0.359 0.037-0.518 0.104l0.009-0.003z"></path>\n<path d="M10.343 21.655c0.243 0.238 0.576 0.384 0.943 0.384s0.7-0.147 0.943-0.385l-0 0 10.372-10.371c0.232-0.24 0.374-0.566 0.374-0.926 0-0.736-0.597-1.333-1.333-1.333-0.36 0-0.687 0.143-0.927 0.375l-10.372 10.37c-0.241 0.241-0.39 0.575-0.39 0.943s0.149 0.701 0.39 0.943v0z"></path>\n<path d="M28.728 6.099l-2.828-2.828c-0.966-0.963-2.299-1.559-3.771-1.559s-2.805 0.596-3.771 1.559l-3.772 3.771c-0.723 0.725-1.171 1.726-1.171 2.831 0 0.551 0.111 1.076 0.313 1.554l-0.010-0.026c0.206 0.488 0.68 0.824 1.233 0.824 0.737 0 1.334-0.597 1.334-1.334 0-0.184-0.037-0.359-0.104-0.518l0.003 0.009c-0.063-0.15-0.1-0.324-0.1-0.506 0-0.368 0.149-0.7 0.389-0.942l3.771-3.771c0.483-0.483 1.149-0.781 1.886-0.781s1.403 0.299 1.886 0.781l2.828 2.828c0.483 0.483 0.781 1.149 0.781 1.886s-0.299 1.403-0.781 1.886v0l-3.776 3.764c-0.244 0.24-0.579 0.388-0.948 0.388-0.183 0-0.357-0.036-0.515-0.102l0.009 0.003c-0.151-0.064-0.326-0.101-0.51-0.101-0.737 0-1.334 0.597-1.334 1.334 0 0.553 0.336 1.027 0.815 1.229l0.009 0.003c0.45 0.189 0.974 0.298 1.523 0.298 1.106 0 2.109-0.445 2.838-1.167l3.77-3.77c0.965-0.966 1.562-2.301 1.562-3.775 0-1.471-0.595-2.803-1.557-3.769l0 0z"></path>\n</svg>\n';const b=(...a)=>a.map((a=>"s-loyalty-program-"+a)).join(" "),v={FIRST_ORDER_STORE_FOR_UNIT:s("span",{innerHTML:c}),FIRST_ORDER_STORE_FOR_UNIT_BY_CATEGORIES:s("span",{innerHTML:c}),FIRST_ORDER_STORE_FIX_AMOUNT:s("span",{innerHTML:c}),FIRST_ORDER_STORE_FIX_AMOUNT_BY_CATEGORIES:s("span",{innerHTML:c}),ORDER_FROM_APP_FOR_UNIT:s("span",{innerHTML:c}),ORDER_FROM_APP_FOR_UNIT_BY_CATEGORIES:s("span",{innerHTML:c}),ORDER_FROM_APP_FIX_AMOUNT:s("span",{innerHTML:c}),ORDER_FROM_APP_FIX_AMOUNT_BY_CATEGORIES:s("span",{innerHTML:c}),CONDITION_RATING_SHIPPING_STORE:s("span",{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</title>\n<path d="M27.25 16c-1.539-0.010-2.899-0.765-3.741-1.921l-0.009-0.013c-0.844 1.178-2.209 1.936-3.75 1.936s-2.906-0.758-3.741-1.922l-0.009-0.014c-0.844 1.178-2.209 1.936-3.75 1.936s-2.906-0.758-3.741-1.922l-0.009-0.014c-0.851 1.169-2.211 1.924-3.748 1.934h-0.002c-2.64-0.075-4.751-2.233-4.751-4.884 0-0.041 0.001-0.081 0.002-0.122l-0 0.006c0-0.086 0.011-0.169 0.032-0.249l-0.002 0.007 2-8c0.112-0.439 0.504-0.758 0.97-0.758h26c0.466 0 0.858 0.319 0.968 0.751l0.002 0.007 2 8c0.019 0.073 0.030 0.156 0.030 0.242v0c0.001 0.034 0.001 0.075 0.001 0.116 0 2.651-2.111 4.809-4.744 4.884l-0.007 0zM23.5 10c0.552 0 1 0.448 1 1v0c-0.006 0.069-0.010 0.149-0.010 0.23 0 1.522 1.234 2.756 2.756 2.756s2.756-1.234 2.756-2.756c0-0.040-0.001-0.080-0.003-0.12l0 0.006-1.782-7.116h-24.436l-1.782 7.116c0 0.003-0 0.007-0 0.011 0 1.544 1.217 2.804 2.744 2.873l0.006 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1s1 0.448 1 1v0c-0.002 0.035-0.002 0.076-0.002 0.117 0 1.547 1.217 2.81 2.746 2.883l0.007 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1s1 0.448 1 1v0c-0.002 0.035-0.002 0.076-0.002 0.117 0 1.547 1.217 2.81 2.746 2.883l0.007 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1v0zM13 30h-10c-0.552 0-1-0.448-1-1v0-14.46c0-0.552 0.448-1 1-1s1 0.448 1 1v0 13.46h9c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM29 30h-10c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h9v-13.46c0-0.552 0.448-1 1-1s1 0.448 1 1v0 14.46c0 0.552-0.448 1-1 1v0zM19 30c-0.552 0-1-0.448-1-1v0-7h-4v7c0 0.552-0.448 1-1 1s-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1v0h6c0.552 0 1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0z"></path>\n</svg>\n'}),CONDITION_RATING_PRODUCT:s("span",{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>chat-conversation-alt</title>\n<path d="M17.333 14.667h-8c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h8c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM22.667 8h-13.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h13.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28 0h-24c-2.205 0-4 1.795-4 4v17.333c0 2.205 1.795 4 4 4h6.027l4.932 6.167c0.253 0.316 0.636 0.5 1.041 0.5s0.788-0.184 1.041-0.5l4.932-6.167h6.027c2.205 0 4-1.795 4-4v-17.333c0-2.205-1.795-4-4-4zM29.333 21.333c0 0.735-0.597 1.333-1.333 1.333h-6.667c-0.405 0-0.788 0.184-1.041 0.5l-4.292 5.365-4.292-5.365c-0.253-0.316-0.636-0.5-1.041-0.5h-6.667c-0.736 0-1.333-0.599-1.333-1.333v-17.333c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n'}),CONDITION_RATING_SHIPPING_COMPANY:s("span",{innerHTML:h}),CONDITION_COMPLETE_PERSONAL_INFORMATION_BIRTHDAY:s("span",{innerHTML:d}),CONDITION_COMPLETE_PERSONAL_INFORMATION_EMAIL:s("span",{innerHTML:y}),CONDITION_COMPLETE_PERSONAL_INFORMATION_MOBILE:s("span",{innerHTML:m}),CONDITION_COMPLETE_PERSONAL_INFORMATION_GENDER:s("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user</title>\n<path d="M16 16c4.412 0 8-3.588 8-8s-3.588-8-8-8-8 3.588-8 8 3.588 8 8 8zM16 2.667c2.941 0 5.333 2.392 5.333 5.333s-2.392 5.333-5.333 5.333-5.333-2.392-5.333-5.333 2.392-5.333 5.333-5.333zM16 18.667c-7.476 0-13.333 3.66-13.333 8.333v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-3.019 4.984-5.667 10.667-5.667s10.667 2.648 10.667 5.667v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-4.673-5.857-8.333-13.333-8.333z"></path>\n</svg>\n'}),CONDITION_BUY_FROM_STORE_FOR_UNIT:s("span",{innerHTML:c}),CONDITION_BUY_FROM_STORE_FOR_UNIT_BY_CATEGORIES:s("span",{innerHTML:c}),CONDITION_BUY_FROM_STORE_FIX_AMOUNT:s("span",{innerHTML:c}),CONDITION_BUY_FROM_STORE_FIX_AMOUNT_BY_CATEGORIES:s("span",{innerHTML:c}),order_from_pos_1:s("span",{innerHTML:m}),order_from_pos_2:s("span",{innerHTML:g}),buy_from_pos_1:s("span",{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>map-location</title>\n<path d="M24.667 8.013v-0.013c0-0.736-0.597-1.327-1.333-1.327s-1.333 0.604-1.333 1.34 0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333zM30.667 18.667c-0.736 0-1.333 0.596-1.333 1.333v8.701l-7.879-3.135c-0.308-0.127-0.651-0.127-0.961-0.011l-9.817 3.684-8.009-3.121v-20.351l7.633 2.181c0.708 0.205 1.447-0.209 1.648-0.916 0.203-0.708-0.207-1.447-0.915-1.648l-9.333-2.667c-0.403-0.115-0.836-0.035-1.169 0.217-0.335 0.252-0.531 0.645-0.531 1.064v23.029c0 0.549 0.337 1.043 0.849 1.243l9.333 3.637c0.305 0.12 0.645 0.12 0.952 0.007l9.812-3.68 9.227 3.669c0.16 0.064 0.327 0.095 0.493 0.095 0.263 0 0.525-0.079 0.749-0.231 0.365-0.247 0.584-0.661 0.584-1.103v-10.667c0-0.737-0.597-1.333-1.333-1.333zM23.333 22.667c0.395 0 0.769-0.175 1.023-0.476 0.783-0.935 7.644-9.241 7.644-13.357 0-4.389-2.976-8.833-8.667-8.833-5.689 0-8.667 4.444-8.667 8.833 0 4.116 6.863 12.423 7.645 13.357 0.253 0.301 0.628 0.476 1.021 0.476zM23.333 2.667c4.145 0 6 3.097 6 6.167 0 2.095-3.347 7.027-6 10.385-2.653-3.36-6-8.291-6-10.385 0-3.069 1.856-6.167 6-6.167z"></path>\n</svg>\n'}),buy_from_pos_2:s("span",{innerHTML:m}),CONDITION_BUY_FROM_POS_FOR_UNIT:s("span",{innerHTML:m}),CONDITION_BUY_FROM_POS_FOR_UNIT_BY_CATEGORIES:s("span",{innerHTML:m}),CONDITION_BUY_FROM_POS_FIX_AMOUNT:s("span",{innerHTML:m}),CONDITION_BUY_FROM_POS_FIX_AMOUNT_BY_CATEGORIES:s("span",{innerHTML:m}),affiliate_link_1:s("span",{innerHTML:f}),affiliate_link_2:s("span",{innerHTML:n}),affiliate_link_3:s("span",{innerHTML:c}),CONDITION_AFFILIATE_LINK:s("span",{innerHTML:f})},O=class{constructor(s){a(this,s)}async handleShareAction(a,s,l){const e=window.matchMedia("(min-width: 1024px)").matches;if("share"in navigator&&!e)try{return void await navigator.share({title:document.title,url:s.url})}catch(a){}const o=a.target,t=o.textContent,r=l;if("clipboard"in navigator)try{return await navigator.clipboard.writeText(s.url),o.textContent=r,void setTimeout((()=>{o.textContent=t}),5e3)}catch(a){}const i=document.createElement("textarea");i.value=s.url,i.style.opacity="0",this.host.appendChild(i),i.focus(),i.select();try{if(!document.execCommand("copy"))throw new Error("Failed to copy URL to clipboard");o.textContent=r,setTimeout((()=>{o.textContent=t}),5e3)}catch(a){}this.host.removeChild(i)}handleAction(a,s){if(a.stopPropagation(),s.is_completed)a.preventDefault();else switch(s.type){case"profile":case"rating":return salla.config.isUser()?void 0:(a.preventDefault(),void o((()=>salla.event.dispatch("login::open"))));case"share":return salla.config.isUser()?(a.preventDefault(),void this.handleShareAction(a,s,salla.lang.get("pages.loyalty_program.copied"))):(a.preventDefault(),void o((()=>salla.event.dispatch("login::open"))))}}getSubHeading(a){switch(a.type){case"share":return s("div",{class:"s-loyalty-program-point-subheading"},s("h2",null,salla.lang.get("pages.loyalty_program.how_to_start")),s("p",null,salla.lang.get("pages.loyalty_program.three_simple_steps")));case"pos":return s("div",{class:"s-loyalty-program-point-subheading"},s("h2",null,salla.lang.get("pages.loyalty_program.how_to_start")),s("p",null,salla.lang.get("pages.loyalty_program.two_simple_steps")));default:return""}}getDetails(a){return a.conditions.filter((a=>a.key.endsWith("_BY_CATEGORIES"))).length>0?s("div",null,s("div",{class:"s-loyalty-program-point-subheading"},s("h2",null,salla.lang.get("pages.loyalty_program.how_to_use")),s("p",null,salla.lang.get("pages.loyalty_program.how_to_use_steps"))),s("div",{class:"s-loyalty-program-points-modal-details"},a.conditions.map((l=>s("div",{class:"s-loyalty-program-points-chains-wrapper mt-5 mb-5"},s("div",{class:"s-loyalty-program-points-chain-item"},s("div",{class:"s-loyalty-program-points-chain-icon"},s("div",{class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xs s-loyalty-program-circle-variant-outline-primary"},v[l.key])),s("div",{class:"s-loyalty-program-points-chain-content"},s("salla-badge",{size:"xs",color:"primary-900",bg:"primary-100"},s("span",{innerHTML:i}),t(l.points,r(a))),s("p",{class:"s-loyalty-program-points-chain-description"},l.name),s("div",null,this.getCategoriesJsx(l.value))))))))):s("div",{class:"s-loyalty-program-points-modal-details"},s("div",{class:"s-loyalty-program-points-chains-wrapper mt-5 mb-5"},s("ul",{class:"s-loyalty-program-points-chain-list"},this.point.conditions.map((l=>s("li",{class:"s-loyalty-program-points-chain-item"},s("div",{class:"s-loyalty-program-points-chain-icon"},s("div",{class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xs s-loyalty-program-circle-variant-outline-primary"},v[l.key]),s("div",{class:"s-loyalty-program-points-chain-line"})),s("div",{class:"s-loyalty-program-points-chain-content"},s("salla-badge",{size:"xs",color:"primary-900",bg:"primary-100"},s("span",{innerHTML:i}),t(l.points,r(a),null!=l.value)),s("p",{class:"s-loyalty-program-points-chain-description"},l.name))))))))}getCategoriesJsx(a){return a.length?s("ul",{class:b("reward-details-categories-list")},a.map((a=>s("li",null,s("a",{href:a.url,class:b("reward-details-categories-item")},s("span",{innerHTML:p}),s("span",{class:b("reward-details-categories-item-content")},a.name)))))):""}getTrailingContent(a){switch(a.type){case"first_order":case"profile":return s("p",{class:"s-loyalty-program-points-completed-note"},salla.lang.get("pages.loyalty_program.one_time_points"));default:return a.is_completed?s("p",{class:"s-loyalty-program-points-completed-note"},salla.lang.get("pages.loyalty_program.one_time_points")):""}}render(){return s("div",{key:"ddfb0e0ffb4c23f7cab43dd994e25ba7c599a931"},s("div",{key:"a2fe514f59b0e01fc6e22011b6734d7ba97e951e",onClick:()=>o((()=>this.modal.open())),class:"s-loyalty-program-point-wrapper"},s("div",{key:"486b61a56b739a881de4ff0581a19ef91fbfc2e8",class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-sm s-loyalty-program-circle-variant-fill"},s("span",{key:"15f77554d8af1f65a66bf788cae341fe9f8f0fa3",class:this.point.icon})),s("div",{key:"2921be35f4d122e1a4580ed625832e4f33d69276",class:"s-loyalty-program-points-badge-mobile"},s("salla-badge",{key:"c809f65f9c93553e595fc995b76070a6a065e9d8",size:"xs",bg:"transparent"},s("span",{key:"d76ddeb873ac19f91b3cfe8af5837feb096cd7ca",innerHTML:i}),t(this.point))),s("div",{key:"18674b523984b6ca91afcee873e219571f867fcf",class:"s-loyalty-program-points-badge-desktop"},s("salla-badge",{key:"7ebbee57d2858f1ba372fd4b0b42771e394e330f",size:"sm",bg:"transparent"},s("span",{key:"41a93def0e2e54b4e6e036222e212703fe9ef88f",innerHTML:i}),t(this.point))),s("p",{key:"acfa0ed98f398b591cb22e828ca677d37007e4e6",class:"s-loyalty-program-point-description"},this.point.name),this.point.is_completed?s("a",{class:{"s-loyalty-program-points-action":!0,"s-loyalty-program-points-action-completed":this.point.is_completed,"s-loyalty-program-points-action-incomplete":!this.point.is_completed}},salla.lang.get("pages.loyalty_program.completed")):s("a",{href:this.point.url,onClick:a=>this.handleAction(a,this.point),class:{"s-loyalty-program-points-action":!0,"s-loyalty-program-points-action-completed":this.point.is_completed,"s-loyalty-program-points-action-incomplete":!this.point.is_completed}},this.point.description)),s("salla-modal",{key:"7c9f4dce935ba3e1f841aab57de04013e2fb983f",ref:a=>this.modal=a,class:"s-loyalty-program-point-modal s-loyalty-program-modal",width:window.matchMedia("(min-width: 768px)").matches?"md":"sm",noPadding:!0},s("div",{key:"5e1dbd60526ae8450ce6453c04ea244ef1a96697",class:"s-loyalty-program-points-modal-header"},s("h1",{key:"b43153fe19ffa308d5bd4126c9bd0fd43f1379ea",class:"s-loyalty-program-points-modal-info"},this.point.name)),s("div",{key:"5d8f1cad86fd916f984f5baa07ff7fb18afeda68",class:"s-loyalty-program-modal-scrollable-content"},s("div",{key:"69c4e3f2d513ec6c52caaa31ab3e7c886c0827a0",class:"s-loyalty-program-points-modal-main"},s("div",{key:"539a7713a22f64e9e4157dcd288ceca49910a449",class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xl s-loyalty-program-circle-variant-fill"},s("span",{key:"5249f670969022167be8b11bff3ec8c75b4f0a5b",class:this.point.icon})),s("salla-badge",{key:"e19decc72866ca36e3cc52c9822fc4677816bbda",size:"sm",bg:"light"},s("span",{key:"f2ed0ef699b63ce091c2b7dc5d30341bb0dcf713",innerHTML:i}),s("span",{key:"54275a2ec227c9415e77f88051bbf4e36d10489e",class:"s-loyalty-program-points-badge-points"},t(this.point)))),this.getSubHeading(this.point),!!this.point.steps&&Object.keys(this.point.steps).length>0&&s("div",{key:"7b8d4168a96586efa2855f169536a0577750cabe",class:"s-loyalty-program-points-modal-details"},s("div",{key:"102274da4418a7119e65c6a5c44630315e348c98",class:"s-loyalty-program-points-chains-wrapper"},s("ul",{key:"9a87e3fcb31ab6a0b984fe3fd43b9b57678b4600",class:"s-loyalty-program-points-chain-list"},Object.values(this.point.steps).map(((a,l)=>{const e=l===Object.values(this.point.steps).length-1;return s("li",{class:"s-loyalty-program-points-chain-item"},s("div",{class:"s-loyalty-program-points-chain-icon"},s("div",{class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xs s-loyalty-program-circle-variant-outline-primary"},v[a.key]),!e&&s("div",{class:"s-loyalty-program-points-chain-line"})),s("div",{class:"s-loyalty-program-points-chain-content"},s("salla-badge",{size:"xs",color:"primary-900",bg:"primary-100"},s("span",null,salla.lang.get(`pages.loyalty_program.step_${l+1}`))),s("p",{class:"s-loyalty-program-points-chain-description"},a.title||a.name)))}))))),this.getDetails(this.point),s("div",{key:"7c96d9b4014f2b531cf85f0f4dd9c797f6b4e352",class:"s-loyalty-program-points-modal-details"},this.getTrailingContent(this.point)),this.point.branches?.length?s("div",{class:"s-loyalty-program-points-modal-list"},s("div",{class:"s-loyalty-program-point-details-branches"},s("h2",null,salla.lang.get("pages.loyalty_program.branches")),s("p",null,salla.lang.get("pages.loyalty_program.shop_from_branches"))),s("div",{class:"s-loyalty-program-points-modal-list-wrapper"},s("ul",null,this.point.branches.map((a=>s("li",{class:"s-loyalty-program-points-modal-list-item"},s("p",null,a.name),s("salla-badge",{size:"sm",bg:"transparent"},s("span",{innerHTML:i}),s("a",{href:a.location?`https://www.google.com/maps?q=${a.location.lat},${a.location.lon}`:"#",target:"_blank",rel:"noopener noreferrer"},a.address_description)))))))):""),s("div",{key:"79a6d37b6af82a40b5b88f1a7e03034c3ac9fe90",class:"s-loyalty-program-points-modal-action"},s("a",{key:"6498d88e64af28621281b8c12b28c1a22473001d",href:this.point.url,onClick:a=>(a.stopPropagation(),this.handleAction(a,this.point)),class:{"s-loyalty-program-points-action":!0,"s-loyalty-program-points-action-completed":this.point.is_completed,"s-loyalty-program-points-action-incomplete":!this.point.is_completed}},this.point.is_completed?salla.lang.get("pages.loyalty_program.completed"):this.point.description))))}get host(){return e(this)}};O.style="";export{_ as salla_loyalty_hero,O as salla_loyalty_point}
|
|
4
|
+
import{r as a,h as s,H as l,a as e}from"./p-BqFb60iF.js";import{c as o,f as t,i as r}from"./p-DsHyM0bg.js";import{S as i}from"./p-CXRKXFgT.js";import{S as c}from"./p-D1s2kXqL.js";import{S as n}from"./p-QpH8MU22.js";import{S as p}from"./p-cgSL_BIo.js";import{e as y}from"./p-DzAIgzdz.js";import{S as d}from"./p-BkmanTR_.js";import{S as m}from"./p-CciN5Q_x.js";import{L as g}from"./p-BO5AoBAP.js";import{S as h}from"./p-CZRcMGA9.js";const _=class{constructor(s){a(this,s)}render(){return s(l,{key:"c0060bac9958abfd0fe8e60a9b24c48d3a44f808"},s("section",{key:"23529c848e4b44e10aef943457926d7fb4053e42",class:"s-loyalty-program-hero-container"},s("div",{key:"d2a7042e02f8a6a7a40f34f445fac4bed07c26e7",class:"s-loyalty-program-hero-background",style:{backgroundImage:`url(${this.image})`}},this.image?s("div",{class:"s-loyalty-program-hero-overlay"}):"",s("div",{key:"d8b5459d499161ee6c79e5c67dc7c50f4be241ff",class:{"s-loyalty-program-hero-content":!0,"s-loyalty-program-hero-white":!!this.image,"s-loyalty-program-hero-gray":!this.image}},s("div",{key:"26ef4c09f27d93b96c0e12f7998484fa73837b6c"},s("h1",{key:"2930af83fa736285c220fca7c241e08f7f67267a",class:"s-loyalty-program-hero-title"},this.name||s("span",{key:"c6a170b91e43f8321a350c95c85c4f0bf24e0d2d",style:{color:"transparent",backgroundColor:"#666",borderRadius:"12px"}},"name")),s("p",{key:"2558c1947c3cb1e78ddd396b596d72a9e62f408d",class:"s-loyalty-program-hero-description"},this.description||s("span",{key:"363b97050db887cd8c05db1feec3fb834d7f48bb",style:{color:"transparent",backgroundColor:"#666",borderRadius:"12px"}},"description"))),s("slot",{key:"27ca29dfcd2cd5d176f22a7cf43ef26343ccf2e8",name:"action"}))),s("div",{key:"a39534b8f093ff4e2373367a1e10bf2d9a986f37",class:"s-loyalty-program-hero-footer"},s("div",{key:"10ccbf09e4e643255df236cc0d2ad55894a420ea",class:"s-loyalty-program-hero-slot-container"},s("slot",{key:"33973737797d6f5303f0e1435768816eea7450c5",name:"crosspoint"})))))}};_.style="";var f='\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>link1</title>\n<path d="M16.541 19.873c-0.489 0.205-0.825 0.68-0.825 1.233 0 0.184 0.037 0.359 0.105 0.519l-0.003-0.009c0.064 0.151 0.101 0.326 0.101 0.51 0 0.368-0.149 0.702-0.391 0.943v0l-3.771 3.772c-0.483 0.482-1.149 0.781-1.885 0.781s-1.403-0.298-1.885-0.781l-2.829-2.828c-0.483-0.483-0.781-1.149-0.781-1.886s0.299-1.403 0.781-1.886l3.776-3.771c0.244-0.24 0.578-0.388 0.948-0.388 0.183 0 0.357 0.036 0.516 0.102l-0.009-0.003c0.15 0.064 0.325 0.101 0.509 0.101 0.736 0 1.334-0.597 1.334-1.334 0-0.553-0.337-1.027-0.816-1.229l-0.009-0.003c-0.449-0.187-0.97-0.295-1.517-0.295-1.107 0-2.11 0.445-2.841 1.165l0-0-3.776 3.771c-0.963 0.966-1.559 2.299-1.559 3.771s0.596 2.805 1.559 3.771l2.829 2.828c0.965 0.965 2.298 1.562 3.771 1.562s2.806-0.597 3.771-1.562l3.772-3.771c0.723-0.725 1.171-1.726 1.171-2.832 0-0.551-0.111-1.076-0.312-1.555l0.010 0.026c-0.206-0.488-0.68-0.824-1.232-0.824-0.184 0-0.359 0.037-0.518 0.104l0.009-0.003z"></path>\n<path d="M10.343 21.655c0.243 0.238 0.576 0.384 0.943 0.384s0.7-0.147 0.943-0.385l-0 0 10.372-10.371c0.232-0.24 0.374-0.566 0.374-0.926 0-0.736-0.597-1.333-1.333-1.333-0.36 0-0.687 0.143-0.927 0.375l-10.372 10.37c-0.241 0.241-0.39 0.575-0.39 0.943s0.149 0.701 0.39 0.943v0z"></path>\n<path d="M28.728 6.099l-2.828-2.828c-0.966-0.963-2.299-1.559-3.771-1.559s-2.805 0.596-3.771 1.559l-3.772 3.771c-0.723 0.725-1.171 1.726-1.171 2.831 0 0.551 0.111 1.076 0.313 1.554l-0.010-0.026c0.206 0.488 0.68 0.824 1.233 0.824 0.737 0 1.334-0.597 1.334-1.334 0-0.184-0.037-0.359-0.104-0.518l0.003 0.009c-0.063-0.15-0.1-0.324-0.1-0.506 0-0.368 0.149-0.7 0.389-0.942l3.771-3.771c0.483-0.483 1.149-0.781 1.886-0.781s1.403 0.299 1.886 0.781l2.828 2.828c0.483 0.483 0.781 1.149 0.781 1.886s-0.299 1.403-0.781 1.886v0l-3.776 3.764c-0.244 0.24-0.579 0.388-0.948 0.388-0.183 0-0.357-0.036-0.515-0.102l0.009 0.003c-0.151-0.064-0.326-0.101-0.51-0.101-0.737 0-1.334 0.597-1.334 1.334 0 0.553 0.336 1.027 0.815 1.229l0.009 0.003c0.45 0.189 0.974 0.298 1.523 0.298 1.106 0 2.109-0.445 2.838-1.167l3.77-3.77c0.965-0.966 1.562-2.301 1.562-3.775 0-1.471-0.595-2.803-1.557-3.769l0 0z"></path>\n</svg>\n';const b=(...a)=>a.map((a=>"s-loyalty-program-"+a)).join(" "),v={FIRST_ORDER_STORE_FOR_UNIT:s("span",{innerHTML:c}),FIRST_ORDER_STORE_FOR_UNIT_BY_CATEGORIES:s("span",{innerHTML:c}),FIRST_ORDER_STORE_FIX_AMOUNT:s("span",{innerHTML:c}),FIRST_ORDER_STORE_FIX_AMOUNT_BY_CATEGORIES:s("span",{innerHTML:c}),ORDER_FROM_APP_FOR_UNIT:s("span",{innerHTML:c}),ORDER_FROM_APP_FOR_UNIT_BY_CATEGORIES:s("span",{innerHTML:c}),ORDER_FROM_APP_FIX_AMOUNT:s("span",{innerHTML:c}),ORDER_FROM_APP_FIX_AMOUNT_BY_CATEGORIES:s("span",{innerHTML:c}),CONDITION_RATING_SHIPPING_STORE:s("span",{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</title>\n<path d="M27.25 16c-1.539-0.010-2.899-0.765-3.741-1.921l-0.009-0.013c-0.844 1.178-2.209 1.936-3.75 1.936s-2.906-0.758-3.741-1.922l-0.009-0.014c-0.844 1.178-2.209 1.936-3.75 1.936s-2.906-0.758-3.741-1.922l-0.009-0.014c-0.851 1.169-2.211 1.924-3.748 1.934h-0.002c-2.64-0.075-4.751-2.233-4.751-4.884 0-0.041 0.001-0.081 0.002-0.122l-0 0.006c0-0.086 0.011-0.169 0.032-0.249l-0.002 0.007 2-8c0.112-0.439 0.504-0.758 0.97-0.758h26c0.466 0 0.858 0.319 0.968 0.751l0.002 0.007 2 8c0.019 0.073 0.030 0.156 0.030 0.242v0c0.001 0.034 0.001 0.075 0.001 0.116 0 2.651-2.111 4.809-4.744 4.884l-0.007 0zM23.5 10c0.552 0 1 0.448 1 1v0c-0.006 0.069-0.010 0.149-0.010 0.23 0 1.522 1.234 2.756 2.756 2.756s2.756-1.234 2.756-2.756c0-0.040-0.001-0.080-0.003-0.12l0 0.006-1.782-7.116h-24.436l-1.782 7.116c0 0.003-0 0.007-0 0.011 0 1.544 1.217 2.804 2.744 2.873l0.006 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1s1 0.448 1 1v0c-0.002 0.035-0.002 0.076-0.002 0.117 0 1.547 1.217 2.81 2.746 2.883l0.007 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1s1 0.448 1 1v0c-0.002 0.035-0.002 0.076-0.002 0.117 0 1.547 1.217 2.81 2.746 2.883l0.007 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1v0zM13 30h-10c-0.552 0-1-0.448-1-1v0-14.46c0-0.552 0.448-1 1-1s1 0.448 1 1v0 13.46h9c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM29 30h-10c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h9v-13.46c0-0.552 0.448-1 1-1s1 0.448 1 1v0 14.46c0 0.552-0.448 1-1 1v0zM19 30c-0.552 0-1-0.448-1-1v0-7h-4v7c0 0.552-0.448 1-1 1s-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1v0h6c0.552 0 1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0z"></path>\n</svg>\n'}),CONDITION_RATING_PRODUCT:s("span",{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>chat-conversation-alt</title>\n<path d="M17.333 14.667h-8c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h8c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM22.667 8h-13.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h13.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28 0h-24c-2.205 0-4 1.795-4 4v17.333c0 2.205 1.795 4 4 4h6.027l4.932 6.167c0.253 0.316 0.636 0.5 1.041 0.5s0.788-0.184 1.041-0.5l4.932-6.167h6.027c2.205 0 4-1.795 4-4v-17.333c0-2.205-1.795-4-4-4zM29.333 21.333c0 0.735-0.597 1.333-1.333 1.333h-6.667c-0.405 0-0.788 0.184-1.041 0.5l-4.292 5.365-4.292-5.365c-0.253-0.316-0.636-0.5-1.041-0.5h-6.667c-0.736 0-1.333-0.599-1.333-1.333v-17.333c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n'}),CONDITION_RATING_SHIPPING_COMPANY:s("span",{innerHTML:h}),CONDITION_COMPLETE_PERSONAL_INFORMATION_BIRTHDAY:s("span",{innerHTML:d}),CONDITION_COMPLETE_PERSONAL_INFORMATION_EMAIL:s("span",{innerHTML:y}),CONDITION_COMPLETE_PERSONAL_INFORMATION_MOBILE:s("span",{innerHTML:m}),CONDITION_COMPLETE_PERSONAL_INFORMATION_GENDER:s("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user</title>\n<path d="M16 16c4.412 0 8-3.588 8-8s-3.588-8-8-8-8 3.588-8 8 3.588 8 8 8zM16 2.667c2.941 0 5.333 2.392 5.333 5.333s-2.392 5.333-5.333 5.333-5.333-2.392-5.333-5.333 2.392-5.333 5.333-5.333zM16 18.667c-7.476 0-13.333 3.66-13.333 8.333v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-3.019 4.984-5.667 10.667-5.667s10.667 2.648 10.667 5.667v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-4.673-5.857-8.333-13.333-8.333z"></path>\n</svg>\n'}),CONDITION_BUY_FROM_STORE_FOR_UNIT:s("span",{innerHTML:c}),CONDITION_BUY_FROM_STORE_FOR_UNIT_BY_CATEGORIES:s("span",{innerHTML:c}),CONDITION_BUY_FROM_STORE_FIX_AMOUNT:s("span",{innerHTML:c}),CONDITION_BUY_FROM_STORE_FIX_AMOUNT_BY_CATEGORIES:s("span",{innerHTML:c}),order_from_pos_1:s("span",{innerHTML:m}),order_from_pos_2:s("span",{innerHTML:g}),buy_from_pos_1:s("span",{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>map-location</title>\n<path d="M24.667 8.013v-0.013c0-0.736-0.597-1.327-1.333-1.327s-1.333 0.604-1.333 1.34 0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333zM30.667 18.667c-0.736 0-1.333 0.596-1.333 1.333v8.701l-7.879-3.135c-0.308-0.127-0.651-0.127-0.961-0.011l-9.817 3.684-8.009-3.121v-20.351l7.633 2.181c0.708 0.205 1.447-0.209 1.648-0.916 0.203-0.708-0.207-1.447-0.915-1.648l-9.333-2.667c-0.403-0.115-0.836-0.035-1.169 0.217-0.335 0.252-0.531 0.645-0.531 1.064v23.029c0 0.549 0.337 1.043 0.849 1.243l9.333 3.637c0.305 0.12 0.645 0.12 0.952 0.007l9.812-3.68 9.227 3.669c0.16 0.064 0.327 0.095 0.493 0.095 0.263 0 0.525-0.079 0.749-0.231 0.365-0.247 0.584-0.661 0.584-1.103v-10.667c0-0.737-0.597-1.333-1.333-1.333zM23.333 22.667c0.395 0 0.769-0.175 1.023-0.476 0.783-0.935 7.644-9.241 7.644-13.357 0-4.389-2.976-8.833-8.667-8.833-5.689 0-8.667 4.444-8.667 8.833 0 4.116 6.863 12.423 7.645 13.357 0.253 0.301 0.628 0.476 1.021 0.476zM23.333 2.667c4.145 0 6 3.097 6 6.167 0 2.095-3.347 7.027-6 10.385-2.653-3.36-6-8.291-6-10.385 0-3.069 1.856-6.167 6-6.167z"></path>\n</svg>\n'}),buy_from_pos_2:s("span",{innerHTML:m}),CONDITION_BUY_FROM_POS_FOR_UNIT:s("span",{innerHTML:m}),CONDITION_BUY_FROM_POS_FOR_UNIT_BY_CATEGORIES:s("span",{innerHTML:m}),CONDITION_BUY_FROM_POS_FIX_AMOUNT:s("span",{innerHTML:m}),CONDITION_BUY_FROM_POS_FIX_AMOUNT_BY_CATEGORIES:s("span",{innerHTML:m}),affiliate_link_1:s("span",{innerHTML:f}),affiliate_link_2:s("span",{innerHTML:n}),affiliate_link_3:s("span",{innerHTML:c}),CONDITION_AFFILIATE_LINK:s("span",{innerHTML:f})},O=class{constructor(s){a(this,s)}async handleShareAction(a,s,l){const e=window.matchMedia("(min-width: 1024px)").matches;if("share"in navigator&&!e)try{return void await navigator.share({title:document.title,url:s.url})}catch(a){}const o=a.target,t=o.textContent,r=l;if("clipboard"in navigator)try{return await navigator.clipboard.writeText(s.url),o.textContent=r,void setTimeout((()=>{o.textContent=t}),5e3)}catch(a){}const i=document.createElement("textarea");i.value=s.url,i.style.opacity="0",this.host.appendChild(i),i.focus(),i.select();try{if(!document.execCommand("copy"))throw new Error("Failed to copy URL to clipboard");o.textContent=r,setTimeout((()=>{o.textContent=t}),5e3)}catch(a){}this.host.removeChild(i)}handleAction(a,s){if(a.stopPropagation(),s.is_completed)a.preventDefault();else switch(s.type){case"profile":case"rating":return salla.config.isUser()?void 0:(a.preventDefault(),void o((()=>salla.event.dispatch("login::open"))));case"share":return salla.config.isUser()?(a.preventDefault(),void this.handleShareAction(a,s,salla.lang.get("pages.loyalty_program.copied"))):(a.preventDefault(),void o((()=>salla.event.dispatch("login::open"))))}}getSubHeading(a){switch(a.type){case"share":return s("div",{class:"s-loyalty-program-point-subheading"},s("h2",null,salla.lang.get("pages.loyalty_program.how_to_start")),s("p",null,salla.lang.get("pages.loyalty_program.three_simple_steps")));case"pos":return s("div",{class:"s-loyalty-program-point-subheading"},s("h2",null,salla.lang.get("pages.loyalty_program.how_to_start")),s("p",null,salla.lang.get("pages.loyalty_program.two_simple_steps")));default:return""}}getDetails(a){return a.conditions.filter((a=>a.key.endsWith("_BY_CATEGORIES"))).length>0?s("div",null,s("div",{class:"s-loyalty-program-point-subheading"},s("h2",null,salla.lang.get("pages.loyalty_program.how_to_use")),s("p",null,salla.lang.get("pages.loyalty_program.how_to_use_steps"))),s("div",{class:"s-loyalty-program-points-modal-details"},a.conditions.map((l=>s("div",{class:"s-loyalty-program-points-chains-wrapper mt-5 mb-5"},s("div",{class:"s-loyalty-program-points-chain-item"},s("div",{class:"s-loyalty-program-points-chain-icon"},s("div",{class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xs s-loyalty-program-circle-variant-outline-primary"},v[l.key])),s("div",{class:"s-loyalty-program-points-chain-content"},s("salla-badge",{size:"xs",color:"primary-900",bg:"primary-100"},s("span",{innerHTML:i}),t(l.points,r(a))),s("p",{class:"s-loyalty-program-points-chain-description"},l.name),s("div",null,this.getCategoriesJsx(l.value))))))))):s("div",{class:"s-loyalty-program-points-modal-details"},s("div",{class:"s-loyalty-program-points-chains-wrapper mt-5 mb-5"},s("ul",{class:"s-loyalty-program-points-chain-list"},this.point.conditions.map((l=>s("li",{class:"s-loyalty-program-points-chain-item"},s("div",{class:"s-loyalty-program-points-chain-icon"},s("div",{class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xs s-loyalty-program-circle-variant-outline-primary"},v[l.key]),s("div",{class:"s-loyalty-program-points-chain-line"})),s("div",{class:"s-loyalty-program-points-chain-content"},s("salla-badge",{size:"xs",color:"primary-900",bg:"primary-100"},s("span",{innerHTML:i}),t(l.points,r(a),null!=l.value)),s("p",{class:"s-loyalty-program-points-chain-description"},l.name))))))))}getCategoriesJsx(a){return a.length?s("ul",{class:b("reward-details-categories-list")},a.map((a=>s("li",null,s("a",{href:a.url,class:b("reward-details-categories-item")},s("span",{innerHTML:p}),s("span",{class:b("reward-details-categories-item-content")},a.name)))))):""}getTrailingContent(a){switch(a.type){case"first_order":case"profile":return s("p",{class:"s-loyalty-program-points-completed-note"},salla.lang.get("pages.loyalty_program.one_time_points"));default:return a.is_completed?s("p",{class:"s-loyalty-program-points-completed-note"},salla.lang.get("pages.loyalty_program.one_time_points")):""}}render(){return s("div",{key:"ddfb0e0ffb4c23f7cab43dd994e25ba7c599a931"},s("div",{key:"a2fe514f59b0e01fc6e22011b6734d7ba97e951e",onClick:()=>o((()=>this.modal.open())),class:"s-loyalty-program-point-wrapper"},s("div",{key:"486b61a56b739a881de4ff0581a19ef91fbfc2e8",class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-sm s-loyalty-program-circle-variant-fill"},s("span",{key:"15f77554d8af1f65a66bf788cae341fe9f8f0fa3",class:this.point.icon})),s("div",{key:"2921be35f4d122e1a4580ed625832e4f33d69276",class:"s-loyalty-program-points-badge-mobile"},s("salla-badge",{key:"c809f65f9c93553e595fc995b76070a6a065e9d8",size:"xs",bg:"transparent"},s("span",{key:"d76ddeb873ac19f91b3cfe8af5837feb096cd7ca",innerHTML:i}),t(this.point))),s("div",{key:"18674b523984b6ca91afcee873e219571f867fcf",class:"s-loyalty-program-points-badge-desktop"},s("salla-badge",{key:"7ebbee57d2858f1ba372fd4b0b42771e394e330f",size:"sm",bg:"transparent"},s("span",{key:"41a93def0e2e54b4e6e036222e212703fe9ef88f",innerHTML:i}),t(this.point))),s("p",{key:"acfa0ed98f398b591cb22e828ca677d37007e4e6",class:"s-loyalty-program-point-description"},this.point.name),this.point.is_completed?s("a",{class:{"s-loyalty-program-points-action":!0,"s-loyalty-program-points-action-completed":this.point.is_completed,"s-loyalty-program-points-action-incomplete":!this.point.is_completed}},salla.lang.get("pages.loyalty_program.completed")):s("a",{href:this.point.url,onClick:a=>this.handleAction(a,this.point),class:{"s-loyalty-program-points-action":!0,"s-loyalty-program-points-action-completed":this.point.is_completed,"s-loyalty-program-points-action-incomplete":!this.point.is_completed}},this.point.description)),s("salla-modal",{key:"7c9f4dce935ba3e1f841aab57de04013e2fb983f",ref:a=>this.modal=a,class:"s-loyalty-program-point-modal s-loyalty-program-modal",width:window.matchMedia("(min-width: 768px)").matches?"md":"sm",noPadding:!0},s("div",{key:"5e1dbd60526ae8450ce6453c04ea244ef1a96697",class:"s-loyalty-program-points-modal-header"},s("h1",{key:"b43153fe19ffa308d5bd4126c9bd0fd43f1379ea",class:"s-loyalty-program-points-modal-info"},this.point.name)),s("div",{key:"5d8f1cad86fd916f984f5baa07ff7fb18afeda68",class:"s-loyalty-program-modal-scrollable-content"},s("div",{key:"69c4e3f2d513ec6c52caaa31ab3e7c886c0827a0",class:"s-loyalty-program-points-modal-main"},s("div",{key:"539a7713a22f64e9e4157dcd288ceca49910a449",class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xl s-loyalty-program-circle-variant-fill"},s("span",{key:"5249f670969022167be8b11bff3ec8c75b4f0a5b",class:this.point.icon})),s("salla-badge",{key:"e19decc72866ca36e3cc52c9822fc4677816bbda",size:"sm",bg:"light"},s("span",{key:"f2ed0ef699b63ce091c2b7dc5d30341bb0dcf713",innerHTML:i}),s("span",{key:"54275a2ec227c9415e77f88051bbf4e36d10489e",class:"s-loyalty-program-points-badge-points"},t(this.point)))),this.getSubHeading(this.point),!!this.point.steps&&Object.keys(this.point.steps).length>0&&s("div",{key:"7b8d4168a96586efa2855f169536a0577750cabe",class:"s-loyalty-program-points-modal-details"},s("div",{key:"102274da4418a7119e65c6a5c44630315e348c98",class:"s-loyalty-program-points-chains-wrapper"},s("ul",{key:"9a87e3fcb31ab6a0b984fe3fd43b9b57678b4600",class:"s-loyalty-program-points-chain-list"},Object.values(this.point.steps).map(((a,l)=>{const e=l===Object.values(this.point.steps).length-1;return s("li",{class:"s-loyalty-program-points-chain-item"},s("div",{class:"s-loyalty-program-points-chain-icon"},s("div",{class:"s-loyalty-program-circle-base s-loyalty-program-circle-size-xs s-loyalty-program-circle-variant-outline-primary"},v[a.key]),!e&&s("div",{class:"s-loyalty-program-points-chain-line"})),s("div",{class:"s-loyalty-program-points-chain-content"},s("salla-badge",{size:"xs",color:"primary-900",bg:"primary-100"},s("span",null,salla.lang.get(`pages.loyalty_program.step_${l+1}`))),s("p",{class:"s-loyalty-program-points-chain-description"},a.title||a.name)))}))))),this.getDetails(this.point),s("div",{key:"7c96d9b4014f2b531cf85f0f4dd9c797f6b4e352",class:"s-loyalty-program-points-modal-details"},this.getTrailingContent(this.point)),this.point.branches?.length?s("div",{class:"s-loyalty-program-points-modal-list"},s("div",{class:"s-loyalty-program-point-details-branches"},s("h2",null,salla.lang.get("pages.loyalty_program.branches")),s("p",null,salla.lang.get("pages.loyalty_program.shop_from_branches"))),s("div",{class:"s-loyalty-program-points-modal-list-wrapper"},s("ul",null,this.point.branches.map((a=>s("li",{class:"s-loyalty-program-points-modal-list-item"},s("p",null,a.name),s("salla-badge",{size:"sm",bg:"transparent"},s("span",{innerHTML:i}),s("a",{href:a.location?`https://www.google.com/maps?q=${a.location.lat},${a.location.lon}`:"#",target:"_blank",rel:"noopener noreferrer"},a.address_description)))))))):""),s("div",{key:"79a6d37b6af82a40b5b88f1a7e03034c3ac9fe90",class:"s-loyalty-program-points-modal-action"},s("a",{key:"6498d88e64af28621281b8c12b28c1a22473001d",href:this.point.url,onClick:a=>(a.stopPropagation(),this.handleAction(a,this.point)),class:{"s-loyalty-program-points-action":!0,"s-loyalty-program-points-action-completed":this.point.is_completed,"s-loyalty-program-points-action-incomplete":!this.point.is_completed}},this.point.is_completed?salla.lang.get("pages.loyalty_program.completed"):this.point.description))))}get host(){return e(this)}};O.style="";export{_ as salla_loyalty_hero,O as salla_loyalty_point}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as t,H as a}from"./p-
|
|
4
|
+
import{r as e,h as t,H as a}from"./p-BqFb60iF.js";const s=class{constructor(t){e(this,t),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return t(a,{key:"2b73681383da172ed01bb199b117d2063228e01e"},t("a",{key:"af5913df51093694667751d16b5ec686103791a4",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},t("div",{key:"49fdb468a67f0a015762a1539d2333ad694628ec",class:"s-list-tile-item-icon"},t("slot",{key:"97417d4c9bf63e498510549d08dbf5df55050526",name:"icon"})),t("div",{key:"53544687a14f2c992ad17d0194a10fba0ad40631",class:"s-list-tile-item-content"},t("div",{key:"a8803d707ccd88df74d425a004e5c180d0106c50",class:"s-list-tile-item-title"},t("slot",{key:"27b091e8cf03dc9253baf135bdc6a8166eac566c",name:"title"})),t("div",{key:"c2ab48314fe243e6cea9dd7e8f0be4104a0b89e3",class:"s-list-tile-item-subtitle"},t("slot",{key:"31c7e05be4026e990704926f6b29c8b1e570a548",name:"subtitle"}))),t("div",{key:"4fb89eaad3693b3b49e6d4ac72f09dca7c52eeeb",class:"s-list-tile-item-action"},t("slot",{key:"7e587373e0282a22387028aaa6a801b9909f707a",name:"action"}))))}};s.style="";export{s as salla_list_tile}
|