@salla.sa/twilight-components 2.14.552 → 2.14.554
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/apple-pay-order-options-DVyeUqBh.js +90 -0
- package/dist/cjs/{filepond-BTsLGLic.js → filepond-ENm3Nngf.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DSHHkMx8.js → filepond-plugin-file-poster-C18vZN4-.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BB6ltSRf.js → filepond-plugin-file-validate-size-DDdErCkO.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CNWlgtpi.js → filepond-plugin-file-validate-type-BIIIZDTF.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DuY72vJR.js → filepond-plugin-image-edit-Dy_kmMTy.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DWzZOyOL.js → filepond-plugin-image-exif-orientation-r9AvWT2R.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-ropJ4nYL.js → filepond-plugin-image-preview-DFS8KaQR.js} +1 -1
- package/dist/cjs/{index-CoSVCFSp.js → index-CdUTvkg8.js} +20 -24
- package/dist/cjs/{intlTelInput-BSHBNNPO.js → intlTelInput-D-fhnv0v.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +5 -86
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/{salla-count-down.cjs.entry.js → salla-count-down_2.cjs.entry.js} +209 -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 +108 -5
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/{salla-slider.cjs.entry.js → salla-map_3.cjs.entry.js} +829 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/{salla-order-options-modal_2.cjs.entry.js → salla-product-card.cjs.entry.js} +1 -209
- 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-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +4 -2
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-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 +42 -3
- 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 +2 -2
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DdIwY7TN.js → vanilla-picker-DkM8pn5M.js} +1 -1
- package/dist/collection/components/salla-gifting/salla-gifting.css +3 -0
- package/dist/collection/components/salla-gifting/salla-gifting.js +106 -3
- package/dist/collection/components/salla-scopes/salla-scopes.js +3 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +42 -2
- package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
- package/dist/components/apple-pay-order-options.js +86 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-gifting.js +165 -20
- package/dist/components/salla-quick-buy2.js +1 -82
- package/dist/components/salla-scopes.js +3 -1
- package/dist/components/salla-user-settings.js +48 -2
- package/dist/components/salla-wishlist-actions.js +1 -1
- package/dist/esm/apple-pay-order-options-Bg2HuLRr.js +86 -0
- package/dist/esm/{filepond-CqbRA3Vl.js → filepond-CfR9FvSg.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-Byt9onuT.js → filepond-plugin-file-poster-B6F5nK4V.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-C1P2OJEv.js → filepond-plugin-file-validate-size-BxIzTBd4.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-BP2FLMsG.js → filepond-plugin-file-validate-type-DfUPdGXA.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-C69hhmiF.js → filepond-plugin-image-edit-Ddgh5YPx.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-B2QzeXLq.js → filepond-plugin-image-exif-orientation-BHjeleJe.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CR1odLVd.js → filepond-plugin-image-preview-Cp3-aadR.js} +1 -1
- package/dist/esm/{index-Q9lz4Iuq.js → index-ku9UdoB5.js} +20 -24
- package/dist/esm/{intlTelInput-DzbfeHCl.js → intlTelInput-BJzNl4Ic.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +2 -83
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/{salla-count-down.entry.js → salla-count-down_2.entry.js} +209 -2
- 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 +108 -5
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/{salla-slider.entry.js → salla-map_3.entry.js} +828 -2
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/{salla-order-options-modal_2.entry.js → salla-product-card.entry.js} +2 -209
- 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-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +4 -2
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-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 +42 -3
- 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 +2 -2
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-DZSS4OVz.js → vanilla-picker-BUvwVv9C.js} +1 -1
- package/dist/twilight/{p-d70c704f.entry.js → p-01484bf0.entry.js} +1 -1
- package/dist/twilight/{p-34dfff49.entry.js → p-02052c05.entry.js} +1 -1
- package/dist/twilight/{p-3c0705e2.entry.js → p-04a4ad1e.entry.js} +1 -1
- package/dist/twilight/{p-06109ef0.entry.js → p-04b36a74.entry.js} +1 -1
- package/dist/twilight/{p-00bb1a13.entry.js → p-0cd9ed66.entry.js} +1 -1
- package/dist/twilight/{p-bf860754.entry.js → p-0cf68108.entry.js} +1 -1
- package/dist/twilight/{p-DPu3dYaG.js → p-0eRD7FGW.js} +1 -1
- package/dist/twilight/{p-61ca8dd2.entry.js → p-123e9135.entry.js} +1 -1
- package/dist/twilight/{p-1dc63988.entry.js → p-14276775.entry.js} +1 -1
- package/dist/twilight/{p-4abffe52.entry.js → p-166165af.entry.js} +1 -1
- package/dist/twilight/{p-f632b2f7.entry.js → p-17fadc87.entry.js} +1 -1
- package/dist/twilight/{p-ea3480ff.entry.js → p-19160d81.entry.js} +1 -1
- package/dist/twilight/{p-92fbada7.entry.js → p-1936f917.entry.js} +1 -1
- package/dist/twilight/{p-d6a04817.entry.js → p-1a469fb0.entry.js} +1 -1
- package/dist/twilight/{p-89aad90f.entry.js → p-1ea8b6d8.entry.js} +1 -1
- package/dist/twilight/{p-e6b1dd40.entry.js → p-1eda5a96.entry.js} +1 -1
- package/dist/twilight/{p-aa1af88d.entry.js → p-26a18c7f.entry.js} +1 -1
- package/dist/twilight/{p-1242708e.entry.js → p-2726700f.entry.js} +1 -1
- package/dist/twilight/{p-ce8205e2.entry.js → p-2b21f1e9.entry.js} +1 -1
- package/dist/twilight/{p-f4207ccf.entry.js → p-2c575150.entry.js} +1 -1
- package/dist/twilight/{p-754af3dd.entry.js → p-3396b86e.entry.js} +1 -1
- package/dist/twilight/{p-729f3fa0.entry.js → p-34193547.entry.js} +1 -1
- package/dist/twilight/{p-462a49e4.entry.js → p-3ab74f2e.entry.js} +1 -1
- package/dist/twilight/p-3fb91980.entry.js +4 -0
- package/dist/twilight/{p-e305f635.entry.js → p-4046701a.entry.js} +1 -1
- package/dist/twilight/p-4c7e19cf.entry.js +4 -0
- package/dist/twilight/{p-49cbb9ed.entry.js → p-56ba07b9.entry.js} +1 -1
- package/dist/twilight/{p-eddf3ee5.entry.js → p-5ed3f495.entry.js} +1 -1
- package/dist/twilight/{p-7022989a.entry.js → p-5fc810c0.entry.js} +1 -1
- package/dist/twilight/{p-5470f52a.entry.js → p-5ff01328.entry.js} +1 -1
- package/dist/twilight/{p-c6ed3a34.entry.js → p-63b99e5f.entry.js} +1 -1
- package/dist/twilight/{p-25017fcd.entry.js → p-64180f95.entry.js} +1 -1
- package/dist/twilight/{p-7d3899e7.entry.js → p-6534ff1f.entry.js} +1 -1
- package/dist/twilight/{p-ae5ce421.entry.js → p-6be9d80d.entry.js} +1 -1
- package/dist/twilight/{p-56e93806.entry.js → p-6d9068ec.entry.js} +1 -1
- package/dist/twilight/{p-e69f6c43.entry.js → p-6fa2b72f.entry.js} +1 -1
- package/dist/twilight/{p-06abf9fb.entry.js → p-7401960d.entry.js} +1 -1
- package/dist/twilight/{p-382e5a40.entry.js → p-783dff94.entry.js} +1 -1
- package/dist/twilight/p-796820a1.entry.js +4 -0
- package/dist/twilight/{p-27176c04.entry.js → p-8437142d.entry.js} +1 -1
- package/dist/twilight/p-85a79d61.entry.js +4 -0
- package/dist/twilight/{p-5b94bea7.entry.js → p-85cffeba.entry.js} +1 -1
- package/dist/twilight/{p-c0599e5d.entry.js → p-89fd6c49.entry.js} +1 -1
- package/dist/twilight/{p-9f4fef0f.entry.js → p-8f8ac48b.entry.js} +1 -1
- package/dist/twilight/p-8fedad10.entry.js +4 -0
- package/dist/twilight/{p-9118b3cf.entry.js → p-9486e09e.entry.js} +1 -1
- package/dist/twilight/{p-bd389ba7.entry.js → p-94ee6712.entry.js} +1 -1
- package/dist/twilight/{p-54bdc583.entry.js → p-95e0a312.entry.js} +1 -1
- package/dist/twilight/{p-7dda74dd.entry.js → p-96fe4aab.entry.js} +1 -1
- package/dist/twilight/{p-bfa2b7c5.entry.js → p-99ff26ab.entry.js} +1 -1
- package/dist/twilight/{p-52e1754b.entry.js → p-9a0e1465.entry.js} +1 -1
- package/dist/twilight/{p-008dcf73.entry.js → p-9aa24215.entry.js} +1 -1
- package/dist/twilight/{p-c90ff0bf.entry.js → p-9c2b4ca2.entry.js} +1 -1
- package/dist/twilight/p-Bg2HuLRr.js +4 -0
- package/dist/twilight/{p-CPEEGqkw.js → p-C1-96ybF.js} +1 -1
- package/dist/twilight/{p-Ce0SoG8e.js → p-Cr4_0D5C.js} +1 -1
- package/dist/twilight/{p-WyyaE0fN.js → p-CzKSvXuO.js} +1 -1
- package/dist/twilight/{p-VPmzkmKU.js → p-Pyyf93a5.js} +1 -1
- package/dist/twilight/{p-sDtjU0pK.js → p-UhifliOR.js} +1 -1
- package/dist/twilight/{p-B31LPQuk.js → p-_vqDDk2C.js} +1 -1
- package/dist/twilight/{p-7d9e3032.entry.js → p-a24943e9.entry.js} +1 -1
- package/dist/twilight/p-a30c03f2.entry.js +4 -0
- package/dist/twilight/{p-c7482df4.entry.js → p-a8e3d089.entry.js} +1 -1
- package/dist/twilight/{p-a24168ae.entry.js → p-aa0fa973.entry.js} +1 -1
- package/dist/twilight/{p-79e2d7eb.entry.js → p-ad60b749.entry.js} +1 -1
- package/dist/twilight/p-b047487a.entry.js +4 -0
- package/dist/twilight/{p-25b7344e.entry.js → p-b0b3e350.entry.js} +1 -1
- package/dist/twilight/{p-8abf3859.entry.js → p-b574a386.entry.js} +1 -1
- package/dist/twilight/{p-ff6672b6.entry.js → p-ba461b3b.entry.js} +1 -1
- package/dist/twilight/{p-4b827efc.entry.js → p-bd5aa915.entry.js} +1 -1
- package/dist/twilight/{p-492c72eb.entry.js → p-be7ff867.entry.js} +1 -1
- package/dist/twilight/{p-0100262e.entry.js → p-c2b52564.entry.js} +1 -1
- package/dist/twilight/{p-31d03d8c.entry.js → p-c31a585e.entry.js} +1 -1
- package/dist/twilight/{p-2845de1c.entry.js → p-c4c39bd9.entry.js} +1 -1
- package/dist/twilight/{p-f0cefe50.entry.js → p-c5ce93d5.entry.js} +1 -1
- package/dist/twilight/{p-d7c03cf7.entry.js → p-c7910ae8.entry.js} +1 -1
- package/dist/twilight/{p-688b40b4.entry.js → p-c8fbf2b5.entry.js} +1 -1
- package/dist/twilight/{p-53e430c6.entry.js → p-cb0d5691.entry.js} +1 -1
- package/dist/twilight/{p-f7c2ff0f.entry.js → p-cf0a59a6.entry.js} +1 -1
- package/dist/twilight/{p-808fef3d.entry.js → p-d19c812d.entry.js} +1 -1
- package/dist/twilight/{p-7deba3f8.entry.js → p-d26a4d0a.entry.js} +1 -1
- package/dist/twilight/p-d756ea47.entry.js +4 -0
- package/dist/twilight/{p-40b70c18.entry.js → p-d87df6bb.entry.js} +1 -1
- package/dist/twilight/{p-f5485435.entry.js → p-dd9b7c3e.entry.js} +1 -1
- package/dist/twilight/{p-7f2bc499.entry.js → p-df068813.entry.js} +1 -1
- package/dist/twilight/{p-36aa4c09.entry.js → p-dfbdadbe.entry.js} +1 -1
- package/dist/twilight/{p-b881f716.entry.js → p-e3c03f82.entry.js} +1 -1
- package/dist/twilight/{p-a7417d3a.entry.js → p-e5a220c9.entry.js} +1 -1
- package/dist/twilight/{p-31394018.entry.js → p-e747bb48.entry.js} +1 -1
- package/dist/twilight/{p-8920aae0.entry.js → p-ea4c9415.entry.js} +1 -1
- package/dist/twilight/{p-6867eb35.entry.js → p-eae027c3.entry.js} +1 -1
- package/dist/twilight/{p-bbdec84a.entry.js → p-f1a054c6.entry.js} +1 -1
- package/dist/twilight/{p-b92af898.entry.js → p-f289cf85.entry.js} +1 -1
- package/dist/twilight/{p-0bb678e7.entry.js → p-f28f5f74.entry.js} +1 -1
- package/dist/twilight/{p-a0e73c0f.entry.js → p-f5de77c3.entry.js} +1 -1
- package/dist/twilight/{p-5d671536.entry.js → p-fb6d8401.entry.js} +1 -1
- package/dist/twilight/{p-7e8b2b0d.entry.js → p-fd6365cf.entry.js} +1 -1
- package/dist/twilight/{p-6f6d6f45.entry.js → p-fe2ab07f.entry.js} +1 -1
- package/dist/twilight/{p-e0868b92.entry.js → p-fe7e6ccf.entry.js} +1 -1
- package/dist/twilight/{p-fe34bfd0.entry.js → p-fee06d0a.entry.js} +1 -1
- package/dist/twilight/{p-CA-ne4vX.js → p-gtQbb5kC.js} +1 -1
- package/dist/twilight/{p-Q9lz4Iuq.js → p-ku9UdoB5.js} +1 -1
- package/dist/twilight/{p-BCwAi8HD.js → p-yevmK0Kl.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +29 -0
- package/dist/types/components/salla-user-settings/salla-user-settings.d.ts +13 -0
- package/package.json +5 -5
- package/dist/cjs/salla-map_2.cjs.entry.js +0 -835
- package/dist/esm/salla-map_2.entry.js +0 -832
- package/dist/twilight/p-171c1927.entry.js +0 -4
- package/dist/twilight/p-4941b3cd.entry.js +0 -4
- package/dist/twilight/p-4bac36be.entry.js +0 -4
- package/dist/twilight/p-67b60d33.entry.js +0 -4
- package/dist/twilight/p-6860331a.entry.js +0 -4
- package/dist/twilight/p-79451510.entry.js +0 -4
- package/dist/twilight/p-8bcf6db3.entry.js +0 -4
- package/dist/twilight/p-a70cbfe9.entry.js +0 -4
- package/dist/twilight/p-dfc67513.entry.js +0 -4
|
@@ -3,10 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Host, h } from "@stencil/core";
|
|
5
5
|
import Bullhorn from "../../assets/svg/bullhorn.svg";
|
|
6
|
+
import UserOff from "../../assets/svg/user-off.svg";
|
|
6
7
|
import UserCancel from "../../assets/svg/user-cancel.svg";
|
|
7
8
|
export class SallaUserSettings {
|
|
8
9
|
constructor() {
|
|
9
10
|
this.otpInputs = [];
|
|
11
|
+
/**
|
|
12
|
+
* Gates the new OTP-verified delete-account flow. When disabled, falls back
|
|
13
|
+
* to the legacy deactivate-account flow (immediate deactivation, no OTP).
|
|
14
|
+
*/
|
|
15
|
+
this.isDeleteAccountEnabled = !!salla.config
|
|
16
|
+
.get('store.features', [])
|
|
17
|
+
?.includes('customer-account-deletion');
|
|
18
|
+
// Legacy deactivate-account texts (used when isDeleteAccountEnabled is false)
|
|
19
|
+
this.deactivateAccount = salla.lang.get('pages.profile.deactivate_account');
|
|
20
|
+
this.deactivateDesc = salla.lang.get('pages.profile.deactivate_account_description');
|
|
21
|
+
this.sorryForLeavingText = salla.lang.get('pages.profile.warning_for_deactivate');
|
|
22
|
+
this.warningText = salla.lang.get('pages.profile.sorry_for_leaving');
|
|
23
|
+
this.keepAccount = salla.lang.get('pages.profile.keep_account');
|
|
24
|
+
this.buttonLoading = false;
|
|
10
25
|
this.deletePendingDays = null;
|
|
11
26
|
this.currentStep = 'confirm';
|
|
12
27
|
this.isDeletePending = false;
|
|
@@ -88,7 +103,9 @@ export class SallaUserSettings {
|
|
|
88
103
|
this.isHiddenName = salla.config.get('user.is_hidden_name');
|
|
89
104
|
this.isNotifiable = salla.config.get('user.is_notifiable');
|
|
90
105
|
this.canHideName = salla.config.get('store.settings.rating.can_customer_hide_name');
|
|
91
|
-
this.
|
|
106
|
+
if (this.isDeleteAccountEnabled) {
|
|
107
|
+
this.fetchDeleteRequestStatus();
|
|
108
|
+
}
|
|
92
109
|
if (!this.isNotifiable || !this.isHiddenName) {
|
|
93
110
|
salla.event.on('profile::info.fetched', res => {
|
|
94
111
|
this.isHiddenName = res.data.is_hidden_name;
|
|
@@ -150,6 +167,11 @@ export class SallaUserSettings {
|
|
|
150
167
|
}
|
|
151
168
|
}
|
|
152
169
|
loadTranslations() {
|
|
170
|
+
this.deactivateAccount = salla.lang.get('pages.profile.deactivate_account');
|
|
171
|
+
this.deactivateDesc = salla.lang.get('pages.profile.deactivate_account_description');
|
|
172
|
+
this.sorryForLeavingText = salla.lang.get('pages.profile.warning_for_deactivate');
|
|
173
|
+
this.warningText = salla.lang.get('pages.profile.sorry_for_leaving');
|
|
174
|
+
this.keepAccount = salla.lang.get('pages.profile.keep_account');
|
|
153
175
|
this.deleteAccount = salla.lang.get('pages.profile.delete_account');
|
|
154
176
|
this.deleteAccountDesc = salla.lang.get('pages.profile.delete_account_description');
|
|
155
177
|
this.deleteConfirmTitle = salla.lang.get('pages.profile.delete_account_confirm_title');
|
|
@@ -209,6 +231,17 @@ export class SallaUserSettings {
|
|
|
209
231
|
this.updateModalForStep();
|
|
210
232
|
this.confirmationModal.open();
|
|
211
233
|
}
|
|
234
|
+
openDeactivateModal() {
|
|
235
|
+
this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount));
|
|
236
|
+
this.confirmationModal.open();
|
|
237
|
+
}
|
|
238
|
+
async confirmDeactivateAccount() {
|
|
239
|
+
this.buttonLoading = true;
|
|
240
|
+
await salla.profile.delete().finally(() => {
|
|
241
|
+
this.buttonLoading = false;
|
|
242
|
+
this.confirmationModal.close();
|
|
243
|
+
});
|
|
244
|
+
}
|
|
212
245
|
closeDeleteModal() {
|
|
213
246
|
this.clearResendTimer();
|
|
214
247
|
this.confirmationModal?.close();
|
|
@@ -499,7 +532,7 @@ export class SallaUserSettings {
|
|
|
499
532
|
return (h("salla-button", { fill: "outline", color: "danger", shape: "btn", size: "medium", width: "normal", onClick: () => this.openDeleteModal() }, this.capitalizeText(this.deleteAccount)));
|
|
500
533
|
}
|
|
501
534
|
render() {
|
|
502
|
-
return (h(Host, { key: '
|
|
535
|
+
return (h(Host, { key: '8a30c7a63785447ce4b5a37233a851056489b7a0', class: "s-user-settings-wrapper" }, this.canHideName && (h("div", { key: 'df325aab1249e9c6fbae8c9218cebe44cf3c627a', class: "s-user-settings-section" }, h("salla-list-tile", { key: '00b155f3cbdb38b97baaebc81b2f3f8ae41926c9' }, h("div", { key: '79e8eaf77e59e8228bc8a68adb55975a1400aea0', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '98e985a057595b1e136d77c8bda2951fb82b1d3e', innerHTML: UserCancel })), h("div", { key: '9c05bf47eda1764880948705b1c78af50b973c94', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.hideMyName)), h("div", { key: '4656a31e4818d1a0678400408c1082f5e738f764', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.hideMyNameDesc)), h("div", { key: '636e6882149c8b692c01cb97ece48014bf284631', slot: "action", class: "s-user-settings-section-action" }, h("label", { key: '5633324ba6128911e955fbf53774f324a37ff136', class: "s-toggle" }, h("input", { key: 'cae5ee95e39ffc7ff3a1ecb86ca8cae9dc9583d9', class: "s-toggle-input", checked: this.isHiddenName, onChange: e => this.toggleSetting('is_hidden_name', e), type: "checkbox" }), h("div", { key: 'd0cdd16ca6104f73f1653088cdf43d7a1d10da34', class: "s-toggle-switcher" })))))), h("div", { key: '781043a116e44c9e60c127faf121f59c010fad17', class: "s-user-settings-section" }, h("salla-list-tile", { key: '72784431a6acd24d12a2a66e9563c603900a1f4d' }, h("div", { key: '0f5ec3452bfb20918b44d99aad5146c2a8595286', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: 'cef5ba0f4cd4e64f995e654b0f566a11ed2e2f48', innerHTML: Bullhorn })), h("div", { key: '8632c4f75da95d01a2cbb8a89c415c3bdd6c10ff', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.promotionalMsgs)), h("div", { key: 'd93b1336e6d09e32d620376083bc704e1edac337', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.promotionalMsgsDesc)), h("div", { key: '7c4f5a8102521d98a230dec0b92ded0a37ff8eea', slot: "action", class: "s-user-settings-section-action" }, h("label", { key: '1b3419f9c933f1e20540fc70a79bdeba338e3dc6', class: "s-toggle" }, h("input", { key: '87ceb43f847b99552566579e2d0d878dbc8bf80a', class: "s-toggle-input", checked: this.isNotifiable, onChange: e => this.toggleSetting('is_notifiable', e), type: "checkbox" }), h("div", { key: '15ddef5bcefe2b062983b0021cfaf03ad9f6cf95', class: "s-toggle-switcher" }))))), this.isDeleteAccountEnabled ? (h("div", { class: "s-user-settings-section s-user-settings-section-delete-user" }, h("salla-list-tile", null, h("div", { slot: "icon", class: "s-user-settings-section-icon" }, this.renderUserDeleteIcon()), h("div", { slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.deleteAccount)), h("div", { slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.isDeletePending ? this.deleteAccountPending : this.deleteAccountDesc)), h("div", { slot: "action", class: "s-user-settings-section-action" }, this.renderDeleteSectionAction())))) : (h("div", { class: "s-user-settings-section s-user-settings-section-deactivate-user" }, h("salla-list-tile", null, h("div", { slot: "icon", class: "s-user-settings-section-icon" }, h("span", { innerHTML: UserOff })), h("div", { slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.deactivateAccount)), h("div", { slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.deactivateDesc)), h("div", { slot: "action", class: "s-user-settings-section-action" }, h("salla-button", { fill: "outline", color: "danger", shape: "btn", size: "medium", width: "normal", onClick: () => this.openDeactivateModal() }, this.capitalizeText(this.deactivateAccount)))))), this.isDeleteAccountEnabled ? (h("salla-modal", { id: "salla-user-settings-delete-modal", width: "xs", centered: true, showBack: this.currentStep === 'otp', isClosable: this.currentStep !== 'success', iconStyle: this.currentStep === 'success' ? 'success' : undefined, onModalVisibilityChanged: e => this.handleModalVisibilityChanged(e), onModalBack: () => this.goBackFromOtp(), ref: modal => (this.confirmationModal = modal) }, this.currentStep !== 'success' ? (h("span", { slot: "icon", class: "s-user-settings-delete-icon" }, this.renderUserDeleteIcon())) : null, h("div", { key: this.currentStep, class: "s-user-settings-delete-step" }, this.renderDeleteStep()))) : (h("salla-modal", { width: "sm", subTitle: this.capitalizeText(this.sorryForLeavingText), ref: modal => (this.confirmationModal = modal) }, h("span", { slot: "icon", class: "s-user-settings-confirmation-icon", innerHTML: UserOff }), h("div", { class: "s-user-settings-confirmation" }, h("div", { class: "s-user-settings-confirmation-warning" }, this.capitalizeText(this.warningText)), h("div", { class: "s-user-settings-confirmation-actions" }, h("salla-button", { width: "wide", onClick: () => this.confirmationModal.close() }, this.capitalizeText(this.keepAccount)), h("salla-button", { fill: "outline", loading: this.buttonLoading, width: "wide", onClick: () => this.confirmDeactivateAccount() }, this.capitalizeText(this.deactivateAccount))))))));
|
|
503
536
|
}
|
|
504
537
|
static get is() { return "salla-user-settings"; }
|
|
505
538
|
static get originalStyleUrls() {
|
|
@@ -514,6 +547,13 @@ export class SallaUserSettings {
|
|
|
514
547
|
}
|
|
515
548
|
static get states() {
|
|
516
549
|
return {
|
|
550
|
+
"isDeleteAccountEnabled": {},
|
|
551
|
+
"deactivateAccount": {},
|
|
552
|
+
"deactivateDesc": {},
|
|
553
|
+
"sorryForLeavingText": {},
|
|
554
|
+
"warningText": {},
|
|
555
|
+
"keepAccount": {},
|
|
556
|
+
"buttonLoading": {},
|
|
517
557
|
"deleteAccount": {},
|
|
518
558
|
"deleteAccountDesc": {},
|
|
519
559
|
"deleteConfirmTitle": {},
|
|
@@ -325,7 +325,7 @@ export class SallaWishlistActions {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
render() {
|
|
328
|
-
return (h(Host, { key: '
|
|
328
|
+
return (h(Host, { key: '7987635ec115238927e9e24ec619beaa10a620e2' }, h("div", { key: 'f9379be51dee5e10f631750134af6b02a7461295', class: "s-wishlist-actions" }, h("div", { key: '1f336e2524dabf609fc65356ae4eeb668d375a6d', class: "s-wishlist-actions-bar flex items-center justify-end gap-3 mb-3" }, h("div", { key: '1462f1ebc6849c4153bd6955e5d12ebcb60d8ca7', class: "s-wishlist-actions-dropdown relative" }, h("salla-button", { key: '79bd2853a3b93f2b346427b0540f3f597b6b4d8d', color: "primary", fill: "outline", type: "button", disabled: !this.hasProducts, "aria-haspopup": "true", "aria-expanded": this.menuOpen ? 'true' : 'false', onClick: () => this.toggleMenu() }, h("div", { key: '6c38209e408858a00b8d8a6d103041d2f6b14f20', class: "flex flex-row justify-center items-center gap-2" }, h("svg", { key: '0e33ffa3d17779ac49b691619038fbfb0f104d4b', version: "1.1", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 32 32", style: { width: '16px', height: '16px' } }, h("path", { key: 'db0eddec152f4e9b58424391f76617af3a180f50', d: "M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.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.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM26.667 29.333c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z" })), this.shareLabel, h("svg", { key: '39a8994a5264fade475e2aaf85c370ea62afb19f', version: "1.1", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 32 32", style: { width: '16px', height: '16px' } }, h("path", { key: '9640320e0151200f147fd15f9b9de72c373fe51e', d: "M26.212 10.996c-0.556-0.484-1.396-0.428-1.881 0.127l-8.331 9.519-8.331-9.52c-0.485-0.555-1.327-0.611-1.881-0.125s-0.609 1.328-0.124 1.881l9.333 10.667c0.253 0.291 0.617 0.456 1.003 0.456s0.749-0.165 1.003-0.456l9.333-10.667c0.485-0.553 0.429-1.396-0.124-1.881z" })))), this.menuOpen && (h("ul", { key: '11897d1e87a4cff34da00cdeb977479970a3aa65', class: "s-wishlist-actions-menu absolute z-20 mt-1 bg-white rounded-lg shadow overflow-hidden" }, h("li", { key: '814dbe73e5489013a75c7cf1101fabc7798ad8c2' }, h("button", { key: '969a4d65f6c82ff56aaad3533fce931d6766761b', type: "button", class: "s-wishlist-actions-menu-item", onClick: () => this.shareAll() }, this.shareAllLabel)), h("li", { key: '142c11ce52add508bcfcec5da6817670b9777d70' }, h("button", { key: 'cc68d65e7fbf2a7894d51c13bb479f2272adbd92', type: "button", class: "s-wishlist-actions-menu-item", onClick: () => this.shareSpecific() }, this.shareSpecificLabel))))), h("salla-social-share", { key: '1a5f6ace554045f0219b596ba94b67391fb6e58e', class: "s-wishlist-actions-social", ref: el => (this.socialShare = el), url: this.shareUrl, mode: "modal", modalTitle: this.shareModalTitle }, h("span", { key: '70a2689d82a23f084fe4fc23585069b2b33338a8', slot: "widget", class: "s-wishlist-actions-social-anchor", "aria-hidden": "true" }))), this.specificMode && (h("div", { key: '4644716c98903805f2450ad82d64812937228563', class: "s-wishlist-actions-panel flex items-center justify-between gap-4 flex-wrap p-4 mt-3 mb-3 bg-white rounded-lg" }, h("label", { key: 'ff8e39fa812166ee319ccca7d65cfc0dc17eb04b', class: "s-wishlist-actions-panel-select-all flex items-center gap-2 cursor-pointer" }, h("input", { key: 'e0454096dc9ef378e66ac316c775b453628ebfb4', type: "checkbox", class: "s-products-list-select-checkbox s-wishlist-actions-select-all", checked: this.isAllSelected, ref: el => (this.selectAllCheckbox = el), "aria-label": this.selectAllLabel, onChange: () => this.toggleSelectAll() }), h("span", { key: 'c77ff8c38230e424bba05bf4e7439020f65da903', class: "s-wishlist-actions-panel-title text-sm font-bold text-gray-700" }, this.shareSpecificLabel, " (", this.selectedCount, ")")), h("div", { key: 'bfb5d90f041f08da9828de70ecd73266adc9e9ce', class: "s-wishlist-actions-panel-buttons flex items-center gap-2" }, h("salla-button", { key: 'cfbfc51124d6d3119a5491b6d2a684498f47e0c8', class: "s-wishlist-actions-cancel", color: "light", fill: "outline", type: "button", onClick: () => this.cancelSpecific() }, this.cancelLabel), h("salla-button", { key: '1f692ded66974de621d949382044d65145175730', class: "s-wishlist-actions-share", color: "primary", fill: "outline", type: "button", disabled: !this.selectedCount, loading: this.isSharing, onClick: () => this.shareSelected() }, this.shareLabel)))))));
|
|
329
329
|
}
|
|
330
330
|
static get is() { return "salla-wishlist-actions"; }
|
|
331
331
|
static get originalStyleUrls() {
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Order-options helpers for the Apple Pay quick-buy flow — keeps <salla-quick-buy> to thin AP wiring.
|
|
6
|
+
* Apple Pay resolves options inside the session-started hook (single gesture), so the caller owns
|
|
7
|
+
* the ApplePaySession and drives it via callbacks.
|
|
8
|
+
*/
|
|
9
|
+
/** Get-or-create the singleton order-options modal on <body>. */
|
|
10
|
+
function ensureOrderOptionsModal() {
|
|
11
|
+
let modal = document.querySelector('salla-order-options-modal');
|
|
12
|
+
if (!modal) {
|
|
13
|
+
modal = document.createElement('salla-order-options-modal');
|
|
14
|
+
document.body.appendChild(modal);
|
|
15
|
+
}
|
|
16
|
+
return modal;
|
|
17
|
+
}
|
|
18
|
+
/** Sync PDP-option validity (an `await` would consume the Apple Pay gesture). Skips hidden/disabled inputs. */
|
|
19
|
+
function reportProductOptionsValiditySync(productId) {
|
|
20
|
+
const optionsElement = document.querySelector(`salla-product-options[product-id="${productId}"]`);
|
|
21
|
+
if (!optionsElement)
|
|
22
|
+
return true;
|
|
23
|
+
const requiredInputs = optionsElement.querySelectorAll('[required]');
|
|
24
|
+
let pass = true;
|
|
25
|
+
requiredInputs.forEach((input) => {
|
|
26
|
+
if (input.disabled || input.closest('.hidden'))
|
|
27
|
+
return;
|
|
28
|
+
if ('reportValidity' in input && !input.reportValidity())
|
|
29
|
+
pass = false;
|
|
30
|
+
});
|
|
31
|
+
return pass;
|
|
32
|
+
}
|
|
33
|
+
/** Merge collected order-options into the quick-purchase payload (FormData or plain object). */
|
|
34
|
+
function appendOrderOptionsToPayload(data, orderOptions) {
|
|
35
|
+
if (!orderOptions.length)
|
|
36
|
+
return;
|
|
37
|
+
if (data && typeof data.append === 'function') {
|
|
38
|
+
orderOptions.forEach((entry, i) => {
|
|
39
|
+
data.append(`order_options[${i}][id]`, String(entry.id));
|
|
40
|
+
data.append(`order_options[${i}][value]`, String(entry.value));
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (data && typeof data === 'object') {
|
|
45
|
+
data.order_options = orderOptions;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Fetch order options and, if any, collect them via the modal (apple-pay mode). Callbacks drive the
|
|
50
|
+
* caller's pre-created session: `beginPendingSession` (no options), `discardPendingSession` (options
|
|
51
|
+
* found — the modal's AP button starts a fresh one), `onSubmit` (submitted).
|
|
52
|
+
*/
|
|
53
|
+
async function resolveApplePayOrderOptions(opts) {
|
|
54
|
+
let resp;
|
|
55
|
+
try {
|
|
56
|
+
resp = await salla.api.withoutNotifier(() => salla.product.api.getOrderOptions([{ id: opts.productId, quantity: opts.quantity }]));
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
salla?.logger?.warn?.('order-options: fetch failed', error);
|
|
60
|
+
opts.beginPendingSession();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const items = resp?.data?.order_options || [];
|
|
64
|
+
if (!items.length) {
|
|
65
|
+
opts.beginPendingSession(); // begin() doesn't need a fresh gesture
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
opts.discardPendingSession(); // drop the unused session; the modal builds a fresh one
|
|
69
|
+
const basePrice = Number(opts.amount) > 0
|
|
70
|
+
? Number(opts.amount)
|
|
71
|
+
: Number(resp?.data?.products?.[0]?.price?.amount) || 0;
|
|
72
|
+
const modal = ensureOrderOptionsModal();
|
|
73
|
+
try {
|
|
74
|
+
await modal.open({
|
|
75
|
+
orderOptions: items,
|
|
76
|
+
basePrice,
|
|
77
|
+
paymentMode: 'apple-pay',
|
|
78
|
+
onSubmit: opts.onSubmit,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// dismissed — no live session
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { reportProductOptionsValiditySync as a, appendOrderOptionsToPayload as b, resolveApplePayOrderOptions as r };
|