@salla.sa/twilight-components 2.14.242 → 2.14.244
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-CVeZYGxB.js → app-globals-DJy_WZhn.js} +3 -3
- package/dist/cjs/{app-globals-CVeZYGxB.js.map → app-globals-DJy_WZhn.js.map} +1 -1
- package/dist/cjs/{index-DJaUOUEA.js → index-CDv7BbT4.js} +4 -4
- package/dist/cjs/index-CDv7BbT4.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
- 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-tiered-offer.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-DFw3DLIF.js → app-globals-DrZ55MAu.js} +3 -3
- package/dist/esm/{app-globals-DFw3DLIF.js.map → app-globals-DrZ55MAu.js.map} +1 -1
- package/dist/esm/{index-9b729OAn.js → index-DqoIvv1w.js} +4 -4
- package/dist/esm/index-DqoIvv1w.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body.entry.js +1 -1
- package/dist/esm/salla-accordion-head.entry.js +1 -1
- package/dist/esm/salla-accordion.entry.js +1 -1
- 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-tiered-offer.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-DFw3DLIF.js → app-globals-DrZ55MAu.js} +2 -2
- package/dist/esm-es5/{app-globals-DFw3DLIF.js.map → app-globals-DrZ55MAu.js.map} +1 -1
- package/dist/esm-es5/{index-9b729OAn.js → index-DqoIvv1w.js} +3 -3
- package/dist/esm-es5/index-DqoIvv1w.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
- package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
- package/dist/esm-es5/salla-accordion.entry.js +1 -1
- 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 +2 -2
- 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 +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- 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-tiered-offer.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-4808ad99.system.entry.js → p-037221ee.system.entry.js} +2 -2
- package/dist/twilight/{p-6bd7d328.entry.js → p-04121f8d.entry.js} +2 -2
- package/dist/twilight/{p-1e5a2920.entry.js → p-07b0c6ef.entry.js} +2 -2
- package/dist/twilight/{p-9cfeaa42.entry.js → p-0e8f8178.entry.js} +2 -2
- package/dist/twilight/{p-3a03b512.system.entry.js → p-0f19ae11.system.entry.js} +2 -2
- package/dist/twilight/{p-3f525377.system.entry.js → p-1df0e1d3.system.entry.js} +2 -2
- package/dist/twilight/{p-a84192ba.system.entry.js → p-22256592.system.entry.js} +2 -2
- package/dist/twilight/{p-d8ebfd19.entry.js → p-232869cb.entry.js} +2 -2
- package/dist/twilight/{p-325b3d57.entry.js → p-23bf60d1.entry.js} +2 -2
- package/dist/twilight/{p-5d7eff34.entry.js → p-23c4080e.entry.js} +2 -2
- package/dist/twilight/{p-CUhlEilx.system.js.map → p-247J1H-3.system.js.map} +1 -1
- package/dist/twilight/{p-2fb30390.system.entry.js → p-2503615b.system.entry.js} +2 -2
- package/dist/twilight/{p-213165ca.entry.js → p-25854dd4.entry.js} +2 -2
- package/dist/twilight/{p-377aa6d4.entry.js → p-26ab837d.entry.js} +2 -2
- package/dist/twilight/{p-ef3f7aa2.entry.js → p-26e365a0.entry.js} +2 -2
- package/dist/twilight/{p-9a9cea9f.system.entry.js → p-28b20344.system.entry.js} +2 -2
- package/dist/twilight/{p-57963695.system.entry.js → p-2dd40103.system.entry.js} +2 -2
- package/dist/twilight/{p-c67a10e4.system.entry.js → p-32221e11.system.entry.js} +2 -2
- package/dist/twilight/{p-44f0aa72.entry.js → p-338904a8.entry.js} +2 -2
- package/dist/twilight/{p-daab72d9.system.entry.js → p-3e4d6cc9.system.entry.js} +3 -3
- package/dist/twilight/{p-6f175079.system.entry.js → p-41449ce3.system.entry.js} +2 -2
- package/dist/twilight/{p-708be213.system.entry.js → p-4d0a16e5.system.entry.js} +2 -2
- package/dist/twilight/{p-CuiwcdnF.system.js.map → p-4wEurwDp.system.js.map} +1 -1
- package/dist/twilight/{p-4f0e3200.entry.js → p-518b7ae6.entry.js} +2 -2
- package/dist/twilight/{p-de6b2d28.system.entry.js → p-52094768.system.entry.js} +2 -2
- package/dist/twilight/{p-9d9532b8.entry.js → p-5a17fffa.entry.js} +2 -2
- package/dist/twilight/p-5a52bfce.entry.js +5 -0
- package/dist/twilight/p-6704bfa4.system.entry.js +5 -0
- package/dist/twilight/p-6dcb366c.system.entry.js +5 -0
- package/dist/twilight/{p-2efe373b.system.entry.js → p-6e46f6a8.system.entry.js} +2 -2
- package/dist/twilight/{p-570786ff.system.entry.js → p-716be554.system.entry.js} +2 -2
- package/dist/twilight/{p-b0cce2cc.entry.js → p-7813edb8.entry.js} +2 -2
- package/dist/twilight/{p-de5eb851.system.entry.js → p-7925a158.system.entry.js} +2 -2
- package/dist/twilight/{p-d7ebbd4e.system.entry.js → p-7a9abd21.system.entry.js} +2 -2
- package/dist/twilight/{p-9e2c530b.entry.js → p-80032b26.entry.js} +2 -2
- package/dist/twilight/{p-8d2b2e83.entry.js → p-854718b1.entry.js} +2 -2
- package/dist/twilight/{p-c1ba5826.system.entry.js → p-85be47bd.system.entry.js} +2 -2
- package/dist/twilight/{p-c5e96aa9.entry.js → p-8920607a.entry.js} +2 -2
- package/dist/twilight/{p-5c4735d4.entry.js → p-9586eb08.entry.js} +2 -2
- package/dist/twilight/{p-81e4f9ad.system.entry.js → p-95ea7275.system.entry.js} +2 -2
- package/dist/twilight/{p-B-MUzZIx.system.js.map → p-9_Q--jIX.system.js.map} +1 -1
- package/dist/twilight/{p-D4L8yQG9.system.js.map → p-B0XOJZCF.system.js.map} +1 -1
- package/dist/twilight/{p-BL4JCeRv.system.js.map → p-BC7Y13dm.system.js.map} +1 -1
- package/dist/twilight/{p-hguDbfki.system.js.map → p-BDy3CuHb.system.js.map} +1 -1
- package/dist/twilight/{p-Ce7ba8qn.system.js.map → p-BHyfFmHZ.system.js.map} +1 -1
- package/dist/twilight/{p-DkEQyxiJ.system.js.map → p-BKylW7nB.system.js.map} +1 -1
- package/dist/twilight/{p-H0xRLzQG.system.js.map → p-BmxwtTcO.system.js.map} +1 -1
- package/dist/twilight/{p-BfSqqIzv.system.js.map → p-C1PsrQAG.system.js.map} +1 -1
- package/dist/twilight/{p-CoMj9FQl.system.js.map → p-C701m3wt.system.js.map} +1 -1
- package/dist/twilight/{p-BGN_H23b.system.js.map → p-CHo5PFsL.system.js.map} +1 -1
- package/dist/twilight/{p-CcBmKuXH.system.js → p-CI4dVh7S.system.js} +2 -2
- package/dist/twilight/{p-CcBmKuXH.system.js.map → p-CI4dVh7S.system.js.map} +1 -1
- package/dist/twilight/{p-D6h8x_9u.system.js.map → p-CMOxiE1F.system.js.map} +1 -1
- package/dist/twilight/{p-ChnVjZGZ.system.js.map → p-CO7ZfKkK.system.js.map} +1 -1
- package/dist/twilight/{p-fsS3K05F.system.js.map → p-CaGcNw1Z.system.js.map} +1 -1
- package/dist/twilight/{p-BSJYFYjL.system.js.map → p-Cck2ybao.system.js.map} +1 -1
- package/dist/twilight/{p-CJE1TAdg.system.js.map → p-Cs2wQSqm.system.js.map} +1 -1
- package/dist/twilight/{p-Cts2FJ_l.system.js → p-CwxmVXDU.system.js} +2 -2
- package/dist/twilight/{p-Cts2FJ_l.system.js.map → p-CwxmVXDU.system.js.map} +1 -1
- package/dist/twilight/{p-C2GBlfF7.js → p-CxH_8eMU.js} +2 -2
- package/dist/twilight/{p-C2GBlfF7.js.map → p-CxH_8eMU.js.map} +1 -1
- package/dist/twilight/{p-Bb8uRHi2.system.js.map → p-Cz6UqluH.system.js.map} +1 -1
- package/dist/twilight/{p-0d3OVzqh.system.js.map → p-CzymfAbl.system.js.map} +1 -1
- package/dist/twilight/{p-DtFWPcj9.system.js.map → p-D1tqKthE.system.js.map} +1 -1
- package/dist/twilight/{p-iySJ93Xi.system.js.map → p-DCe8uUCP.system.js.map} +1 -1
- package/dist/twilight/{p-BCFhwSDC.system.js.map → p-DUWjIKaw.system.js.map} +1 -1
- package/dist/twilight/{p-BOK-IBaI.system.js.map → p-Da6QCqOQ.system.js.map} +1 -1
- package/dist/twilight/{p-DmROPGmI.system.js.map → p-DdrwPobi.system.js.map} +1 -1
- package/dist/twilight/{p-D8nhmz8a.system.js → p-DkSyqz4l.system.js} +3 -3
- package/dist/twilight/p-DkSyqz4l.system.js.map +1 -0
- package/dist/twilight/{p-CwqZi9Jw.system.js.map → p-DmhCAQbQ.system.js.map} +1 -1
- package/dist/twilight/{p-9b729OAn.js → p-DqoIvv1w.js} +3 -3
- package/dist/twilight/p-DqoIvv1w.js.map +1 -0
- package/dist/twilight/{p-BLQy_whM.system.js.map → p-DsJ4jRoR.system.js.map} +1 -1
- package/dist/twilight/{p-DtsGcxvj.system.js.map → p-DsPsvNzB.system.js.map} +1 -1
- package/dist/twilight/{p-D3RvTuse.system.js.map → p-DuID4Rze.system.js.map} +1 -1
- package/dist/twilight/{p-BR4AEmmd.system.js.map → p-Dvcu41FO.system.js.map} +1 -1
- package/dist/twilight/{p-BAuVrq4d.system.js.map → p-VosFv_vR.system.js.map} +1 -1
- package/dist/twilight/{p-3c5a1df2.entry.js → p-a2d57c9f.entry.js} +7 -7
- package/dist/twilight/{p-df83c722.system.entry.js → p-a43e8674.system.entry.js} +2 -2
- package/dist/twilight/{p-4519db39.system.entry.js → p-a85b896b.system.entry.js} +2 -2
- package/dist/twilight/{p-675f61b3.entry.js → p-ae1a9be9.entry.js} +2 -2
- package/dist/twilight/{p-8f44bec7.system.entry.js → p-ae64b07f.system.entry.js} +2 -2
- package/dist/twilight/{p-853b0235.system.entry.js → p-b36e20f9.system.entry.js} +3 -3
- package/dist/twilight/{p-4f8cfb95.system.entry.js → p-b62f2b5e.system.entry.js} +2 -2
- package/dist/twilight/{p-758231d6.entry.js → p-b6ed442a.entry.js} +2 -2
- package/dist/twilight/{p-c8151ab6.entry.js → p-bf2fb565.entry.js} +2 -2
- package/dist/twilight/{p-e7812eee.system.entry.js → p-c2db0fbb.system.entry.js} +2 -2
- package/dist/twilight/{p-2cc79952.entry.js → p-cc1afa63.entry.js} +2 -2
- package/dist/twilight/{p-0228e57b.system.entry.js → p-cc33c31a.system.entry.js} +2 -2
- package/dist/twilight/{p-e55eb9fd.system.entry.js → p-d0bbbb85.system.entry.js} +2 -2
- package/dist/twilight/{p-e7494f56.system.entry.js → p-d8b32757.system.entry.js} +2 -2
- package/dist/twilight/{p-92b44893.system.entry.js → p-d944dc95.system.entry.js} +2 -2
- package/dist/twilight/{p-6a05c8a7.entry.js → p-d9c5659c.entry.js} +2 -2
- package/dist/twilight/{p-b91925bc.entry.js → p-dac38223.entry.js} +2 -2
- package/dist/twilight/{p-d866b4b3.entry.js → p-de1aea31.entry.js} +2 -2
- package/dist/twilight/{p-4825d388.entry.js → p-e1e27429.entry.js} +2 -2
- package/dist/twilight/{p-59bef03d.entry.js → p-e26e3a20.entry.js} +2 -2
- package/dist/twilight/{p-6819efbb.entry.js → p-ea334ef9.entry.js} +2 -2
- package/dist/twilight/{p-d147530e.entry.js → p-ebf678fa.entry.js} +2 -2
- package/dist/twilight/{p-17139edc.entry.js → p-ecdc7423.entry.js} +2 -2
- package/dist/twilight/{p-103acf28.system.entry.js → p-f41783e1.system.entry.js} +2 -2
- package/dist/twilight/{p-434d4e46.system.entry.js → p-f4a4027d.system.entry.js} +2 -2
- package/dist/twilight/{p-4823dd50.entry.js → p-f60d04da.entry.js} +2 -2
- package/dist/twilight/{p-f25034a5.system.entry.js → p-fb15b4c9.system.entry.js} +2 -2
- package/dist/twilight/{p-290ed7a3.entry.js → p-fd035cdb.entry.js} +2 -2
- package/dist/twilight/{p-DmPY-r_Z.system.js.map → p-h9UdSuoR.system.js.map} +1 -1
- package/dist/twilight/{p-BIq8f4ja.system.js.map → p-hf6L_PEd.system.js.map} +1 -1
- package/dist/twilight/{p-CPPkAxL6.system.js.map → p-p6-og1mL.system.js.map} +1 -1
- package/dist/twilight/{p-cmP329Ib.system.js.map → p-t2tJeeRa.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-DJaUOUEA.js.map +0 -1
- package/dist/esm/index-9b729OAn.js.map +0 -1
- package/dist/esm-es5/index-9b729OAn.js.map +0 -1
- package/dist/twilight/p-4140d30e.system.entry.js +0 -5
- package/dist/twilight/p-6b9aa749.entry.js +0 -5
- package/dist/twilight/p-916b00a3.system.entry.js +0 -5
- package/dist/twilight/p-9b729OAn.js.map +0 -1
- package/dist/twilight/p-D8nhmz8a.system.js.map +0 -1
- /package/dist/twilight/{p-4808ad99.system.entry.js.map → p-037221ee.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6bd7d328.entry.js.map → p-04121f8d.entry.js.map} +0 -0
- /package/dist/twilight/{p-1e5a2920.entry.js.map → p-07b0c6ef.entry.js.map} +0 -0
- /package/dist/twilight/{p-9cfeaa42.entry.js.map → p-0e8f8178.entry.js.map} +0 -0
- /package/dist/twilight/{p-3a03b512.system.entry.js.map → p-0f19ae11.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3f525377.system.entry.js.map → p-1df0e1d3.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a84192ba.system.entry.js.map → p-22256592.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d8ebfd19.entry.js.map → p-232869cb.entry.js.map} +0 -0
- /package/dist/twilight/{p-325b3d57.entry.js.map → p-23bf60d1.entry.js.map} +0 -0
- /package/dist/twilight/{p-5d7eff34.entry.js.map → p-23c4080e.entry.js.map} +0 -0
- /package/dist/twilight/{p-2fb30390.system.entry.js.map → p-2503615b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-213165ca.entry.js.map → p-25854dd4.entry.js.map} +0 -0
- /package/dist/twilight/{p-377aa6d4.entry.js.map → p-26ab837d.entry.js.map} +0 -0
- /package/dist/twilight/{p-ef3f7aa2.entry.js.map → p-26e365a0.entry.js.map} +0 -0
- /package/dist/twilight/{p-9a9cea9f.system.entry.js.map → p-28b20344.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-57963695.system.entry.js.map → p-2dd40103.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c67a10e4.system.entry.js.map → p-32221e11.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-44f0aa72.entry.js.map → p-338904a8.entry.js.map} +0 -0
- /package/dist/twilight/{p-daab72d9.system.entry.js.map → p-3e4d6cc9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6f175079.system.entry.js.map → p-41449ce3.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-708be213.system.entry.js.map → p-4d0a16e5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4f0e3200.entry.js.map → p-518b7ae6.entry.js.map} +0 -0
- /package/dist/twilight/{p-de6b2d28.system.entry.js.map → p-52094768.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9d9532b8.entry.js.map → p-5a17fffa.entry.js.map} +0 -0
- /package/dist/twilight/{p-6b9aa749.entry.js.map → p-5a52bfce.entry.js.map} +0 -0
- /package/dist/twilight/{p-916b00a3.system.entry.js.map → p-6704bfa4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4140d30e.system.entry.js.map → p-6dcb366c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2efe373b.system.entry.js.map → p-6e46f6a8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-570786ff.system.entry.js.map → p-716be554.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b0cce2cc.entry.js.map → p-7813edb8.entry.js.map} +0 -0
- /package/dist/twilight/{p-de5eb851.system.entry.js.map → p-7925a158.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d7ebbd4e.system.entry.js.map → p-7a9abd21.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9e2c530b.entry.js.map → p-80032b26.entry.js.map} +0 -0
- /package/dist/twilight/{p-8d2b2e83.entry.js.map → p-854718b1.entry.js.map} +0 -0
- /package/dist/twilight/{p-c1ba5826.system.entry.js.map → p-85be47bd.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c5e96aa9.entry.js.map → p-8920607a.entry.js.map} +0 -0
- /package/dist/twilight/{p-5c4735d4.entry.js.map → p-9586eb08.entry.js.map} +0 -0
- /package/dist/twilight/{p-81e4f9ad.system.entry.js.map → p-95ea7275.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3c5a1df2.entry.js.map → p-a2d57c9f.entry.js.map} +0 -0
- /package/dist/twilight/{p-df83c722.system.entry.js.map → p-a43e8674.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4519db39.system.entry.js.map → p-a85b896b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-675f61b3.entry.js.map → p-ae1a9be9.entry.js.map} +0 -0
- /package/dist/twilight/{p-8f44bec7.system.entry.js.map → p-ae64b07f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-853b0235.system.entry.js.map → p-b36e20f9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4f8cfb95.system.entry.js.map → p-b62f2b5e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-758231d6.entry.js.map → p-b6ed442a.entry.js.map} +0 -0
- /package/dist/twilight/{p-c8151ab6.entry.js.map → p-bf2fb565.entry.js.map} +0 -0
- /package/dist/twilight/{p-e7812eee.system.entry.js.map → p-c2db0fbb.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2cc79952.entry.js.map → p-cc1afa63.entry.js.map} +0 -0
- /package/dist/twilight/{p-0228e57b.system.entry.js.map → p-cc33c31a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e55eb9fd.system.entry.js.map → p-d0bbbb85.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e7494f56.system.entry.js.map → p-d8b32757.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-92b44893.system.entry.js.map → p-d944dc95.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6a05c8a7.entry.js.map → p-d9c5659c.entry.js.map} +0 -0
- /package/dist/twilight/{p-b91925bc.entry.js.map → p-dac38223.entry.js.map} +0 -0
- /package/dist/twilight/{p-d866b4b3.entry.js.map → p-de1aea31.entry.js.map} +0 -0
- /package/dist/twilight/{p-4825d388.entry.js.map → p-e1e27429.entry.js.map} +0 -0
- /package/dist/twilight/{p-59bef03d.entry.js.map → p-e26e3a20.entry.js.map} +0 -0
- /package/dist/twilight/{p-6819efbb.entry.js.map → p-ea334ef9.entry.js.map} +0 -0
- /package/dist/twilight/{p-d147530e.entry.js.map → p-ebf678fa.entry.js.map} +0 -0
- /package/dist/twilight/{p-17139edc.entry.js.map → p-ecdc7423.entry.js.map} +0 -0
- /package/dist/twilight/{p-103acf28.system.entry.js.map → p-f41783e1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-434d4e46.system.entry.js.map → p-f4a4027d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4823dd50.entry.js.map → p-f60d04da.entry.js.map} +0 -0
- /package/dist/twilight/{p-f25034a5.system.entry.js.map → p-fb15b4c9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-290ed7a3.entry.js.map → p-fd035cdb.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,g as i}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,g as i}from"./p-DqoIvv1w.js";import{a}from"./p-CgtvEd63.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);var i;this.currentSlug=salla.config.get("page.slug");salla.onReady((()=>{this.currentSlug=salla.config.get("page.slug")}));this.advSlot=((i=this.host.querySelector('[slot="adv"]'))===null||i===void 0?void 0:i.innerHTML)||`<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n `}isNotVisible(s){return!!salla.storage.get(`statusAd-${s.id}`)}setCanDisplayFlag(s,t){if(!t){salla.storage.set(`statusAd-${s.id}`,"dismissed");a({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}}render(){if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((s=>t("div",{class:{"s-hidden":this.isNotVisible(s),"s-advertisement":true},"data-id":s.id,style:{"background-color":s.colors.bg,color:s.colors.text}},t("div",{id:"adv-slot",innerHTML:this.advSlot.replace("{iconElem}",`<i class="s-advertisement-content-icon ${s.icon}"></i>`).replace("{urlElem}",s.url?`<a href="${s.url}" target="${s.target}">${s.description}</a>`:s.description).replace("{closeElem}",`<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>`).replace("{icon}",s.icon).replace("{url}",s.url).replace("{target}",s.target).replace("{description}",s.description).replace("{bg_color}",s.colors.bg).replace("{text_color}",s.colors.text)}))))}componentWillLoad(){return new Promise((s=>salla.onReady(s))).then((()=>salla.api.advertisement.fetch(this.currentSlug))).then((s=>Array.isArray(s.data)?s.data.find((s=>!salla.storage.get(`statusAd-${s.id}`))):null)).then((s=>this.advertisements=s?[s]:[]))}componentDidRender(){var s;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((()=>{let s=this.host.querySelector(".s-advertisement-action");if(s){s.addEventListener("click",(()=>this.setCanDisplayFlag(this.advertisements[0],false)))}}));this.host.querySelectorAll("#adv-slot").forEach((s=>s===null||s===void 0?void 0:s.replaceWith(s===null||s===void 0?void 0:s.firstChild)));(s=this.host.querySelector('[slot="adv"]'))===null||s===void 0?void 0:s.remove();a({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})}get host(){return i(this)}};l.style=e;export{l as salla_advertisement};
|
|
5
|
+
//# sourceMappingURL=p-9586eb08.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-DkSyqz4l.system.js","./p-CSGkUch3.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-95ea7275.system.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-B-MUzZIx.system.js","sources":["src/components/salla-filters/salla-filters.scss?tag=salla-filters","src/components/salla-filters/salla-filters.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.s-rating-stars-small {\n line-height: 12px;\n}\n.s-filters-radio{\n background-image: none !important;\n}","import { Component, Element, h, Event, EventEmitter, Host, Method, Prop, State } from '@stencil/core';\nimport { Filter, FilterOptionTypes } from \"./interfaces\";\nimport Helper from '../../Helpers/Helper';\n@Component({\n tag: 'salla-filters',\n styleUrl: 'salla-filters.scss',\n})\nexport class SallaFilters {\n\n constructor() {\n salla.event.on('filters::hidden', () => this.host.style.display = 'none');\n\n salla.lang.onLoaded(() => {\n this.apply = salla.lang.get('pages.checkout.apply');\n this.reset = salla.lang.get('pages.categories.filters_reset');\n });\n\n salla.event.on('filters::fetched', ({ filters }) => {\n this.host.style.display = '';\n let freshFilterData: any = {};\n this.filters = filters\n .map((filter: Filter) => {\n filter.label = {\n category_id: salla.lang.get('common.titles.categories'),\n brand_id: salla.lang.get('common.titles.brands'),\n rating: salla.lang.get('pages.categories.filter_rating'),\n price: salla.lang.get('pages.categories.filter_price'),\n }[filter.key] || filter.label;\n // filter.type = FilterOptionTypes.VALUES;\n if (filter.key == 'rating') {\n filter.type = FilterOptionTypes.VALUES;\n //@ts-ignore\n let { max, min } = filter.values;\n //@ts-ignore\n filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max)\n }\n if (this.filtersData.variants && filter.type == FilterOptionTypes.VARIANTS) {\n freshFilterData.variants = this.filtersData.variants;\n }\n if (this.filtersData[filter.key] && filter.type !== FilterOptionTypes.VARIANTS) {\n freshFilterData[filter.key] = this.filtersData[filter.key];\n }\n let searchParams = new URLSearchParams(window.location.search);\n let hasFilters = false;\n for (let key of searchParams.keys()) {\n if (key.includes('filters')) {\n hasFilters = true;\n break; // No need to continue checking once a match is found\n }\n }\n if (salla.config.get('page.slug') == \"product.index\" && Object.keys(freshFilterData).length == 0 && !hasFilters) {\n // Append the current category to the url if there are no pre-selected filters\n let currentUrl = window.location.href;\n let filterValue = salla.config.get('page.id');\n let separator = currentUrl.indexOf('?') !== -1 ? '&' : '?';\n let newUrl = currentUrl + separator + 'filters[category_id]=' + filterValue;\n freshFilterData.category_id = filterValue;\n window.history.pushState({ path: newUrl }, '', newUrl);\n }\n return filter;\n });\n this.filtersData = freshFilterData;\n this.host.childNodes.forEach(async (widget: HTMLSallaFiltersWidgetElement) => widget.setWidgetHeight && await widget.setWidgetHeight())\n });\n }\n\n async componentWillLoad() {\n try {\n const searchParams = new URLSearchParams(window.location.search);\n this.filtersData = await Helper.extractFiltersFromUrl(searchParams);\n } catch (e) {\n console.warn('failed to get filters from URL', e.message);\n }\n }\n\n\n @Element() host: HTMLElement;\n\n /**\n * Array of filter options\n */\n @Prop({ reflect: true, mutable: true }) filters?: Filter[];\n\n private isReady = false;//to avoid triggering the changed event\n\n @State() isSidebarOpen: boolean;\n @State() filtersData: object | any = {}\n @State() apply: string;\n @State() reset: string;\n\n /**\n * Custom event fired when the selected filters are changed.\n */\n @Event() changed: EventEmitter;\n\n /**\n * Method to get filter data.\n */\n @Method()\n async getFilters() {\n return this.filtersData;\n }\n\n /**\n * Apply filter action.\n */\n @Method()\n async applyFilters() {\n if (!this.isReady) {\n return;\n }\n let hasFilters = Object.keys(this.filtersData).length > 0;\n setTimeout(() => {\n if (hasFilters) {\n let url = new URL(window.location.href);\n for (const [key] of url.searchParams.entries()) {\n if (key.startsWith(\"filters\")) {\n url.searchParams.delete(key);\n }\n }\n let encodedFilterValues = this.encodeFilters(this.filtersData)\n let sanitizedFilterValues = url.search.split(\"&\").filter(item => !item.includes('filters')).join(\"&\")\n if (sanitizedFilterValues) {\n url.search = url.search.split(\"&filters\")[0] + \"&\" + encodedFilterValues\n } else {\n url.search = `?${encodedFilterValues}`\n }\n window.history.pushState({}, '', url.href);\n }\n else {\n let url = new URL(window.location.href);\n url.searchParams?.delete('filters');\n window.history.pushState({}, '', url.toString());\n }\n salla.event.emit('salla-filters::changed', this.filtersData);\n this.changed.emit(this.filtersData);\n }, 300);\n }\n\n\n private encodeFilters(filters, parentKey = 'filters') {\n const encodedFilters = [];\n\n for (const key in filters) {\n if (Object.prototype.hasOwnProperty.call(filters, key)) {\n const value = filters[key];\n\n const fullKey = parentKey ? `${parentKey}[${key}]` : key;\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n encodedFilters.push(`${fullKey}[${i}]=${value[i]}`)\n }\n }\n else if (typeof value === 'object' && value !== null) {\n encodedFilters.push(this.encodeFilters(value, fullKey));\n } else {\n // const encodedKey = encodeURIComponent(fullKey);\n // const encodedValue = encodeURIComponent(value);\n let result = `${fullKey}=${value}`\n encodedFilters.push(result);\n }\n }\n }\n return encodedFilters.join('&');\n };\n\n /**\n * Reset selected filters.\n */\n @Method()\n async resetFilters() {\n this.removeFiltersQueryParams()\n this.filtersData = {};\n this.host.childNodes.forEach((widget: HTMLSallaFiltersWidgetElement) => widget.reset && widget.reset())\n salla.event.emit('salla-filters::reset');\n return this.applyFilters();\n }\n\n private removeFiltersQueryParams() {\n const searchParams = new URLSearchParams(window.location.search);\n\n const newUrl = Array.from(searchParams.keys())\n .filter(key => !key.startsWith('filters['))\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(searchParams.get(key))}`)\n .join('&');\n\n const finalUrl = newUrl ? `${window.location.pathname}?${newUrl}` : window.location.pathname;\n window.history.pushState({}, '', finalUrl);\n }\n\n /**\n * @param {{target:HTMLInputElement}} event\n * @param option\n * @param value\n * @private\n */\n private handleOptionChange(event, option: Filter, value) {\n if (option.type === FilterOptionTypes.RANGE) {\n this.filtersData[option.key] = value;\n\n }\n let isChecked = event.target.checked;\n\n if (option.type === FilterOptionTypes.VARIANTS) {\n this.filtersData.variants = this.filtersData.variants || {};\n isChecked && (this.filtersData.variants[option.key] = value);\n isChecked || (delete this.filtersData.variants[option.key]);\n }\n\n else if (event.target.type == \"radio\") {\n isChecked && (this.filtersData[option.key] = value);\n isChecked || (delete this.filtersData[option.key]);\n }\n\n //it's checkbox\n // add if condition to avoid error when the filter is not existed in the filtersData\n else if (event.target.type == \"checkbox\") {\n this.filtersData[option.key] = this.filtersData[option.key] || [];\n if (isChecked) {\n this.filtersData[option.key].push(value);\n\n }\n this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);\n }\n this.applyFilters();\n }\n\n\n\n render() {\n return <Host>\n {this.filters?.map(option => <salla-filters-widget\n option={option}\n filtersData={this.filtersData}\n onChanged={({ detail: { event, option, value } }) => {\n this.handleOptionChange(event, option, value)\n }} />)}\n\n {this.filters?.length ? <div class=\"s-filters-footer\">\n {/* <salla-button color='primary' onClick={() => this.applyFilters()}>{this.apply}</salla-button> */}\n <salla-button color='gray' fill='outline' onClick={() => this.resetFilters()}>{this.reset}</salla-button>\n </div> : ''}\n </Host>;\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAAA,MAAM,eAAe,GAAG,+GAA+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rB,MAAM,GAAA;;MACJ,QAAA,OAAO,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACT,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA;MAAE,YAAA,EAAA,CAAA,GAAG,CAAC,MAAM,IAAI,CAAA,CAAA,sBAAA,EAAA,EAC3B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAI;0BAClD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;MAC/C,iBAAC,GAAI,CAAC,EAEP,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,MAAM,IAAG,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,kBAAkB,EAAA,EAEnD,CAAA,CAAA,cAAA,EAAA,EAAc,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAAA,EAAG,IAAI,CAAC,KAAK,CAAgB,CACrG,GAAG,EAAE,CACN;;UAGT,gBAAgB,GAAA;MACd,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-9_Q--jIX.system.js","sources":["src/components/salla-filters/salla-filters.scss?tag=salla-filters","src/components/salla-filters/salla-filters.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.s-rating-stars-small {\n line-height: 12px;\n}\n.s-filters-radio{\n background-image: none !important;\n}","import { Component, Element, h, Event, EventEmitter, Host, Method, Prop, State } from '@stencil/core';\nimport { Filter, FilterOptionTypes } from \"./interfaces\";\nimport Helper from '../../Helpers/Helper';\n@Component({\n tag: 'salla-filters',\n styleUrl: 'salla-filters.scss',\n})\nexport class SallaFilters {\n\n constructor() {\n salla.event.on('filters::hidden', () => this.host.style.display = 'none');\n\n salla.lang.onLoaded(() => {\n this.apply = salla.lang.get('pages.checkout.apply');\n this.reset = salla.lang.get('pages.categories.filters_reset');\n });\n\n salla.event.on('filters::fetched', ({ filters }) => {\n this.host.style.display = '';\n let freshFilterData: any = {};\n this.filters = filters\n .map((filter: Filter) => {\n filter.label = {\n category_id: salla.lang.get('common.titles.categories'),\n brand_id: salla.lang.get('common.titles.brands'),\n rating: salla.lang.get('pages.categories.filter_rating'),\n price: salla.lang.get('pages.categories.filter_price'),\n }[filter.key] || filter.label;\n // filter.type = FilterOptionTypes.VALUES;\n if (filter.key == 'rating') {\n filter.type = FilterOptionTypes.VALUES;\n //@ts-ignore\n let { max, min } = filter.values;\n //@ts-ignore\n filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max)\n }\n if (this.filtersData.variants && filter.type == FilterOptionTypes.VARIANTS) {\n freshFilterData.variants = this.filtersData.variants;\n }\n if (this.filtersData[filter.key] && filter.type !== FilterOptionTypes.VARIANTS) {\n freshFilterData[filter.key] = this.filtersData[filter.key];\n }\n let searchParams = new URLSearchParams(window.location.search);\n let hasFilters = false;\n for (let key of searchParams.keys()) {\n if (key.includes('filters')) {\n hasFilters = true;\n break; // No need to continue checking once a match is found\n }\n }\n if (salla.config.get('page.slug') == \"product.index\" && Object.keys(freshFilterData).length == 0 && !hasFilters) {\n // Append the current category to the url if there are no pre-selected filters\n let currentUrl = window.location.href;\n let filterValue = salla.config.get('page.id');\n let separator = currentUrl.indexOf('?') !== -1 ? '&' : '?';\n let newUrl = currentUrl + separator + 'filters[category_id]=' + filterValue;\n freshFilterData.category_id = filterValue;\n window.history.pushState({ path: newUrl }, '', newUrl);\n }\n return filter;\n });\n this.filtersData = freshFilterData;\n this.host.childNodes.forEach(async (widget: HTMLSallaFiltersWidgetElement) => widget.setWidgetHeight && await widget.setWidgetHeight())\n });\n }\n\n async componentWillLoad() {\n try {\n const searchParams = new URLSearchParams(window.location.search);\n this.filtersData = await Helper.extractFiltersFromUrl(searchParams);\n } catch (e) {\n console.warn('failed to get filters from URL', e.message);\n }\n }\n\n\n @Element() host: HTMLElement;\n\n /**\n * Array of filter options\n */\n @Prop({ reflect: true, mutable: true }) filters?: Filter[];\n\n private isReady = false;//to avoid triggering the changed event\n\n @State() isSidebarOpen: boolean;\n @State() filtersData: object | any = {}\n @State() apply: string;\n @State() reset: string;\n\n /**\n * Custom event fired when the selected filters are changed.\n */\n @Event() changed: EventEmitter;\n\n /**\n * Method to get filter data.\n */\n @Method()\n async getFilters() {\n return this.filtersData;\n }\n\n /**\n * Apply filter action.\n */\n @Method()\n async applyFilters() {\n if (!this.isReady) {\n return;\n }\n let hasFilters = Object.keys(this.filtersData).length > 0;\n setTimeout(() => {\n if (hasFilters) {\n let url = new URL(window.location.href);\n for (const [key] of url.searchParams.entries()) {\n if (key.startsWith(\"filters\")) {\n url.searchParams.delete(key);\n }\n }\n let encodedFilterValues = this.encodeFilters(this.filtersData)\n let sanitizedFilterValues = url.search.split(\"&\").filter(item => !item.includes('filters')).join(\"&\")\n if (sanitizedFilterValues) {\n url.search = url.search.split(\"&filters\")[0] + \"&\" + encodedFilterValues\n } else {\n url.search = `?${encodedFilterValues}`\n }\n window.history.pushState({}, '', url.href);\n }\n else {\n let url = new URL(window.location.href);\n url.searchParams?.delete('filters');\n window.history.pushState({}, '', url.toString());\n }\n salla.event.emit('salla-filters::changed', this.filtersData);\n this.changed.emit(this.filtersData);\n }, 300);\n }\n\n\n private encodeFilters(filters, parentKey = 'filters') {\n const encodedFilters = [];\n\n for (const key in filters) {\n if (Object.prototype.hasOwnProperty.call(filters, key)) {\n const value = filters[key];\n\n const fullKey = parentKey ? `${parentKey}[${key}]` : key;\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n encodedFilters.push(`${fullKey}[${i}]=${value[i]}`)\n }\n }\n else if (typeof value === 'object' && value !== null) {\n encodedFilters.push(this.encodeFilters(value, fullKey));\n } else {\n // const encodedKey = encodeURIComponent(fullKey);\n // const encodedValue = encodeURIComponent(value);\n let result = `${fullKey}=${value}`\n encodedFilters.push(result);\n }\n }\n }\n return encodedFilters.join('&');\n };\n\n /**\n * Reset selected filters.\n */\n @Method()\n async resetFilters() {\n this.removeFiltersQueryParams()\n this.filtersData = {};\n this.host.childNodes.forEach((widget: HTMLSallaFiltersWidgetElement) => widget.reset && widget.reset())\n salla.event.emit('salla-filters::reset');\n return this.applyFilters();\n }\n\n private removeFiltersQueryParams() {\n const searchParams = new URLSearchParams(window.location.search);\n\n const newUrl = Array.from(searchParams.keys())\n .filter(key => !key.startsWith('filters['))\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(searchParams.get(key))}`)\n .join('&');\n\n const finalUrl = newUrl ? `${window.location.pathname}?${newUrl}` : window.location.pathname;\n window.history.pushState({}, '', finalUrl);\n }\n\n /**\n * @param {{target:HTMLInputElement}} event\n * @param option\n * @param value\n * @private\n */\n private handleOptionChange(event, option: Filter, value) {\n if (option.type === FilterOptionTypes.RANGE) {\n this.filtersData[option.key] = value;\n\n }\n let isChecked = event.target.checked;\n\n if (option.type === FilterOptionTypes.VARIANTS) {\n this.filtersData.variants = this.filtersData.variants || {};\n isChecked && (this.filtersData.variants[option.key] = value);\n isChecked || (delete this.filtersData.variants[option.key]);\n }\n\n else if (event.target.type == \"radio\") {\n isChecked && (this.filtersData[option.key] = value);\n isChecked || (delete this.filtersData[option.key]);\n }\n\n //it's checkbox\n // add if condition to avoid error when the filter is not existed in the filtersData\n else if (event.target.type == \"checkbox\") {\n this.filtersData[option.key] = this.filtersData[option.key] || [];\n if (isChecked) {\n this.filtersData[option.key].push(value);\n\n }\n this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);\n }\n this.applyFilters();\n }\n\n\n\n render() {\n return <Host>\n {this.filters?.map(option => <salla-filters-widget\n option={option}\n filtersData={this.filtersData}\n onChanged={({ detail: { event, option, value } }) => {\n this.handleOptionChange(event, option, value)\n }} />)}\n\n {this.filters?.length ? <div class=\"s-filters-footer\">\n {/* <salla-button color='primary' onClick={() => this.applyFilters()}>{this.apply}</salla-button> */}\n <salla-button color='gray' fill='outline' onClick={() => this.resetFilters()}>{this.reset}</salla-button>\n </div> : ''}\n </Host>;\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAAA,MAAM,eAAe,GAAG,+GAA+G;;YCO1H,YAAY,4BAAA,MAAA;MAEvB,IAAA,WAAA,CAAA,OAAA,EAAA;;;MA0EQ,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC;MAGf,QAAA,IAAW,CAAA,WAAA,GAAiB,EAAE;cA5ErC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;MAEzE,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;kBACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC;kBACnD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC;MAC/D,SAAC,CAAC;MAEF,QAAA,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC,EAAE,OAAO,EAAE,KAAI;kBACjD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE;kBAC5B,IAAI,eAAe,GAAQ,EAAE;kBAC7B,IAAI,CAAC,OAAO,GAAG;MACZ,iBAAA,GAAG,CAAC,CAAC,MAAc,KAAI;sBACtB,MAAM,CAAC,KAAK,GAAG;0BACb,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,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,CACN;;UAGT,gBAAgB,GAAA;MACd,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-D4L8yQG9.system.js","sources":["src/components/salla-filters-widget/salla-filters-widget.scss?tag=salla-filters-widget","src/components/salla-filters-widget/salla-filters-widget.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, h, Method, State, Prop, Event, Element } from '@stencil/core';\nimport Helper from '../../Helpers/Helper';\nimport { Filter, FilterOptionTypes } from \"../salla-filters/interfaces\";\n\n@Component({\n tag: 'salla-filters-widget',\n styleUrl: 'salla-filters-widget.scss',\n})\nexport class SallaFiltersWidget {\n @Element() host: HTMLElement;\n\n /**\n * Show more or less filter options.\n */\n @Prop({ mutable: true }) withLoadMore: boolean;\n\n /**\n * Selected filter options value.\n */\n @Prop({ reflect: true }) filtersData: object;\n\n /**\n * Filter option along with possible values.\n */\n @Prop({ reflect: true }) option: Filter;\n\n\n priceRange: HTMLSallaPriceRangeElement\n\n\n private widgetValues: HTMLElement;\n private widgetContent: HTMLDivElement;\n private initHeight: number = 195;\n\n @State() isOpen: boolean = true;\n @State() isShowMore: boolean = false;\n @State() showMoreLabel: string = \"عرض المزيد\";\n @State() showLessLabel: string = \"عرض أقل\";\n @State() page: any = salla.config.get('page');\n\n /**\n * Custom event emitted up on filter option selection changes.\n */\n @Event() changed: any;\n\n connectedCallback() {\n //lets be smart and don't show 5 and more link for 8 options\n this.withLoadMore = this.option.key != 'price' && Array.isArray(this.option.values) && this.option.values.length > 8;\n salla.onReady(() => {\n this.page = salla.config.get('page');\n })\n salla.lang.onLoaded(() => {\n this.showMoreLabel = salla.lang.getWithDefault('common.titles.more', this.showMoreLabel)\n this.showLessLabel = salla.lang.getWithDefault('common.elements.show_less', this.showLessLabel)\n })\n }\n\n componentDidLoad() {\n this.widgetValues.scrollHeight < this.initHeight && (this.withLoadMore = false);\n (this.withLoadMore && this.widgetValues) && (this.widgetValues.style.maxHeight = `${this.initHeight}px`);\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }\n\n /**\n * Asynchronously sets the height of a widget element to its current height, allowing for smooth transitions.\n * This function is often used in scenarios where the widget's content changes dynamically, and animating\n * the height adjustment is desired for a smoother user experience.\n *\n * @param {number} [delay=250] - Optional. The delay (in milliseconds) before updating the widget height.\n * Defaults to 250 milliseconds.\n *\n * @returns {Promise<void>} - A Promise that resolves once the widget height is set after the specified delay.\n *\n * @example\n * // Set widget height with the default delay (250 milliseconds)\n * await setWidgetHeight();\n *\n * // Set widget height with a custom delay (e.g., 500 milliseconds)\n * await setWidgetHeight(500);\n */\n @Method()\n async setWidgetHeight(delay = 250) {\n this.widgetContent.removeAttribute('style');\n setTimeout(() => {\n let currentWidgetHeight: number = this.widgetContent.scrollHeight;\n this.widgetContent.style.height = currentWidgetHeight + 'px';\n }, delay)\n }\n\n /**\n * Reset selected filter options.\n */\n @Method()\n async reset() {\n if (this.option.type === FilterOptionTypes.RANGE) {\n this.priceRange.reset()\n }\n Array.from(this.host.querySelectorAll('input')).forEach(input => input.checked = false);\n }\n\n\n /**\n * Action to show more or less filter options.\n */\n @Method()\n async showMore() {\n this.isShowMore = !this.isShowMore\n this.widgetContent.style.height = 'auto';\n this.widgetValues.style.maxHeight = this.isShowMore ? `${this.widgetValues.scrollHeight}px` : `${this.initHeight}px`;\n setTimeout(() => {\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }, 400); // get height after time of collapse animtion (duration-300)\n }\n\n /**\n * Action to toggle widget open or closed (expand/ collapse).\n */\n @Method()\n async toggleWidget() {\n this.isOpen = !this.isOpen;\n Helper.toggleElementClassIf(this.widgetContent, 's-filters-widget-opened', 's-filters-widget-closed', () => this.isOpen);\n }\n\n renderFilterOption(option: Filter) {\n if (![FilterOptionTypes.VALUES, FilterOptionTypes.MINIMUM, FilterOptionTypes.VARIANTS].includes(option.type)) {\n return '';\n }\n //@ts-ignore\n return option.values.map((filterOption, index) => {\n let value = typeof filterOption == 'number' ? filterOption : (filterOption.key || filterOption.value);\n\n return <label class=\"s-filters-label\" htmlFor={`${option.key}-option-${value}`} key={`${option.key}-option-${value}`}>\n <input\n id={`${option.key}-option-${value}`}\n name={option.key}\n type=\"radio\"\n checked={this.isSelectedOption(option, value)}\n class={`s-filters-radio`}\n onChange={event => this.changed.emit({ event, option, value })}\n />\n {this.getOptionLabel(option, filterOption)}\n </label>\n }\n )\n\n }\n private isSelectedOption(option: Filter, value: any): boolean {\n if (option.type === FilterOptionTypes.MINIMUM) {\n return this.filtersData[option.key] == value;\n }\n if (option.type === FilterOptionTypes.VARIANTS) {\n return this.filtersData[option.type] && this.filtersData[option.type][Object.keys(this.filtersData[option.type])[0]] == value;\n }\n if (option.type === FilterOptionTypes.RANGE) {\n\n return this.filtersData[option.key] && this.filtersData[option.key].min == value.min && this.filtersData[option.key].max == value.max;\n }\n\n if (option.type === FilterOptionTypes.VALUES) {\n return this.filtersData[option.key] && Number(this.filtersData[option.key]) == Number(value);\n }\n return false;\n }\n\n\n\n private getOptionLabel(option: Filter, filterOption) {\n if (option.key == 'rating') {\n //in amazon has stars & up, should we add it, to avoid those people who will come to say I selected 4 why I see 5 sars products\n return <salla-rating-stars size=\"small\" value={filterOption} />;\n }\n let label = filterOption.value || 'null';\n //label+=filterOption.count ? ` (${salla.helpers.number(filterOption.count)})` : '';\n return <span class=\"s-filters-option-name\">{label}</span>;\n }\n\n render() {\n return (\n <Host class=\"s-filters-widget-container\">\n <h3 class=\"s-filters-widget-title\" onClick={() => this.toggleWidget()}>\n <span>{this.option.label}</span>\n <span class={`s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}`} />\n </h3>\n <div class=\"s-filters-widget-content\" ref={(el) => this.widgetContent = el}>\n <div class=\"s-filters-widget-values\" ref={(el) => this.widgetValues = el}>\n <slot />\n {\n this.option.type !== FilterOptionTypes.RANGE\n ? this.renderFilterOption(this.option)\n : <salla-price-range onChanged={(event) => {\n this.changed.emit(event.detail)\n }}\n ref={price => this.priceRange = price}\n filtersData={this.filtersData}\n option={this.option} />\n }\n </div>\n {this.withLoadMore &&\n <a class=\"s-filters-widget-more\"\n onClick={() => this.showMore()}>{!this.isShowMore ? this.showMoreLabel : this.showLessLabel}</a>\n }\n </div>\n </Host>\n );\n }\n\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAAA,MAAM,qBAAqB,GAAG,sBAAsB;;YCQvC,kBAAkB,mCAAA,MAAA;MAJ/B,IAAA,WAAA,CAAA,OAAA,EAAA;;;MA4BU,QAAA,IAAU,CAAA,UAAA,GAAW,GAAG;MAEvB,QAAA,IAAM,CAAA,MAAA,GAAY,IAAI;MACtB,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;MAC3B,QAAA,IAAa,CAAA,aAAA,GAAW,YAAY;MACpC,QAAA,IAAa,CAAA,aAAA,GAAW,SAAS;cACjC,IAAI,CAAA,IAAA,GAAQ,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;MAwK9C;UAjKC,iBAAiB,GAAA;;MAEf,QAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;MACpH,QAAA,KAAK,CAAC,OAAO,CAAC,MAAK;kBACjB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;MACtC,SAAC,CAAC;MACF,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;MACvB,YAAA,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,oBAAoB,EAAE,IAAI,CAAC,aAAa,CAAC;MACxF,YAAA,IAAI,CAAC,aAAa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,EAAE,CAAA,CAAE,GAAI,CACpG,EACL,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,0BAA0B,EAAC,GAAG,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,aAAa,GAAG,EAAE,EAAA,EACxE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,yBAAyB,EAAC,GAAG,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,YAAY,GAAG,EAAE,EAAA,EACtE,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EAEN,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,iBAAiB,CAAC;oBACnC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM;oBACnC,CAAmB,CAAA,mBAAA,EAAA,EAAA,SAAS,EAAE,CAAC,KAAK,KAAI;0BACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;MACjC,iBAAC,EACC,GAAG,EAAE,KAAK,IAAI,IAAI,CAAC,UAAU,GAAG,KAAK,EACrC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,MAAM,EAAE,IAAI,CAAC,MAAM,EAAA,CAAI,CAEzB,EACL,IAAI,CAAC,YAAY;MAChB,YAAA,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,uBAAuB,EAC9B,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAA,EAAG,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAK,CAEhG,CACD;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-B0XOJZCF.system.js","sources":["src/components/salla-filters-widget/salla-filters-widget.scss?tag=salla-filters-widget","src/components/salla-filters-widget/salla-filters-widget.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, h, Method, State, Prop, Event, Element } from '@stencil/core';\nimport Helper from '../../Helpers/Helper';\nimport { Filter, FilterOptionTypes } from \"../salla-filters/interfaces\";\n\n@Component({\n tag: 'salla-filters-widget',\n styleUrl: 'salla-filters-widget.scss',\n})\nexport class SallaFiltersWidget {\n @Element() host: HTMLElement;\n\n /**\n * Show more or less filter options.\n */\n @Prop({ mutable: true }) withLoadMore: boolean;\n\n /**\n * Selected filter options value.\n */\n @Prop({ reflect: true }) filtersData: object;\n\n /**\n * Filter option along with possible values.\n */\n @Prop({ reflect: true }) option: Filter;\n\n\n priceRange: HTMLSallaPriceRangeElement\n\n\n private widgetValues: HTMLElement;\n private widgetContent: HTMLDivElement;\n private initHeight: number = 195;\n\n @State() isOpen: boolean = true;\n @State() isShowMore: boolean = false;\n @State() showMoreLabel: string = \"عرض المزيد\";\n @State() showLessLabel: string = \"عرض أقل\";\n @State() page: any = salla.config.get('page');\n\n /**\n * Custom event emitted up on filter option selection changes.\n */\n @Event() changed: any;\n\n connectedCallback() {\n //lets be smart and don't show 5 and more link for 8 options\n this.withLoadMore = this.option.key != 'price' && Array.isArray(this.option.values) && this.option.values.length > 8;\n salla.onReady(() => {\n this.page = salla.config.get('page');\n })\n salla.lang.onLoaded(() => {\n this.showMoreLabel = salla.lang.getWithDefault('common.titles.more', this.showMoreLabel)\n this.showLessLabel = salla.lang.getWithDefault('common.elements.show_less', this.showLessLabel)\n })\n }\n\n componentDidLoad() {\n this.widgetValues.scrollHeight < this.initHeight && (this.withLoadMore = false);\n (this.withLoadMore && this.widgetValues) && (this.widgetValues.style.maxHeight = `${this.initHeight}px`);\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }\n\n /**\n * Asynchronously sets the height of a widget element to its current height, allowing for smooth transitions.\n * This function is often used in scenarios where the widget's content changes dynamically, and animating\n * the height adjustment is desired for a smoother user experience.\n *\n * @param {number} [delay=250] - Optional. The delay (in milliseconds) before updating the widget height.\n * Defaults to 250 milliseconds.\n *\n * @returns {Promise<void>} - A Promise that resolves once the widget height is set after the specified delay.\n *\n * @example\n * // Set widget height with the default delay (250 milliseconds)\n * await setWidgetHeight();\n *\n * // Set widget height with a custom delay (e.g., 500 milliseconds)\n * await setWidgetHeight(500);\n */\n @Method()\n async setWidgetHeight(delay = 250) {\n this.widgetContent.removeAttribute('style');\n setTimeout(() => {\n let currentWidgetHeight: number = this.widgetContent.scrollHeight;\n this.widgetContent.style.height = currentWidgetHeight + 'px';\n }, delay)\n }\n\n /**\n * Reset selected filter options.\n */\n @Method()\n async reset() {\n if (this.option.type === FilterOptionTypes.RANGE) {\n this.priceRange.reset()\n }\n Array.from(this.host.querySelectorAll('input')).forEach(input => input.checked = false);\n }\n\n\n /**\n * Action to show more or less filter options.\n */\n @Method()\n async showMore() {\n this.isShowMore = !this.isShowMore\n this.widgetContent.style.height = 'auto';\n this.widgetValues.style.maxHeight = this.isShowMore ? `${this.widgetValues.scrollHeight}px` : `${this.initHeight}px`;\n setTimeout(() => {\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }, 400); // get height after time of collapse animtion (duration-300)\n }\n\n /**\n * Action to toggle widget open or closed (expand/ collapse).\n */\n @Method()\n async toggleWidget() {\n this.isOpen = !this.isOpen;\n Helper.toggleElementClassIf(this.widgetContent, 's-filters-widget-opened', 's-filters-widget-closed', () => this.isOpen);\n }\n\n renderFilterOption(option: Filter) {\n if (![FilterOptionTypes.VALUES, FilterOptionTypes.MINIMUM, FilterOptionTypes.VARIANTS].includes(option.type)) {\n return '';\n }\n //@ts-ignore\n return option.values.map((filterOption, index) => {\n let value = typeof filterOption == 'number' ? filterOption : (filterOption.key || filterOption.value);\n\n return <label class=\"s-filters-label\" htmlFor={`${option.key}-option-${value}`} key={`${option.key}-option-${value}`}>\n <input\n id={`${option.key}-option-${value}`}\n name={option.key}\n type=\"radio\"\n checked={this.isSelectedOption(option, value)}\n class={`s-filters-radio`}\n onChange={event => this.changed.emit({ event, option, value })}\n />\n {this.getOptionLabel(option, filterOption)}\n </label>\n }\n )\n\n }\n private isSelectedOption(option: Filter, value: any): boolean {\n if (option.type === FilterOptionTypes.MINIMUM) {\n return this.filtersData[option.key] == value;\n }\n if (option.type === FilterOptionTypes.VARIANTS) {\n return this.filtersData[option.type] && this.filtersData[option.type][Object.keys(this.filtersData[option.type])[0]] == value;\n }\n if (option.type === FilterOptionTypes.RANGE) {\n\n return this.filtersData[option.key] && this.filtersData[option.key].min == value.min && this.filtersData[option.key].max == value.max;\n }\n\n if (option.type === FilterOptionTypes.VALUES) {\n return this.filtersData[option.key] && Number(this.filtersData[option.key]) == Number(value);\n }\n return false;\n }\n\n\n\n private getOptionLabel(option: Filter, filterOption) {\n if (option.key == 'rating') {\n //in amazon has stars & up, should we add it, to avoid those people who will come to say I selected 4 why I see 5 sars products\n return <salla-rating-stars size=\"small\" value={filterOption} />;\n }\n let label = filterOption.value || 'null';\n //label+=filterOption.count ? ` (${salla.helpers.number(filterOption.count)})` : '';\n return <span class=\"s-filters-option-name\">{label}</span>;\n }\n\n render() {\n return (\n <Host class=\"s-filters-widget-container\">\n <h3 class=\"s-filters-widget-title\" onClick={() => this.toggleWidget()}>\n <span>{this.option.label}</span>\n <span class={`s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}`} />\n </h3>\n <div class=\"s-filters-widget-content\" ref={(el) => this.widgetContent = el}>\n <div class=\"s-filters-widget-values\" ref={(el) => this.widgetValues = el}>\n <slot />\n {\n this.option.type !== FilterOptionTypes.RANGE\n ? this.renderFilterOption(this.option)\n : <salla-price-range onChanged={(event) => {\n this.changed.emit(event.detail)\n }}\n ref={price => this.priceRange = price}\n filtersData={this.filtersData}\n option={this.option} />\n }\n </div>\n {this.withLoadMore &&\n <a class=\"s-filters-widget-more\"\n onClick={() => this.showMore()}>{!this.isShowMore ? this.showMoreLabel : this.showLessLabel}</a>\n }\n </div>\n </Host>\n );\n }\n\n}\n"],"names":[],"mappings":";;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AK,KAAK,EAAC,yBAAyB,EAAC,GAAG,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,YAAY,GAAG,EAAE,EAAA,EACtE,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EAEN,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,iBAAiB,CAAC;oBACnC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM;oBACnC,CAAmB,CAAA,mBAAA,EAAA,EAAA,SAAS,EAAE,CAAC,KAAK,KAAI;0BACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;MACjC,iBAAC,EACC,GAAG,EAAE,KAAK,IAAI,IAAI,CAAC,UAAU,GAAG,KAAK,EACrC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,MAAM,EAAE,IAAI,CAAC,MAAM,EAAA,CAAI,CAEzB,EACL,IAAI,CAAC,YAAY;MAChB,YAAA,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,uBAAuB,EAC9B,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAA,EAAG,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAK,CAEhG,CACD;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-BC7Y13dm.system.js","sources":["src/components/salla-advertisement/salla-advertisement.scss?tag=salla-advertisement","src/components/salla-advertisement/salla-advertisement.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, State, Element, h } from '@stencil/core';\nimport { Advertisement } from './interfaces';\nimport AnimeJS from 'animejs';\n/**\n * @name SallaAdvertisement\n * @description A StencilJS component for handling and displaying advertisements in different pages of salla applications.\n * @tag salla-advertisement\n */\n\n/**\n * @slot adv - Replaces the entire advertisement, has replaceable props `{icon}`, `{url}`, `{target}`, `{description}`, `{bg_color}`, `{text_color}`.\n * */\n@Component({\n tag: 'salla-advertisement',\n styleUrl: 'salla-advertisement.scss',\n})\nexport class SallaAdvertisement {\n /**\n * Constructor for initializing the component.\n */\n constructor() {\n salla.onReady(() => {\n this.currentSlug = salla.config.get(\"page.slug\");\n })\n\n this.advSlot = this.host.querySelector('[slot=\"adv\"]')?.innerHTML || `<div class=\"s-advertisement-content\"><h2 class=\"s-advertisement-content-main\">{iconElem}{urlElem}</h2>{closeElem}</div>\n `;\n }\n private readonly advSlot: string;\n // State properties for managing component state\n @State() position: string;\n @State() advertisements: Advertisement[];\n @State() advertIcon: string;\n @State() currentSlug: string = salla.config.get(\"page.slug\");\n\n @Element() private host: HTMLElement;\n\n\n /**\n * Checks whether an advertisement is marked as not visible/dismissed.\n * @param advert - The advertisement to check.\n * @returns True if the advertisement is not visible, false otherwise.\n */\n private isNotVisible(advert: Advertisement): boolean {\n return !!salla.storage.get(`statusAd-${advert.id}`)\n }\n\n /**\n * Sets a flag to control the visibility of an advertisement and triggers an animation when hiding it.\n * @param advert - The advertisement to update.\n * @param flag - The flag indicating whether to display or hide the advertisement.\n */\n private setCanDisplayFlag(advert: Advertisement, flag: boolean): void {\n if (!flag) {\n // Set the statusAd flag to 'dismissed'\n salla.storage.set(`statusAd-${advert.id}`, 'dismissed');\n // Trigger an animation to hide the advertisement\n AnimeJS({\n targets: this.host,\n opacity: [1, 0],\n duration: 300,\n height: [this.host.clientHeight, 0],\n easing: 'easeInOutQuad',\n });\n }\n }\n\n /**\n * Renders the advertisements based on the fetched data and visibility status.\n * @returns JSX for rendering advertisements.\n */\n render() {\n if ((Array.isArray(this.advertisements) && !this.advertisements.length) || !this.advertisements) {\n return;\n }\n return this.advertisements.map((advertisement: Advertisement) => {\n return <div class={{ \"s-hidden\": this.isNotVisible(advertisement), 's-advertisement': true }} data-id={advertisement.id}\n style={{ \"background-color\": advertisement.colors.bg, \"color\": advertisement.colors.text }}>\n <div id=\"adv-slot\" innerHTML={\n this.advSlot\n // Replace the props with the advertisement data\n // !Note: The props with the 'Elem' suffix are for internal use only.\n .replace(\"{iconElem}\", `<i class=\"s-advertisement-content-icon ${advertisement.icon}\"></i>`)\n .replace(\"{urlElem}\", advertisement.url ? `<a href=\"${advertisement.url}\" target=\"${advertisement.target}\">${advertisement.description}</a>` : advertisement.description)\n .replace(\"{closeElem}\", `<button class=\"s-advertisement-action\" aria-label=\"close-alert\"><i class=\"sicon-cancel\"></i></button>`)\n .replace('{icon}', advertisement.icon)\n .replace('{url}', advertisement.url)\n .replace('{target}', advertisement.target)\n .replace('{description}', advertisement.description)\n .replace('{bg_color}', advertisement.colors.bg)\n .replace('{text_color}', advertisement.colors.text)\n }></div>\n </div>\n }\n );\n }\n\n /**\n * Lifecycle method that fetches advertisements before the component is loaded.\n */\n componentWillLoad() {\n // Fetch advertisements based on the current page\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => salla.api.advertisement.fetch(this.currentSlug))\n .then(resp => Array.isArray(resp.data) ? resp.data.find(ad => !salla.storage.get(`statusAd-${ad.id}`)) : null)\n .then(ad => this.advertisements = ad ? [ad] : []);\n }\n\n componentDidRender() {\n if ((Array.isArray(this.advertisements) && !this.advertisements.length) || !this.advertisements) {\n return;\n }\n // Add event listener for the close button\n setTimeout(() => {\n let closeBtn = this.host.querySelector('.s-advertisement-action');\n if (closeBtn) {\n closeBtn.addEventListener('click', () => this.setCanDisplayFlag(this.advertisements[0], false));\n }\n });\n\n // Reduce Dom size by removing the slot element\n this.host.querySelectorAll('#adv-slot').forEach(el => el?.replaceWith(el?.firstChild));\n this.host.querySelector('[slot=\"adv\"]')?.remove();\n\n // Trigger an animation to show the advertisement\n AnimeJS({\n targets: this.host,\n opacity: [0, 1],\n duration: 300,\n height: [0, this.host.clientHeight],\n easing: 'easeInOutQuad',\n });\n }\n}\n"],"names":["AnimeJS"],"mappings":";;;;;;;;;;;;;;;;MAAA,MAAM,qBAAqB,G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AA,GAAA,MAAA,GAAA,EAAE,CAAE,WAAW,CAAC,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,MAAA,GAAA,MAAA,GAAF,EAAE,CAAE,UAAU,CAAC,CAAC;MACtF,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,EAAE;;MAGjD,QAAAA,KAAO,CAAC;kBACN,OAAO,EAAE,IAAI,CAAC,IAAI;MAClB,YAAA,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;MACf,YAAA,QAAQ,EAAE,GAAG;kBACb,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;MACnC,YAAA,MAAM,EAAE,eAAe;MACxB,SAAA,CAAC;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-BDy3CuHb.system.js","sources":["src/components/salla-accordion/salla-accordion-body.scss?tag=salla-accordion-body","src/components/salla-accordion/salla-accordion-body.tsx"],"sourcesContent":["\n","import { Component, Host, h } from '@stencil/core';\n\n/**\n * @salla/ui-components\n * The `salla-accordion-body` component represents the body/content of an accordion.\n */\n@Component({\n tag: 'salla-accordion-body',\n styleUrl: 'salla-accordion-body.scss',\n shadow: false\n})\nexport class SallaAccordionBody {\n render() {\n return (\n <Host class=\"s-accordion-body-wrapper\">\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,MAAM,qBAAqB,GAAG,EAAE;;kBCWnB,kBAAkB,mCAAA,MAAA;;;;gBAC7B,MAAM,GAAA;oBACJ,QACE,CAAC,CAAA,IAAI,EAAC,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,0BAA0B,EAAA,EACpC,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-BHyfFmHZ.system.js","sources":["src/components/salla-social/salla-social.scss?tag=salla-social","src/components/salla-social/salla-social.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, State, h, Element } from '@stencil/core';\nimport instagram from '../../assets/svg/instagram.svg';\nimport twitter from '../../assets/svg/twitter.svg';\nimport facebook from '../../assets/svg/facebook.svg';\nimport youtube from '../../assets/svg/youtube.svg';\nimport snapchat from '../../assets/svg/snapchat.svg';\nimport tiktok from '../../assets/svg/tiktok.svg';\n\n/**\n * @slot social-item - Replaces social item, has replaceable keys `{icon}`, `{type} and {link}`.\n */\n@Component({\n tag: 'salla-social',\n styleUrl: 'salla-social.scss',\n})\nexport class SallaSocial {\n constructor() {\n this.socialSlot = this.host.querySelector('[slot=\"social-item\"]')?.innerHTML ||\n `<a href={link} rel=\"noopener\" target=\"_blank\" title={type} aria-label={type}><span class=\"s-social-icon\">{icon}</span></a>`;\n salla.lang.onLoaded(() => {\n this.links = salla.config.get('store.social');\n });\n }\n\n private readonly socialSlot: string;\n @State() links = salla.config.get('store.social');\n @Element() host: HTMLElement;\n @State() iconsList: any = { instagram, twitter, facebook, youtube, snapchat, tiktok }\n\n private getLinksArray() {\n return this.links ? Object.entries(this.links)\n .filter(([key, value]) => !!value && key !== 'whatsapp')\n .map(([type, value]) => ({ type, value })) : [];\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n render() {\n const linksArray = this.getLinksArray();\n return (\n <Host>\n <ul class=\"s-social-list\">\n {linksArray.map((link) => (\n <li class=\"s-social-link\">\n <div id=\"social-slot\" innerHTML={this.socialSlot\n .replace(/\\{icon\\}/g, this.iconsList[link.type])\n .replace(/\\{type\\}/g, link.type)\n .replace(/\\{link\\}/g, link.value.toString())}>\n </div>\n </li>\n ))}\n </ul>\n </Host>\n );\n }\n componentDidRender() {\n this.host.querySelectorAll('#social-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"social-item\"]')?.remove();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA,MAAM,cAAc,GAAG,sBAAsB;;YCehC,WAAW,2BAAA,MAAA;MACtB,IAAA,WAAA,CAAA,OAAA,EAAA;;;cASS,IAAK,CAAA,KAAA,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;MAExC,QAAA,IAAA,CAAA,SAAS,GAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;MAVnF,QAAA,IAAI,CAAC,UAAU,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,0CAAE,SAAS;MAC1E,YAAA,CAAA,0HAAA,CAA4H;MAC9H,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;kBACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;MAC/C,SAAC,CAAC;MACH;UAOO,aAAa,GAAA;MACnB,QAAA,OAAO,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK;MAC1C,aAAA,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,GAAG,KAAK,UAAU;mBACtD,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE;;UAGnD,iBAAiB,GAAA;MACf,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;;UAGvD,MAAM,GAAA;MACJ,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE;cACvC,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAI,KAAK,EAAC,eAAe,EACtB,EAAA,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,MACnB,CAAI,CAAA,IAAA,EAAA,EAAA,KAAK,EAAC,eAAe,EAAA,EACvB,CAAK,CAAA,KAAA,EAAA,EAAA,EAAE,EAAC,aAAa,EAAC,SAAS,EAAE,IAAI,CAAC;uBACnC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;MAC9C,iBAAA,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI;MAC9B,iBAAA,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,GACxC,CACH,CACN,CAAC,CACC,CACA;;UAGX,kBAAkB,GAAA;;cAChB,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;MACvF,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,EAAE;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-DkEQyxiJ.system.js","sources":["src/components/salla-offer/interfaces.ts","src/components/salla-offer/salla-offer.scss?tag=salla-offer","src/components/salla-offer/salla-offer.tsx"],"sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\",\n SpecialPrice = \"special_price\",\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface SpecialPriceDetail {\n apply_to: \"product\" | \"category\";\n discount_value: number;\n ends_at: number;\n min_items: number; \n min_spend: number;\n targets: Array<string | number>;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail | SpecialPriceDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n",".s-offer-wrapper .s-slider-block__title {\n h2 {\n font-size: 1.125rem;\n line-height: 1.75rem;\n color: #f87171;\n\n &::before {\n font-family: \"sallaicons\";\n content: \"\\ee30\" !important;\n position: absolute;\n top: 1rem;\n font-size: 3rem;\n font-weight: 400;\n line-height: 1;\n color: #fef2f2;\n }\n }\n}\n\n.s-offer-bank-wrapper-sinlge-item{\n display: flex;\n align-items: center !important;\n gap: 14px;\n}\n\n.s-offer-bank-wrapper {\n display: flex !important;\n width: 100% !important;\n}\n\n// .s-offer-bank-wrapper {\n // \n// }","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer,SpecialPriceDetail, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n *\n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private async getEndpointByPageName(): Promise<string> {\n if (this.currentPage == PageType.Cart) {\n const cartId = await Salla.cart.getCurrentCartId();\n return `offers/cart/${cartId}`;\n }\n\n if (this.currentPage == PageType.ProductDetail) {\n return `offers/product/${salla.config.get('page.id')}`;\n }\n\n return \"offers\";\n }\n\n /**\n * Emits a promotion viewed event for analytics tracking\n */\n private emitPromotionViewed(): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: 1 \n };\n \n salla.event.emit('promotion::viewed', [promotionData]);\n }\n /**\n * Emits a promotion clicked event\n */\n private emitPromotionClicked(position: number = 1): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: position\n };\n \n salla.event.emit('promotion::clicked', [promotionData]);\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(async () => salla.api.request(await this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.SpecialPrice,OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n\n //if it's special price offer\n if (offer.type === OfferType.SpecialPrice) {\n const details = offer.details as SpecialPriceDetail;\n\n return details.apply_to === 'product'\n // Avoid additional requests; use `salla-products-slider` and pass the custom card\n ? salla.product.api.fetch({ source: \"selected\", source_value: details.targets})\n .then((response: any) => {\n (offer.details as any).products = response.data; // Set the fetched products\n return this.offersList = [offer];\n })\n : salla.product.api.categories() // Fetch all categories in one query\n .then((res) => {\n const categoriesToRender = this.findCategories(res.data, details.targets); // Extract only the selected categories\n (offer.details as any).categories = categoriesToRender;\n return this.offersList = [offer];\n });\n }\n\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n this.emitPromotionViewed();\n }\n\n \n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n // Check if the offers list is empty or if the component is not ready to render\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\" onClick={() => this.emitPromotionClicked()}>\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.SpecialPrice) {\n return this.renderSpecialPriceSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n *\n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n private renderSpecialPriceSection() {\n const details = this.offersList[0].details as SpecialPriceDetail;\n\n return [\n // Render products if `apply_to` is \"product\"\n details.apply_to === \"product\" &&\n details.products?.map((product:Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n\n // Render categories if `apply_to` is \"category\"\n details.apply_to === \"category\" &&\n details.categories?.map((category: Category) => this.getCategoriesSection(category)),\n ];\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,IAAY,QAGX;YAHD,CAAA,UAAY,QAAQ,EAAA;YAClB,IAAA,QAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA;YAED,IAAY,SAOX;YAPD,CAAA,UAAY,SAAS,EAAA;YACnB,IAAA,SAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;YAC3B,IAAA,SAAA,CAAA,mBAAA,CAAA,GAAA,OAA2B;YAC3B,IAAA,SAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;YAClC,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACb,IAAA,SAAA,CAAA,UAAA,CAAA,GAAA,aAAwB;YACxB,IAAA,SAAA,CAAA,cAAA,CAAA,GAAA,eAA8B;YAChC,CAAC,EAPW,SAAS,KAAT,SAAS,GAOpB,EAAA,CAAA,CAAA;;YCZD,MAAM,aAAa,GAAG,khBAAkhB;;kBCmB3hB,UAAU,0BAAA,MAAA;YAErB,IAAA,WAAA,CAAA,OAAA,EAAA;;;YAoBA;;;;;;;;YAQG;YACK,QAAA,IAAoB,CAAA,oBAAA,GAAW,2BAA2B;;YAGzD,QAAA,IAAU,CAAA,UAAA,GAAY,EAAE;YAExB,QAAA,IAAc,CAAA,cAAA,GAAY,KAAK;YAK/B,QAAA,IAAW,CAAA,WAAA,GAA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,CAAC,QAAQ,0CAAE,GAAG,CAAC,CAAC,OAAe,MACpC,WAAK,KAAK,EAAC,0BAA0B,EAClC,EAAA,IAAI,CAAC;YACJ,sBAAE,EAAC,IAAI,CAAC,oBAAoB,EAAC,EAAA,OAAO,EAAE,OAAO,EAA8B;YAC3E,sBAAE,mDAAoC,OAAO,EAAE,OAAO,EAAuB,CAAA,CAC3E,CACP,CAAC,CAAA;;wBAGF,OAAO,CAAC,QAAQ,KAAK,UAAU;YAC/B,iBAAA,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAC,QAAkB,KAAK,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAA;qBACrF;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-BKylW7nB.system.js","sources":["src/components/salla-offer/interfaces.ts","src/components/salla-offer/salla-offer.scss?tag=salla-offer","src/components/salla-offer/salla-offer.tsx"],"sourcesContent":["export enum PageType {\n ProductDetail = \"product.single\",\n Cart = \"cart\"\n}\n\nexport enum OfferType {\n Conditional = \"conditional\",\n PercentageOrFixed = \"fixed\",\n DiscountsTable = \"discounts_table\",\n Bank = \"bank\",\n BuyXGetY = \"buy_x_get_y\",\n SpecialPrice = \"special_price\",\n}\n\n\nexport interface DiscountDetailFixed {\n discount_type: \"fixed\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailFreeProduct {\n discount_type: \"free_product\";\n min_spend: number;\n discount_value: number;\n}\n\nexport interface DiscountDetailConditional extends Array<DiscountDetailFixed | DiscountDetailFreeProduct> {}\n\nexport interface DiscountDetailPercentageFixed {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\";\n targets: Array<string | number>;\n ends_at: number;\n min_spend: number;\n discount_value: number;\n}\n\nexport interface Discount {\n discounted_amount: any;\n quantity: number;\n percentage: number;\n}\n\nexport interface DiscountDetailTable {\n apply_to: \"all\" | \"products\" | \"categories\" | \"payment_methods\" | \"order\";\n discount_value: number;\n ends_at: string;\n min_items: number;\n min_spend: number;\n show_price_after_discount: boolean;\n discounts: Discount[];\n}\n\nexport interface BankOffer {\n logo: string;\n discount_value: number;\n discount_type: string;\n minimum_spend: number;\n payments: string[];\n}\n\nexport interface SpecialPriceDetail {\n apply_to: \"product\" | \"category\";\n discount_value: number;\n ends_at: number;\n min_items: number; \n min_spend: number;\n targets: Array<string | number>;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n\n}\n\nexport interface BuyXGetYDetail {\n ends_at: number;\n buy: {\n source: \"product\" | \"category\";\n source_value: number[];\n quantity: number;\n };\n get: {\n source: \"products\" | \"category\";\n source_value: number[];\n type: \"free_product\" | \"percentage\" | \"fixed\";\n value: number;\n products?: Product[];//we will set this dynamically\n categories?: Category[];//we will set this dynamically\n };\n}\n\nexport interface Offer {\n id: number;\n title: string;\n description: string;\n type: OfferType | \"conditional\" | \"fixed\" | \"discounts_table\" | \"bank\" | \"buy_x_get_y\";\n details: DiscountDetailConditional | DiscountDetailPercentageFixed | DiscountDetailTable | BankOffer | BuyXGetYDetail | SpecialPriceDetail;\n}\n\nexport interface Product {\n id: number;\n type: string;\n status: string;\n is_available: boolean;\n sku: string;\n name: string;\n price: { amount: number; currency: string; };\n promotion: { title: string; sub_title: string; };\n sale_price: { amount: number; currency: string; };\n regular_price: { amount: number; currency: string; };\n currency: string;\n url: string;\n thumbnail: string;\n has_special_price: boolean;\n favorite?: any;\n}\n\nexport interface Category {\n id?: string;\n id_?: number;\n name?: string;\n url?: string;\n icon?: string;\n sub_categories?: Category[];\n items?: any[] | null;\n}\n\nexport interface Currency {\n code: string | 'SAR';\n name: string;\n symbol: string;\n amount?: number;\n country_code?: string;\n}\n",".s-offer-wrapper .s-slider-block__title {\n h2 {\n font-size: 1.125rem;\n line-height: 1.75rem;\n color: #f87171;\n\n &::before {\n font-family: \"sallaicons\";\n content: \"\\ee30\" !important;\n position: absolute;\n top: 1rem;\n font-size: 3rem;\n font-weight: 400;\n line-height: 1;\n color: #fef2f2;\n }\n }\n}\n\n.s-offer-bank-wrapper-sinlge-item{\n display: flex;\n align-items: center !important;\n gap: 14px;\n}\n\n.s-offer-bank-wrapper {\n display: flex !important;\n width: 100% !important;\n}\n\n// .s-offer-bank-wrapper {\n // \n// }","import { Component, Element, Prop, State, h } from '@stencil/core';\nimport { Offer, Category, Product, Discount, Currency, BuyXGetYDetail, PageType, OfferType, BankOffer,SpecialPriceDetail, DiscountDetailTable } from './interfaces';\n\n\n/**\n * `salla-offer` is a StencilJS component that displays offers, categories, products, banks, and discount information.\n * It uses the `salla-slider` component for carousel functionality.\n *\n * @slot category - The slot for customizing the category entry layout.\n *\n * @csspart custom - Custom CSS part to target specific elements in the component.\n *\n * @example\n * <salla-offer product-id=\"123\"></salla-offer>\n */\n@Component({\n tag: 'salla-offer',\n styleUrl: 'salla-offer.scss',\n})\nexport class SallaOffer {\n\n constructor() {\n // Language\n salla.lang.onLoaded(() => {\n this.offer_with_price_text = salla.lang.get('pages.offer.with_price');\n this.with_discount_text = salla.lang.get('pages.products.with_a_discount');\n this.product_discount_text = salla.lang.get('pages.products.discount');\n this.special_offer_text = salla.lang.get('pages.products.special_offer');\n this.multipleBankOfferTitleText = salla.lang.get('pages.offer.multiple_bank_offers_title');\n this.multipleBankOfferTitleDescription = salla.lang.get('pages.offer.multiple_bank_offers_message');\n this.buy_quantity_text(0);\n })\n\n salla.onReady(() => {\n this.currentPage = salla.config.get('page.slug')\n this.userCurrency = salla.config.get('currencies')[salla.config.get('user.currency_code')].symbol\n });\n\n this.categorySlot = this.host.querySelector('[slot=\"category\"]')?.innerHTML || '<a href={url} class=\"s-offer-slide-cat-entry\"><i class={icon}></i><h4>{name}</h4></a>';\n }\n\n /**\n * Custom Card Component for the Salla Products List.\n *\n * This component allows you to customize the appearance of individual product cards within a Salla Products List.\n *\n * @example\n * <salla-products-list product-card-component=\"my-custom-card-style1\" ...\n * <salla-products-list product-card-component=\"my-custom-card-style2\" ...\n */\n @Prop() productCardComponent: string = 'custom-salla-product-card';\n\n // Declare component state variables\n @State() offersList: Offer[] = [];\n @State() userCurrency: Currency;\n @State() isMultipleBank: boolean = false;\n @State() title?: string;\n @State() currentPage: string;\n @State() hasCustomComponent: boolean;\n\n @State() isBankOffer: boolean = false;\n @State() canRender: boolean = false;\n @State() showOffer: boolean = salla.config.get('store.settings.product.show_special_offers');\n\n // Default translated texts\n @State() offer_with_price_text: string = salla.lang.get('pages.offer.with_price', { price: '' });\n @State() with_discount_text: string = salla.lang.get('pages.products.with_a_discount')\n @State() product_discount_text: string = salla.lang.get('pages.products.discount')\n @State() special_offer_text: string = salla.lang.get('pages.products.special_offer')\n @State() multipleBankOfferTitleText: string = salla.lang.get('pages.offer.multiple_bank_offers_title')\n @State() multipleBankOfferTitleDescription: string = salla.lang.get('pages.offer.multiple_bank_offers_message')\n @State() buy_quantity_text: (quantity: number) => string = (quantity) => salla.lang.get('pages.offer.buy_quantity', { quantity })\n\n // Reference to the host element\n @Element() host: HTMLElement;\n\n private categorySlot: string;\n\n private async getEndpointByPageName(): Promise<string> {\n if (this.currentPage == PageType.Cart) {\n const cartId = await Salla.cart.getCurrentCartId();\n return `offers/cart/${cartId}`;\n }\n\n if (this.currentPage == PageType.ProductDetail) {\n return `offers/product/${salla.config.get('page.id')}`;\n }\n\n return \"offers\";\n }\n\n /**\n * Emits a promotion viewed event for analytics tracking\n */\n private emitPromotionViewed(): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: 1 \n };\n \n salla.event.emit('promotion::viewed', [promotionData]);\n }\n /**\n * Emits a promotion clicked event\n */\n private emitPromotionClicked(position: number = 1): void {\n if(!(this.offersList.length && this.canRender && this.showOffer)) return;\n \n // Transform offer data to match analytics expectations\n const promotionData = {\n id: this.offersList[0].id,\n name: this.offersList[0].title,\n creative: this.offersList[0].description || '',\n position: position\n };\n \n salla.event.emit('promotion::clicked', [promotionData]);\n }\n\n componentWillLoad() {\n this.hasCustomComponent = !!customElements.get(this.productCardComponent);\n // let offers = this.getOffersFromStorage();\n // if (offers) {\n // return offers.then(offersFromStorage => this.offersList = offersFromStorage);\n // }\n\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n this.showOffer = !salla.url.is_page('product.single') || salla.config.get('store.settings.product.show_special_offers')\n if (this.showOffer) {\n return;\n }\n throw new Error(\"Merchant disabled showing the offers on product page\");\n }\n )\n .then(async () => salla.api.request(await this.getEndpointByPageName()))\n .then((res) => {\n if (!(this.offersList = res.data).length) {\n throw new Error('salla-offers:: There is no offers!');\n }\n //we support these offers only\n const offer = this.offersList.find(offer => [OfferType.SpecialPrice,OfferType.Bank, OfferType.BuyXGetY, OfferType.DiscountsTable].includes(offer.type as any));\n if (!offer) {\n throw new Error('salla-offers:: Offer type not supported yet!');\n }\n //because there is no need for special handling for discounts table, just skip the other cases\n if (offer.type === OfferType.DiscountsTable) {\n return this.offersList = [offer];\n }\n\n //if it's banks offer, we need to include the other banks overs\n if ((this.isBankOffer = offer.type === OfferType.Bank)) {\n this.offersList = this.offersList.filter(offer => offer.type === OfferType.Bank);\n this.isMultipleBank = this.offersList.length > 1;\n return this.offersList;\n }\n\n //if it's special price offer\n if (offer.type === OfferType.SpecialPrice) {\n const details = offer.details as SpecialPriceDetail;\n\n return details.apply_to === 'product'\n // Avoid additional requests; use `salla-products-slider` and pass the custom card\n ? salla.product.api.fetch({ source: \"selected\", source_value: details.targets})\n .then((response: any) => {\n (offer.details as any).products = response.data; // Set the fetched products\n return this.offersList = [offer];\n })\n : salla.product.api.categories() // Fetch all categories in one query\n .then((res) => {\n const categoriesToRender = this.findCategories(res.data, details.targets); // Extract only the selected categories\n (offer.details as any).categories = categoriesToRender;\n return this.offersList = [offer];\n });\n }\n\n //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n return getY.source === 'products'\n //todo:: avoid this request, and the handling for the products, just use `salla-products-slider` and don't forget to pass the customcard\n ? salla.product.api.fetch({ source: \"selected\", source_value: getY.source_value })\n .then((response: any) => {\n getY.products = response.data;\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n })//set the products\n : salla.product.api.categories()//get all categories in one query, then extract only the selected one, instead of sending multi requests\n .then((res) => {\n getY.categories = this.findCategories(res.data, getY.source_value);\n (offer.details as any).get = getY;\n return this.offersList = [offer];\n });\n })\n .then((offers: Offer[]) => {\n salla.storage.set(this.getStorageKey(), { offers, stored_at: new Date().getTime() });\n this.canRender = true;\n })\n .catch((error) => {\n salla.logger.warn(error)\n });\n }\n\n componentDidLoad() {\n let nav = this.host.querySelector('.s-slider-block__title-nav');\n nav?.classList.add(\"s-offer-bank-payment-nav\")\n this.emitPromotionViewed();\n }\n\n \n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n for (const category of categories) {\n if (ids.includes(category.id_ || category.id)) { //here we are using || because we are planning to drop `id_`\n found.push(category);\n }\n if (category.sub_categories?.length > 0) {\n found = found.concat(this.findCategories(category.sub_categories, ids));\n }\n }\n\n return found;\n }\n\n //todo::add to the key params, to make sure it will support multi offers in the same page if it's wanted\n getStorageKey(): string {\n try {\n const pageSlug = salla.config.get('page.slug').replace('.', '_');\n const locale = salla.lang.getLocale();\n const currencyCode = salla.config.currency().code;\n\n if (!pageSlug || !locale || !currencyCode) {\n throw new Error('Unable to get the storage key.');\n }\n\n return `s-offers-${pageSlug}-${salla.config.get('page.id')}-${locale}-${currencyCode}`;\n } catch (error) {\n return '';\n }\n }\n\n //@ts-ignore\n getOffersFromStorage(): null | Promise<Offer[]> {\n let storageOffers = salla.storage.get(this.getStorageKey());\n //if the offers not existed, or it has been stored before 10 minutes from now, ignore it;\n if (!storageOffers || storageOffers.stored_at < (new Date().getTime() - 10 * 60 * 1000)) {\n salla.storage.remove(this.getStorageKey());\n return null;\n }\n this.canRender = true;\n\n //return it as resolve to support .then\n return Promise.resolve(storageOffers.offers);\n }\n\n render() {\n // Check if the offers list is empty or if the component is not ready to render\n if (!this.offersList.length || !this.canRender || !this.showOffer) return null;\n const offer: Offer = this.offersList[0];\n\n const blockTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleText : null) : offer.title;\n const blockSubTitle = this.isBankOffer ? (this.isMultipleBank ? this.multipleBankOfferTitleDescription : null) : offer.description;\n\n const titles = {\n 'block-title': blockTitle,\n 'block-subTitle': blockSubTitle,\n 'show-controls': this.isMultipleBank\n };\n\n return (\n <div class=\"s-offer-wrapper\" onClick={() => this.emitPromotionClicked()}>\n {<p class=\"s-offer-corner-badge\">{this.special_offer_text}</p>}\n {/* discounts table is not a slider, it's a table🤔 */}\n {/* single bank offer is not a slider, it's a dom without slider🤔 */}\n <salla-slider type=\"carousel\" id=\"offer-slider\" {...titles}>\n <div slot='items'>\n {this.renderSectionForOfferType(offer.type)}\n </div>\n </salla-slider>\n </div>\n );\n }\n\n private renderSectionForOfferType(offerType: OfferType | string) {\n if (this.isBankOffer) {\n return this.renderBankSection();\n }\n if (offerType == OfferType.SpecialPrice) {\n return this.renderSpecialPriceSection();\n }\n if (offerType == OfferType.BuyXGetY) {\n return this.renderBuyXGetYSection();\n }\n\n return this.renderDiscountTableSection();\n }\n\n /**\n * Generates content for the categories section.\n *\n * @param offeredCategories - An array of Category objects.\n * @returns An array of HTML elements representing categories.\n */\n private getCategoriesSection(category: Category) {\n return <div class=\"s-offer-slide-one-sixth swiper-slide\" innerHTML={this.categorySlot\n .replace(/\\{url\\}/g, category.url)\n .replace(/\\{icon\\}/g, category.icon || \"sicon-store\")\n .replace(/\\{name\\}/g, category.name)}></div>\n }\n\n private renderBuyXGetYSection() {\n const details = (this.offersList[0].details as BuyXGetYDetail)\n return [\n details.get.products?.map((product: Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n details.get.categories?.map((category: Category) => this.getCategoriesSection(category))\n ];\n }\n\n /**\n * Generates content for the bank section.\n *\n * @param offeredBank - An array of Bank objects.\n * @param name - The title of the current offer.\n * @param description - The description of the current offer.\n * @returns An array of HTML elements representing banks.\n *\n * TODO: loop over the list and filter bank types and pass it to this function\n */\n private renderBankSection() {\n return this.offersList.map((bankOffer: Offer) => {\n return <div class={{ \"s-offer-slide-one-sixth\": this.isMultipleBank, \"s-offer-bank-wrapper-sinlge-item\": !this.isMultipleBank }}>\n <div class={{ \"s-offer-bank-wrapper\": true, \"s-offer-slide-one-sixth\": !this.isMultipleBank, \"s-offer-bank-wrapper-multi-spacer\": this.isMultipleBank }}>\n <div class=\"s-offer-bank-logo\">\n <img src={(bankOffer.details as BankOffer).logo || salla.url.cdn('images/s-empty.png')} data-src={(bankOffer.details as BankOffer).logo} alt={bankOffer.title + \" offer\"} />\n </div>\n <ul class=\"s-offer-bank-payment-wrapper\">\n {(bankOffer.details as BankOffer).payments.map((payment: string) => {\n return <li class=\"s-offer-bank-payment-single\">\n <img\n src={salla.url.cdn('images/payment/' + payment + '.png') || salla.url.cdn('images/s-empty.png')}\n data-src={salla.url.cdn('images/payment/' + payment + '.png')}\n alt=\"payment\" />\n </li>\n })}\n </ul>\n {this.isMultipleBank ?\n <p class=\"s-offer-bank-payment-discount-percent\">\n {`${this.product_discount_text} ${(bankOffer.details as BankOffer).discount_value}${(bankOffer.details as BankOffer).discount_type === \"percentage\" && '%'}`}\n </p>\n : \"\"}\n </div>\n {!this.isMultipleBank ?\n <div class=\"s-offer-bank-message s-offer-slide-one-fourth\">\n <h2>{this.offersList[0].title}</h2>\n <p innerHTML={this.generateBankDescription(this.offersList[0].description, (bankOffer.details as BankOffer).discount_value)}></p>\n </div>\n : \"\"}\n </div>\n })\n }\n\n private generateBankDescription(desc: string, value): string {\n return desc.replace(new RegExp(`${value} %`), `<span class=\"s-offer-bank-message-amount\">${value} %</span>`)\n }\n\n /**\n * Generates content for the discount table section.\n *\n * @param discountTable - An array of Discount objects.\n * @returns An array of HTML elements representing discounts_table.\n */\n private renderDiscountTableSection() {\n const offer: Offer = this.offersList[0];\n let show_discounted_price = (offer.details as DiscountDetailTable).show_price_after_discount;\n return (this.offersList[0].details as DiscountDetailTable).discounts?.map((discount: Discount) => <div class=\"s-offer-slide-one-fourth\">\n <div class=\"s-offer-slide-offer-entry\">\n <div class=\"s-offer-slide-offer-entry-price-quantity-container\">\n <p class=\"s-offer-slide-offer-entry-quantity\">{this.buy_quantity_text(discount.quantity)}</p>\n {show_discounted_price ?\n <div class=\"s-offer-slide-offer-entry-price\">\n <span>{this.offer_with_price_text}</span>\n <span class=\"s-offer-slide-offer-entry-price-amount\">{discount.discounted_amount}</span> <span>{this.userCurrency}</span>\n </div> : \"\"}\n </div>\n <p class=\"s-offer-slide-offer-entry-price-amount-percent\">{this.with_discount_text}\n (<span>{discount.percentage}{!!discount.percentage && '%'}</span>)</p>\n </div>\n </div>\n )\n }\n\n private renderSpecialPriceSection() {\n const details = this.offersList[0].details as SpecialPriceDetail;\n\n return [\n // Render products if `apply_to` is \"product\"\n details.apply_to === \"product\" &&\n details.products?.map((product:Product) => (\n <div class=\"s-offer-slide-one-fourth\">\n {this.hasCustomComponent\n ? <this.productCardComponent product={product}></this.productCardComponent>\n : <salla-product-card shadow-on-hover product={product}></salla-product-card>}\n </div>\n )),\n\n // Render categories if `apply_to` is \"category\"\n details.apply_to === \"category\" &&\n details.categories?.map((category: Category) => this.getCategoriesSection(category)),\n ];\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,IAAY,QAGX;YAHD,CAAA,UAAY,QAAQ,EAAA;YAClB,IAAA,QAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;YACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA;YAED,IAAY,SAOX;YAPD,CAAA,UAAY,SAAS,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salla-accordion.scss?tag=salla-accordion","src/components/salla-accordion/salla-accordion.tsx"],"sourcesContent":["\n","import { Component, Host, h, Element, Prop, State, Listen } from '@stencil/core';\n\n/**\n * @salla/ui-components\n * The `salla-accordion` component represents an accordion element.\n * Use this component to encapsulate content within a collapsible section.\n */\n@Component({\n tag: 'salla-accordion',\n styleUrl: 'salla-accordion.scss',\n shadow: false\n})\nexport class SallaAccordion {\n /** Reference to the host element. */\n @Element() host: HTMLElement;\n\n /** Should the accordion be collapsible or not. Default is true. */\n @Prop() collapsible: boolean = true;\n\n /** Detect if accordion collapsed or not. */\n @Prop({ mutable: true, reflect: true }) collapsed: boolean = true;\n\n /** Represents the direction of the layout. */\n @State() dir: string = document.dir || 'rtl';\n\n @Listen('salla::language.change', { target: 'document' })\n directionChangedHandler(event: CustomEvent) {\n this.dir = event.detail.dir;\n }\n\n @Listen('accordionToggle')\n handleCollapse(event: CustomEvent) {\n this.collapsed = event.detail.payload.collapsed;\n }\n\n private setcollapsibleProp(): void {\n const head = this.host.querySelector('salla-accordion-head');\n if (this.collapsible && head) {\n head.setAttribute('collapsible', 'true');\n head.setAttribute('collapsed', this.collapsed.toString());\n }\n }\n\n componentDidRender() {\n this.setcollapsibleProp();\n\n const body = this.host.querySelector('salla-accordion-body');\n if (this.collapsible) {\n this.host.setAttribute('data-collapsed', this.collapsed.toString());\n body?.setAttribute('data-collapsed', this.collapsed.toString());\n }\n }\n\n render() {\n return (\n <Host class={`s-accordion-wrapper ${this.dir}`} data-collapsed={this.collapsed.toString()}>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;YAAA,MAAM,iBAAiB,GAAG,EAAE;;kBCYf,cAAc,8BAAA,MAAA;YAL3B,IAAA,WAAA,CAAA,OAAA,EAAA;;;YAUU,QAAA,IAAW,CAAA,WAAA,GAAY,IAAI;;YAGK,QAAA,IAAS,CAAA,SAAA,GAAY,IAAI;;oBAGxD,IAAA,CAAA,GAAG,GAAW,Q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