@salla.sa/twilight-components 2.14.207 → 2.14.209
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/{app-globals-C_Mp1ous.js → app-globals-DnyRiRYq.js} +3 -3
- package/dist/cjs/{app-globals-C_Mp1ous.js.map → app-globals-DnyRiRYq.js.map} +1 -1
- package/dist/cjs/{index-bKn8ju_o.js → index--fMSCM2r.js} +4 -4
- package/dist/cjs/index--fMSCM2r.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.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-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.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-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.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 +1 -1
- package/dist/cjs/salla-metadata.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.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.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-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.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/twilight.cjs.js +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{app-globals-BSOA2rRD.js → app-globals-DmlqkOgT.js} +3 -3
- package/dist/esm/{app-globals-BSOA2rRD.js.map → app-globals-DmlqkOgT.js.map} +1 -1
- package/dist/esm/{index-Bnb9o2EU.js → index-BatAlgoq.js} +4 -4
- package/dist/esm/index-BatAlgoq.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm/salla-advertisement.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-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.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-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.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.entry.js +1 -1
- package/dist/esm/salla-order-summary.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-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tooltip.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/twilight.js +3 -3
- package/dist/esm-es5/{app-globals-BSOA2rRD.js → app-globals-DmlqkOgT.js} +2 -2
- package/dist/esm-es5/{app-globals-BSOA2rRD.js.map → app-globals-DmlqkOgT.js.map} +1 -1
- package/dist/esm-es5/{index-Bnb9o2EU.js → index-BatAlgoq.js} +3 -3
- package/dist/esm-es5/index-BatAlgoq.js.map +1 -0
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +2 -2
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +2 -2
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-76e6cd7c.system.entry.js → p-03d05ff7.system.entry.js} +2 -2
- package/dist/twilight/{p-78c84518.system.entry.js → p-079bbb77.system.entry.js} +2 -2
- package/dist/twilight/{p-3f779d9c.system.entry.js → p-0bfd5650.system.entry.js} +2 -2
- package/dist/twilight/{p-6aad8e83.entry.js → p-1a42e5c2.entry.js} +2 -2
- package/dist/twilight/{p-b9f89fcb.system.entry.js → p-1a680b8b.system.entry.js} +2 -2
- package/dist/twilight/{p-ac73c90f.entry.js → p-1e06c24f.entry.js} +2 -2
- package/dist/twilight/{p-ce66a530.system.entry.js → p-1e1756f3.system.entry.js} +2 -2
- package/dist/twilight/{p-cc600b50.system.entry.js → p-28f617a0.system.entry.js} +2 -2
- package/dist/twilight/{p-2e5f684a.entry.js → p-2e87cd6a.entry.js} +2 -2
- package/dist/twilight/{p-89fbd685.entry.js → p-36eb860c.entry.js} +2 -2
- package/dist/twilight/{p-de98257a.system.entry.js → p-3fd47568.system.entry.js} +2 -2
- package/dist/twilight/{p-97ae00c9.system.entry.js → p-45757266.system.entry.js} +2 -2
- package/dist/twilight/{p-7366b64b.system.entry.js → p-4d9fe421.system.entry.js} +2 -2
- package/dist/twilight/{p-4f378af6.system.entry.js → p-50ae60d2.system.entry.js} +2 -2
- package/dist/twilight/{p-cb59ade7.entry.js → p-54f6791f.entry.js} +2 -2
- package/dist/twilight/{p-a550fd33.entry.js → p-59903c79.entry.js} +2 -2
- package/dist/twilight/{p-e0dc6027.entry.js → p-5dab89a8.entry.js} +6 -6
- package/dist/twilight/{p-01161a80.entry.js → p-5dac65de.entry.js} +2 -2
- package/dist/twilight/{p-18022f58.entry.js → p-5e6fa731.entry.js} +2 -2
- package/dist/twilight/p-60589ce1.system.entry.js +5 -0
- package/dist/twilight/{p-ac010210.system.entry.js → p-6100976f.system.entry.js} +2 -2
- package/dist/twilight/p-65cd9e7a.system.entry.js +5 -0
- package/dist/twilight/{p-6bc0214a.entry.js → p-67a256a7.entry.js} +2 -2
- package/dist/twilight/{p-242c0564.entry.js → p-6955ce69.entry.js} +2 -2
- package/dist/twilight/{p-33649ba5.entry.js → p-70704e1d.entry.js} +2 -2
- package/dist/twilight/{p-3921a8c6.entry.js → p-78077873.entry.js} +2 -2
- package/dist/twilight/{p-ed88e346.system.entry.js → p-78a416ca.system.entry.js} +2 -2
- package/dist/twilight/{p-36f30c6a.system.entry.js → p-7907509a.system.entry.js} +2 -2
- package/dist/twilight/{p-410915f7.system.entry.js → p-7abc0612.system.entry.js} +2 -2
- package/dist/twilight/{p-8b0d2f99.system.entry.js → p-7d15f3b4.system.entry.js} +2 -2
- package/dist/twilight/{p-d1387d06.entry.js → p-82f04007.entry.js} +2 -2
- package/dist/twilight/{p-ec115a9a.entry.js → p-83d6ce59.entry.js} +2 -2
- package/dist/twilight/{p-d212a02f.system.entry.js → p-8da32ed6.system.entry.js} +2 -2
- package/dist/twilight/{p-e6cfbe60.system.entry.js → p-8f50f4b9.system.entry.js} +2 -2
- package/dist/twilight/{p-261cb51a.entry.js → p-9189f52f.entry.js} +2 -2
- package/dist/twilight/{p-afac5532.system.entry.js → p-92235f14.system.entry.js} +2 -2
- package/dist/twilight/{p-79865a3f.entry.js → p-97b48d7e.entry.js} +2 -2
- package/dist/twilight/{p-8OKI0xnm.system.js.map → p-AnMu3g7b.system.js.map} +1 -1
- package/dist/twilight/{p-BF9hBzYP.system.js.map → p-B3RHXsr7.system.js.map} +1 -1
- package/dist/twilight/{p-8fgRDndx.system.js.map → p-B4SU1g3q.system.js.map} +1 -1
- package/dist/twilight/{p-DIy6y8WY.system.js.map → p-BHW-GO50.system.js.map} +1 -1
- package/dist/twilight/{p-CyzTEVh0.system.js.map → p-BTTIDEre.system.js.map} +1 -1
- package/dist/twilight/{p-OkHV0dSG.system.js.map → p-B_OizA7a.system.js.map} +1 -1
- package/dist/twilight/{p-Bnb9o2EU.js → p-BatAlgoq.js} +3 -3
- package/dist/twilight/p-BatAlgoq.js.map +1 -0
- package/dist/twilight/{p-Evnbx58Y.system.js.map → p-Bcb7yCXn.system.js.map} +1 -1
- package/dist/twilight/{p-DiWkSRWh.system.js.map → p-BhZpSwqI.system.js.map} +1 -1
- package/dist/twilight/{p-BKj50GYl.system.js.map → p-Bmd6zZ0m.system.js.map} +1 -1
- package/dist/twilight/{p-CS1GuA26.system.js.map → p-BsbNF3Z-.system.js.map} +1 -1
- package/dist/twilight/{p-9WKAzrvM.system.js.map → p-BvWLO2gs.system.js.map} +1 -1
- package/dist/twilight/{p-D7TBi1pO.system.js.map → p-C0U9gYYp.system.js.map} +1 -1
- package/dist/twilight/{p-DJYvVLRB.system.js.map → p-C6nZWk1r.system.js.map} +1 -1
- package/dist/twilight/{p-CZnno-Rq.system.js.map → p-CF1o0vv1.system.js.map} +1 -1
- package/dist/twilight/{p-CTW8mSLV.system.js → p-CIja5TEZ.system.js} +2 -2
- package/dist/twilight/{p-CTW8mSLV.system.js.map → p-CIja5TEZ.system.js.map} +1 -1
- package/dist/twilight/{p-B98ni0f1.js → p-CP2j3ZPg.js} +2 -2
- package/dist/twilight/{p-B98ni0f1.js.map → p-CP2j3ZPg.js.map} +1 -1
- package/dist/twilight/{p-ByLjJNAK.system.js.map → p-ChP4xxfM.system.js.map} +1 -1
- package/dist/twilight/{p-DRKqy1OJ.system.js.map → p-CjW13N2A.system.js.map} +1 -1
- package/dist/twilight/{p-Da7qarZi.system.js.map → p-CqJ0hEUd.system.js.map} +1 -1
- package/dist/twilight/{p-Bguq3N_k.system.js.map → p-Cr7ohUhK.system.js.map} +1 -1
- package/dist/twilight/{p-CBdwm9Tb.system.js.map → p-CrTvwSzO.system.js.map} +1 -1
- package/dist/twilight/{p-BADGJnjL.system.js → p-CsdOUKHt.system.js} +3 -3
- package/dist/twilight/p-CsdOUKHt.system.js.map +1 -0
- package/dist/twilight/{p-jt0p_nQ2.system.js.map → p-CyHoKHUE.system.js.map} +1 -1
- package/dist/twilight/{p-CmE6HYto.system.js.map → p-DDmdhB_y.system.js.map} +1 -1
- package/dist/twilight/{p-BkE_0pX2.system.js.map → p-DNNIyeMq.system.js.map} +1 -1
- package/dist/twilight/{p-BGAkzMa5.system.js.map → p-DSOiABpX.system.js.map} +1 -1
- package/dist/twilight/{p-B6_jmgEs.system.js.map → p-DXq_-MMV.system.js.map} +1 -1
- package/dist/twilight/{p-yC3sW8YP.system.js.map → p-DevZyOH3.system.js.map} +1 -1
- package/dist/twilight/{p-DyvalDgd.system.js.map → p-DmsQsph8.system.js.map} +1 -1
- package/dist/twilight/{p-4O9dEzXd.system.js.map → p-Dp_e9gUx.system.js.map} +1 -1
- package/dist/twilight/{p-DBCkCVZ9.system.js.map → p-DxqE-rkL.system.js.map} +1 -1
- package/dist/twilight/{p-BZoyiOv5.system.js.map → p-QYxprPHQ.system.js.map} +1 -1
- package/dist/twilight/{p-CLyAgwAV.system.js.map → p-Yu0MdovS.system.js.map} +1 -1
- package/dist/twilight/{p-db1b9306.entry.js → p-a3e58405.entry.js} +2 -2
- package/dist/twilight/{p-892c7f39.entry.js → p-a4965cf0.entry.js} +2 -2
- package/dist/twilight/{p-a07e074b.system.entry.js → p-afbd4667.system.entry.js} +2 -2
- package/dist/twilight/{p-7692746d.system.entry.js → p-b025baa0.system.entry.js} +2 -2
- package/dist/twilight/{p-3c66790e.entry.js → p-b431cc5d.entry.js} +2 -2
- package/dist/twilight/{p-a131c1a2.entry.js → p-b7850c72.entry.js} +2 -2
- package/dist/twilight/{p-4845ca97.system.entry.js → p-bca59e7f.system.entry.js} +2 -2
- package/dist/twilight/{p-39d2476a.system.entry.js → p-c027ba55.system.entry.js} +2 -2
- package/dist/twilight/p-c5b13164.entry.js +5 -0
- package/dist/twilight/{p-7b53600b.entry.js → p-c6f91c40.entry.js} +2 -2
- package/dist/twilight/{p-c9805d21.entry.js → p-cd1ed9ac.entry.js} +2 -2
- package/dist/twilight/{p-e8e459c6.system.entry.js → p-cdf43f94.system.entry.js} +2 -2
- package/dist/twilight/{p-0adcde42.entry.js → p-d696f322.entry.js} +2 -2
- package/dist/twilight/{p-11e926d9.entry.js → p-d7fc8c04.entry.js} +2 -2
- package/dist/twilight/{p-b039d04c.system.entry.js → p-db033470.system.entry.js} +2 -2
- package/dist/twilight/p-e95a56fb.entry.js +5 -0
- package/dist/twilight/{p-5a5b02fb.system.entry.js → p-ed750dff.system.entry.js} +3 -3
- package/dist/twilight/{p-7fe0a8a8.entry.js → p-f0448908.entry.js} +2 -2
- package/dist/twilight/{p-657ab253.system.entry.js → p-f3b6b7d1.system.entry.js} +2 -2
- package/dist/twilight/{p-dbe5784e.entry.js → p-f50625b0.entry.js} +2 -2
- package/dist/twilight/{p-b96cc5af.system.entry.js → p-fab255ef.system.entry.js} +2 -2
- package/dist/twilight/{p-C9voGlG0.system.js → p-whb3OThz.system.js} +2 -2
- package/dist/twilight/{p-C9voGlG0.system.js.map → p-whb3OThz.system.js.map} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-bKn8ju_o.js.map +0 -1
- package/dist/esm/index-Bnb9o2EU.js.map +0 -1
- package/dist/esm-es5/index-Bnb9o2EU.js.map +0 -1
- package/dist/twilight/p-0d18c621.system.entry.js +0 -5
- package/dist/twilight/p-2e90687d.entry.js +0 -5
- package/dist/twilight/p-37e0e136.system.entry.js +0 -5
- package/dist/twilight/p-817b6fb8.entry.js +0 -5
- package/dist/twilight/p-BADGJnjL.system.js.map +0 -1
- package/dist/twilight/p-Bnb9o2EU.js.map +0 -1
- /package/dist/twilight/{p-76e6cd7c.system.entry.js.map → p-03d05ff7.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-78c84518.system.entry.js.map → p-079bbb77.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3f779d9c.system.entry.js.map → p-0bfd5650.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6aad8e83.entry.js.map → p-1a42e5c2.entry.js.map} +0 -0
- /package/dist/twilight/{p-b9f89fcb.system.entry.js.map → p-1a680b8b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ac73c90f.entry.js.map → p-1e06c24f.entry.js.map} +0 -0
- /package/dist/twilight/{p-ce66a530.system.entry.js.map → p-1e1756f3.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cc600b50.system.entry.js.map → p-28f617a0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2e5f684a.entry.js.map → p-2e87cd6a.entry.js.map} +0 -0
- /package/dist/twilight/{p-89fbd685.entry.js.map → p-36eb860c.entry.js.map} +0 -0
- /package/dist/twilight/{p-de98257a.system.entry.js.map → p-3fd47568.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-97ae00c9.system.entry.js.map → p-45757266.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7366b64b.system.entry.js.map → p-4d9fe421.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4f378af6.system.entry.js.map → p-50ae60d2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cb59ade7.entry.js.map → p-54f6791f.entry.js.map} +0 -0
- /package/dist/twilight/{p-a550fd33.entry.js.map → p-59903c79.entry.js.map} +0 -0
- /package/dist/twilight/{p-e0dc6027.entry.js.map → p-5dab89a8.entry.js.map} +0 -0
- /package/dist/twilight/{p-01161a80.entry.js.map → p-5dac65de.entry.js.map} +0 -0
- /package/dist/twilight/{p-18022f58.entry.js.map → p-5e6fa731.entry.js.map} +0 -0
- /package/dist/twilight/{p-0d18c621.system.entry.js.map → p-60589ce1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ac010210.system.entry.js.map → p-6100976f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-37e0e136.system.entry.js.map → p-65cd9e7a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6bc0214a.entry.js.map → p-67a256a7.entry.js.map} +0 -0
- /package/dist/twilight/{p-242c0564.entry.js.map → p-6955ce69.entry.js.map} +0 -0
- /package/dist/twilight/{p-33649ba5.entry.js.map → p-70704e1d.entry.js.map} +0 -0
- /package/dist/twilight/{p-3921a8c6.entry.js.map → p-78077873.entry.js.map} +0 -0
- /package/dist/twilight/{p-ed88e346.system.entry.js.map → p-78a416ca.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-36f30c6a.system.entry.js.map → p-7907509a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-410915f7.system.entry.js.map → p-7abc0612.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8b0d2f99.system.entry.js.map → p-7d15f3b4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d1387d06.entry.js.map → p-82f04007.entry.js.map} +0 -0
- /package/dist/twilight/{p-ec115a9a.entry.js.map → p-83d6ce59.entry.js.map} +0 -0
- /package/dist/twilight/{p-d212a02f.system.entry.js.map → p-8da32ed6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e6cfbe60.system.entry.js.map → p-8f50f4b9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-261cb51a.entry.js.map → p-9189f52f.entry.js.map} +0 -0
- /package/dist/twilight/{p-afac5532.system.entry.js.map → p-92235f14.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-79865a3f.entry.js.map → p-97b48d7e.entry.js.map} +0 -0
- /package/dist/twilight/{p-db1b9306.entry.js.map → p-a3e58405.entry.js.map} +0 -0
- /package/dist/twilight/{p-892c7f39.entry.js.map → p-a4965cf0.entry.js.map} +0 -0
- /package/dist/twilight/{p-a07e074b.system.entry.js.map → p-afbd4667.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7692746d.system.entry.js.map → p-b025baa0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3c66790e.entry.js.map → p-b431cc5d.entry.js.map} +0 -0
- /package/dist/twilight/{p-a131c1a2.entry.js.map → p-b7850c72.entry.js.map} +0 -0
- /package/dist/twilight/{p-4845ca97.system.entry.js.map → p-bca59e7f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-39d2476a.system.entry.js.map → p-c027ba55.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-817b6fb8.entry.js.map → p-c5b13164.entry.js.map} +0 -0
- /package/dist/twilight/{p-7b53600b.entry.js.map → p-c6f91c40.entry.js.map} +0 -0
- /package/dist/twilight/{p-c9805d21.entry.js.map → p-cd1ed9ac.entry.js.map} +0 -0
- /package/dist/twilight/{p-e8e459c6.system.entry.js.map → p-cdf43f94.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0adcde42.entry.js.map → p-d696f322.entry.js.map} +0 -0
- /package/dist/twilight/{p-11e926d9.entry.js.map → p-d7fc8c04.entry.js.map} +0 -0
- /package/dist/twilight/{p-b039d04c.system.entry.js.map → p-db033470.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2e90687d.entry.js.map → p-e95a56fb.entry.js.map} +0 -0
- /package/dist/twilight/{p-5a5b02fb.system.entry.js.map → p-ed750dff.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7fe0a8a8.entry.js.map → p-f0448908.entry.js.map} +0 -0
- /package/dist/twilight/{p-657ab253.system.entry.js.map → p-f3b6b7d1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-dbe5784e.entry.js.map → p-f50625b0.entry.js.map} +0 -0
- /package/dist/twilight/{p-b96cc5af.system.entry.js.map → p-fab255ef.system.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,r,s){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):n(e.value).then(a,o)}l((s=s.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,n,i,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(e){return function(t){return l([e,t])}}function l(o){if(s)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(r=0)),r)try{if(s=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];n=0}finally{s=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-BADGJnjL.system.js"],(function(e){"use strict";var t,r,s;return{setters:[function(e){t=e.r;r=e.h;s=e.g}],execute:function(){var n;(function(e){e["ProductDetail"]="product.single";e["Cart"]="cart"})(n||(n={}));var i;(function(e){e["Conditional"]="conditional";e["PercentageOrFixed"]="fixed";e["DiscountsTable"]="discounts_table";e["Bank"]="bank";e["BuyXGetY"]="buy_x_get_y";e["SpecialPrice"]="special_price"})(i||(i={}));var a='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';var o=e("salla_offer",function(){function e(e){var r=this;t(this,e);var s;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){r.offer_with_price_text=salla.lang.get("pages.offer.with_price");r.with_discount_text=salla.lang.get("pages.products.with_a_discount");r.product_discount_text=salla.lang.get("pages.products.discount");r.special_offer_text=salla.lang.get("pages.products.special_offer");r.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");r.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");r.buy_quantity_text(0)}));salla.onReady((function(){r.currentPage=salla.config.get("page.slug");r.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((s=this.host.querySelector('[slot="category"]'))===null||s===void 0?void 0:s.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getEndpointByPageName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!(this.currentPage==n.Cart))return[3,2];return[4,Salla.cart.getCurrentCartId()];case 1:e=t.sent();return[2,"offers/cart/".concat(e)];case 2:if(this.currentPage==n.ProductDetail){return[2,"offers/product/".concat(salla.config.get("page.id"))]}return[2,"offers"]}}))}))};e.prototype.emitPromotionViewed=function(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;var e={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:1};salla.event.emit("promotion::viewed",[e])};e.prototype.emitPromotionClicked=function(e){if(e===void 0){e=1}if(!(this.offersList.length&&this.canRender&&this.showOffer))return;var t={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:e};salla.event.emit("promotion::clicked",[t])};e.prototype.componentWillLoad=function(){var e=this;this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((function(e){return salla.onReady(e)})).then((function(){e.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(e.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((function(){return __awaiter(e,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:t=(e=salla.api).request;return[4,this.getEndpointByPageName()];case 1:return[2,t.apply(e,[r.sent()])]}}))}))})).then((function(t){if(!(e.offersList=t.data).length){throw new Error("salla-offers:: There is no offers!")}var r=e.offersList.find((function(e){return[i.SpecialPrice,i.Bank,i.BuyXGetY,i.DiscountsTable].includes(e.type)}));if(!r){throw new Error("salla-offers:: Offer type not supported yet!")}if(r.type===i.DiscountsTable){return e.offersList=[r]}if(e.isBankOffer=r.type===i.Bank){e.offersList=e.offersList.filter((function(e){return e.type===i.Bank}));e.isMultipleBank=e.offersList.length>1;return e.offersList}if(r.type===i.SpecialPrice){var s=r.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((function(t){r.details.products=t.data;return e.offersList=[r]})):salla.product.api.categories().then((function(t){var n=e.findCategories(t.data,s.targets);r.details.categories=n;return e.offersList=[r]}))}var n=r.details.get;return n.source==="products"?salla.product.api.fetch({source:"selected",source_value:n.source_value}).then((function(t){n.products=t.data;r.details.get=n;return e.offersList=[r]})):salla.product.api.categories().then((function(t){n.categories=e.findCategories(t.data,n.source_value);r.details.get=n;return e.offersList=[r]}))})).then((function(t){salla.storage.set(e.getStorageKey(),{offers:t,stored_at:(new Date).getTime()});e.canRender=true})).catch((function(e){salla.logger.warn(e)}))};e.prototype.componentDidLoad=function(){var e=this.host.querySelector(".s-slider-block__title-nav");e===null||e===void 0?void 0:e.classList.add("s-offer-bank-payment-nav");this.emitPromotionViewed()};e.prototype.findCategories=function(e,t){var r;var s=[];for(var n=0,i=e;n<i.length;n++){var a=i[n];if(t.includes(a.id_||a.id)){s.push(a)}if(((r=a.sub_categories)===null||r===void 0?void 0:r.length)>0){s=s.concat(this.findCategories(a.sub_categories,t))}}return s};e.prototype.getStorageKey=function(){try{var e=salla.config.get("page.slug").replace(".","_");var t=salla.lang.getLocale();var r=salla.config.currency().code;if(!e||!t||!r){throw new Error("Unable to get the storage key.")}return"s-offers-".concat(e,"-").concat(salla.config.get("page.id"),"-").concat(t,"-").concat(r)}catch(e){return""}};e.prototype.getOffersFromStorage=function(){var e=salla.storage.get(this.getStorageKey());if(!e||e.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(e.offers)};e.prototype.render=function(){var e=this;if(!this.offersList.length||!this.canRender||!this.showOffer)return null;var t=this.offersList[0];var s=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:t.title;var n=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:t.description;var i={"block-title":s,"block-subTitle":n,"show-controls":this.isMultipleBank};return r("div",{class:"s-offer-wrapper",onClick:function(){return e.emitPromotionClicked()}},r("p",{class:"s-offer-corner-badge"},this.special_offer_text),r("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},i),r("div",{slot:"items"},this.renderSectionForOfferType(t.type))))};e.prototype.renderSectionForOfferType=function(e){if(this.isBankOffer){return this.renderBankSection()}if(e==i.SpecialPrice){return this.renderSpecialPriceSection()}if(e==i.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()};e.prototype.getCategoriesSection=function(e){return r("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon||"sicon-store").replace(/\{name\}/g,e.name)})};e.prototype.renderBuyXGetYSection=function(){var e=this;var t,s;var n=this.offersList[0].details;return[(t=n.get.products)===null||t===void 0?void 0:t.map((function(t){return r("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?r(e.productCardComponent,{product:t}):r("salla-product-card",{"shadow-on-hover":true,product:t}))})),(s=n.get.categories)===null||s===void 0?void 0:s.map((function(t){return e.getCategoriesSection(t)}))]};e.prototype.renderBankSection=function(){var e=this;return this.offersList.map((function(t){return r("div",{class:{"s-offer-slide-one-sixth":e.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!e.isMultipleBank}},r("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!e.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":e.isMultipleBank}},r("div",{class:"s-offer-bank-logo"},r("img",{src:t.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":t.details.logo,alt:t.title+" offer"})),r("ul",{class:"s-offer-bank-payment-wrapper"},t.details.payments.map((function(e){return r("li",{class:"s-offer-bank-payment-single"},r("img",{src:salla.url.cdn("images/payment/"+e+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+".png"),alt:"payment"}))}))),e.isMultipleBank?r("p",{class:"s-offer-bank-payment-discount-percent"},"".concat(e.product_discount_text," ").concat(t.details.discount_value).concat(t.details.discount_type==="percentage"&&"%")):""),!e.isMultipleBank?r("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},r("h2",null,e.offersList[0].title),r("p",{innerHTML:e.generateBankDescription(e.offersList[0].description,t.details.discount_value)})):"")}))};e.prototype.generateBankDescription=function(e,t){return e.replace(new RegExp("".concat(t," %")),'<span class="s-offer-bank-message-amount">'.concat(t," %</span>"))};e.prototype.renderDiscountTableSection=function(){var e=this;var t;var s=this.offersList[0];var n=s.details.show_price_after_discount;return(t=this.offersList[0].details.discounts)===null||t===void 0?void 0:t.map((function(t){return r("div",{class:"s-offer-slide-one-fourth"},r("div",{class:"s-offer-slide-offer-entry"},r("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},r("p",{class:"s-offer-slide-offer-entry-quantity"},e.buy_quantity_text(t.quantity)),n?r("div",{class:"s-offer-slide-offer-entry-price"},r("span",null,e.offer_with_price_text),r("span",{class:"s-offer-slide-offer-entry-price-amount"},t.discounted_amount)," ",r("span",null,e.userCurrency)):""),r("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},e.with_discount_text,"(",r("span",null,t.percentage,!!t.percentage&&"%"),")")))}))};e.prototype.renderSpecialPriceSection=function(){var e=this;var t,s;var n=this.offersList[0].details;return[n.apply_to==="product"&&((t=n.products)===null||t===void 0?void 0:t.map((function(t){return r("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?r(e.productCardComponent,{product:t}):r("salla-product-card",{"shadow-on-hover":true,product:t}))}))),n.apply_to==="category"&&((s=n.categories)===null||s===void 0?void 0:s.map((function(t){return e.getCategoriesSection(t)})))]};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=a}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-CsdOUKHt.system.js"],(function(e){"use strict";var t,r,s;return{setters:[function(e){t=e.r;r=e.h;s=e.g}],execute:function(){var n;(function(e){e["ProductDetail"]="product.single";e["Cart"]="cart"})(n||(n={}));var i;(function(e){e["Conditional"]="conditional";e["PercentageOrFixed"]="fixed";e["DiscountsTable"]="discounts_table";e["Bank"]="bank";e["BuyXGetY"]="buy_x_get_y";e["SpecialPrice"]="special_price"})(i||(i={}));var a='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';var o=e("salla_offer",function(){function e(e){var r=this;t(this,e);var s;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){r.offer_with_price_text=salla.lang.get("pages.offer.with_price");r.with_discount_text=salla.lang.get("pages.products.with_a_discount");r.product_discount_text=salla.lang.get("pages.products.discount");r.special_offer_text=salla.lang.get("pages.products.special_offer");r.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");r.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");r.buy_quantity_text(0)}));salla.onReady((function(){r.currentPage=salla.config.get("page.slug");r.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((s=this.host.querySelector('[slot="category"]'))===null||s===void 0?void 0:s.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getEndpointByPageName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!(this.currentPage==n.Cart))return[3,2];return[4,Salla.cart.getCurrentCartId()];case 1:e=t.sent();return[2,"offers/cart/".concat(e)];case 2:if(this.currentPage==n.ProductDetail){return[2,"offers/product/".concat(salla.config.get("page.id"))]}return[2,"offers"]}}))}))};e.prototype.emitPromotionViewed=function(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;var e={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:1};salla.event.emit("promotion::viewed",[e])};e.prototype.emitPromotionClicked=function(e){if(e===void 0){e=1}if(!(this.offersList.length&&this.canRender&&this.showOffer))return;var t={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:e};salla.event.emit("promotion::clicked",[t])};e.prototype.componentWillLoad=function(){var e=this;this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((function(e){return salla.onReady(e)})).then((function(){e.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(e.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((function(){return __awaiter(e,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:t=(e=salla.api).request;return[4,this.getEndpointByPageName()];case 1:return[2,t.apply(e,[r.sent()])]}}))}))})).then((function(t){if(!(e.offersList=t.data).length){throw new Error("salla-offers:: There is no offers!")}var r=e.offersList.find((function(e){return[i.SpecialPrice,i.Bank,i.BuyXGetY,i.DiscountsTable].includes(e.type)}));if(!r){throw new Error("salla-offers:: Offer type not supported yet!")}if(r.type===i.DiscountsTable){return e.offersList=[r]}if(e.isBankOffer=r.type===i.Bank){e.offersList=e.offersList.filter((function(e){return e.type===i.Bank}));e.isMultipleBank=e.offersList.length>1;return e.offersList}if(r.type===i.SpecialPrice){var s=r.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((function(t){r.details.products=t.data;return e.offersList=[r]})):salla.product.api.categories().then((function(t){var n=e.findCategories(t.data,s.targets);r.details.categories=n;return e.offersList=[r]}))}var n=r.details.get;return n.source==="products"?salla.product.api.fetch({source:"selected",source_value:n.source_value}).then((function(t){n.products=t.data;r.details.get=n;return e.offersList=[r]})):salla.product.api.categories().then((function(t){n.categories=e.findCategories(t.data,n.source_value);r.details.get=n;return e.offersList=[r]}))})).then((function(t){salla.storage.set(e.getStorageKey(),{offers:t,stored_at:(new Date).getTime()});e.canRender=true})).catch((function(e){salla.logger.warn(e)}))};e.prototype.componentDidLoad=function(){var e=this.host.querySelector(".s-slider-block__title-nav");e===null||e===void 0?void 0:e.classList.add("s-offer-bank-payment-nav");this.emitPromotionViewed()};e.prototype.findCategories=function(e,t){var r;var s=[];for(var n=0,i=e;n<i.length;n++){var a=i[n];if(t.includes(a.id_||a.id)){s.push(a)}if(((r=a.sub_categories)===null||r===void 0?void 0:r.length)>0){s=s.concat(this.findCategories(a.sub_categories,t))}}return s};e.prototype.getStorageKey=function(){try{var e=salla.config.get("page.slug").replace(".","_");var t=salla.lang.getLocale();var r=salla.config.currency().code;if(!e||!t||!r){throw new Error("Unable to get the storage key.")}return"s-offers-".concat(e,"-").concat(salla.config.get("page.id"),"-").concat(t,"-").concat(r)}catch(e){return""}};e.prototype.getOffersFromStorage=function(){var e=salla.storage.get(this.getStorageKey());if(!e||e.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(e.offers)};e.prototype.render=function(){var e=this;if(!this.offersList.length||!this.canRender||!this.showOffer)return null;var t=this.offersList[0];var s=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:t.title;var n=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:t.description;var i={"block-title":s,"block-subTitle":n,"show-controls":this.isMultipleBank};return r("div",{class:"s-offer-wrapper",onClick:function(){return e.emitPromotionClicked()}},r("p",{class:"s-offer-corner-badge"},this.special_offer_text),r("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},i),r("div",{slot:"items"},this.renderSectionForOfferType(t.type))))};e.prototype.renderSectionForOfferType=function(e){if(this.isBankOffer){return this.renderBankSection()}if(e==i.SpecialPrice){return this.renderSpecialPriceSection()}if(e==i.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()};e.prototype.getCategoriesSection=function(e){return r("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon||"sicon-store").replace(/\{name\}/g,e.name)})};e.prototype.renderBuyXGetYSection=function(){var e=this;var t,s;var n=this.offersList[0].details;return[(t=n.get.products)===null||t===void 0?void 0:t.map((function(t){return r("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?r(e.productCardComponent,{product:t}):r("salla-product-card",{"shadow-on-hover":true,product:t}))})),(s=n.get.categories)===null||s===void 0?void 0:s.map((function(t){return e.getCategoriesSection(t)}))]};e.prototype.renderBankSection=function(){var e=this;return this.offersList.map((function(t){return r("div",{class:{"s-offer-slide-one-sixth":e.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!e.isMultipleBank}},r("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!e.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":e.isMultipleBank}},r("div",{class:"s-offer-bank-logo"},r("img",{src:t.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":t.details.logo,alt:t.title+" offer"})),r("ul",{class:"s-offer-bank-payment-wrapper"},t.details.payments.map((function(e){return r("li",{class:"s-offer-bank-payment-single"},r("img",{src:salla.url.cdn("images/payment/"+e+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+".png"),alt:"payment"}))}))),e.isMultipleBank?r("p",{class:"s-offer-bank-payment-discount-percent"},"".concat(e.product_discount_text," ").concat(t.details.discount_value).concat(t.details.discount_type==="percentage"&&"%")):""),!e.isMultipleBank?r("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},r("h2",null,e.offersList[0].title),r("p",{innerHTML:e.generateBankDescription(e.offersList[0].description,t.details.discount_value)})):"")}))};e.prototype.generateBankDescription=function(e,t){return e.replace(new RegExp("".concat(t," %")),'<span class="s-offer-bank-message-amount">'.concat(t," %</span>"))};e.prototype.renderDiscountTableSection=function(){var e=this;var t;var s=this.offersList[0];var n=s.details.show_price_after_discount;return(t=this.offersList[0].details.discounts)===null||t===void 0?void 0:t.map((function(t){return r("div",{class:"s-offer-slide-one-fourth"},r("div",{class:"s-offer-slide-offer-entry"},r("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},r("p",{class:"s-offer-slide-offer-entry-quantity"},e.buy_quantity_text(t.quantity)),n?r("div",{class:"s-offer-slide-offer-entry-price"},r("span",null,e.offer_with_price_text),r("span",{class:"s-offer-slide-offer-entry-price-amount"},t.discounted_amount)," ",r("span",null,e.userCurrency)):""),r("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},e.with_discount_text,"(",r("span",null,t.percentage,!!t.percentage&&"%"),")")))}))};e.prototype.renderSpecialPriceSection=function(){var e=this;var t,s;var n=this.offersList[0].details;return[n.apply_to==="product"&&((t=n.products)===null||t===void 0?void 0:t.map((function(t){return r("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?r(e.productCardComponent,{product:t}):r("salla-product-card",{"shadow-on-hover":true,product:t}))}))),n.apply_to==="category"&&((s=n.categories)===null||s===void 0?void 0:s.map((function(t){return e.getCategoriesSection(t)})))]};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=a}}}));
|
|
5
|
+
//# sourceMappingURL=p-7d15f3b4.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,g as o}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as s,g as o}from"./p-BatAlgoq.js";import{H as e}from"./p-DjVGZdqd.js";import"./p-CgtvEd63.js";const r=":host{display:block}";const a=class{constructor(s){t(this,s);this.orderNumberText=salla.lang.get("pages.thank_you.order_id");this.totalOrderText=salla.lang.get("pages.orders.total");this.orderDateText=salla.lang.get("pages.orders.date");this.orderStatusText=salla.lang.get("pages.orders.status");this.noOrderText=salla.lang.get("pages.orders.non_orders");this.load_more_text_trans=salla.lang.get("common.elements.load_more");this.languageCode=salla.lang.locale;this.orders=[];salla.lang.onLoaded((()=>{this.languageCode=salla.lang.locale;this.orderNumberText=salla.lang.get("pages.thank_you.order_id");this.totalOrderText=salla.lang.get("pages.orders.total");this.orderDateText=salla.lang.get("pages.orders.date");this.orderStatusText=salla.lang.get("pages.orders.status");this.noOrderText=salla.lang.get("pages.orders.non_orders");this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=true){var s;let o=(s=this.status)===null||s===void 0?void 0:s.querySelector(".s-button-text");if(o){e.toggleElementClassIf(o,"s-button-hide","s-button-show",(()=>t));this.btnLoader.style.display=t?"inherit":"none"}}initiateInfiniteScroll(){var t,s,o;if(!this.hasInfiniteScroll){return}if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:false,nextPage:this.nextPage,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(t=>{this.loading()}));(s=this.infiniteScroll)===null||s===void 0?void 0:s.on("load",(t=>{var s,o;this.loading(false);this.pagination=t.pagination;this.nextPage=((o=(s=t.pagination)===null||s===void 0?void 0:s.links)===null||o===void 0?void 0:o.next)||null;this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));let r=this.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(r)}));(o=this.infiniteScroll)===null||o===void 0?void 0:o.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))}async loadMore(){this.infiniteScroll.loadNextPage()}handleResponse(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadInitialData(){const t=new URL(window.location.href);await salla.order.api.fetch(Object.assign(Object.assign({},this.params),{types:[""],feedback_status:t.searchParams.get("feedback_status")})).then((t=>{var s,o,r,a;this.orders=t.data;this.hasInfiniteScroll=!!((s=t.pagination)===null||s===void 0?void 0:s.links.next);this.pagination=t.pagination;this.total=(o=t.pagination)===null||o===void 0?void 0:o.total;this.nextPage=((a=(r=t.pagination)===null||r===void 0?void 0:r.links)===null||a===void 0?void 0:a.next)||null;if(!this.orders.length){this.showPlaceholder=true;return this.loading(false)}setTimeout((()=>{this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)}),100)})).catch((t=>{this.showPlaceholder=true;this.loading(false);salla.logger.error(t)}))}getSingleOrderItem(t){const s=document.createElement("tr");s.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const o=document.createElement("td");o.classList.add("s-orders-table-tbody-tr-td");const r=document.createElement("div");r.classList.add("s-orders-table-tbody-tr-td-content");const a=document.createElement("span");a.classList.add("s-orders-mobile-title");a.textContent=this.orderNumberText+":";const i=document.createElement("span");i.classList.add("s-orders-reference-id");i.textContent="#"+t.reference_id;r.appendChild(a);r.appendChild(i);if(t.source=="buy_as_gift"){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon");r.appendChild(t)}const n=document.createElement("a");n.href=t.url;r.appendChild(n);const l=document.createElement("div");l.classList.add("s-orders-copy-to-clipboard-button");const d=document.createElement("salla-button");d.classList.add("relative");d.setAttribute("color","dark");d.setAttribute("shape","link");d.dataset.content=t.reference_id.toString();d.addEventListener("click",(t=>{e.copyToClipboard(t);e.toggleElementClassIf(d,"copied","code-to-copy",(()=>true));setTimeout((()=>{e.toggleElementClassIf(d,"code-to-copy","copied",(()=>true))}),1e3)}));const c=document.createElement("span");c.textContent="#"+t.reference_id;const h=document.createElement("i");h.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon");let u=salla.config.get("theme.is_rtl",true);if(u){d.appendChild(h);d.appendChild(c)}else{d.appendChild(c);d.appendChild(h)}l.appendChild(d);r.appendChild(l);o.appendChild(r);s.appendChild(o);const b=document.createElement("td");b.classList.add("s-orders-table-tbody-tr-td");const m=document.createElement("div");m.classList.add("s-orders-table-tbody-tr-td-content");const p=document.createElement("span");p.classList.add("s-orders-mobile-title");p.textContent=this.totalOrderText+":";const v=document.createElement("div");v.innerHTML=salla.money(t.total);const f=document.createElement("a");f.href=t.url;m.appendChild(p);m.appendChild(v);m.appendChild(f);b.appendChild(m);s.appendChild(b);const y=document.createElement("td");y.classList.add("s-orders-table-tbody-tr-td");const g=document.createElement("div");g.classList.add("s-orders-table-tbody-tr-td-content");const _=document.createElement("span");_.classList.add("s-orders-mobile-title");_.textContent=this.orderDateText+":";const k=document.createElement("div");k.textContent=e.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);const w=document.createElement("a");w.href=t.url;g.appendChild(_);g.appendChild(k);g.appendChild(w);y.appendChild(g);s.appendChild(y);const x=document.createElement("td");x.classList.add("s-orders-table-tbody-tr-td");const j=document.createElement("div");j.classList.add("s-orders-table-tbody-tr-td-content");const q=document.createElement("span");q.classList.add("s-orders-mobile-title");q.textContent=this.orderStatusText+":";const C=document.createElement("span");C.classList.add("s-orders-status-container");C.style.color=t.status.color;const I=document.createElement("i");I.classList.add(t.status.icon);const O=document.createElement("span");O.textContent=t.status.name;C.appendChild(I);C.appendChild(O);j.appendChild(q);j.appendChild(C);const T=document.createElement("i");T.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text");j.appendChild(T);const D=document.createElement("a");D.href=t.url;j.appendChild(D);x.appendChild(j);s.appendChild(x);return s}render(){var t;if(this.showPlaceholder){return s("div",{class:"s-orders-no-content"},s("i",{class:"sicon-packed-box icon"}),s("p",null,this.noOrderText))}return s("div",{class:"s-orders-wrapper"},s("table",{class:"s-orders-table"},s("thead",{class:"s-orders-table-head"},s("tr",{class:"s-orders-table-head-tr"},s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),s("tbody",{class:"s-orders-table-tbody",ref:t=>this.wrapper=t})),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},(t=this.loadMoreText)!==null&&t!==void 0?t:this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}componentWillLoad(){return salla.onReady().then((()=>this.loadInitialData())).then((()=>this.initiateInfiniteScroll()))}get host(){return o(this)}};a.style=r;export{a as salla_orders};
|
|
5
|
+
//# sourceMappingURL=p-82f04007.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as e,g as t}from"./p-Bnb9o2EU.js";var i;(function(s){s["ProductDetail"]="product.single";s["Cart"]="cart"})(i||(i={}));var r;(function(s){s["Conditional"]="conditional";s["PercentageOrFixed"]="fixed";s["DiscountsTable"]="discounts_table";s["Bank"]="bank";s["BuyXGetY"]="buy_x_get_y";s["SpecialPrice"]="special_price"})(r||(r={}));const a='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';const o=class{constructor(e){s(this,e);var t;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=s=>salla.lang.get("pages.offer.buy_quantity",{quantity:s});salla.lang.onLoaded((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_price");this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text(0)}));salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");this.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((t=this.host.querySelector('[slot="category"]'))===null||t===void 0?void 0:t.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}async getEndpointByPageName(){if(this.currentPage==i.Cart){const s=await Salla.cart.getCurrentCartId();return`offers/cart/${s}`}if(this.currentPage==i.ProductDetail){return`offers/product/${salla.config.get("page.id")}`}return"offers"}emitPromotionViewed(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const s={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:1};salla.event.emit("promotion::viewed",[s])}emitPromotionClicked(s=1){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const e={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:s};salla.event.emit("promotion::clicked",[e])}componentWillLoad(){this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((s=>salla.onReady(s))).then((()=>{this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(this.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((async()=>salla.api.request(await this.getEndpointByPageName()))).then((s=>{if(!(this.offersList=s.data).length){throw new Error("salla-offers:: There is no offers!")}const e=this.offersList.find((s=>[r.SpecialPrice,r.Bank,r.BuyXGetY,r.DiscountsTable].includes(s.type)));if(!e){throw new Error("salla-offers:: Offer type not supported yet!")}if(e.type===r.DiscountsTable){return this.offersList=[e]}if(this.isBankOffer=e.type===r.Bank){this.offersList=this.offersList.filter((s=>s.type===r.Bank));this.isMultipleBank=this.offersList.length>1;return this.offersList}if(e.type===r.SpecialPrice){const s=e.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((s=>{e.details.products=s.data;return this.offersList=[e]})):salla.product.api.categories().then((t=>{const i=this.findCategories(t.data,s.targets);e.details.categories=i;return this.offersList=[e]}))}const t=e.details.get;return t.source==="products"?salla.product.api.fetch({source:"selected",source_value:t.source_value}).then((s=>{t.products=s.data;e.details.get=t;return this.offersList=[e]})):salla.product.api.categories().then((s=>{t.categories=this.findCategories(s.data,t.source_value);e.details.get=t;return this.offersList=[e]}))})).then((s=>{salla.storage.set(this.getStorageKey(),{offers:s,stored_at:(new Date).getTime()});this.canRender=true})).catch((s=>{salla.logger.warn(s)}))}componentDidLoad(){let s=this.host.querySelector(".s-slider-block__title-nav");s===null||s===void 0?void 0:s.classList.add("s-offer-bank-payment-nav");this.emitPromotionViewed()}findCategories(s,e){var t;let i=[];for(const r of s){if(e.includes(r.id_||r.id)){i.push(r)}if(((t=r.sub_categories)===null||t===void 0?void 0:t.length)>0){i=i.concat(this.findCategories(r.sub_categories,e))}}return i}getStorageKey(){try{const s=salla.config.get("page.slug").replace(".","_");const e=salla.lang.getLocale();const t=salla.config.currency().code;if(!s||!e||!t){throw new Error("Unable to get the storage key.")}return`s-offers-${s}-${salla.config.get("page.id")}-${e}-${t}`}catch(s){return""}}getOffersFromStorage(){let s=salla.storage.get(this.getStorageKey());if(!s||s.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(s.offers)}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const s=this.offersList[0];const t=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:s.title;const i=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:s.description;const r={"block-title":t,"block-subTitle":i,"show-controls":this.isMultipleBank};return e("div",{class:"s-offer-wrapper",onClick:()=>this.emitPromotionClicked()},e("p",{class:"s-offer-corner-badge"},this.special_offer_text),e("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},r),e("div",{slot:"items"},this.renderSectionForOfferType(s.type))))}renderSectionForOfferType(s){if(this.isBankOffer){return this.renderBankSection()}if(s==r.SpecialPrice){return this.renderSpecialPriceSection()}if(s==r.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()}getCategoriesSection(s){return e("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,s.url).replace(/\{icon\}/g,s.icon||"sicon-store").replace(/\{name\}/g,s.name)})}renderBuyXGetYSection(){var s,t;const i=this.offersList[0].details;return[(s=i.get.products)===null||s===void 0?void 0:s.map((s=>e("div",{class:"s-offer-slide-one-fourth"},this.hasCustomComponent?e(this.productCardComponent,{product:s}):e("salla-product-card",{"shadow-on-hover":true,product:s})))),(t=i.get.categories)===null||t===void 0?void 0:t.map((s=>this.getCategoriesSection(s)))]}renderBankSection(){return this.offersList.map((s=>e("div",{class:{"s-offer-slide-one-sixth":this.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!this.isMultipleBank}},e("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!this.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":this.isMultipleBank}},e("div",{class:"s-offer-bank-logo"},e("img",{src:s.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":s.details.logo,alt:s.title+" offer"})),e("ul",{class:"s-offer-bank-payment-wrapper"},s.details.payments.map((s=>e("li",{class:"s-offer-bank-payment-single"},e("img",{src:salla.url.cdn("images/payment/"+s+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+s+".png"),alt:"payment"}))))),this.isMultipleBank?e("p",{class:"s-offer-bank-payment-discount-percent"},`${this.product_discount_text} ${s.details.discount_value}${s.details.discount_type==="percentage"&&"%"}`):""),!this.isMultipleBank?e("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},e("h2",null,this.offersList[0].title),e("p",{innerHTML:this.generateBankDescription(this.offersList[0].description,s.details.discount_value)})):"")))}generateBankDescription(s,e){return s.replace(new RegExp(`${e} %`),`<span class="s-offer-bank-message-amount">${e} %</span>`)}renderDiscountTableSection(){var s;const t=this.offersList[0];let i=t.details.show_price_after_discount;return(s=this.offersList[0].details.discounts)===null||s===void 0?void 0:s.map((s=>e("div",{class:"s-offer-slide-one-fourth"},e("div",{class:"s-offer-slide-offer-entry"},e("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},e("p",{class:"s-offer-slide-offer-entry-quantity"},this.buy_quantity_text(s.quantity)),i?e("div",{class:"s-offer-slide-offer-entry-price"},e("span",null,this.offer_with_price_text),e("span",{class:"s-offer-slide-offer-entry-price-amount"},s.discounted_amount)," ",e("span",null,this.userCurrency)):""),e("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},this.with_discount_text,"(",e("span",null,s.percentage,!!s.percentage&&"%"),")")))))}renderSpecialPriceSection(){var s,t;const i=this.offersList[0].details;return[i.apply_to==="product"&&((s=i.products)===null||s===void 0?void 0:s.map((s=>e("div",{class:"s-offer-slide-one-fourth"},this.hasCustomComponent?e(this.productCardComponent,{product:s}):e("salla-product-card",{"shadow-on-hover":true,product:s}))))),i.apply_to==="category"&&((t=i.categories)===null||t===void 0?void 0:t.map((s=>this.getCategoriesSection(s))))]}get host(){return t(this)}};o.style=a;export{o as salla_offer};
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as e,g as t}from"./p-BatAlgoq.js";var i;(function(s){s["ProductDetail"]="product.single";s["Cart"]="cart"})(i||(i={}));var r;(function(s){s["Conditional"]="conditional";s["PercentageOrFixed"]="fixed";s["DiscountsTable"]="discounts_table";s["Bank"]="bank";s["BuyXGetY"]="buy_x_get_y";s["SpecialPrice"]="special_price"})(r||(r={}));const a='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';const o=class{constructor(e){s(this,e);var t;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=s=>salla.lang.get("pages.offer.buy_quantity",{quantity:s});salla.lang.onLoaded((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_price");this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text(0)}));salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");this.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((t=this.host.querySelector('[slot="category"]'))===null||t===void 0?void 0:t.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}async getEndpointByPageName(){if(this.currentPage==i.Cart){const s=await Salla.cart.getCurrentCartId();return`offers/cart/${s}`}if(this.currentPage==i.ProductDetail){return`offers/product/${salla.config.get("page.id")}`}return"offers"}emitPromotionViewed(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const s={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:1};salla.event.emit("promotion::viewed",[s])}emitPromotionClicked(s=1){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const e={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:s};salla.event.emit("promotion::clicked",[e])}componentWillLoad(){this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((s=>salla.onReady(s))).then((()=>{this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(this.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((async()=>salla.api.request(await this.getEndpointByPageName()))).then((s=>{if(!(this.offersList=s.data).length){throw new Error("salla-offers:: There is no offers!")}const e=this.offersList.find((s=>[r.SpecialPrice,r.Bank,r.BuyXGetY,r.DiscountsTable].includes(s.type)));if(!e){throw new Error("salla-offers:: Offer type not supported yet!")}if(e.type===r.DiscountsTable){return this.offersList=[e]}if(this.isBankOffer=e.type===r.Bank){this.offersList=this.offersList.filter((s=>s.type===r.Bank));this.isMultipleBank=this.offersList.length>1;return this.offersList}if(e.type===r.SpecialPrice){const s=e.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((s=>{e.details.products=s.data;return this.offersList=[e]})):salla.product.api.categories().then((t=>{const i=this.findCategories(t.data,s.targets);e.details.categories=i;return this.offersList=[e]}))}const t=e.details.get;return t.source==="products"?salla.product.api.fetch({source:"selected",source_value:t.source_value}).then((s=>{t.products=s.data;e.details.get=t;return this.offersList=[e]})):salla.product.api.categories().then((s=>{t.categories=this.findCategories(s.data,t.source_value);e.details.get=t;return this.offersList=[e]}))})).then((s=>{salla.storage.set(this.getStorageKey(),{offers:s,stored_at:(new Date).getTime()});this.canRender=true})).catch((s=>{salla.logger.warn(s)}))}componentDidLoad(){let s=this.host.querySelector(".s-slider-block__title-nav");s===null||s===void 0?void 0:s.classList.add("s-offer-bank-payment-nav");this.emitPromotionViewed()}findCategories(s,e){var t;let i=[];for(const r of s){if(e.includes(r.id_||r.id)){i.push(r)}if(((t=r.sub_categories)===null||t===void 0?void 0:t.length)>0){i=i.concat(this.findCategories(r.sub_categories,e))}}return i}getStorageKey(){try{const s=salla.config.get("page.slug").replace(".","_");const e=salla.lang.getLocale();const t=salla.config.currency().code;if(!s||!e||!t){throw new Error("Unable to get the storage key.")}return`s-offers-${s}-${salla.config.get("page.id")}-${e}-${t}`}catch(s){return""}}getOffersFromStorage(){let s=salla.storage.get(this.getStorageKey());if(!s||s.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(s.offers)}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const s=this.offersList[0];const t=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:s.title;const i=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:s.description;const r={"block-title":t,"block-subTitle":i,"show-controls":this.isMultipleBank};return e("div",{class:"s-offer-wrapper",onClick:()=>this.emitPromotionClicked()},e("p",{class:"s-offer-corner-badge"},this.special_offer_text),e("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},r),e("div",{slot:"items"},this.renderSectionForOfferType(s.type))))}renderSectionForOfferType(s){if(this.isBankOffer){return this.renderBankSection()}if(s==r.SpecialPrice){return this.renderSpecialPriceSection()}if(s==r.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()}getCategoriesSection(s){return e("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,s.url).replace(/\{icon\}/g,s.icon||"sicon-store").replace(/\{name\}/g,s.name)})}renderBuyXGetYSection(){var s,t;const i=this.offersList[0].details;return[(s=i.get.products)===null||s===void 0?void 0:s.map((s=>e("div",{class:"s-offer-slide-one-fourth"},this.hasCustomComponent?e(this.productCardComponent,{product:s}):e("salla-product-card",{"shadow-on-hover":true,product:s})))),(t=i.get.categories)===null||t===void 0?void 0:t.map((s=>this.getCategoriesSection(s)))]}renderBankSection(){return this.offersList.map((s=>e("div",{class:{"s-offer-slide-one-sixth":this.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!this.isMultipleBank}},e("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!this.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":this.isMultipleBank}},e("div",{class:"s-offer-bank-logo"},e("img",{src:s.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":s.details.logo,alt:s.title+" offer"})),e("ul",{class:"s-offer-bank-payment-wrapper"},s.details.payments.map((s=>e("li",{class:"s-offer-bank-payment-single"},e("img",{src:salla.url.cdn("images/payment/"+s+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+s+".png"),alt:"payment"}))))),this.isMultipleBank?e("p",{class:"s-offer-bank-payment-discount-percent"},`${this.product_discount_text} ${s.details.discount_value}${s.details.discount_type==="percentage"&&"%"}`):""),!this.isMultipleBank?e("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},e("h2",null,this.offersList[0].title),e("p",{innerHTML:this.generateBankDescription(this.offersList[0].description,s.details.discount_value)})):"")))}generateBankDescription(s,e){return s.replace(new RegExp(`${e} %`),`<span class="s-offer-bank-message-amount">${e} %</span>`)}renderDiscountTableSection(){var s;const t=this.offersList[0];let i=t.details.show_price_after_discount;return(s=this.offersList[0].details.discounts)===null||s===void 0?void 0:s.map((s=>e("div",{class:"s-offer-slide-one-fourth"},e("div",{class:"s-offer-slide-offer-entry"},e("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},e("p",{class:"s-offer-slide-offer-entry-quantity"},this.buy_quantity_text(s.quantity)),i?e("div",{class:"s-offer-slide-offer-entry-price"},e("span",null,this.offer_with_price_text),e("span",{class:"s-offer-slide-offer-entry-price-amount"},s.discounted_amount)," ",e("span",null,this.userCurrency)):""),e("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},this.with_discount_text,"(",e("span",null,s.percentage,!!s.percentage&&"%"),")")))))}renderSpecialPriceSection(){var s,t;const i=this.offersList[0].details;return[i.apply_to==="product"&&((s=i.products)===null||s===void 0?void 0:s.map((s=>e("div",{class:"s-offer-slide-one-fourth"},this.hasCustomComponent?e(this.productCardComponent,{product:s}):e("salla-product-card",{"shadow-on-hover":true,product:s}))))),i.apply_to==="category"&&((t=i.categories)===null||t===void 0?void 0:t.map((s=>this.getCategoriesSection(s))))]}get host(){return t(this)}};o.style=a;export{o as salla_offer};
|
|
5
|
+
//# sourceMappingURL=p-83d6ce59.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(i,t,e,n){function r(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,s){function a(i){try{c(n.next(i))}catch(i){s(i)}}function o(i){try{c(n["throw"](i))}catch(i){s(i)}}function c(i){i.done?e(i.value):r(i.value).then(a,o)}c((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(i){return function(t){return c([i,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(e=0)),e)try{if(n=1,r&&(s=o[0]&2?r["return"]:o[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;if(r=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;r=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){e.label=o[1];break}if(o[0]===6&&e.label<s[1]){e.label=s[1];s=o;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(o);break}if(s[2])e.ops.pop();e.trys.pop();continue}o=t.call(i,e)}catch(i){o=[6,i];r=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-CsdOUKHt.system.js","./p-Dxc5oJG6.system.js"],(function(i){"use strict";var t,e,n,r;return{setters:[function(i){t=i.r;e=i.h;n=i.g},function(i){r=i.I}],execute:function(){var s=' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="currentcolor" />\n</svg>';var a=' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="#DDDDDD" />\n</svg>';var o=' <svg width="12" height="17" view-box="0 0 12 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 16.2501C9.10658 16.2501 11.625 13.7317 11.625 10.6251C11.625 9.976 11.4523 9.35252 11.25 8.77232C9.99998 10.0075 9.05002 10.6251 8.4 10.6251C11.3966 5.37512 9.75 3.12512 5.25 0.125122C5.625 3.87475 3.15302 5.58043 2.14634 6.52757C1.0559 7.5535 0.375 9.00977 0.375 10.6251C0.375 13.7317 2.89339 16.2501 6 16.2501ZM6.53205 2.92636C8.96333 4.98908 8.97495 6.59185 7.09725 9.88157C6.5265 10.8815 7.2486 12.1251 8.4 12.1251C8.9163 12.1251 9.43807 11.9745 9.98917 11.6789C9.52342 13.4466 7.91393 14.7501 6 14.7501C3.72182 14.7501 1.875 12.9033 1.875 10.6251C1.875 9.47072 2.34959 8.39582 3.17419 7.62002C3.2687 7.53115 3.74812 7.1062 3.76858 7.08782C4.08646 6.8017 4.34835 6.54985 4.60718 6.2727C5.52998 5.28461 6.19283 4.18735 6.53205 2.92636Z" fill="currentcolor" />\n </svg>';var c=":host{display:block}";var u=i("salla_review_card",function(){function i(i){var e=this;t(this,i);this.currentSlide=0;this.showPurchaseCount=false;this.startPoint={x:0,y:0};this.isSwiping=false;this.isRTL="rtl";this.handlePointerDown=function(i){var t;if(!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.setPointerCapture(i.pointerId);e.startSwipe(i.clientX,i.clientY);i.preventDefault()};this.handlePointerMove=function(i){if(!e.isSwiping||!i.isPrimary)return;i.preventDefault()};this.handlePointerUp=function(i){var t;if(!e.isSwiping||!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.releasePointerCapture(i.pointerId);e.endSwipe(i.clientX,i.clientY)};this.handlePointerCancel=function(i){var t;if(!e.isSwiping||!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.releasePointerCapture(i.pointerId);e.isSwiping=false};this.goToSlide=function(i){e.currentSlide=Math.max(0,Math.min(i,e.images.length-1))}}i.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var i,t;return __generator(this,(function(e){switch(e.label){case 0:return[4,salla.onReady()];case 1:e.sent();this.showPurchaseCount=!!salla.config.get("store.settings.product.total_sold_enabled",false);this.isRTL=salla.config.get("theme.is_rtl",true);this.purchasedCount=salla.lang.getWithDefault("blocks.home.reviews.purchased_count",this.isRTL?" تم شراءه ".concat((i=this.review.product)===null||i===void 0?void 0:i.sold_quantity," مرة"):"Purchased ".concat(this.review.product.sold_quantity," times"),{count:(t=this.review.product)===null||t===void 0?void 0:t.sold_quantity});this.initializeSlider();return[2]}}))}))};i.prototype.disconnectedCallback=function(){this.removeEventListeners()};Object.defineProperty(i.prototype,"images",{get:function(){var i,t;var e=this.review;return((i=e===null||e===void 0?void 0:e.images)===null||i===void 0?void 0:i.length)>1?e.images.map((function(i,t){return{url:i,alt:"",id:t}})):((t=e===null||e===void 0?void 0:e.product)===null||t===void 0?void 0:t.images)||[]},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"hasMultipleImages",{get:function(){return this.images.length>1},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"slideTransform",{get:function(){var i=this.isRTL?1:-1;return"translateX(".concat(this.currentSlide*100*i,"%)")},enumerable:false,configurable:true});i.prototype.initializeSlider=function(){if(!this.hasMultipleImages)return;this.sliderElement=this.el.querySelector(".s-review-card-slider-container");if(!this.sliderElement)return;this.sliderElement.style.touchAction="pan-y pinch-zoom";this.addEventListeners()};i.prototype.addEventListeners=function(){if(!this.sliderElement)return;this.sliderElement.addEventListener("pointerdown",this.handlePointerDown,{passive:false});this.sliderElement.addEventListener("pointermove",this.handlePointerMove,{passive:false});this.sliderElement.addEventListener("pointerup",this.handlePointerUp,{passive:true});this.sliderElement.addEventListener("pointercancel",this.handlePointerCancel,{passive:true})};i.prototype.removeEventListeners=function(){if(!this.sliderElement)return;this.sliderElement.removeEventListener("pointerdown",this.handlePointerDown);this.sliderElement.removeEventListener("pointermove",this.handlePointerMove);this.sliderElement.removeEventListener("pointerup",this.handlePointerUp);this.sliderElement.removeEventListener("pointercancel",this.handlePointerCancel)};i.prototype.startSwipe=function(i,t){this.startPoint={x:i,y:t};this.isSwiping=true};i.prototype.componentDidRender=function(){this.removeEventListeners();this.addEventListeners()};i.prototype.endSwipe=function(i,t){this.isSwiping=false;var e=i-this.startPoint.x;var n=t-this.startPoint.y;this.processSwipe(e,n)};i.prototype.processSwipe=function(i,t){var e=10;if(Math.abs(i)<e||Math.abs(t)>Math.abs(i))return;var n=i<0;var r=this.isRTL?!n:n;if(r){this.goToNextSlide()}else{this.goToPrevSlide()}};i.prototype.goToNextSlide=function(){if(this.currentSlide<this.images.length-1){this.currentSlide++}};i.prototype.goToPrevSlide=function(){if(this.currentSlide>0){this.currentSlide--}};i.prototype.renderStars=function(){var i=this;return Array(5).fill(null).map((function(t,n){return e("span",{key:n,innerHTML:i.review.stars>=n+1?s:a})}))};i.prototype.renderDots=function(){var i=this;return this.images.map((function(t,n){var r=t.url;return e("button",{key:r||n,type:"button",class:"s-review-card-slider-dot ".concat(i.currentSlide===n?"active":""),onClick:function(){return i.goToSlide(n)},"aria-label":"Go to slide ".concat(n+1),onPointerDown:function(){return i.goToSlide(n)}})}))};i.prototype.renderSlider=function(){if(!this.hasMultipleImages)return null;return e("div",{class:"s-review-card-slider-container"},e("div",{class:"s-review-card-slides",style:{transform:this.slideTransform}},this.images.map((function(i){return e("div",{key:i===null||i===void 0?void 0:i.id,class:"s-review-card-slider-slide"},e("img",{src:i.url,alt:i.alt||"Product image",width:275,height:275,loading:"lazy",draggable:false}))}))),e("div",{class:"s-review-card-slider-dots"},this.renderDots()))};i.prototype.renderSingleImage=function(){var i,t;var n=(t=(i=this.review)===null||i===void 0?void 0:i.product)===null||t===void 0?void 0:t.image;if(!n||this.hasMultipleImages)return null;return e("img",{src:n.url,alt:n.alt||"Product image",class:"s-review-card-image",width:275,height:275,loading:"lazy",decoding:"async",draggable:false})};i.prototype.renderHeader=function(){var i,t;return e("div",{class:"s-review-card-header"},e("div",{class:"s-review-card-reviewer-name"},e("p",null,(i=this.review)===null||i===void 0?void 0:i.name),((t=this.review)===null||t===void 0?void 0:t.has_order)&&e("span",{class:"s-review-card-verified-icon",innerHTML:r})),e("div",{class:"s-review-card-stars"},this.renderStars()))};i.prototype.renderProductInfo=function(){var i,t,n,r,s;var a=(i=this.review)===null||i===void 0?void 0:i.product;if(!a)return null;return e("a",{href:(n=(t=this.review)===null||t===void 0?void 0:t.product)===null||n===void 0?void 0:n.url,class:"s-review-card-product-container"},e("img",{alt:((r=a.image)===null||r===void 0?void 0:r.alt)||"Product",src:(s=a.image)===null||s===void 0?void 0:s.url,class:"s-review-card-product-image",width:60,height:60,loading:"lazy",decoding:"async",draggable:false}),e("div",{class:"s-review-card-product-details"},e("p",{class:"s-review-card-product-details-name"},a.name),this.showPurchaseCount?e("p",{class:"s-review-card-product-details-purchase-count"},e("span",{innerHTML:o}),this.purchasedCount):null))};i.prototype.render=function(){var i;return e("div",{key:"8f3f7a3806e0aa42c403636842a1ba5fc2d4ca06",class:"s-review-card-container"},this.renderSlider(),this.renderSingleImage(),l(),e("div",{key:"8d7e3ce61120ff6a3b237a3859a72cdc0a80ce29",class:"s-review-card-content"},this.renderHeader(),e("p",{key:"da56e290401cda3b44c7340d3dbb248ae53320fb",class:"s-review-card-review-content",innerHTML:(i=this.review)===null||i===void 0?void 0:i.content}),l(),this.renderProductInfo()))};Object.defineProperty(i.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return i}());var l=function(i){return e("div",{class:"s-review-card-divider ".concat("")})};u.style=c}}}));
|
|
5
|
+
//# sourceMappingURL=p-8da32ed6.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-CsdOUKHt.system.js"],(function(t){"use strict";var s,n,a,i;return{setters:[function(t){s=t.r;n=t.h;a=t.H;i=t.g}],execute:function(){var r=":host{display:block}";var e=t("salla_apps_icons",function(){function t(t){var n=this;s(this,t);var a;this.apps=salla.config.get("store.apps");this.appSlot=((a=this.host.querySelector('[slot="app"]'))===null||a===void 0?void 0:a.innerHTML)||"<img alt={name} src={icon} />";salla.onReady((function(){n.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((function(){n.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}t.prototype.getAppsArray=function(){return Object.entries(this.apps).map((function(t){var s=t[0],n=t[1];return{name:s,value:n}}))};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return n(a,{class:"s-apps-icons"},!this.hideTitle&&n("h3",null,this.appsTitle),n("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map((function(s,a){return n("a",{key:a,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:t.appSlot.replace(/\{icon\}/g,salla.url.cdn("images/".concat(s.name,".png"))).replace(/\{name\}/g,s.name)})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());e.style=r}}}));
|
|
5
|
+
//# sourceMappingURL=p-8f50f4b9.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as a,H as s,g as l}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as a,H as s,g as l}from"./p-BatAlgoq.js";const i=":host{display:block}";const e=class{constructor(a){t(this,a);this.alertDelay=null;this.data=salla.config.get("store.app_install_prompt");this.open=false;this.closing=false}connectedCallback(){salla.onReady((()=>{this.data=salla.config.get("store.app_install_prompt");if(!this.isMobileOrTabletDevice())return;if(!this.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");this.ctaLink=salla.url.get("app");this.alertDelay=setTimeout((()=>this.open=true),3e3)}))}disconnectedCallback(){clearTimeout(this.alertDelay)}isMobileOrTabletDevice(t=1024){const a=window.innerWidth<=t;const s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);const l="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&a&&l}closeAlert(){salla.storage.set("app_install_prompt_disabled",true);this.closing=true;this.host.addEventListener("animationend",(()=>{this.closing=false;this.open=false}),{once:true})}render(){return this.data?a(s,{class:`s-app-install-alert-wrapper ${this.open?"open":""} ${this.closing?"closing":""}`,position:this.data.position},a("div",null,a("img",{src:this.data.icon,width:"58",height:"58",alt:`${salla.config.get("store.name")}`})),a("div",{class:"s-app-install-alert-content"},a("h2",{class:"s-app-install-alert-title"},this.data.title),a("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",a("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),a("button",{class:"s-app-install-alert-cancel-button","aria-label":"close alert",onClick:()=>this.closeAlert()},a("i",{class:"sicon-cancel"}))):null}get host(){return l(this)}};e.style=i;export{e as salla_app_install_alert};
|
|
5
|
+
//# sourceMappingURL=p-9189f52f.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,n,i,e){function r(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,o){function s(t){try{u(e.next(t))}catch(t){o(t)}}function a(t){try{u(e["throw"](t))}catch(t){o(t)}}function u(t){t.done?i(t.value):r(t.value).then(s,a)}u((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},e,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(n){return u([t,n])}}function u(a){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(i=0)),i)try{if(e=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=n.call(t,i)}catch(t){a=[6,t];r=0}finally{e=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-CsdOUKHt.system.js","./p-C-c0Msup.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var n,i,e,r;return{setters:[function(t){n=t.r;i=t.h;e=t.g},function(t){r=t.H},null],execute:function(){var o="";var s=t("salla_notifications",function(){function t(t){var i=this;n(this,t);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((function(){i.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");i.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}t.prototype.loading=function(t){if(t===void 0){t=true}var n;var i=(n=this.status)===null||n===void 0?void 0:n.querySelector(".s-button-text");if(i){r.toggleElementClassIf(i,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.getNotificationCard=function(t){var n=document.createElement("salla-notification-item");n.notification=t;n.classList.add("s-block");return n};t.prototype.render=function(){var t=this;var n;if(this.showPlaceholder){return i("div",{class:"s-notifications-no-content"},i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.no_notifications_trans)))}return i("div",{class:"s-notifications-wrapper"},i("div",{class:"s-notifications-container",ref:function(n){return t.wrapper=n}}),this.nextPage&&i("div",{class:"s-infinite-scroll-wrapper",ref:function(n){return t.status=n}},i("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},(n=this.loadMoreText)!==null&&n!==void 0?n:this.load_more_text_trans),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(n){return t.btnLoader=n},style:{display:"none"}}))))};t.prototype.handleResponse=function(t){var n=this;return t.map((function(t){return n.getNotificationCard(t)}))};t.prototype.initiateInfiniteScroll=function(){var t=this;var n,i,e;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return t.nextPage},history:true,nextPage:this.nextPage,scrollThreshold:false},true);(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("request",(function(n){t.loading()}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(function(n){var i;t.loading(false);t.pagination=n.pagination;t.nextPage=((i=n.pagination.links)===null||i===void 0?void 0:i.next)||null;t.handleResponse(n.data).forEach((function(n){return t.wrapper.append(n)}));var e=t.host.querySelectorAll("salla-notification-item:not(.animated)");r.animateItems(e)}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("error",(function(t){salla.logger.error("Error loading more comments:",t)}))};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.api.notifications.fetch({per_page:this.itemPerPage}).then((function(n){var i;t.pagination=n.pagination;t.total=n.pagination.total;t.nextPage=((i=n.pagination.links)===null||i===void 0?void 0:i.next)||null;setTimeout((function(){if(!n.data.length){return t.showPlaceholder=true}t.handleResponse(n.data).forEach((function(n){return t.wrapper.append(n)}));t.initiateInfiniteScroll();var i=t.wrapper.querySelectorAll("salla-notification-item:not(.animated)");r.animateItems(i)}),100)})).catch((function(n){salla.logger.error(n);t.showPlaceholder=true;t.loading(false)}))];case 1:n.sent();return[2]}}))}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage();return[2]}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.loadInitialData()];case 1:t.sent();return[2]}}))}))};Object.defineProperty(t.prototype,"host",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());s.style=o}}}));
|
|
5
|
+
//# sourceMappingURL=p-92235f14.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as t,H as l}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as a,h as t,H as l}from"./p-BatAlgoq.js";const e=".s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:-ms-flexbox !important;display:flex !important;-ms-flex-align:center !important;align-items:center !important;-ms-flex-pack:start !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}";const s=class{constructor(t){a(this,t);this.isLoading=false;this.nextPageUrl="";this.handleClick=()=>{this.loadMoreTransactions()}}componentWillLoad(){return salla.onReady().then((()=>this.loadTransactions()))}async loadTransactions(){this.isLoading=true;try{let a=`/balance/wallet?per_page=10&page=1`;let t=await salla.api.request(a);this.nextPageUrl=t.data.transactions.next_page_url;this.transactionsArray=t.data.transactions;this.balance=t.data.balance}catch(a){console.error("Error loading wallet transactions",a)}finally{this.isLoading=false}}async loadMoreTransactions(){this.isLoading=true;try{let a=this.nextPageUrl||"/balance/wallet?page=2&per_page=10";let t=await salla.api.request(a);this.nextPageUrl=t.data.transactions.next_page_url;this.transactionsArray.push(...t.data.transactions.data);this.balance=t.data.balance}catch(a){console.error("Error loading wallet transactions",a)}finally{this.isLoading=false}}render(){if(this.transactionsArray.length>0){return t(l,null,t("table",{class:"s-wallet-table"},t("tbody",{class:"s-wallet-table-tbody"},t("tr",{class:"s-table__tr"},t("td",null,t("div",{class:"s-wallet-table-balance-container"},t("i",{class:"s-wallet-table-balance-icon sicon-wallet"}),t("div",null,t("div",{innerHTML:salla.money(this.balance)}),t("div",{class:"font-normal text-gray-400"}," ",salla.lang.get("pages.wallet.balance")))))))),t("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),t("table",{class:"s-wallet-table"},t("thead",{class:"s-wallet-table-head"},t("tr",{class:"s-wallet-table-head-tr"},t("th",{scope:"col"},salla.lang.get("pages.wallet.transaction_number")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.amount")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.date")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.order_no")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.transaction_type")," "))),t("tbody",{class:"s-wallet-table-tbody"},this.transactionsArray.map((a=>t("tr",{class:"s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated"},t("td",{class:"s-wallet-table-tbody-tr-td"},t("div",{class:"s-wallet-table-tbody-tr-td-content"},t("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.transaction_number"),":"),a.id&&t("span",{class:"hidden md:inline-block"},"#",a.id),t("div",{class:"flex items-center md:hidden"},t("salla-button",{class:"relative",color:"dark",shape:"link","data-content":a.order_id},a.order_id&&t("span",null,"#",a.order_id))))),t("td",{id:"main123",class:"s-wallet-table-tbody-tr-td"},t("div",{id:"main124",class:"s-wallet-table-tbody-tr-td-content"},t("span",{id:"main125",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.amount"),":"),t("div",{innerHTML:salla.money(a.amount)}))),t("td",{class:"s-wallet-table-tbody-tr-td"},t("div",{class:"s-wallet-table-tbody-tr-td-content"},t("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.date"),":"),a.created_at&&new Date(a.created_at*1e3).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}))),t("td",{id:"main133",class:"s-wallet-table-tbody-tr-td"},t("div",{id:"main134",class:"s-wallet-table-tbody-tr-td-content"},t("span",{id:"main135",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.order_no"),":"),t("span",{class:"rtl:mr-auto ltr:ml-auto md:mx-0"},a.order_id&&t("span",null,"#",a.order_id)))),t("td",{id:"main143",class:"s-wallet-table-tbody-tr-td"},t("div",{id:"main144",class:"s-wallet-table-tbody-tr-td-content"},t("span",{id:"main145",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.expiry_date"),":"),t("span",null,a.expired_at&&new Date(a.expired_at*1e3).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})))),t("td",{class:"s-wallet-table-tbody-tr-td"},t("div",{class:"s-wallet-table-tbody-tr-td-content"},t("div",null,t("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.transaction_type"),":")),t("div",{class:{"s-wallet-table-transaction-status-default":true,"s-wallet-table-transaction-status-cashback":a.action_type==="cashback","s-wallet-table-transaction-status-refund":a.action_type==="refund","s-wallet-table-transaction-status-purchase":a.action_type==="purchase_by_wallet"}},!!a.description&&t("i",{id:a.id.toString(),class:"sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"}),!!a.description&&t("salla-tooltip",{text:a.description,targetId:a.id.toString()}),t("span",null,a.title))))))))),t("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrl&&t("salla-button",{onClick:this.handleClick,loading:this.isLoading},salla.lang.get("common.elements.load_more"))))}else{return t(l,null,t("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),t("div",{class:"s-wallet-table-empty-state"},t("i",{class:"sicon-full-wallet"}),t("div",{class:"text-center p-3 text-xl font-bold "},salla.lang.get("pages.wallet.no_transactions")),t("div",{class:"text-center text-gray-400 text-sm font-normal "},salla.lang.get("pages.wallet.zero_balance")," ")))}}};s.style=e;export{s as salla_wallet};
|
|
5
|
+
//# sourceMappingURL=p-97b48d7e.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-8OKI0xnm.system.js","sources":["src/components/salla-installment/salla-installment.scss?tag=salla-installment","src/components/salla-installment/salla-installment.tsx"],"sourcesContent":["/*\n The whole installment methods is a third-party widgets,\n So there aren't a custom classes (as other components) to style them.\n*/\n\nsalla-installment:empty {\n display: none;\n}\n\n/*\n* Installment::Tabby\n*/\n#tabbyPromoWrapper {\n background: white;\n border-radius: 0.375rem;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n margin-bottom: 20px;\n border: unset !important;\n font-weight: 500;\n\n .salla-y & {\n border: 1px solid var(--color-grey-dark);\n border-radius: 12px\n }\n\n &:hover {\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n }\n\n #tabbyPromo {\n * {\n font-family: var(--font-main);\n }\n\n >div>div {\n max-width: none;\n //padding: 15px;\n box-shadow: none;\n border: none;\n }\n\n .tabby-promo-snippet {\n max-width: 100%;\n min-height: 100px;\n padding: 18px 20px;\n // border-color: var(--color-grey-dark);\n border: none !important;\n\n\n &__text,\n &__link {\n font-size: var(--font-sm);\n color: var(--color-text) !important;\n }\n\n &__link {\n font-weight: bold;\n }\n }\n }\n}\n\n.tabby-promo-wrapper {\n #tabby-promo {\n font-family: var(--font-main) !important;\n\n .tabby-promo {\n &__feature-title {\n font-size: var(--font-md);\n }\n\n &__feature-desc {\n font-size: var(--font-sm);\n line-height: 20px;\n }\n }\n }\n}\n\n/*\n* Installment::Tamara & Spotii\n*/\n.tamara-product-widget {\n margin-bottom: 20px;\n}\n\n.tamara-product-widget,\n.spotii-wrapper {\n min-height: 100px;\n position: relative;\n color: var(--main-text-color);\n font-size: var(--font-sm);\n line-height: 1.25;\n padding: 20px 20px 20px 115px !important;\n background: white;\n border-radius: 0.375rem;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n border: unset !important;\n font-family: inherit !important;\n font-weight: 500;\n .salla-y & {\n border-radius: 12px;\n border: 1px solid var(--color-grey-dark);\n }\n\n &:hover {\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n }\n\n .spotii-logo {\n float: left;\n margin: 0 0 0 -75px;\n }\n}\n\n.ltr .tamara-product-widget,\n.ltr .spotii-wrapper {\n text-align: left;\n padding: 18px 100px 18px 20px !important;\n\n .spotii-logo {\n float: right;\n margin: 0 -75px 0 0;\n }\n\n .spotii-product-widget {\n text-align: left !important;\n }\n}\n\n.spotii-wrapper {\n margin-bottom: 20px;\n\n .spotii-promo {\n font-size: var(--font-md);\n }\n\n .spotii-product-widget {\n font-size: var(--font-sm) !important;\n margin-top: 10px;\n }\n}\n\n.tamara-product-widget {\n .tamara-logo {\n position: absolute;\n left: 20px !important;\n top: 35px !important;\n margin: 0 !important;\n height: 24px !important;\n\n .ltr & {\n right: 20px !important;\n left: auto !important;\n }\n }\n\n span {\n font-family: var(--font-main);\n font-size: var(--font-sm);\n color: var(--color-text);\n\n &:last-child {\n display: block;\n position: relative;\n margin-top: 8px;\n }\n }\n}\n\n.tamara-popup {\n &__wrap {\n overflow: auto !important;\n }\n}\n\n// mispay and madfu and emkan\n// mispay, madfu, and emkan\n.s-installment-mispay-wrapper,\n.s-installment-madfu-wrapper,\n.s-installment-emkan-wrapper,\n.s-installment-rajehi-wrapper {\n // font-family: \"Noto Sans Arabic\", sans-serif;\n font-size: 14px;\n text-align: right;\n padding: 20px;\n gap: 42px;\n line-height: 22px;\n color: rgb(0, 0, 0);\n min-width: 100%;\n box-sizing: border-box;\n position: relative;\n background-color: white;\n border-radius: 10px;\n margin: 15px 0;\n display: flex;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.s-installment-mispay-wrapper:hover,\n.s-installment-madfu-wrapper:hover,\n.s-installment-emkan-wrapper:hover,\n.s-installment-rajehi-wrapper:hover{\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n}\n\n.s-installment-mispay-content,\n.s-installment-madfu-content,\n.s-installment-emkan-content,\n.s-installment-rajehi-content {\n display: flex;\n flex-direction: row-reverse;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n gap: 1rem;\n}\n\n.s-installment-mispay-content-text,\n.s-installment-madfu-content-text,\n.s-installment-emkan-content-text,\n.s-installment-rajehi-content-text {\n color: var(--main-text-color);\n font-size: 14px;\n font-weight: 500;\n margin: 0 16px 0 0;\n width: 80%;\n // position: absolute;\n left: 14px;\n text-align: left;\n}\n\n.s-installment-mispay-content img,\n.s-installment-madfu-content img,\n.s-installment-emkan-content img,\n.s-installment-rajehi-content img{\n height: 28px;\n width: 70px;\n display: inline-block;\n max-height: 100%;\n vertical-align: middle;\n fill: none;\n stroke: unset;\n width: auto;\n // position: absolute;\n}\n\n/* RTL Support */\n.rtl .s-installment-mispay-content-text,\n.rtl .s-installment-madfu-content-text,\n.rtl .s-installment-emkan-content-text,\n.rtl .s-installment-rajehi-content-text {\n right: 14px;\n text-align: right;\n margin: 0 0 0 16px;\n}\n\n.rtl .s-installment-mispay-content img,\n.rtl .s-installment-madfu-content img,\n.rtl .s-installment-emkan-content img,\n.rtl .s-installment-rajehi-content img{\n left: 14px !important;\n}\n\n.ltr .s-installment-mispay-content img,\n.ltr .s-installment-madfu-content img,\n.ltr .s-installment-emkan-content img,\n.ltr .s-installment-rajehi-content img {\n right: 14px !important;\n}\n\n\n.s-installment-rajehi-content img {\n width: 70px !important;\n height: 40px !important;;\n}\n\n.s-installment-emkan-content img {\n height: 35px !important;\n}\n\n","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\n\n@Component({\n tag: 'salla-installment',\n styleUrl: 'salla-installment.scss',\n})\nexport class SallaInstallment {\n private tabbyBorderRemoved: boolean = false;\n private tabbyRemoveBorderTries: number = 0;\n @Element() host: HTMLElement;\n\n /**\n * Current product price\n */\n @Prop() price: string;\n /**\n * Language code\n */\n @Prop() language: string = salla.config.get('user.language_code');\n /**\n * Currency code\n */\n @Prop() currency: string = salla.config.get('user.currency_code');\n /**\n * Country code\n */\n @Prop() country: string = salla.config.get('user.country_code');\n\n @State() tabbyIsActive: boolean;\n @State() spotiiIsActive: boolean;\n @State() tamaraIsActive: null | { publicKey: string };\n @State() mispayActive: null | { merchantCode: string; publicKey: string };\n @State() emkanIsActive: boolean;\n @State() madfuActive: boolean;\n @State() rajehiIsActive?: { pointsPerRiyal: number };\n\n @State() installment_sheria_text: (key: string, replacement: object) => string = (key, replacement) => salla.lang.get(key, replacement);\n\n async componentWillLoad() {\n await salla.onReady();\n await salla.lang.onLoaded();\n this.currency = salla.config.get('user.currency_code') || 'SAR';\n this.language = salla.config.get('user.language_code') || 'ar';\n this.country = salla.config.get('user.country_code') || 'SA';\n\n const installmentOptions = [\n { key: 'pages.products.installments', installments: 3 },\n { key: 'pages.products.installments_emkan', installments: 5 },\n ];\n\n installmentOptions.forEach(option => {\n this.installment_sheria_text(option.key, {\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / option.installments).toFixed(2)).replace(/\\.00$/, ''),\n installments: option.installments,\n });\n });\n\n const installment = salla.config.get('store.settings.installments');\n if (installment) {\n this.tamaraIsActive = installment.tamara;\n this.tabbyIsActive = installment.tabby;\n this.spotiiIsActive = installment.spotii;\n this.mispayActive = installment.mispay;\n this.emkanIsActive = installment.emkan;\n this.madfuActive = installment.madfu;\n this.rajehiIsActive = installment.mokafaa_alrajhi;\n }\n\n salla.event.on('product::price.updated', ({ data }) => {\n if (!data.price || data.price == this.price) {\n return;\n }\n this.price = data.price;\n this.renderInstallments(true);\n });\n }\n\n componentDidLoad() {\n this.renderInstallments();\n }\n\n render() {\n const isSAR = this.currency === 'SAR';\n\n if (!this.isValidPrice(this.price)) {\n return '';\n }\n return (\n <Host>\n {this.tamaraIsActive &&\n (this.tamaraIsActive?.publicKey ? (\n // Tamara widget v2\n <div class=\"mb-5\">\n <tamara-widget\n type=\"tamara-summary\"\n inline-type=\"2\"\n amount={this.price}\n ></tamara-widget>\n </div>\n ) : (\n // Tamara widget v1 fallback\n <div\n class=\"tamara-product-widget\"\n data-price={this.price}\n data-currency={this.currency}\n data-lang={this.language}\n data-payment-type=\"installment\"\n ></div>\n ))}\n\n {this.tabbyIsActive ? (\n <div id=\"tabbyPromoWrapper\">\n <div id=\"tabbyPromo\"></div>\n </div>\n ) : (\n ''\n )}\n\n {this.spotiiIsActive ? (\n <div class=\"spotii-wrapper\">\n {/*No need for the price, the price already in the page, and also tammara & tabby doesn't have price */}\n <div class=\"spotii-promo\"></div>\n </div>\n ) : (\n ''\n )}\n\n {this.shouldShowMispay() &&\n (this.mispayActive.publicKey ? (\n <div class=\"mb-5\">\n <mispay-widget amount={this.price} lang={this.language}></mispay-widget>\n </div>\n ) : (\n <div class=\"s-installment-mispay-wrapper\">\n <div class=\"s-installment-mispay-content\">\n <img src={salla.url.cdn('images/payment/png/mispay.png')} alt=\"mispay\" />\n <span class=\"s-installment-mispay-content-text\" innerHTML={this.installment_sheria_text('pages.products.installments',{\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / 4).toFixed(2)),\n installments: 4,\n })}></span>\n </div>\n </div>\n ))}\n\n {this.emkanIsActive && this.currency === \"SAR\" ? (\n <div class=\"s-installment-emkan-wrapper\">\n <div class=\"s-installment-emkan-content\">\n <img src={salla.url.cdn('images/payment/png/emkan.png')} alt=\"emkan\" />\n <span class=\"s-installment-emkan-content-text\" innerHTML={this.installment_sheria_text('pages.products.installments_emkan', {\n payment: salla.money(parseFloat(this.price)),\n installments: 5,\n })}></span>\n </div>\n </div>\n ) : (\n ''\n )}\n {this.madfuActive && this.currency === \"SAR\" ? (\n <div class=\"s-installment-madfu-wrapper\">\n <div class=\"s-installment-madfu-content\">\n <img\n src={\n salla.url.cdn('images/payment/png/madfu.png')\n }\n alt=\"madfu\"\n />\n <span class=\"s-installment-madfu-content-text\">\n {salla.lang.get('pages.products.installments_madfu')}\n </span>\n </div>\n </div>\n ) : (\n ''\n )}\n\n {(isSAR && this.rajehiIsActive) ?\n <div class=\"s-installment-rajehi-wrapper\">\n <div class=\"s-installment-rajehi-content\">\n <img src={salla.url.cdn('images/payment/png/mokafaa_alrajhi_loyalty.png')} alt=\"mokafaa_alrajhi_loyalty\"/>\n\n <span class=\"s-installment-rajehi-content-text\">\n {salla.lang.get(\"pages.products.rajahi_earn_points\", {points: Math.floor(+this.price * this.rajehiIsActive.pointsPerRiyal)})}\n </span>\n\n </div>\n </div>\n\n : ''}\n </Host>\n );\n }\n\n renderInstallments(isUpdating: boolean = false) {\n if (!this.isValidPrice(this.price)) {\n return;\n }\n // Tamara\n if (this.tamaraIsActive) {\n this.loadTamara({isUpdating});\n }\n\n // tabby\n if (this.tabbyIsActive) {\n if (isUpdating) {\n // remove #tabbyPromoWrapper and re append it\n var oldTabbyWrapper = this.host.querySelector('#tabbyPromoWrapper');\n if (oldTabbyWrapper) {\n oldTabbyWrapper.remove();\n }\n\n var tabbyPromoWrapper = document.createElement('div');\n tabbyPromoWrapper.setAttribute('id', 'tabbyPromoWrapper');\n var tabbyPromo = document.createElement('div');\n tabbyPromo.setAttribute('id', 'tabbyPromo');\n tabbyPromoWrapper.appendChild(tabbyPromo);\n this.host.appendChild(tabbyPromoWrapper);\n\n var oldTabbyScript = document.querySelector(\n 'script[src=\"https://checkout.tabby.ai/tabby-promo.js\"]',\n );\n if (oldTabbyScript) {\n oldTabbyScript.remove();\n }\n }\n\n var tabbyScript = document.createElement('script');\n tabbyScript.setAttribute('src', 'https://checkout.tabby.ai/tabby-promo.js');\n document.head.appendChild(tabbyScript);\n tabbyScript.onload = () => {\n const TabbyPromo = window.TabbyPromo;\n new TabbyPromo({\n selector: '#tabbyPromo',\n currency: this.currency,\n price: this.price,\n lang: this.language,\n publicKey: salla.config.get('store.settings.installments.tabby.publicKey'),\n merchantCode: salla.config.get('store.settings.installments.tabby.merchantCode'),\n });\n document.querySelectorAll('.tabby-promo-snippet__logo').forEach(function (element) {\n element.setAttribute('aria-label', 'Tabby Logo');\n });\n };\n // this is a workaround to remove the default border and add margin\n this.removeTabbyBorder();\n }\n\n // Spotii\n if (this.spotiiIsActive) {\n if (isUpdating) {\n var oldSpotiiWrapper = this.host.querySelector('.spotii-wrapper');\n if (oldSpotiiWrapper) {\n oldSpotiiWrapper.remove();\n }\n\n var spotiiPromoWrapper = document.createElement('div');\n spotiiPromoWrapper.classList.add('spotii-wrapper');\n var spotiiPromo = document.createElement('div');\n spotiiPromo.classList.add('spotii-promo');\n spotiiPromoWrapper.appendChild(spotiiPromo);\n this.host.appendChild(spotiiPromoWrapper);\n var oldSpotiiScript = document.querySelector(\n 'script[src=\"' + salla.url.cdn('js/price-widget-ar-salla.js') + '\"]',\n );\n if (oldSpotiiScript) {\n oldSpotiiScript.remove();\n }\n }\n\n let amount = salla.money((Number(this.price) / 3).toFixed(2), false);\n let isRTL = salla.config.get('theme.is_rtl', true);\n window.spotiiConfig = {\n targetXPath: ['.spotii-wrapper'],\n renderToPath: ['.spotii-promo'],\n numberOfPayment: 3,\n currency: this.currency,\n templateLine: '${textOne} ${number} ${textTwo} ' + amount + '${logo} ${info}',\n //todo:: translate these\n textOne: isRTL ? 'جزء الدفع على' : 'Split it into',\n textTwo: isRTL ? 'أقساط متساوية بدون تكاليف اضافية بقيمة' : 'payments of',\n textThree: 'مع',\n price: this.price,\n // forcedShow: false,\n // merchantID: null,\n };\n\n var spotiiScript = document.createElement('script');\n spotiiScript.setAttribute('src', salla.url.cdn('js/price-widget-ar-salla.js'));\n document.head.appendChild(spotiiScript);\n // spotiiScript.onload = () => {\n // // setTimeout()\n // }\n }\n\n // Mispay\n if (this.shouldShowMispay() && this.mispayActive.publicKey) {\n this.loadExternalScript({\n position: 'head',\n src: `https://widget.mispay.co/v1/sdk.js?authorize=${this.mispayActive.publicKey}`,\n });\n }\n }\n\n private isValidPrice(price: string): boolean {\n const pricePattern = /^\\d+(\\.\\d{1,2})?$/;\n const isValid = pricePattern.test(price);\n const isGreaterThanZero = parseFloat(price) > 0;\n\n return isValid && isGreaterThanZero;\n }\n\n loadExternalScript({\n src,\n onLoad,\n position,\n }: {\n src: string;\n onLoad?: HTMLScriptElement['onload'];\n position: 'head' | 'body';\n }) {\n const script = document.createElement('script');\n script.src = src;\n script.onload = onLoad;\n document[position].appendChild(script);\n }\n\n loadTamara({ isUpdating }: { isUpdating: boolean }) {\n const isV2Enabled = !!this.tamaraIsActive?.publicKey;\n\n if (isUpdating) {\n setTimeout(() => {\n if (isV2Enabled) {\n return window.TamaraWidgetV2?.refresh();\n }\n\n // v1 fallback widget refresh\n window.TamaraProductWidget?.render();\n }, 300);\n } else {\n if (isV2Enabled) {\n const language_code = salla.config.get('user.language_code');\n const lang = ['ar', 'en'].includes(language_code) ? language_code : 'ar';\n // this used in case user change the currency to get the country code\n const countryCodeByCurrency = this.currency?.slice(0, -1);\n\n const country = ['SA', 'AE', 'KW', 'BH', 'OM', 'QA'].includes(countryCodeByCurrency)\n ? countryCodeByCurrency\n : null;\n\n if (!country) {\n console.error('Tamara: Country code is not supported', countryCodeByCurrency);\n } else {\n window.tamaraWidgetConfig = {\n lang,\n country,\n publicKey: this.tamaraIsActive.publicKey,\n style: {\n fontSize: '14px',\n },\n };\n\n this.loadExternalScript({\n position: 'head',\n src: 'https://cdn.tamara.co/widget-v2/tamara-widget.js',\n });\n }\n } else {\n // v1 fallback widget\n this.loadExternalScript({\n position: 'head',\n src: 'https://cdn.tamara.co/widget/product-widget.min.js',\n onLoad: () => {\n window.TamaraProductWidget.init({ lang: this.language });\n setTimeout(() => {\n window.TamaraProductWidget.render();\n }, 300);\n },\n });\n }\n }\n }\n\n shouldShowMispay() {\n return this.currency === 'SAR' && this.mispayActive;\n }\n\n /**\n * this is workaround to remove the default border and add margin\n * we will try to remove tabby border 5 times for 7.5 seconds\n */\n removeTabbyBorder() {\n if (this.tabbyBorderRemoved || this.tabbyRemoveBorderTries > 5) {\n return;\n }\n this.tabbyRemoveBorderTries++;\n setTimeout(() => {\n let promo: any = document.querySelector('#tabbyPromo>div>div');\n promo = promo && promo.shadowRoot\n ? promo.shadowRoot.querySelector('div[class^=\"styles__tabby-promo-snippet--\"]')\n : null;\n if (promo) {\n promo.style = 'border: none; margin: 15px 0!important;';\n this.tabbyBorderRemoved = true;\n } else {\n this.removeTabbyBorder();\n }\n }, this.tabbyRemoveBorderTries * 500);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAAA,MAAM,mBAAmB,GAAG,0kMAA0kM;;YCMzlM,gBAAgB,gCAAA,MAAA;MAJ7B,IAAA,WAAA,CAAA,OAAA,EAAA;;MAKU,QAAA,IAAkB,CAAA,kBAAA,GAAY,KAAK;MACnC,QAAA,IAAsB,CAAA,sBAAA,GAAW,CAAC;MAO1C;;MAEG;cACK,IAAQ,CAAA,QAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;MACjE;;MAEG;cACK,IAAQ,CAAA,QAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;MACjE;;MAEG;cACK,IAAO,CAAA,OAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;cAUtD,IAAA,CAAA,uBAAuB,GAAiD,CAAC,GAAG,EAAE,WAAW,KAAK,KAAK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,kBAAkB,GAAG,IAAI;;uBACzB;sBACL,IAAI,CAAC,iBAAiB,EAAE;;MAE5B,SAAC,EAAE,IAAI,CAAC,sBAAsB,GAAG,GAAG,CAAC;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-AnMu3g7b.system.js","sources":["src/components/salla-installment/salla-installment.scss?tag=salla-installment","src/components/salla-installment/salla-installment.tsx"],"sourcesContent":["/*\n The whole installment methods is a third-party widgets,\n So there aren't a custom classes (as other components) to style them.\n*/\n\nsalla-installment:empty {\n display: none;\n}\n\n/*\n* Installment::Tabby\n*/\n#tabbyPromoWrapper {\n background: white;\n border-radius: 0.375rem;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n margin-bottom: 20px;\n border: unset !important;\n font-weight: 500;\n\n .salla-y & {\n border: 1px solid var(--color-grey-dark);\n border-radius: 12px\n }\n\n &:hover {\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n }\n\n #tabbyPromo {\n * {\n font-family: var(--font-main);\n }\n\n >div>div {\n max-width: none;\n //padding: 15px;\n box-shadow: none;\n border: none;\n }\n\n .tabby-promo-snippet {\n max-width: 100%;\n min-height: 100px;\n padding: 18px 20px;\n // border-color: var(--color-grey-dark);\n border: none !important;\n\n\n &__text,\n &__link {\n font-size: var(--font-sm);\n color: var(--color-text) !important;\n }\n\n &__link {\n font-weight: bold;\n }\n }\n }\n}\n\n.tabby-promo-wrapper {\n #tabby-promo {\n font-family: var(--font-main) !important;\n\n .tabby-promo {\n &__feature-title {\n font-size: var(--font-md);\n }\n\n &__feature-desc {\n font-size: var(--font-sm);\n line-height: 20px;\n }\n }\n }\n}\n\n/*\n* Installment::Tamara & Spotii\n*/\n.tamara-product-widget {\n margin-bottom: 20px;\n}\n\n.tamara-product-widget,\n.spotii-wrapper {\n min-height: 100px;\n position: relative;\n color: var(--main-text-color);\n font-size: var(--font-sm);\n line-height: 1.25;\n padding: 20px 20px 20px 115px !important;\n background: white;\n border-radius: 0.375rem;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n border: unset !important;\n font-family: inherit !important;\n font-weight: 500;\n .salla-y & {\n border-radius: 12px;\n border: 1px solid var(--color-grey-dark);\n }\n\n &:hover {\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n }\n\n .spotii-logo {\n float: left;\n margin: 0 0 0 -75px;\n }\n}\n\n.ltr .tamara-product-widget,\n.ltr .spotii-wrapper {\n text-align: left;\n padding: 18px 100px 18px 20px !important;\n\n .spotii-logo {\n float: right;\n margin: 0 -75px 0 0;\n }\n\n .spotii-product-widget {\n text-align: left !important;\n }\n}\n\n.spotii-wrapper {\n margin-bottom: 20px;\n\n .spotii-promo {\n font-size: var(--font-md);\n }\n\n .spotii-product-widget {\n font-size: var(--font-sm) !important;\n margin-top: 10px;\n }\n}\n\n.tamara-product-widget {\n .tamara-logo {\n position: absolute;\n left: 20px !important;\n top: 35px !important;\n margin: 0 !important;\n height: 24px !important;\n\n .ltr & {\n right: 20px !important;\n left: auto !important;\n }\n }\n\n span {\n font-family: var(--font-main);\n font-size: var(--font-sm);\n color: var(--color-text);\n\n &:last-child {\n display: block;\n position: relative;\n margin-top: 8px;\n }\n }\n}\n\n.tamara-popup {\n &__wrap {\n overflow: auto !important;\n }\n}\n\n// mispay and madfu and emkan\n// mispay, madfu, and emkan\n.s-installment-mispay-wrapper,\n.s-installment-madfu-wrapper,\n.s-installment-emkan-wrapper,\n.s-installment-rajehi-wrapper {\n // font-family: \"Noto Sans Arabic\", sans-serif;\n font-size: 14px;\n text-align: right;\n padding: 20px;\n gap: 42px;\n line-height: 22px;\n color: rgb(0, 0, 0);\n min-width: 100%;\n box-sizing: border-box;\n position: relative;\n background-color: white;\n border-radius: 10px;\n margin: 15px 0;\n display: flex;\n transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.s-installment-mispay-wrapper:hover,\n.s-installment-madfu-wrapper:hover,\n.s-installment-emkan-wrapper:hover,\n.s-installment-rajehi-wrapper:hover{\n box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;\n}\n\n.s-installment-mispay-content,\n.s-installment-madfu-content,\n.s-installment-emkan-content,\n.s-installment-rajehi-content {\n display: flex;\n flex-direction: row-reverse;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n gap: 1rem;\n}\n\n.s-installment-mispay-content-text,\n.s-installment-madfu-content-text,\n.s-installment-emkan-content-text,\n.s-installment-rajehi-content-text {\n color: var(--main-text-color);\n font-size: 14px;\n font-weight: 500;\n margin: 0 16px 0 0;\n width: 80%;\n // position: absolute;\n left: 14px;\n text-align: left;\n}\n\n.s-installment-mispay-content img,\n.s-installment-madfu-content img,\n.s-installment-emkan-content img,\n.s-installment-rajehi-content img{\n height: 28px;\n width: 70px;\n display: inline-block;\n max-height: 100%;\n vertical-align: middle;\n fill: none;\n stroke: unset;\n width: auto;\n // position: absolute;\n}\n\n/* RTL Support */\n.rtl .s-installment-mispay-content-text,\n.rtl .s-installment-madfu-content-text,\n.rtl .s-installment-emkan-content-text,\n.rtl .s-installment-rajehi-content-text {\n right: 14px;\n text-align: right;\n margin: 0 0 0 16px;\n}\n\n.rtl .s-installment-mispay-content img,\n.rtl .s-installment-madfu-content img,\n.rtl .s-installment-emkan-content img,\n.rtl .s-installment-rajehi-content img{\n left: 14px !important;\n}\n\n.ltr .s-installment-mispay-content img,\n.ltr .s-installment-madfu-content img,\n.ltr .s-installment-emkan-content img,\n.ltr .s-installment-rajehi-content img {\n right: 14px !important;\n}\n\n\n.s-installment-rajehi-content img {\n width: 70px !important;\n height: 40px !important;;\n}\n\n.s-installment-emkan-content img {\n height: 35px !important;\n}\n\n","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\n\n@Component({\n tag: 'salla-installment',\n styleUrl: 'salla-installment.scss',\n})\nexport class SallaInstallment {\n private tabbyBorderRemoved: boolean = false;\n private tabbyRemoveBorderTries: number = 0;\n @Element() host: HTMLElement;\n\n /**\n * Current product price\n */\n @Prop() price: string;\n /**\n * Language code\n */\n @Prop() language: string = salla.config.get('user.language_code');\n /**\n * Currency code\n */\n @Prop() currency: string = salla.config.get('user.currency_code');\n /**\n * Country code\n */\n @Prop() country: string = salla.config.get('user.country_code');\n\n @State() tabbyIsActive: boolean;\n @State() spotiiIsActive: boolean;\n @State() tamaraIsActive: null | { publicKey: string };\n @State() mispayActive: null | { merchantCode: string; publicKey: string };\n @State() emkanIsActive: boolean;\n @State() madfuActive: boolean;\n @State() rajehiIsActive?: { pointsPerRiyal: number };\n\n @State() installment_sheria_text: (key: string, replacement: object) => string = (key, replacement) => salla.lang.get(key, replacement);\n\n async componentWillLoad() {\n await salla.onReady();\n await salla.lang.onLoaded();\n this.currency = salla.config.get('user.currency_code') || 'SAR';\n this.language = salla.config.get('user.language_code') || 'ar';\n this.country = salla.config.get('user.country_code') || 'SA';\n\n const installmentOptions = [\n { key: 'pages.products.installments', installments: 3 },\n { key: 'pages.products.installments_emkan', installments: 5 },\n ];\n\n installmentOptions.forEach(option => {\n this.installment_sheria_text(option.key, {\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / option.installments).toFixed(2)).replace(/\\.00$/, ''),\n installments: option.installments,\n });\n });\n\n const installment = salla.config.get('store.settings.installments');\n if (installment) {\n this.tamaraIsActive = installment.tamara;\n this.tabbyIsActive = installment.tabby;\n this.spotiiIsActive = installment.spotii;\n this.mispayActive = installment.mispay;\n this.emkanIsActive = installment.emkan;\n this.madfuActive = installment.madfu;\n this.rajehiIsActive = installment.mokafaa_alrajhi;\n }\n\n salla.event.on('product::price.updated', ({ data }) => {\n if (!data.price || data.price == this.price) {\n return;\n }\n this.price = data.price;\n this.renderInstallments(true);\n });\n }\n\n componentDidLoad() {\n this.renderInstallments();\n }\n\n render() {\n const isSAR = this.currency === 'SAR';\n\n if (!this.isValidPrice(this.price)) {\n return '';\n }\n return (\n <Host>\n {this.tamaraIsActive &&\n (this.tamaraIsActive?.publicKey ? (\n // Tamara widget v2\n <div class=\"mb-5\">\n <tamara-widget\n type=\"tamara-summary\"\n inline-type=\"2\"\n amount={this.price}\n ></tamara-widget>\n </div>\n ) : (\n // Tamara widget v1 fallback\n <div\n class=\"tamara-product-widget\"\n data-price={this.price}\n data-currency={this.currency}\n data-lang={this.language}\n data-payment-type=\"installment\"\n ></div>\n ))}\n\n {this.tabbyIsActive ? (\n <div id=\"tabbyPromoWrapper\">\n <div id=\"tabbyPromo\"></div>\n </div>\n ) : (\n ''\n )}\n\n {this.spotiiIsActive ? (\n <div class=\"spotii-wrapper\">\n {/*No need for the price, the price already in the page, and also tammara & tabby doesn't have price */}\n <div class=\"spotii-promo\"></div>\n </div>\n ) : (\n ''\n )}\n\n {this.shouldShowMispay() &&\n (this.mispayActive.publicKey ? (\n <div class=\"mb-5\">\n <mispay-widget amount={this.price} lang={this.language}></mispay-widget>\n </div>\n ) : (\n <div class=\"s-installment-mispay-wrapper\">\n <div class=\"s-installment-mispay-content\">\n <img src={salla.url.cdn('images/payment/png/mispay.png')} alt=\"mispay\" />\n <span class=\"s-installment-mispay-content-text\" innerHTML={this.installment_sheria_text('pages.products.installments',{\n payment: salla.money(parseFloat(this.price)),\n amount: salla.money((parseFloat(this.price) / 4).toFixed(2)),\n installments: 4,\n })}></span>\n </div>\n </div>\n ))}\n\n {this.emkanIsActive && this.currency === \"SAR\" ? (\n <div class=\"s-installment-emkan-wrapper\">\n <div class=\"s-installment-emkan-content\">\n <img src={salla.url.cdn('images/payment/png/emkan.png')} alt=\"emkan\" />\n <span class=\"s-installment-emkan-content-text\" innerHTML={this.installment_sheria_text('pages.products.installments_emkan', {\n payment: salla.money(parseFloat(this.price)),\n installments: 5,\n })}></span>\n </div>\n </div>\n ) : (\n ''\n )}\n {this.madfuActive && this.currency === \"SAR\" ? (\n <div class=\"s-installment-madfu-wrapper\">\n <div class=\"s-installment-madfu-content\">\n <img\n src={\n salla.url.cdn('images/payment/png/madfu.png')\n }\n alt=\"madfu\"\n />\n <span class=\"s-installment-madfu-content-text\">\n {salla.lang.get('pages.products.installments_madfu')}\n </span>\n </div>\n </div>\n ) : (\n ''\n )}\n\n {(isSAR && this.rajehiIsActive) ?\n <div class=\"s-installment-rajehi-wrapper\">\n <div class=\"s-installment-rajehi-content\">\n <img src={salla.url.cdn('images/payment/png/mokafaa_alrajhi_loyalty.png')} alt=\"mokafaa_alrajhi_loyalty\"/>\n\n <span class=\"s-installment-rajehi-content-text\">\n {salla.lang.get(\"pages.products.rajahi_earn_points\", {points: Math.floor(+this.price * this.rajehiIsActive.pointsPerRiyal)})}\n </span>\n\n </div>\n </div>\n\n : ''}\n </Host>\n );\n }\n\n renderInstallments(isUpdating: boolean = false) {\n if (!this.isValidPrice(this.price)) {\n return;\n }\n // Tamara\n if (this.tamaraIsActive) {\n this.loadTamara({isUpdating});\n }\n\n // tabby\n if (this.tabbyIsActive) {\n if (isUpdating) {\n // remove #tabbyPromoWrapper and re append it\n var oldTabbyWrapper = this.host.querySelector('#tabbyPromoWrapper');\n if (oldTabbyWrapper) {\n oldTabbyWrapper.remove();\n }\n\n var tabbyPromoWrapper = document.createElement('div');\n tabbyPromoWrapper.setAttribute('id', 'tabbyPromoWrapper');\n var tabbyPromo = document.createElement('div');\n tabbyPromo.setAttribute('id', 'tabbyPromo');\n tabbyPromoWrapper.appendChild(tabbyPromo);\n this.host.appendChild(tabbyPromoWrapper);\n\n var oldTabbyScript = document.querySelector(\n 'script[src=\"https://checkout.tabby.ai/tabby-promo.js\"]',\n );\n if (oldTabbyScript) {\n oldTabbyScript.remove();\n }\n }\n\n var tabbyScript = document.createElement('script');\n tabbyScript.setAttribute('src', 'https://checkout.tabby.ai/tabby-promo.js');\n document.head.appendChild(tabbyScript);\n tabbyScript.onload = () => {\n const TabbyPromo = window.TabbyPromo;\n new TabbyPromo({\n selector: '#tabbyPromo',\n currency: this.currency,\n price: this.price,\n lang: this.language,\n publicKey: salla.config.get('store.settings.installments.tabby.publicKey'),\n merchantCode: salla.config.get('store.settings.installments.tabby.merchantCode'),\n });\n document.querySelectorAll('.tabby-promo-snippet__logo').forEach(function (element) {\n element.setAttribute('aria-label', 'Tabby Logo');\n });\n };\n // this is a workaround to remove the default border and add margin\n this.removeTabbyBorder();\n }\n\n // Spotii\n if (this.spotiiIsActive) {\n if (isUpdating) {\n var oldSpotiiWrapper = this.host.querySelector('.spotii-wrapper');\n if (oldSpotiiWrapper) {\n oldSpotiiWrapper.remove();\n }\n\n var spotiiPromoWrapper = document.createElement('div');\n spotiiPromoWrapper.classList.add('spotii-wrapper');\n var spotiiPromo = document.createElement('div');\n spotiiPromo.classList.add('spotii-promo');\n spotiiPromoWrapper.appendChild(spotiiPromo);\n this.host.appendChild(spotiiPromoWrapper);\n var oldSpotiiScript = document.querySelector(\n 'script[src=\"' + salla.url.cdn('js/price-widget-ar-salla.js') + '\"]',\n );\n if (oldSpotiiScript) {\n oldSpotiiScript.remove();\n }\n }\n\n let amount = salla.money((Number(this.price) / 3).toFixed(2), false);\n let isRTL = salla.config.get('theme.is_rtl', true);\n window.spotiiConfig = {\n targetXPath: ['.spotii-wrapper'],\n renderToPath: ['.spotii-promo'],\n numberOfPayment: 3,\n currency: this.currency,\n templateLine: '${textOne} ${number} ${textTwo} ' + amount + '${logo} ${info}',\n //todo:: translate these\n textOne: isRTL ? 'جزء الدفع على' : 'Split it into',\n textTwo: isRTL ? 'أقساط متساوية بدون تكاليف اضافية بقيمة' : 'payments of',\n textThree: 'مع',\n price: this.price,\n // forcedShow: false,\n // merchantID: null,\n };\n\n var spotiiScript = document.createElement('script');\n spotiiScript.setAttribute('src', salla.url.cdn('js/price-widget-ar-salla.js'));\n document.head.appendChild(spotiiScript);\n // spotiiScript.onload = () => {\n // // setTimeout()\n // }\n }\n\n // Mispay\n if (this.shouldShowMispay() && this.mispayActive.publicKey) {\n this.loadExternalScript({\n position: 'head',\n src: `https://widget.mispay.co/v1/sdk.js?authorize=${this.mispayActive.publicKey}`,\n });\n }\n }\n\n private isValidPrice(price: string): boolean {\n const pricePattern = /^\\d+(\\.\\d{1,2})?$/;\n const isValid = pricePattern.test(price);\n const isGreaterThanZero = parseFloat(price) > 0;\n\n return isValid && isGreaterThanZero;\n }\n\n loadExternalScript({\n src,\n onLoad,\n position,\n }: {\n src: string;\n onLoad?: HTMLScriptElement['onload'];\n position: 'head' | 'body';\n }) {\n const script = document.createElement('script');\n script.src = src;\n script.onload = onLoad;\n document[position].appendChild(script);\n }\n\n loadTamara({ isUpdating }: { isUpdating: boolean }) {\n const isV2Enabled = !!this.tamaraIsActive?.publicKey;\n\n if (isUpdating) {\n setTimeout(() => {\n if (isV2Enabled) {\n return window.TamaraWidgetV2?.refresh();\n }\n\n // v1 fallback widget refresh\n window.TamaraProductWidget?.render();\n }, 300);\n } else {\n if (isV2Enabled) {\n const language_code = salla.config.get('user.language_code');\n const lang = ['ar', 'en'].includes(language_code) ? language_code : 'ar';\n // this used in case user change the currency to get the country code\n const countryCodeByCurrency = this.currency?.slice(0, -1);\n\n const country = ['SA', 'AE', 'KW', 'BH', 'OM', 'QA'].includes(countryCodeByCurrency)\n ? countryCodeByCurrency\n : null;\n\n if (!country) {\n console.error('Tamara: Country code is not supported', countryCodeByCurrency);\n } else {\n window.tamaraWidgetConfig = {\n lang,\n country,\n publicKey: this.tamaraIsActive.publicKey,\n style: {\n fontSize: '14px',\n },\n };\n\n this.loadExternalScript({\n position: 'head',\n src: 'https://cdn.tamara.co/widget-v2/tamara-widget.js',\n });\n }\n } else {\n // v1 fallback widget\n this.loadExternalScript({\n position: 'head',\n src: 'https://cdn.tamara.co/widget/product-widget.min.js',\n onLoad: () => {\n window.TamaraProductWidget.init({ lang: this.language });\n setTimeout(() => {\n window.TamaraProductWidget.render();\n }, 300);\n },\n });\n }\n }\n }\n\n shouldShowMispay() {\n return this.currency === 'SAR' && this.mispayActive;\n }\n\n /**\n * this is workaround to remove the default border and add margin\n * we will try to remove tabby border 5 times for 7.5 seconds\n */\n removeTabbyBorder() {\n if (this.tabbyBorderRemoved || this.tabbyRemoveBorderTries > 5) {\n return;\n }\n this.tabbyRemoveBorderTries++;\n setTimeout(() => {\n let promo: any = document.querySelector('#tabbyPromo>div>div');\n promo = promo && promo.shadowRoot\n ? promo.shadowRoot.querySelector('div[class^=\"styles__tabby-promo-snippet--\"]')\n : null;\n if (promo) {\n promo.style = 'border: none; margin: 15px 0!important;';\n this.tabbyBorderRemoved = true;\n } else {\n this.removeTabbyBorder();\n }\n }, this.tabbyRemoveBorderTries * 500);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAAA,MAAM,mBAAmB,GAAG,0kMAA0kM;;YCMzlM,gBAAgB,gCAAA,MAAA;MAJ7B,IAAA,WAAA,CAAA,OAAA,EAAA;;MAKU,QAAA,IAAkB,CAAA,kBAAA,GAAY,KAAK;MACnC,QAAA,IAAsB,CAAA,sBAAA,GAAW,CAAC;MAO1C;;MAEG;cACK,IAAQ,CAAA,QAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;MACjE;;MAEG;cACK,IAAQ,CAAA,QAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;MACjE;;MAEG;cACK,IAAO,CAAA,OAAA,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;cAUtD,IAAA,CAAA,uBAAuB,GAAiD,CAAC,GAAG,EAAE,WAAW,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC;MAqXxI;MAnXC,IAAA,MAAM,iBAAiB,GAAA;MACrB,QAAA,MAAM,KAAK,CAAC,OAAO,EAAE;MACrB,QAAA,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE;MAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,KAAK;MAC/D,QAAA,IAAI,CAAC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A,CAAC;;;uBAEC;;sBAEL,IAAI,CAAC,kBAAkB,CAAC;MACtB,oBAAA,QAAQ,EAAE,MAAM;MAChB,oBAAA,GAAG,EAAE,oDAAoD;0BACzD,MAAM,EAAE,MAAK;MACX,wBAAA,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;8BACxD,UAAU,CAAC,MAAK;MACd,4BAAA,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE;+BACpC,EAAE,GAAG,CAAC;2BACR;MACF,iBAAA,CAAC;;;;UAKR,gBAAgB,GAAA;cACd,OAAO,IAAI,CAAC,QAAQ,KAAK,KAAK,IAAI,IAAI,CAAC,YAAY;;MAGrD;;;MAGG;UACH,iBAAiB,GAAA;cACf,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,sBAAsB,GAAG,CAAC,EAAE;kBAC9D;;cAEF,IAAI,CAAC,sBAAsB,EAAE;cAC7B,UAAU,CAAC,MAAK;kBACd,IAAI,KAAK,GAAQ,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC;MAC9D,YAAA,KAAK,GAAG,KAAK,IAAI,KAAK,CAAC;wBACnB,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,6CAA6C;wBAC5E,IAAI;kBACR,IAAI,KAAK,EAAE;MACT,gBAAA,KAAK,CAAC,KAAK,GAAG,yCAAyC;MACvD,gBAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI;;uBACzB;sBACL,IAAI,CAAC,iBAAiB,EAAE;;MAE5B,SAAC,EAAE,IAAI,CAAC,sBAAsB,GAAG,GAAG,CAAC;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-B3RHXsr7.system.js","sources":["@lazy-external-entrypoint?app-data=conditional"],"sourcesContent":["export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\nexport const defineCustomElements = async (win, options) => {\n if (typeof window === 'undefined') return undefined;\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGY,YAAC,oBAAoB,mCAAG,OAAO,GAAG,EAAE,OAAO,KAAK;MAC5D,EAAE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,OAAO,SAAS;MACrD,EAAE,MAAM,aAAa,EAAE;MACvB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;MAC7D;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-B4SU1g3q.system.js","sources":["src/components/salla-apps-icons/salla-apps-icons.scss?tag=salla-apps-icons","src/components/salla-apps-icons/salla-apps-icons.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot app - Replaces app item, has replaceable props `{icon}`, `{name}`.\n */\n@Component({\n tag: 'salla-apps-icons',\n styleUrl: 'salla-apps-icons.scss',\n})\nexport class SallaAppsIcons {\n constructor() {\n this.appSlot = this.host.querySelector('[slot=\"app\"]')?.innerHTML || `<img alt={name} src={icon} />`;\n salla.onReady(() => {\n this.apps = salla.config.get('store.apps');\n });\n\n salla.lang.onLoaded(() => {\n this.appsTitle = salla.lang.get('blocks.footer.download_apps');\n });\n }\n private readonly appSlot: string;\n @Element() host: HTMLElement;\n @State() apps = salla.config.get('store.apps');\n\n /**\n * Flag to show or hide title.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * The title to display.\n */\n @Prop() appsTitle: string;\n\n /**\n * Display flag to horizontal/vertical.\n */\n @Prop() vertical: boolean;\n\n private getAppsArray() {\n return Object.entries(this.apps)\n .map(([name, value]) => ({ name, value }));\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n render() {\n const appsArray = this.getAppsArray();\n if (Array.isArray(appsArray) && !appsArray.length) {\n return;\n }\n return (\n <Host class=\"s-apps-icons\">\n {!this.hideTitle && <h3>{this.appsTitle}</h3>}\n <div class={{\"s-apps-icons-list\": true, \"vertical\": this.vertical}}>\n {appsArray.map((app, index) => (\n <a key={index} href={app.value as string} rel=\"noreferrer\" target=\"_blank\" class=\"s-apps-icons-item\" id=\"app-slot\" innerHTML={this.appSlot\n .replace(/\\{icon\\}/g, salla.url.cdn(`images/${app.name}.png`))\n .replace(/\\{name\\}/g, app.name)}>\n </a>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n this.host.querySelector('[slot=\"app\"]')?.remove();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAAA,MAAM,iBAAiB,GAAG,sBAAsB;;YCQnC,cAAc,+BAAA,MAAA;MACzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;cAYS,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;MAX5C,QAAA,IAAI,CAAC,OAAO,GAAG,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,+BAA+B;MACpG,QAAA,KAAK,CAAC,OAAO,CAAC,MAAK;kBACjB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;MAC5C,SAAC,CAAC;MAEF,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;kBACvB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC;MAChE,SAAC,CAAC;MACH;UAoBO,YAAY,GAAA;MAClB,QAAA,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;MAC5B,aAAA,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KA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