@salla.sa/twilight-components 2.14.597 → 2.14.599
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-Dw1N5qBB.js → filepond-Dk1cJoJp.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-C1ipzdpz.js → filepond-plugin-file-poster-Bg4PCTUm.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DbTJ1H8k.js → filepond-plugin-file-validate-size-DmqmRxXK.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CDOD2WKz.js → filepond-plugin-file-validate-type-BKd2QnuC.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-CP7JkpKx.js → filepond-plugin-image-edit-BIPbEbnk.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Bm5i6zMO.js → filepond-plugin-image-exif-orientation-eQvkwjqa.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-INllb63L.js → filepond-plugin-image-preview-Ba8K6ft0.js} +1 -1
- package/dist/cjs/{index-DIEWuq3M.js → index-Bm1Ew-5K.js} +7 -7
- package/dist/cjs/{intlTelInput-bnpl10H7.js → intlTelInput-MWwwr9Td.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-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 +73 -13
- 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 +4 -2
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +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-gift-card-redeem_2.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 +14 -3
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +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-options-modal.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 +11 -4
- package/dist/cjs/salla-orders.cjs.entry.js +32 -2
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +3 -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-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 +3 -3
- package/dist/cjs/salla-search-product-card.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-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-trust-badges.cjs.entry.js +2 -2
- package/dist/cjs/salla-user-menu.cjs.entry.js +33 -2
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/cjs/{vanilla-picker-BaSDLxjI.js → vanilla-picker-BpuzEJnJ.js} +1 -1
- package/dist/collection/Helpers/money-text.js +37 -0
- package/dist/collection/components/salla-comments/salla-comment-item.js +3 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +63 -3
- package/dist/collection/components/salla-login-modal/salla-login-modal.css +3 -0
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +12 -1
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +10 -3
- package/dist/collection/components/salla-orders/salla-orders.js +4 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +2 -0
- package/dist/collection/components/salla-scopes/salla-scopes.css +14 -0
- package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
- package/dist/collection/components/salla-trust-badges/salla-trust-badges.css +17 -12
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +32 -1
- package/dist/components/index.js +3 -3
- package/dist/components/salla-comment-item2.js +3 -1
- package/dist/components/salla-file-upload2.js +63 -3
- package/dist/components/salla-login-modal2.js +13 -2
- package/dist/components/salla-order-totals-card.js +10 -3
- package/dist/components/salla-orders.js +31 -1
- package/dist/components/salla-product-card2.js +2 -0
- package/dist/components/salla-scopes.js +2 -2
- package/dist/components/salla-trust-badges.js +1 -1
- package/dist/components/salla-user-menu.js +32 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{filepond-DfLkIBAw.js → filepond-3PnWp9w_.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-D3ie06bz.js → filepond-plugin-file-poster-DmoyhYlz.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-C_S_eFQe.js → filepond-plugin-file-validate-size-CFkn2RRt.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-BE7nqQRE.js → filepond-plugin-file-validate-type-pyAPn10a.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-C6jDcMnX.js → filepond-plugin-image-edit-B5Rfgqvi.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-nKXdF-ae.js → filepond-plugin-image-exif-orientation-DK15iBED.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-Dzl44GI1.js → filepond-plugin-image-preview-BIW0XW_M.js} +1 -1
- package/dist/esm/{index-BmRQjBRH.js → index-CwwxD-7C.js} +7 -7
- package/dist/esm/{intlTelInput-dGrU4Iu9.js → intlTelInput-DYJOvh3V.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-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 +73 -13
- 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 +4 -2
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +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-gift-card-redeem_2.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 +14 -3
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_3.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +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-options-modal.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 +11 -4
- package/dist/esm/salla-orders.entry.js +32 -2
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +3 -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-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 +3 -3
- package/dist/esm/salla-search-product-card.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-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-trust-badges.entry.js +2 -2
- package/dist/esm/salla-user-menu.entry.js +33 -2
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/salla-wishlist-summary.entry.js +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm/{vanilla-picker-DRghK0RD.js → vanilla-picker-BzVn0xEV.js} +1 -1
- package/dist/twilight/{p-aeafb519.entry.js → p-0253bf71.entry.js} +1 -1
- package/dist/twilight/{p-e2d1d888.entry.js → p-065f2937.entry.js} +1 -1
- package/dist/twilight/{p-e8d94147.entry.js → p-067ad44c.entry.js} +1 -1
- package/dist/twilight/{p-db9994c2.entry.js → p-07817ae8.entry.js} +1 -1
- package/dist/twilight/{p-1f2844db.entry.js → p-0889368b.entry.js} +1 -1
- package/dist/twilight/{p-41248f5f.entry.js → p-0b0c9ecb.entry.js} +1 -1
- package/dist/twilight/{p-4235b3c2.entry.js → p-0ba03206.entry.js} +1 -1
- package/dist/twilight/{p-dd4bcce0.entry.js → p-0bff8609.entry.js} +1 -1
- package/dist/twilight/{p-cca10a34.entry.js → p-10418cc0.entry.js} +1 -1
- package/dist/twilight/{p-f70fa2e9.entry.js → p-114e4228.entry.js} +1 -1
- package/dist/twilight/{p-3bf933f6.entry.js → p-14b1b664.entry.js} +1 -1
- package/dist/twilight/{p-d3be7885.entry.js → p-18e75544.entry.js} +1 -1
- package/dist/twilight/{p-68919916.entry.js → p-1b25ea2a.entry.js} +1 -1
- package/dist/twilight/{p-d307d40a.entry.js → p-1c191c15.entry.js} +1 -1
- package/dist/twilight/{p-12338d19.entry.js → p-1f561241.entry.js} +1 -1
- package/dist/twilight/{p-1908ab44.entry.js → p-1fd1c0a3.entry.js} +1 -1
- package/dist/twilight/{p-730101ff.entry.js → p-20f98a45.entry.js} +1 -1
- package/dist/twilight/{p-3d1842e4.entry.js → p-2213f6eb.entry.js} +1 -1
- package/dist/twilight/{p-7e724019.entry.js → p-25fb1508.entry.js} +1 -1
- package/dist/twilight/{p-f0180034.entry.js → p-261aff22.entry.js} +1 -1
- package/dist/twilight/p-27df0290.entry.js +4 -0
- package/dist/twilight/{p-d034a3ba.entry.js → p-2b5242cb.entry.js} +1 -1
- package/dist/twilight/{p-00e1f5fd.entry.js → p-2db00d46.entry.js} +1 -1
- package/dist/twilight/{p-1c8dde1a.entry.js → p-2f04343f.entry.js} +1 -1
- package/dist/twilight/{p-4b111d7a.entry.js → p-3243ab6e.entry.js} +1 -1
- package/dist/twilight/{p-8c10cb85.entry.js → p-3de0b3ae.entry.js} +1 -1
- package/dist/twilight/p-46c8b068.entry.js +4 -0
- package/dist/twilight/{p-7aa15258.entry.js → p-49bba37d.entry.js} +1 -1
- package/dist/twilight/{p-8e2488fe.entry.js → p-4ca3b245.entry.js} +1 -1
- package/dist/twilight/{p-ece1fecd.entry.js → p-4ebee06a.entry.js} +1 -1
- package/dist/twilight/{p-8b21158b.entry.js → p-509b04c7.entry.js} +1 -1
- package/dist/twilight/{p-4aa07eca.entry.js → p-55399fed.entry.js} +1 -1
- package/dist/twilight/{p-3745be6d.entry.js → p-56c77026.entry.js} +1 -1
- package/dist/twilight/{p-87cedb04.entry.js → p-62373e96.entry.js} +1 -1
- package/dist/twilight/{p-8248cecd.entry.js → p-62c985bc.entry.js} +1 -1
- package/dist/twilight/{p-15ab81d6.entry.js → p-62dc337d.entry.js} +1 -1
- package/dist/twilight/{p-fde4cf31.entry.js → p-651db82c.entry.js} +1 -1
- package/dist/twilight/{p-3f373f1e.entry.js → p-659e00b7.entry.js} +1 -1
- package/dist/twilight/{p-99463d58.entry.js → p-6b2f6957.entry.js} +1 -1
- package/dist/twilight/{p-182d7bab.entry.js → p-6d47b269.entry.js} +1 -1
- package/dist/twilight/p-6d61d93c.entry.js +4 -0
- package/dist/twilight/{p-7dfe99e6.entry.js → p-6e7433f2.entry.js} +1 -1
- package/dist/twilight/{p-e9319448.entry.js → p-6fa1498b.entry.js} +1 -1
- package/dist/twilight/{p-71cbf7a4.entry.js → p-7148dbad.entry.js} +1 -1
- package/dist/twilight/{p-ac7d45b6.entry.js → p-76ca3445.entry.js} +1 -1
- package/dist/twilight/p-79ce9e95.entry.js +4 -0
- package/dist/twilight/{p-ec1589cf.entry.js → p-7f653481.entry.js} +1 -1
- package/dist/twilight/{p-7c7648d7.entry.js → p-83e1c586.entry.js} +1 -1
- package/dist/twilight/{p-3f66f717.entry.js → p-84912a5a.entry.js} +1 -1
- package/dist/twilight/p-89bba634.entry.js +4 -0
- package/dist/twilight/{p-39a16468.entry.js → p-89fddf1e.entry.js} +1 -1
- package/dist/twilight/{p-d542e647.entry.js → p-8aa29666.entry.js} +1 -1
- package/dist/twilight/{p-ab1d320f.entry.js → p-8d99e9d1.entry.js} +1 -1
- package/dist/twilight/{p-5f35b46a.entry.js → p-8e91da09.entry.js} +1 -1
- package/dist/twilight/{p-c5d4f71c.entry.js → p-925ba8ce.entry.js} +1 -1
- package/dist/twilight/{p-51694dd2.entry.js → p-93d284c4.entry.js} +1 -1
- package/dist/twilight/{p-bfdde3db.entry.js → p-96154a67.entry.js} +1 -1
- package/dist/twilight/{p-C1XjCBHg.js → p-B8yyit_i.js} +1 -1
- package/dist/twilight/{p-CWismw4I.js → p-Bb9AkvT4.js} +1 -1
- package/dist/twilight/{p-C48Rktr4.js → p-CYeysHdt.js} +1 -1
- package/dist/twilight/{p-B4fbRnFh.js → p-CaabLwI1.js} +1 -1
- package/dist/twilight/{p-DnZfyhH5.js → p-CntnRJCa.js} +1 -1
- package/dist/twilight/{p-BmRQjBRH.js → p-CwwxD-7C.js} +2 -2
- package/dist/twilight/{p-DYEGhE1O.js → p-DFj0n9Nh.js} +1 -1
- package/dist/twilight/{p-OCGvfvVA.js → p-DHXSZjVo.js} +1 -1
- package/dist/twilight/{p-imI5he7m.js → p-DzBc32wK.js} +1 -1
- package/dist/twilight/{p-BIToxPOg.js → p-FcjN5vEx.js} +1 -1
- package/dist/twilight/{p-5617656f.entry.js → p-a6594c68.entry.js} +1 -1
- package/dist/twilight/{p-c22ea75b.entry.js → p-a743a10a.entry.js} +1 -1
- package/dist/twilight/{p-f348601d.entry.js → p-aaac2388.entry.js} +1 -1
- package/dist/twilight/p-ac8a7743.entry.js +4 -0
- package/dist/twilight/{p-33e769b3.entry.js → p-afd47a18.entry.js} +1 -1
- package/dist/twilight/{p-de3c5f91.entry.js → p-b2ff66ed.entry.js} +1 -1
- package/dist/twilight/{p-cc46f297.entry.js → p-b7c815f7.entry.js} +1 -1
- package/dist/twilight/{p-91326a74.entry.js → p-b7dfb1f1.entry.js} +1 -1
- package/dist/twilight/{p-b5829615.entry.js → p-bc5b70e9.entry.js} +1 -1
- package/dist/twilight/{p-fa600113.entry.js → p-bcbb4a03.entry.js} +1 -1
- package/dist/twilight/{p-96f9eb1f.entry.js → p-c282869e.entry.js} +1 -1
- package/dist/twilight/{p-3a996401.entry.js → p-c4f92bae.entry.js} +1 -1
- package/dist/twilight/{p-58dcc966.entry.js → p-c7a491ef.entry.js} +1 -1
- package/dist/twilight/{p-b5499627.entry.js → p-c84e619a.entry.js} +1 -1
- package/dist/twilight/{p-c3d33aee.entry.js → p-c892e962.entry.js} +1 -1
- package/dist/twilight/{p-2cf7eb3b.entry.js → p-c98d1097.entry.js} +1 -1
- package/dist/twilight/{p-737b93c2.entry.js → p-cce07c4c.entry.js} +1 -1
- package/dist/twilight/{p-60e1fb1a.entry.js → p-d01c4ba8.entry.js} +1 -1
- package/dist/twilight/{p-6b0d6b9b.entry.js → p-d6886b07.entry.js} +1 -1
- package/dist/twilight/{p-6854e982.entry.js → p-d8cf239a.entry.js} +1 -1
- package/dist/twilight/{p-b6c5435e.entry.js → p-db1e0bc6.entry.js} +1 -1
- package/dist/twilight/{p-cf1cc0d1.entry.js → p-dc090987.entry.js} +1 -1
- package/dist/twilight/{p-baaa3e72.entry.js → p-dda47e56.entry.js} +1 -1
- package/dist/twilight/{p-feb068a2.entry.js → p-e1fb95cb.entry.js} +1 -1
- package/dist/twilight/{p-2de666d8.entry.js → p-e248f0d0.entry.js} +1 -1
- package/dist/twilight/{p-3fdaf198.entry.js → p-e4ed760b.entry.js} +1 -1
- package/dist/twilight/{p-2de4c351.entry.js → p-ee2a5db7.entry.js} +1 -1
- package/dist/twilight/{p-a80acba3.entry.js → p-f1d5ebf4.entry.js} +1 -1
- package/dist/twilight/{p-9e196eb0.entry.js → p-f310c72e.entry.js} +1 -1
- package/dist/twilight/p-f345a77d.entry.js +4 -0
- package/dist/twilight/{p-1a8c7481.entry.js → p-f38d6c1b.entry.js} +1 -1
- package/dist/twilight/{p-55b5158c.entry.js → p-f4d52f9b.entry.js} +1 -1
- package/dist/twilight/{p-f76349b3.entry.js → p-f5026adf.entry.js} +1 -1
- package/dist/twilight/{p-61956814.entry.js → p-f51e9549.entry.js} +1 -1
- package/dist/twilight/{p-e6bc3cf4.entry.js → p-f5693509.entry.js} +1 -1
- package/dist/twilight/p-f580d024.entry.js +4 -0
- package/dist/twilight/{p-f5afeed8.entry.js → p-f8b428cb.entry.js} +1 -1
- package/dist/twilight/{p-9108e712.entry.js → p-fe7751a8.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/Helpers/money-text.d.ts +13 -0
- package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +10 -0
- package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +3 -0
- package/dist/types/components/salla-order-totals-card/interfaces.d.ts +3 -3
- package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +2 -0
- package/dist/types/components/salla-scopes/interfaces.d.ts +1 -0
- package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +13 -0
- package/package.json +19 -19
- package/dist/twilight/p-1557d0ca.entry.js +0 -4
- package/dist/twilight/p-19592be3.entry.js +0 -4
- package/dist/twilight/p-1c8bf883.entry.js +0 -4
- package/dist/twilight/p-74ccf675.entry.js +0 -4
- package/dist/twilight/p-844ebeb6.entry.js +0 -4
- package/dist/twilight/p-cdbb6758.entry.js +0 -4
- package/dist/twilight/p-d37e6c2f.entry.js +0 -4
- package/dist/twilight/p-fe3645b0.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 s,H as i,a as e}from"./p-
|
|
4
|
+
import{r as t,h as s,H as i,a as e}from"./p-CwwxD-7C.js";import{W as n}from"./p-CgR-T_ZS.js";import{M as a}from"./p-DmgxDvXL.js";const o=class{constructor(s){t(this,s),this.contacts=salla.config.get("store.contacts"),this.iconsList={mobile:'\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>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',whatsapp:n,phone:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n',telegram:'\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>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n',email:a},this.contactSlot=this.host.querySelector('[slot="contact"]')?.innerHTML||`<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly&&"<span class='unicode'>{value}</span>"}</a>`,salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")}))}connectedCallback(){this.langUnsubscribe=salla.lang.subscribe((()=>{this.contactsTitle&&this.contactsTitle!==this.langTitle||(this.contactsTitle=this.langTitle=salla.lang.get("blocks.footer.social"))}))}disconnectedCallback(){this.langUnsubscribe?.()}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>""!==s)).map((([t,s])=>({type:t,value:s})))}getContactLink(t){const s=this.contacts[t];switch(t){case"phone":case"mobile":return`tel:${s}`;case"whatsapp":const t=(s||"").toString().replace(/[^\d]/g,"");return t?`https://wa.me/${t}`:salla.url.get("whatsapp/send");case"email":return`mailto:${s}`;case"telegram":return s.startsWith("https://t.me/")?s:`https://t.me/${s}`;default:return s}}getContactIcon(t){return this.iconsList[t]}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}render(){const t=this.getContactsArray();if(t&&0!=t.length)return this.isHeader?s(i,{class:"s-contacts s-contacts-header"},t.filter((t=>"phone"==t.type||"email"==t.type)).map(((t,i)=>s("a",{href:this.getContactLink(t.type),key:i,class:"s-contacts-topnav-link"},"email"===t.type?t.value:[s("span",null,this.contactsTitle,": "),s("span",{class:"unicode"},t.value)])))):s(i,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":!0,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,i)=>s("div",{key:i,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){this.host.querySelector('[slot="contact"]')?.remove()}get host(){return e(this)}};o.style='/*!twlt*/.unicode{unicode-bidi:plaintext}.block{display:block}.contents{display:contents}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-contacts-title{margin-bottom:0.75rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}@media (min-width: 1024px){.s-contacts-title{margin-bottom:1.25rem}}.s-contacts-header{display:none;align-items:center}@media (min-width: 1024px){.s-contacts-header{display:flex}}.s-contacts-topnav-link{display:inline-block;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1px;padding-bottom:1px;font-size:0.875rem;line-height:1.25rem;line-height:1;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-contacts-topnav-link:hover{opacity:0.8}.s-contacts-topnav-link:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px}.s-contacts-topnav-link:last-child:where([dir="ltr"],[dir="ltr"] *){border-width:0px;padding-right:0px}.s-contacts-topnav-link:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px}.s-contacts-topnav-link:last-child:where([dir="rtl"],[dir="rtl"] *){border-width:0px;padding-left:0px}.s-contacts-item{display:flex;align-items:center;font-size:0.875rem;line-height:1.25rem;line-height:1}.s-contacts-icon{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;border-width:1px}.s-contacts-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.625rem}.s-contacts-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-contacts-icon svg{height:0.875rem;width:0.875rem;fill:currentColor}.s-contacts-list{display:flex;gap:1rem}.s-contacts-list-horizontal{align-items:center}.s-contacts-list-vertical{flex-direction:column}.s-contacts-list-icons-only .s-contacts-icon{margin-left:0px;margin-right:0px}';export{o as salla_contacts}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,H as s,a as i}from"./p-
|
|
4
|
+
import{r as t,h as e,H as s,a as i}from"./p-CwwxD-7C.js";const a=class{constructor(e){t(this,e),this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{if("string"==typeof this.exclude)try{this.exclude=JSON.parse(this.exclude)}catch(t){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude),this.exclude=[]}this.paymentSlot=this.host.querySelector('[slot="payment"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="{payment}" /></li>',this.sbcSlot=this.host.querySelector('[slot="sbc"]')?.innerHTML||'<li class="s-payments-list-item"><a target="_blank" href="{link}"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" class="s-payments-sbc-image" alt="SBC" /></a></li>',this.codSlot=this.host.querySelector('[slot="cod"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="COD" /></li>',this.payments=salla.config.get("store.settings.payments")}))}paymentLogo(t){const e=`images/payment/${t}_mini.png`;return a.NEW_CDN_LOGOS.includes(t)?salla.url.assetsCdn(e,58,58):salla.url.cdn(e,58,58)}render(){const t=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa"),i=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return e(s,{key:"60b72f2ebc5ca110451eee1470213f9cb8a78708",class:"s-payments-list-wrap"},e("ul",{key:"31f3fe24c210ee4da474bf7945d2ecbc7054b9d9",class:"s-payments-list"},t&&e("li",{key:"cff81724ca2e084e06fdcf34c637d8d48e8d0a41",class:"s-payments-list-item"},e("img",{key:"080404b387136270111e68a123cf48002f83be79",width:58,height:58,decoding:"async",loading:"lazy",src:salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.filter((t=>!this.exclude.includes(t))).map((t=>e("div","cod"==t?{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,this.paymentLogo("cod"))}:{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,this.paymentLogo(t)).replace(/\{payment\}/g,t)}))),i&&e("div",{key:"a658a8e2c91eaddf9336a586aa5e7a87c6be39f6",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${i}`)})))}componentDidLoad(){this.auditTrustBadge()}auditTrustBadge(){if(a.audited||"undefined"==typeof IntersectionObserver)return;if(!this.host.closest("footer"))return;if("SA"!==salla.config.get("store.store_country"))return;if("index"!==salla.config.get("page.slug"))return;if("live"!==salla.config.get("theme.mode")||window.self!==window.top)return;if(!salla.config.get("store.settings.commercial_number")&&!salla.config.get("store.settings.freelance_number"))return;let t=!1;const e=()=>{"visible"!==document.visibilityState&&(t=!0)},s=t=>{const e=t.checkVisibility;if("function"!=typeof e)return!0;const s={contentVisibilityAuto:!0,visibilityProperty:!0};if(!e.call(t,s))return!1;if(e.call(t,{...s,opacityProperty:!0}))return!0;const i=t.getBoundingClientRect();return!(i.bottom>0&&i.right>0&&i.top<window.innerHeight&&i.left<window.innerWidth)},i=()=>{if(e(),t)return null;if(salla.config.isMobileApp())return null;const i=Array.from(document.querySelectorAll("salla-trust-badges"));return i.length?i.some((t=>!t.classList.contains("hydrated")))||i.some(s)?null:"hidden":"absent"},n=new IntersectionObserver((t=>{if(a.audited||!t.some((t=>t.isIntersecting)))return;a.audited=!0,n.disconnect(),e(),document.addEventListener("visibilitychange",e);const s=()=>document.removeEventListener("visibilitychange",e);setTimeout((()=>{i()?setTimeout((async()=>{const t=i();if(s(),t&&!salla.storage.getWithTTL("salla::tb-audit"))try{await(salla.analytics?.log("salla::trust-badges.hidden",{store_id:salla.config.get("store.id"),store_username:salla.config.get("store.username"),theme_id:salla.config.get("theme.name"),page_slug:salla.config.get("page.slug"),cause:t})),salla.storage.setWithTTL("salla::tb-audit",!0,1440)}catch(t){salla.logger.error("salla-payments:: failed to report a hidden trust badge",t)}}),2e3):s()}),4e3)}),{threshold:.5});n.observe(this.host)}componentDidRender(){this.host.querySelectorAll("#payment-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#sbc-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#cod-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelector('[slot="payment"]')?.remove(),this.host.querySelector('[slot="sbc"]')?.remove(),this.host.querySelector('[slot="cod"]')?.remove()}get host(){return i(this)}};a.NEW_CDN_LOGOS=["tabby_installment","emkan_installment","benefit","qpay","omannet"],a.audited=!1,a.style='/*!twlt*/:host{display:block}.visible{visibility:visible}.static{position:static}.hidden{display:none}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-payments-list{display:flex;flex-wrap:wrap;align-items:stretch;justify-content:center;gap:0.5rem}.s-payments-list:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-payments-list-item{display:flex;height:2rem;width:3rem;align-items:center;justify-content:center;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.25rem}.s-payments-list-item img{max-height:100%;object-fit:contain}.s-payments-sbc-image{height:1.5rem;border-radius:0.125rem;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-payments-sbc-image:hover{opacity:0.8}';export{a as salla_payments}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,h as a,F as s,a as i}from"./p-CwwxD-7C.js";const e=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,this.loginSucceeded=!1,salla.event.on("login::open",(t=>this.onLoginOpen(t))),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")}))}onLoginOpen(t){salla.mobile?.isNativeLoginEnabled?.()||(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."))}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 this.loginSucceeded=!0,!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()}onVisibilityChanged(t){t?this.loginSucceeded=!1:!this.loginSucceeded&&Salla.event.emit("salla-login::dismissed")}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"),i=!1;if(Object.entries(t).filter((t=>!Salla.storage.get(t[0]))).forEach((([t,e])=>{salla.log("Shared storage from accounts domain",t,e);let l="string"==typeof e?e?.replace(/^"|"$/g,""):e;salla.storage.set(t,l),"token"===t&&(a=l),"user"===t&&s&&l.id!==s&&(i=!0)})),a){this.loginSucceeded=!0,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)}i&&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 i&&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",onModalVisibilityChanged:t=>this.onVisibilityChanged(t.detail)},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}&version=${salla.config.get("login.version","0.1.78")}`,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 i(this)}};e.style="/*!twlt*/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%}.visible{visibility:visible}.inline{display:inline}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}";export{e as salla_login_modal}
|