@salla.sa/twilight-components 2.14.170 → 2.14.172
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-KyQhbOUb.js → app-globals-Bk9IDSPX.js} +3 -3
- package/dist/cjs/{app-globals-KyQhbOUb.js.map → app-globals-Bk9IDSPX.js.map} +1 -1
- package/dist/cjs/{index-CyyWuThh.js → index-B1jJnKON.js} +4 -4
- package/dist/cjs/{index-CyyWuThh.js.map → index-B1jJnKON.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-add-product-button_49.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.salla-conditional-fields.entry.cjs.js.map +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-booking-field_2.cjs.entry.js.map +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-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 +11 -7
- package/dist/cjs/salla-offer.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-offer.entry.cjs.js.map +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/components/salla-booking-field/salla-booking-field.js +1 -1
- package/dist/collection/components/salla-booking-field/salla-booking-field.js.map +1 -1
- package/dist/collection/components/salla-offer/salla-offer.js +10 -6
- package/dist/collection/components/salla-offer/salla-offer.js.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-booking-field2.js +1 -1
- package/dist/components/salla-booking-field2.js.map +1 -1
- package/dist/components/salla-offer.js +10 -6
- package/dist/components/salla-offer.js.map +1 -1
- package/dist/esm/{app-globals-Eok5C8eP.js → app-globals-BlWInTtE.js} +3 -3
- package/dist/esm/{app-globals-Eok5C8eP.js.map → app-globals-BlWInTtE.js.map} +1 -1
- package/dist/esm/{index-EWYMQsdr.js → index-CayW-agT.js} +4 -4
- package/dist/esm/{index-EWYMQsdr.js.map → index-CayW-agT.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-add-product-button_49.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.salla-conditional-fields.entry.js.map +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +2 -2
- package/dist/esm/salla-booking-field_2.entry.js.map +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-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 +11 -7
- package/dist/esm/salla-offer.entry.js.map +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm-es5/{app-globals-Eok5C8eP.js → app-globals-BlWInTtE.js} +2 -2
- package/dist/esm-es5/{app-globals-Eok5C8eP.js.map → app-globals-BlWInTtE.js.map} +1 -1
- package/dist/esm-es5/{index-EWYMQsdr.js → index-CayW-agT.js} +3 -3
- package/dist/esm-es5/{index-EWYMQsdr.js.map → index-CayW-agT.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-add-product-button_49.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.salla-conditional-fields.entry.js.map +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +2 -2
- package/dist/esm-es5/salla-booking-field_2.entry.js.map +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-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 +2 -2
- package/dist/esm-es5/salla-offer.entry.js.map +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- package/dist/esm-es5/salla-orders.entry.js +2 -2
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-4fbad277.entry.js → p-0649d076.entry.js} +2 -2
- package/dist/twilight/{p-b6d17480.system.entry.js → p-1696a245.system.entry.js} +2 -2
- package/dist/twilight/{p-1d879370.entry.js → p-19f533ec.entry.js} +2 -2
- package/dist/twilight/{p-0bdf2224.entry.js → p-1dd178a2.entry.js} +2 -2
- package/dist/twilight/{p-1f4fc47f.entry.js → p-20bdcd53.entry.js} +2 -2
- package/dist/twilight/{p-5c52e00c.entry.js → p-247636ef.entry.js} +2 -2
- package/dist/twilight/{p-38a60819.entry.js → p-269ebd5d.entry.js} +2 -2
- package/dist/twilight/{p-1fbf0ba0.entry.js → p-29e96484.entry.js} +2 -2
- package/dist/twilight/p-29e96484.entry.js.map +1 -0
- package/dist/twilight/{p-fe7d4113.system.entry.js → p-2a10bff2.system.entry.js} +2 -2
- package/dist/twilight/{p-cd6c8a64.entry.js → p-2d0c2877.entry.js} +2 -2
- package/dist/twilight/{p-8a42ee60.system.entry.js → p-2da442c2.system.entry.js} +2 -2
- package/dist/twilight/{p-c7589247.system.entry.js → p-3093ea8e.system.entry.js} +2 -2
- package/dist/twilight/{p-7f0b3753.entry.js → p-316e3ea9.entry.js} +2 -2
- package/dist/twilight/{p-f5929cee.entry.js → p-33963e7d.entry.js} +2 -2
- package/dist/twilight/{p-feb9b85a.entry.js → p-37a3c661.entry.js} +2 -2
- package/dist/twilight/{p-d9073cf3.entry.js → p-41480e7b.entry.js} +2 -2
- package/dist/twilight/{p-2a8279d6.entry.js → p-41ecc4f7.entry.js} +2 -2
- package/dist/twilight/{p-9395f082.system.entry.js → p-44a213de.system.entry.js} +2 -2
- package/dist/twilight/p-4ced9aab.entry.js +5 -0
- package/dist/twilight/p-4fb112e6.system.entry.js +5 -0
- package/dist/twilight/p-4fb112e6.system.entry.js.map +1 -0
- package/dist/twilight/{p-ec81a36e.entry.js → p-51195e76.entry.js} +2 -2
- package/dist/twilight/{p-ff9d70f4.system.entry.js → p-54bd7e18.system.entry.js} +2 -2
- package/dist/twilight/{p-3134126e.system.entry.js → p-611b6013.system.entry.js} +2 -2
- package/dist/twilight/{p-bd4d0f9a.system.entry.js → p-679bb855.system.entry.js} +2 -2
- package/dist/twilight/{p-4c74100d.system.entry.js → p-67fe618e.system.entry.js} +2 -2
- package/dist/twilight/{p-1ebd5929.system.entry.js → p-69ec9ac8.system.entry.js} +2 -2
- package/dist/twilight/{p-b09ad735.system.entry.js → p-740b39fc.system.entry.js} +2 -2
- package/dist/twilight/{p-2ea1d52b.entry.js → p-756fe45d.entry.js} +2 -2
- package/dist/twilight/{p-d2edeb7c.system.entry.js → p-7ddf00a9.system.entry.js} +2 -2
- package/dist/twilight/{p-5fd16112.system.entry.js → p-86dd7e02.system.entry.js} +2 -2
- package/dist/twilight/{p-42291bce.entry.js → p-8c9ae8bd.entry.js} +2 -2
- package/dist/twilight/{p-3b5eb2c9.system.entry.js → p-8e242779.system.entry.js} +2 -2
- package/dist/twilight/{p-4daef7a0.entry.js → p-9361e7a2.entry.js} +2 -2
- package/dist/twilight/{p-3aa0ac01.entry.js → p-952a8078.entry.js} +2 -2
- package/dist/twilight/{p-bf454ddd.entry.js → p-9ca8c6b6.entry.js} +2 -2
- package/dist/twilight/{p-15e36352.system.entry.js → p-9d750b3d.system.entry.js} +2 -2
- package/dist/twilight/{p-B4BfwIfE.system.js.map → p-B3wutB2s.system.js.map} +1 -1
- package/dist/twilight/{p-BRLbCud3.system.js.map → p-BYBYDro2.system.js.map} +1 -1
- package/dist/twilight/{p-CaL9vXSW.system.js.map → p-BeVJFUxX.system.js.map} +1 -1
- package/dist/twilight/{p-ug8rkhBt.system.js.map → p-BmwlZkRw.system.js.map} +1 -1
- package/dist/twilight/{p-D9oLy_KT.system.js → p-BuezmX1t.system.js} +2 -2
- package/dist/twilight/{p-D9oLy_KT.system.js.map → p-BuezmX1t.system.js.map} +1 -1
- package/dist/twilight/{p-qSZ6al46.system.js.map → p-BuxFmGAL.system.js.map} +1 -1
- package/dist/twilight/{p-DSV8tV1E.system.js.map → p-Bxsqm2ye.system.js.map} +1 -1
- package/dist/twilight/{p-5vs3r5UR.system.js.map → p-C2OoabIm.system.js.map} +1 -1
- package/dist/twilight/{p-vvacIepq.system.js.map → p-C4gOv56I.system.js.map} +1 -1
- package/dist/twilight/{p-CbLv2Rkn.system.js.map → p-C7B9pjwv.system.js.map} +1 -1
- package/dist/twilight/{p-6eZfgC1O.system.js.map → p-CCr4sv_K.system.js.map} +1 -1
- package/dist/twilight/{p-DO9CJiWa.system.js.map → p-CECjqlBg.system.js.map} +1 -1
- package/dist/twilight/p-CPIDPWPd.system.js.map +1 -0
- package/dist/twilight/{p-DraEtCIO.system.js.map → p-CT4XUl4u.system.js.map} +1 -1
- package/dist/twilight/{p-Mx729n7_.system.js.map → p-CT7GoHDG.system.js.map} +1 -1
- package/dist/twilight/{p-EWYMQsdr.js → p-CayW-agT.js} +3 -3
- package/dist/twilight/{p-EWYMQsdr.js.map → p-CayW-agT.js.map} +1 -1
- package/dist/twilight/{p-zj6gyLfC.system.js.map → p-Ccj3kuAD.system.js.map} +1 -1
- package/dist/twilight/{p-Ew9kSVbn.system.js.map → p-CeyDIaJF.system.js.map} +1 -1
- package/dist/twilight/{p-CeyGkw1h.system.js.map → p-CjXAM86c.system.js.map} +1 -1
- package/dist/twilight/{p-BU23HIMq.system.js → p-CmumtzEL.system.js} +3 -3
- package/dist/twilight/{p-BU23HIMq.system.js.map → p-CmumtzEL.system.js.map} +1 -1
- package/dist/twilight/{p-48XKn75T.system.js.map → p-D4ot6EsS.system.js.map} +1 -1
- package/dist/twilight/{p-Dd5CEUFO.system.js.map → p-DEOECcHf.system.js.map} +1 -1
- package/dist/twilight/{p-gm6N2F_h.system.js.map → p-DUKloBXK.system.js.map} +1 -1
- package/dist/twilight/{p-Cni316MV.system.js.map → p-Dg8Ywiaf.system.js.map} +1 -1
- package/dist/twilight/{p-5QHjuX9p.system.js.map → p-Dmm2RXZq.system.js.map} +1 -1
- package/dist/twilight/{p-QtuY1UHD.system.js.map → p-DraNKP6B.system.js.map} +1 -1
- package/dist/twilight/{p-a0nHD-aB.system.js.map → p-DzJCsxNk.system.js.map} +1 -1
- package/dist/twilight/{p-m9Evhpmi.system.js → p-FxRE-bWf.system.js} +2 -2
- package/dist/twilight/{p-m9Evhpmi.system.js.map → p-FxRE-bWf.system.js.map} +1 -1
- package/dist/twilight/{p-B3t8frU_.js → p-PnQHllOh.js} +2 -2
- package/dist/twilight/{p-B3t8frU_.js.map → p-PnQHllOh.js.map} +1 -1
- package/dist/twilight/{p-BBMoQKyK.system.js.map → p-UOO6uSKD.system.js.map} +1 -1
- package/dist/twilight/{p-L8BD77j0.system.js.map → p-W3JU15BC.system.js.map} +1 -1
- package/dist/twilight/{p-9f657953.system.entry.js → p-a78387e7.system.entry.js} +2 -2
- package/dist/twilight/{p-abcc0cbf.entry.js → p-aa6a0113.entry.js} +2 -2
- package/dist/twilight/{p-2147391e.system.entry.js → p-ad02a471.system.entry.js} +2 -2
- package/dist/twilight/{p-c8053b6f.entry.js → p-b63bc4db.entry.js} +2 -2
- package/dist/twilight/{p-213c3ce4.entry.js → p-b72f268b.entry.js} +2 -2
- package/dist/twilight/{p-f2dda5b0.system.entry.js → p-c70ed29b.system.entry.js} +2 -2
- package/dist/twilight/{p-5a86938a.system.entry.js → p-cdc147d2.system.entry.js} +2 -2
- package/dist/twilight/p-d0912efd.entry.js +5 -0
- package/dist/twilight/p-d0912efd.entry.js.map +1 -0
- package/dist/twilight/{p-55ce45d1.system.entry.js → p-d14e40fe.system.entry.js} +2 -2
- package/dist/twilight/{p-01578d6d.system.entry.js → p-d2c834be.system.entry.js} +2 -2
- package/dist/twilight/{p-32429afe.system.entry.js → p-d56a7bd9.system.entry.js} +2 -2
- package/dist/twilight/{p-50c60622.entry.js → p-d600f506.entry.js} +2 -2
- package/dist/twilight/{p-b6ac3dd8.system.entry.js → p-db68e58b.system.entry.js} +2 -2
- package/dist/twilight/p-db68e58b.system.entry.js.map +1 -0
- package/dist/twilight/{p-95e2b228.system.entry.js → p-e061a1f5.system.entry.js} +2 -2
- package/dist/twilight/{p-065d60f6.entry.js → p-e084e3c4.entry.js} +2 -2
- package/dist/twilight/{p-0ebd2162.entry.js → p-e9ca7e7c.entry.js} +2 -2
- package/dist/twilight/{p-df8a68d9.system.entry.js → p-ee97bc7b.system.entry.js} +2 -2
- package/dist/twilight/{p-8079920d.system.entry.js → p-f5ce1227.system.entry.js} +2 -2
- package/dist/twilight/{p-e9046909.system.entry.js → p-fb9cd621.system.entry.js} +2 -2
- package/dist/twilight/{p-01f043b8.entry.js → p-fdd3788a.entry.js} +2 -2
- package/dist/twilight/{p-zB1aXyll.system.js.map → p-hIDulQlu.system.js.map} +1 -1
- package/dist/twilight/p-qziIzWVk.system.js.map +1 -0
- package/dist/twilight/{p-Bs4v2LtA.system.js.map → p-y427D1HL.system.js.map} +1 -1
- package/dist/twilight/salla-booking-field.salla-conditional-fields.entry.esm.js.map +1 -1
- package/dist/twilight/salla-offer.entry.esm.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/twilight/p-1fbf0ba0.entry.js.map +0 -1
- package/dist/twilight/p-545302d2.entry.js +0 -5
- package/dist/twilight/p-545302d2.entry.js.map +0 -1
- package/dist/twilight/p-B3dc8MoR.system.js.map +0 -1
- package/dist/twilight/p-BkvW8UWg.system.js.map +0 -1
- package/dist/twilight/p-a22b72f6.entry.js +0 -5
- package/dist/twilight/p-b6ac3dd8.system.entry.js.map +0 -1
- package/dist/twilight/p-d0122bff.system.entry.js +0 -5
- package/dist/twilight/p-d0122bff.system.entry.js.map +0 -1
- /package/dist/twilight/{p-4fbad277.entry.js.map → p-0649d076.entry.js.map} +0 -0
- /package/dist/twilight/{p-b6d17480.system.entry.js.map → p-1696a245.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1d879370.entry.js.map → p-19f533ec.entry.js.map} +0 -0
- /package/dist/twilight/{p-0bdf2224.entry.js.map → p-1dd178a2.entry.js.map} +0 -0
- /package/dist/twilight/{p-1f4fc47f.entry.js.map → p-20bdcd53.entry.js.map} +0 -0
- /package/dist/twilight/{p-5c52e00c.entry.js.map → p-247636ef.entry.js.map} +0 -0
- /package/dist/twilight/{p-38a60819.entry.js.map → p-269ebd5d.entry.js.map} +0 -0
- /package/dist/twilight/{p-fe7d4113.system.entry.js.map → p-2a10bff2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cd6c8a64.entry.js.map → p-2d0c2877.entry.js.map} +0 -0
- /package/dist/twilight/{p-8a42ee60.system.entry.js.map → p-2da442c2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c7589247.system.entry.js.map → p-3093ea8e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7f0b3753.entry.js.map → p-316e3ea9.entry.js.map} +0 -0
- /package/dist/twilight/{p-f5929cee.entry.js.map → p-33963e7d.entry.js.map} +0 -0
- /package/dist/twilight/{p-feb9b85a.entry.js.map → p-37a3c661.entry.js.map} +0 -0
- /package/dist/twilight/{p-d9073cf3.entry.js.map → p-41480e7b.entry.js.map} +0 -0
- /package/dist/twilight/{p-2a8279d6.entry.js.map → p-41ecc4f7.entry.js.map} +0 -0
- /package/dist/twilight/{p-9395f082.system.entry.js.map → p-44a213de.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a22b72f6.entry.js.map → p-4ced9aab.entry.js.map} +0 -0
- /package/dist/twilight/{p-ec81a36e.entry.js.map → p-51195e76.entry.js.map} +0 -0
- /package/dist/twilight/{p-ff9d70f4.system.entry.js.map → p-54bd7e18.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3134126e.system.entry.js.map → p-611b6013.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-bd4d0f9a.system.entry.js.map → p-679bb855.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4c74100d.system.entry.js.map → p-67fe618e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1ebd5929.system.entry.js.map → p-69ec9ac8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b09ad735.system.entry.js.map → p-740b39fc.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2ea1d52b.entry.js.map → p-756fe45d.entry.js.map} +0 -0
- /package/dist/twilight/{p-d2edeb7c.system.entry.js.map → p-7ddf00a9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5fd16112.system.entry.js.map → p-86dd7e02.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-42291bce.entry.js.map → p-8c9ae8bd.entry.js.map} +0 -0
- /package/dist/twilight/{p-3b5eb2c9.system.entry.js.map → p-8e242779.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4daef7a0.entry.js.map → p-9361e7a2.entry.js.map} +0 -0
- /package/dist/twilight/{p-3aa0ac01.entry.js.map → p-952a8078.entry.js.map} +0 -0
- /package/dist/twilight/{p-bf454ddd.entry.js.map → p-9ca8c6b6.entry.js.map} +0 -0
- /package/dist/twilight/{p-15e36352.system.entry.js.map → p-9d750b3d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9f657953.system.entry.js.map → p-a78387e7.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-abcc0cbf.entry.js.map → p-aa6a0113.entry.js.map} +0 -0
- /package/dist/twilight/{p-2147391e.system.entry.js.map → p-ad02a471.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c8053b6f.entry.js.map → p-b63bc4db.entry.js.map} +0 -0
- /package/dist/twilight/{p-213c3ce4.entry.js.map → p-b72f268b.entry.js.map} +0 -0
- /package/dist/twilight/{p-f2dda5b0.system.entry.js.map → p-c70ed29b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5a86938a.system.entry.js.map → p-cdc147d2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-55ce45d1.system.entry.js.map → p-d14e40fe.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-01578d6d.system.entry.js.map → p-d2c834be.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-32429afe.system.entry.js.map → p-d56a7bd9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-50c60622.entry.js.map → p-d600f506.entry.js.map} +0 -0
- /package/dist/twilight/{p-95e2b228.system.entry.js.map → p-e061a1f5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-065d60f6.entry.js.map → p-e084e3c4.entry.js.map} +0 -0
- /package/dist/twilight/{p-0ebd2162.entry.js.map → p-e9ca7e7c.entry.js.map} +0 -0
- /package/dist/twilight/{p-df8a68d9.system.entry.js.map → p-ee97bc7b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8079920d.system.entry.js.map → p-f5ce1227.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e9046909.system.entry.js.map → p-fb9cd621.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-01f043b8.entry.js.map → p-fdd3788a.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sallaBookingFieldCss","SallaBookingField","constructor","hostRef","this","bookNowLabel","salla","lang","get","editLabel","bookedLabel","selectDate","bookingUrl","iframeReady","reservations","onLoaded","setTranslations","Salla","event","on","data","handleBookingOpen","setNestedAsync","key","value","Promise","resolve","helpers","setNested","messages","openBookingModal","afterReload","detail","productId","config","isGuest","setAfterReloadEvent","dispatch","booking","add","then","resp","redirect","to","Error","url","id","catch","error","logger","response","addParamToUrl","setTimeout","modal","setTitle","open","payload","storage","set","emitAfterReloadEvent","eventDetails","customEvent","CustomEvent","window","dispatchEvent","remove","componentWillLoad","option","details","length","componentDidLoad","addEventListener","handleMessageEvent","bind","reservationsInput","e","invalidInput","emit","setCustomValidity","reportValidity","source","action","type","message","localStorage","getItem","console","log","_a","fields","reservation","notify","errorList","Object","values","flat","map","join","Number","schedule","time","timeSlot","date","day","from_timestamp","from","to_timestamp","filter","item","success","_b","close","location","reload","iframe","height","bookingModal","h","class","ref","width","position","noPadding","src","frameborder","renderReservationDate","innerHTML","Calendar","renderReservationTime","TimeIcon","render","Host","required","money","price","size","loaderPosition","fill","onClick","BookingTime","index","name","JSON","stringify","SallaConditionalFields","hideAllOptions","optionId","host","querySelectorAll","forEach","field","classList","dataset","disableInputs","input","setAttribute","removeAttribute","tagName","toLowerCase","includes","getAttribute","hasOwnProperty","checked","changeHandler","target","replace","isMultiple","isRadio","isEqual","showWhen","trim","isSelected","selectedValues","Array","toString","showTheInput","closestProductOption","closest","optionRequired","checkboxes","document","isAnyChecked","some","checkbox","componentDidRender","optionName","querySelector"],"sources":["src/components/salla-booking-field/salla-booking-field.scss?tag=salla-booking-field","src/components/salla-booking-field/salla-booking-field.tsx","src/components/salla-conditional-fields/salla-conditional-fields.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h, Element, State, Event, EventEmitter } from '@stencil/core';\nimport { Option, Reservation } from './interfaces';\nimport BookingTime from '../../assets/svg/calendar-time.svg';\nimport Calendar from '../../assets/svg/calendar.svg';\nimport TimeIcon from '../../assets/svg/time.svg';\n\n@Component({\n tag: 'salla-booking-field',\n styleUrl: 'salla-booking-field.scss',\n})\nexport class SallaBookingField {\n /**\n * The booking option configuration\n */\n @Prop() option: Option;\n /**\n * The ID of the product for which the booking is being made\n */\n @Prop() productId: number;\n @Element() host: HTMLElement;\n @State() bookNowLabel: string = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');\n @State() editLabel: string = salla.lang.get('pages.cart.edit_an_appointment', 'تعديل الموعد');\n @State() bookedLabel: string = salla.lang.get('pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n @State() selectDate: string = salla.lang.get('pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n @State() bookingUrl: string = '';\n @State() iframeReady: boolean = false;\n @State() reservations: Reservation[] = [];\n @State() reservationsInput: HTMLInputElement;\n\n /**\n * Event emitted when the input is invalid.\n */\n @Event() invalidInput: EventEmitter<any>;\n\n private modal: HTMLSallaModalElement;\n private iframe: HTMLIFrameElement;\n\n constructor() {\n // Load translations\n salla.lang.onLoaded(() => this.setTranslations());\n // Register event listeners\n Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));\n }\n\n private async setTranslations() {\n const setNestedAsync = (lang, key, value) => {\n return new Promise((resolve) => {\n salla.helpers.setNested(salla.lang.messages[lang], key, value);\n resolve(true);\n });\n };\n\n await setNestedAsync('ar.trans', 'pages.cart.book_an_appointment', 'حجز موعد');\n await setNestedAsync('en.trans', 'pages.cart.book_an_appointment', 'Book an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.edit_an_appointment', 'تعديل الموعد');\n await setNestedAsync('en.trans', 'pages.cart.edit_an_appointment', 'Edit an Appointment');\n await setNestedAsync('ar.trans', 'pages.cart.booked_successfully', 'تمت اضافة الموعد بنجاح');\n await setNestedAsync('en.trans', 'pages.cart.booked_successfully', 'Booked Successfully');\n await setNestedAsync('ar.trans', 'pages.cart.select_appointment_date', 'حدد تاريخ الموعد');\n await setNestedAsync('en.trans', 'pages.cart.select_appointment_date', 'Select appointment date');\n\n this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment');\n this.editLabel = salla.lang.get('pages.cart.edit_an_appointment');\n this.bookedLabel = salla.lang.get('pages.cart.booked_successfully');\n this.selectDate = salla.lang.get('pages.cart.select_appointment_date');\n }\n\n private openBookingModal(event: any, afterReload = false) {\n if (afterReload && (!event.detail || typeof event.detail !== 'number' || event.detail !== this.productId)) {\n return;\n }\n if (salla.config.isGuest()) {\n this.setAfterReloadEvent('booking::open-after-reload', this.productId);\n salla.event.dispatch('login::open');\n return;\n }\n salla.booking.add(this.productId, false)\n .then((resp) => {\n if (resp.data.redirect.to !== 'booking') {\n throw new Error('Unexpected redirect!');\n }\n salla.event.dispatch('booking::open', { url: resp.data.redirect.url, id: this.productId });\n })\n .catch((error) => {\n salla.error(salla.lang.get('common.errors.error_occurred'));\n salla.logger.error(error.response || error);\n });\n }\n\n private handleBookingOpen(data) {\n if (data.id !== this.productId) return;\n this.bookingUrl = salla.url.addParamToUrl('product_id', data.id, data.url);\n this.iframeReady = true;\n setTimeout(() => {\n this.modal.setTitle(this.selectDate);\n this.modal.open();\n }, 100);\n }\n\n private setAfterReloadEvent(event, payload) {\n salla.storage.set('afterReloadEvent', { event, payload });\n }\n\n private emitAfterReloadEvent() {\n const eventDetails = salla.storage.get('afterReloadEvent');\n if (eventDetails && eventDetails.event) {\n const customEvent = new CustomEvent(eventDetails.event, {\n detail: eventDetails.payload\n });\n window.dispatchEvent(customEvent)\n salla.storage.remove('afterReloadEvent');\n }\n }\n\n componentWillLoad() {\n if (this.option && this.option.details.length) {\n this.reservations = this.option.details;\n }\n }\n\n componentDidLoad() {\n window.addEventListener('booking::open-after-reload', (event) => this.openBookingModal(event, true));\n this.emitAfterReloadEvent();\n window.addEventListener('message', this.handleMessageEvent.bind(this));\n this.reservationsInput.addEventListener('invalid', e => this.invalidInput.emit(e));\n this.reservationsInput.addEventListener('input', () => {\n this.reservationsInput.setCustomValidity('');\n this.reservationsInput.reportValidity();\n });\n }\n\n private handleMessageEvent(event) {\n if (event.data.source !== 'booking') return;\n const action = event.data.type;\n const value = event.data.message;\n if (localStorage.getItem('debug')) console.log(`Received an action:${action}`, event.data);\n\n if (action === 'error') {\n if (value.fields?.reservation) {\n salla.notify.error(value.fields.reservation[0]);\n return;\n }\n const errorList = Object.values(value.fields || [value.message]).flat().map(error => `<li>${error}</li>`).join('');\n salla.notify.error(`<ul>${errorList}</ul>`);\n }\n\n if (action === 'success') {\n if (Number(value.productId) !== Number(this.productId)) return;\n this.reservations = value.data.reservations.map(schedule => {\n if (schedule.time && schedule.time.length > 0) {\n const timeSlot = schedule.time[0];\n return {\n date: schedule.date,\n day: schedule.day,\n from_timestamp: timeSlot.from,\n to_timestamp: timeSlot.to,\n };\n }\n return null;\n }).filter(item => item !== null);\n\n salla.notify.success(this.bookedLabel);\n this.modal?.close();\n setTimeout(() => window.location.reload());\n }\n\n if (action === 'height') {\n this.iframe.height = value?.height + 'px';\n }\n }\n\n private bookingModal() {\n return (\n <salla-modal class=\"s-booking-field-modal\" ref={modal => (this.modal = modal)} width=\"md\" position=\"middle\" noPadding>\n <iframe ref={iframe => (this.iframe = iframe)} src={this.bookingUrl} frameborder=\"0\"></iframe>\n </salla-modal>\n );\n }\n\n renderReservationDate(reservation: Reservation) {\n return (\n <span class={reservation.from_timestamp ? 's-booking-field-reservations-has-time' : ''}>\n <i class=\"s-booking-field-reservations-icon\" innerHTML={Calendar}></i>\n {reservation.date}\n </span>\n );\n }\n\n renderReservationTime(reservation: Reservation) {\n if (!reservation.from_timestamp) return '';\n return (\n <span class=\"s-booking-field-reservations-time\">\n <i class=\"s-booking-field-reservations-icon\" innerHTML={TimeIcon}></i>\n <span>\n {reservation.from_timestamp} - {reservation.to_timestamp}\n </span>\n </span>\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"s-booking-field-main\">\n {this.option.required || this.reservations.length > 0 ? <div class=\"s-booking-field-price\">\n <span innerHTML={salla.money(this.option.price)}></span>\n </div> : ''}\n <salla-button class=\"s-booking-field-book-now\" size=\"small\" loaderPosition=\"center\" fill=\"outline\" onClick={event => this.openBookingModal(event, false)}>\n <span class=\"s-booking-field-book-now-content\">\n <span innerHTML={BookingTime}></span>\n {this.reservations.length ? this.editLabel : this.bookNowLabel}\n </span>\n </salla-button>\n </div>\n {this.reservations.length > 0 && (\n <div class=\"s-booking-field-reservations\">\n {this.reservations.map((reservation, index) => (\n <div key={index} class=\"s-booking-field-reservations-item\">\n {this.renderReservationDate(reservation)}\n {this.renderReservationTime(reservation)}\n </div>\n ))}\n </div>\n )}\n <input\n class=\"s-hidden\"\n name={this.option.name}\n required={this.option.required}\n value={JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations)}\n ref={reservations => this.reservationsInput = reservations}\n />\n {this.iframeReady && this.bookingModal()}\n </Host>\n );\n }\n}\n","import { Component, Element, Host, Listen, h } from '@stencil/core';\n\n/**\n * its to easy to use, currenlty its support select & checkbox input as trigger for show/hide the dom\n * the dom you can put it like this data-show-when=\"{name of the field} {= or !=} {value of the field}\"\n */\n@Component({\n tag: 'salla-conditional-fields'\n})\nexport class SallaConditionalFields {\n\n @Element() host: HTMLElement;\n\n private hideAllOptions(optionId) {\n this.host.querySelectorAll(`[data-show-when^=\"options[${optionId}\"]`).forEach((field: HTMLElement) => {\n field.classList.add('hidden');\n this.hideAllOptions(field.dataset.optionId);\n this.disableInputs(field);\n });\n }\n\n private disableInputs(field) {\n field.querySelectorAll('[name]').forEach((input) => {\n\n input.setAttribute('disabled', '');\n input.removeAttribute('required');\n if (input?.tagName?.toLowerCase() === 'select') {\n input.value = ''\n }\n if (['checkbox'].includes(input.getAttribute('type')) && input.hasOwnProperty('checked')) {\n // @ts-ignore\n input.checked = false;\n }\n });\n }\n \n @Listen('change')\n changeHandler(event) {\n salla.event.emit('salla-onditional-fields::change', event);\n salla.log('Received the change event: ', event);\n\n if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox', 'radio'].includes(event.target.getAttribute('type'))) {\n salla.log('Ignore the change because is not a supported input: ' + (event?.target?.tagName || 'N/A'));\n return;\n }\n\n let optionId = event.target.name.replace('[]', '');\n let isMultiple = event.target.getAttribute('type') === 'checkbox';\n let isRadio = event.target.getAttribute('type') === 'radio';\n\n salla.log('Trying to find all elements with condition:', `[data-show-when^=\"${optionId}\"]`);\n\n this.host.querySelectorAll(`[data-show-when^=\"${optionId}\"]`)\n .forEach((field: HTMLElement) => {\n let isEqual = !field?.dataset.showWhen.includes('!=');\n let value = field?.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$3').trim();\n let isSelected;\n if (isMultiple) {\n let selectedValues = Array.from(this.host.querySelectorAll(`input[name=\"${event.target.name}\"]:checked`), e => (e as HTMLInputElement)?.value);\n isSelected = selectedValues.includes(value.toString());\n } else if (isRadio) {\n // Handle radio inputs.\n isSelected = event.target.checked && event.target.value === value;\n } else {\n isSelected = value === event.target.value;\n }\n\n salla.log('The input is ', isMultiple ? 'Multiple' : isRadio ? 'Radio' : 'Single', ' value:', isSelected);\n\n let showTheInput = (isEqual && isSelected) || (!isEqual && !isSelected);\n if (showTheInput) {\n field.classList.remove('hidden');\n field.querySelectorAll('[name]').forEach((input) => {\n input.removeAttribute('disabled');\n\n const closestProductOption = (input as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n if (closestProductOption.dataset.optionRequired === 'true') {\n input.setAttribute('required', '');\n }\n\n if (input.getAttribute('type') === 'checkbox') {\n const checkboxes = Array.from(document.querySelectorAll(`input[type=\"checkbox\"][name=\"${input.getAttribute('name')}\"]`)) as HTMLInputElement[];\n const isAnyChecked = checkboxes.some((checkbox) => checkbox.checked);\n if (isAnyChecked) {\n checkboxes.forEach((checkbox) => {\n checkbox.removeAttribute('required');\n });\n }\n }\n });\n } else {\n this.hideAllOptions(field.dataset.optionId);\n field.classList.add('hidden');\n this.disableInputs(field);\n }\n });\n } \n\n componentDidRender() {\n this.host.querySelectorAll(`[data-show-when]`).forEach((field) => {\n // @ts-ignore\n let optionName = field?.dataset?.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();\n if (!optionName) {\n return;\n }\n\n this.changeHandler({\n target: this.host.querySelector('[name^=\"' + optionName + '\"]')\n })\n });\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":";;;0nFAAA,MAAMA,EAAuB,uB,MCUhBC,EAAiB,MA2B5B,WAAAC,CAAAC,G,mDAjBSC,KAAYC,aAAWC,MAAMC,KAAKC,IAAI,iCAAkC,YACxEJ,KAASK,UAAWH,MAAMC,KAAKC,IAAI,iCAAkC,gBACrEJ,KAAWM,YAAWJ,MAAMC,KAAKC,IAAI,iCAAkC,0BACvEJ,KAAUO,WAAWL,MAAMC,KAAKC,IAAI,qCAAsC,oBAC1EJ,KAAUQ,WAAW,GACrBR,KAAWS,YAAY,MACvBT,KAAYU,aAAkB,GAarCR,MAAMC,KAAKQ,UAAS,IAAMX,KAAKY,oBAE/BC,MAAMC,MAAMC,GAAG,iBAAkBC,GAAShB,KAAKiB,kBAAkBD,IAClE,CAEO,qBAAMJ,GACZ,MAAMM,EAAiB,CAACf,EAAMgB,EAAKC,IAC1B,IAAIC,SAASC,IAClBpB,MAAMqB,QAAQC,UAAUtB,MAAMC,KAAKsB,SAAStB,GAAOgB,EAAKC,GACxDE,EAAQ,KAAK,UAIXJ,EAAe,WAAY,iCAAkC,kBAC7DA,EAAe,WAAY,iCA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KAAK+I,KAAKuC,cAAc,WAAaD,EAAa,OAC1D,G,CAIN,MAAAvD,GACE,OACEb,EAACc,EAAI,CAAA5G,IAAA,4CACH8F,EAAa,QAAA9F,IAAA,6C","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-CmumtzEL.system.js"],(function(e){"use strict";var i,t;return{setters:[function(e){i=e.r;t=e.h}],execute:function(){var c="";var n=e("salla_notification_item",function(){function e(e){i(this,e)}e.prototype.render=function(){return t("a",{key:"1b234e649b23636170f30dfc46884e047d0f02ce",href:this.notification.url,class:{"s-notifications-item":true,"s-notifications-item-shadow":true,"s-notifications-item-read":!this.notification.is_new}},t("span",{key:"948c47868767a413bc488287af46caac7aa35c1e",class:"s-notifications-item-icon"},t("i",{key:"2ac3ada00bd7d7f3a6d5ba85341628ac382acef5",class:{"s-notifications-item-icon sicon-bell-ring":true,"s-notifications-item-icon-new":this.notification.is_new}})),t("div",{key:"a19c06341302bc389a2f5829c06367c03372fbfb",class:"s-notifications-item-content"},t("div",{key:"77ed75864e91b39095ee2505e10f432fbc896ec5",class:"s-notifications-item-content-leading"},t("h4",{key:"cee7566266dff68eeb2d8635e1eeaf2745b1930f"},this.notification.title),t("p",{key:"459ffde17436ff4311c64ee7f53966283390c410"},this.notification.sub_title)),t("span",{key:"b681d2c40f719e7d6d1e5abda8993b1bb870cbb6",class:"s-notifications-item-content-trailing"},t("i",{key:"2cd02287aaeeeaa00f972f4e0448f66e96949525",class:"sicon-time s-notifications-item-content-trailing-icon"}),t("span",{key:"4fd57d3f80816b0e607d5e6900d7975f94cf0892"},this.notification.date))))};return e}());n.style=c}}}));
|
|
5
|
+
//# sourceMappingURL=p-2a10bff2.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as t,H as s,g as r}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as a,h as t,H as s,g as r}from"./p-CayW-agT.js";const e="";const i=class{constructor(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(a){salla.log("Bad json passed via entityId prop")}}}getValue(a){if(a.type==="file"){return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`}if(a.type==="url"){return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`}if(a.type==="date"){const t=new Date(a.value);const s=String(t.getDate()).padStart(2,"0");const r=String(t.getMonth()+1).padStart(2,"0");const e=t.getFullYear();const i=`${s}/${r}/${e}`;return i}return a.value}componentWillLoad(){return salla.onReady().then((()=>{var a;if(!((a=salla.config.get("store.features"))===null||a===void 0?void 0:a.includes("custom-fields"))){throw new Error("feature custom-fields is not activated")}})).then((()=>{if(!this.entityId&&salla.url.is_page("product.single")){this.entityId=salla.config.get("page.id")}if(!this.entityId){throw new Error("can't render salla-metadata without enity-id prop!")}salla.lang.onLoaded((()=>this.download=salla.lang.get("pages.thank_you.download")));const a=Array.isArray(this.entityId)?this.entityId:[this.entityId];const t=a.map((a=>`entities[]=${a}`)).join("&");const s=`https://api.salla.dev/store/v1/metadata/values?type=${this.entity}&${t}`;return salla.api.request(s).then((a=>{var t;return(t=a.data[0])===null||t===void 0?void 0:t.sections}))})).then((a=>this.specs=a)).catch((a=>salla.logger.error("Error loading more specs:",a)))}render(){if(!this.specs.length){return}return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return r(this)}};i.style=e;export{i as salla_metadata};
|
|
5
|
+
//# sourceMappingURL=p-2d0c2877.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,i,e,n){function s(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function a(t){try{o(n.next(t))}catch(t){r(t)}}function u(t){try{o(n["throw"](t))}catch(t){r(t)}}function o(t){t.done?e(t.value):s(t.value).then(a,u)}o((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(i){return o([t,i])}}function o(u){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(n=1,s&&(r=u[0]&2?s["return"]:u[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,u[1])).done)return r;if(s=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;s=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1];r=u;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(u);break}if(r[2])e.ops.pop();e.trys.pop();continue}u=i.call(t,e)}catch(t){u=[6,t];s=0}finally{n=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-CmumtzEL.system.js","./p-C-c0Msup.system.js","./p-Bnro4LR3.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var i,e,n,s,r,a,u;return{setters:[function(t){i=t.r;e=t.c;n=t.h;s=t.H;r=t.g},function(t){a=t.H},function(t){u=t.F},null],execute:function(){var o=":host{display:block}";var c=t("salla_filters_widget",function(){function t(t){i(this,t);this.changed=e(this,"changed");this.initHeight=195;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}t.prototype.connectedCallback=function(){var t=this;this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((function(){t.page=salla.config.get("page")}));salla.lang.onLoaded((function(){t.showMoreLabel=salla.lang.getWithDefault("common.titles.more",t.showMoreLabel);t.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",t.showLessLabel)}))};t.prototype.componentDidLoad=function(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight="".concat(this.initHeight,"px"));this.widgetContent.style.height="".concat(this.widgetContent.scrollHeight,"px")};t.prototype.setWidgetHeight=function(){return __awaiter(this,arguments,void 0,(function(t){var i=this;if(t===void 0){t=250}return __generator(this,(function(e){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=i.widgetContent.scrollHeight;i.widgetContent.style.height=t+"px"}),t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.option.type===u.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((function(t){return t.checked=false}));return[2]}))}))};t.prototype.showMore=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?"".concat(this.widgetValues.scrollHeight,"px"):"".concat(this.initHeight,"px");setTimeout((function(){t.widgetContent.style.height="".concat(t.widgetContent.scrollHeight,"px")}),400);return[2]}))}))};t.prototype.toggleWidget=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){this.isOpen=!this.isOpen;a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var i=this;if(![u.VALUES,u.MINIMUM,u.VARIANTS].includes(t.type)){return""}return t.values.map((function(e,s){var r=typeof e=="number"?e:e.key||e.value;return n("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(r),key:"".concat(t.key,"-option-").concat(r)},n("input",{id:"".concat(t.key,"-option-").concat(r),name:t.key,type:"radio",checked:i.isSelectedOption(t,r),class:"s-filters-radio",onChange:function(e){return i.changed.emit({event:e,option:t,value:r})}}),i.getOptionLabel(t,e))}))};t.prototype.isSelectedOption=function(t,i){if(t.type===u.MINIMUM){return this.filtersData[t.key]==i}if(t.type===u.VARIANTS){return this.filtersData[t.type]&&this.filtersData[t.type][Object.keys(this.filtersData[t.type])[0]]==i}if(t.type===u.RANGE){return this.filtersData[t.key]&&this.filtersData[t.key].min==i.min&&this.filtersData[t.key].max==i.max}if(t.type===u.VALUES){return this.filtersData[t.key]&&Number(this.filtersData[t.key])==Number(i)}return false};t.prototype.getOptionLabel=function(t,i){if(t.key=="rating"){return n("salla-rating-stars",{size:"small",value:i})}var e=i.value||"null";return n("span",{class:"s-filters-option-name"},e)};t.prototype.render=function(){var t=this;return n(s,{key:"faa16285c7c2dcd248f00230aa4b1eebc1814fdd",class:"s-filters-widget-container"},n("h3",{key:"019354d300116c2d567b75e5cc93d0d1dfc4785b",class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},n("span",{key:"8ce2bc6a789a0f5d82308afad47cbae58467439a"},this.option.label),n("span",{key:"a5dcaa63ad18d41a324b499f36c82780c0670d4f",class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),n("div",{key:"bef8427341d94bb6eb6e37d9736f9ca3e9503058",class:"s-filters-widget-content",ref:function(i){return t.widgetContent=i}},n("div",{key:"451025fa922e84970107fe6ab2752db780effd86",class:"s-filters-widget-values",ref:function(i){return t.widgetValues=i}},n("slot",{key:"cbea119413f48c302684ae52c81786dcb69c6f29"}),this.option.type!==u.RANGE?this.renderFilterOption(this.option):n("salla-price-range",{onChanged:function(i){t.changed.emit(i.detail)},ref:function(i){return t.priceRange=i},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&n("a",{key:"6b2e1b91b27509b445ad4af9367b4cc464bd2d4e",class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());c.style=o}}}));
|
|
5
|
+
//# sourceMappingURL=p-2da442c2.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,a,l,e){function s(t){return t instanceof l?t:new l((function(a){a(t)}))}return new(l||(l=Promise))((function(l,n){function r(t){try{c(e.next(t))}catch(t){n(t)}}function i(t){try{c(e["throw"](t))}catch(t){n(t)}}function c(t){t.done?l(t.value):s(t.value).then(r,i)}c((e=e.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var l={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},e,s,n,r;return r={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function i(t){return function(a){return c([t,a])}}function c(i){if(e)throw new TypeError("Generator is already executing.");while(r&&(r=0,i[0]&&(l=0)),l)try{if(e=1,s&&(n=i[0]&2?s["return"]:i[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,i[1])).done)return n;if(s=0,n)i=[i[0]&2,n.value];switch(i[0]){case 0:case 1:n=i;break;case 4:l.label++;return{value:i[1],done:false};case 5:l.label++;s=i[1];i=[0];continue;case 7:i=l.ops.pop();l.trys.pop();continue;default:if(!(n=l.trys,n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){l=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){l.label=i[1];break}if(i[0]===6&&l.label<n[1]){l.label=n[1];n=i;break}if(n&&l.label<n[2]){l.label=n[2];l.ops.push(i);break}if(n[2])l.ops.pop();l.trys.pop();continue}i=a.call(t,l)}catch(t){i=[6,t];s=0}finally{e=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-CmumtzEL.system.js"],(function(t){"use strict";var a,l,e;return{setters:[function(t){a=t.r;l=t.h;e=t.H}],execute:function(){var s=".s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:-ms-flexbox !important;display:flex !important;-ms-flex-align:center !important;align-items:center !important;-ms-flex-pack:start !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}";var n=t("salla_wallet",function(){function t(t){var l=this;a(this,t);this.isLoading=false;this.nextPageUrl="";this.handleClick=function(){l.loadMoreTransactions()}}t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){return t.loadTransactions()}))};t.prototype.loadTransactions=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,l;return __generator(this,(function(e){switch(e.label){case 0:this.isLoading=true;e.label=1;case 1:e.trys.push([1,3,4,5]);t="/balance/wallet?per_page=10&page=1";return[4,salla.api.request(t)];case 2:a=e.sent();this.nextPageUrl=a.data.transactions.next_page_url;this.transactionsArray=a.data.transactions;this.balance=a.data.balance;return[3,5];case 3:l=e.sent();console.error("Error loading wallet transactions",l);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};t.prototype.loadMoreTransactions=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,l;var e;return __generator(this,(function(s){switch(s.label){case 0:this.isLoading=true;s.label=1;case 1:s.trys.push([1,3,4,5]);t=this.nextPageUrl||"/balance/wallet?page=2&per_page=10";return[4,salla.api.request(t)];case 2:a=s.sent();this.nextPageUrl=a.data.transactions.next_page_url;(e=this.transactionsArray).push.apply(e,a.data.transactions.data);this.balance=a.data.balance;return[3,5];case 3:l=s.sent();console.error("Error loading wallet transactions",l);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};t.prototype.render=function(){if(this.transactionsArray.length>0){return l(e,null,l("table",{class:"s-wallet-table"},l("tbody",{class:"s-wallet-table-tbody"},l("tr",{class:"s-table__tr"},l("td",null,l("div",{class:"s-wallet-table-balance-container"},l("i",{class:"s-wallet-table-balance-icon sicon-wallet"}),l("div",null,l("div",{innerHTML:salla.money(this.balance)}),l("div",{class:"font-normal text-gray-400"}," ",salla.lang.get("pages.wallet.balance")))))))),l("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),l("table",{class:"s-wallet-table"},l("thead",{class:"s-wallet-table-head"},l("tr",{class:"s-wallet-table-head-tr"},l("th",{scope:"col"},salla.lang.get("pages.wallet.transaction_number")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.amount")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.date")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.order_no")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),l("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.transaction_type")," "))),l("tbody",{class:"s-wallet-table-tbody"},this.transactionsArray.map((function(t){return l("tr",{class:"s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated"},l("td",{class:"s-wallet-table-tbody-tr-td"},l("div",{class:"s-wallet-table-tbody-tr-td-content"},l("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.transaction_number"),":"),t.id&&l("span",{class:"hidden md:inline-block"},"#",t.id),l("div",{class:"flex items-center md:hidden"},l("salla-button",{class:"relative",color:"dark",shape:"link","data-content":t.order_id},t.order_id&&l("span",null,"#",t.order_id))))),l("td",{id:"main123",class:"s-wallet-table-tbody-tr-td"},l("div",{id:"main124",class:"s-wallet-table-tbody-tr-td-content"},l("span",{id:"main125",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.amount"),":"),l("div",{innerHTML:salla.money(t.amount)}))),l("td",{class:"s-wallet-table-tbody-tr-td"},l("div",{class:"s-wallet-table-tbody-tr-td-content"},l("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.date"),":"),t.created_at&&new Date(t.created_at*1e3).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}))),l("td",{id:"main133",class:"s-wallet-table-tbody-tr-td"},l("div",{id:"main134",class:"s-wallet-table-tbody-tr-td-content"},l("span",{id:"main135",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.order_no"),":"),l("span",{class:"rtl:mr-auto ltr:ml-auto md:mx-0"},t.order_id&&l("span",null,"#",t.order_id)))),l("td",{id:"main143",class:"s-wallet-table-tbody-tr-td"},l("div",{id:"main144",class:"s-wallet-table-tbody-tr-td-content"},l("span",{id:"main145",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.expiry_date"),":"),l("span",null,t.expired_at&&new Date(t.expired_at*1e3).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})))),l("td",{class:"s-wallet-table-tbody-tr-td"},l("div",{class:"s-wallet-table-tbody-tr-td-content"},l("div",null,l("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.transaction_type"),":")),l("div",{class:{"s-wallet-table-transaction-status-default":true,"s-wallet-table-transaction-status-cashback":t.action_type==="cashback","s-wallet-table-transaction-status-refund":t.action_type==="refund","s-wallet-table-transaction-status-purchase":t.action_type==="purchase_by_wallet"}},!!t.description&&l("i",{id:t.id.toString(),class:"sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"}),!!t.description&&l("salla-tooltip",{text:t.description,targetId:t.id.toString()}),l("span",null,t.title)))))})))),l("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrl&&l("salla-button",{onClick:this.handleClick,loading:this.isLoading},salla.lang.get("common.elements.load_more"))))}else{return l(e,null,l("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),l("div",{class:"s-wallet-table-empty-state"},l("i",{class:"sicon-full-wallet"}),l("div",{class:"text-center p-3 text-xl font-bold "},salla.lang.get("pages.wallet.no_transactions")),l("div",{class:"text-center text-gray-400 text-sm font-normal "},salla.lang.get("pages.wallet.zero_balance")," ")))}};return t}());n.style=s}}}));
|
|
5
|
+
//# sourceMappingURL=p-3093ea8e.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,c as i,h as t,H as e,g as
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,c as i,h as t,H as e,g as l}from"./p-CayW-agT.js";import{M as r}from"./p-DmgxDvXL.js";var h=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n`;const o="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";const a=class{constructor(t){s(this,t);this.verified=i(this,"verified");this.translationLoaded=false;this.display="modal";this.type="mobile";this.autoReload=true;this.supportWebAuth=true;this.resendAfter=30;this.isProfileVerify=false;salla.lang.onLoaded((()=>{var s;this.translationLoaded=true;this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type);(s=this.modal)===null||s===void 0?void 0:s.setTitle(this.title)}));if(this.display=="inline"){this.modal={open:()=>"",close:()=>"",setTitle:()=>""};return}salla.event.on("profile::verification",(s=>{var i;let t=Array.isArray(s)?s[0]:s;this.isProfileVerify=true;this.open(t);this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type);(i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title)}));salla.event.on("modalClosed",(()=>{this.resendAfter=0;this.timer.innerHTML="30 : 00"}))}splitNumber(s){this.resetError();let i=s.data||s.target.value;if(!i)return;if(i.length===1)return;this.modifyNext(s.target,i)}modifyNext(s,i){s.value=i[0];i=i.substring(1);if(s.nextElementSibling&&i.length){this.modifyNext(s.nextElementSibling,i)}else if(!s.nextElementSibling&&i.length===0){s.focus()}else if(s.nextElementSibling&&i.length===0){s.nextElementSibling.focus()}}checkAllInputs(){let s=true;for(let i=0;i<this.otpInputs.length;i++){if(this.otpInputs[i].value===""){s=false}}return s}handleKeyUp(s){var i,t,e,l;this.resetError();if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(s.key)){return}let r=s.keyCode||s.charCode;if(s.target.value){(i=s.target.nextElementSibling)===null||i===void 0?void 0:i.focus();(t=s.target.nextElementSibling)===null||t===void 0?void 0:t.select()}else if([8,46].includes(r)){(e=s.target.previousElementSibling)===null||e===void 0?void 0:e.focus();(l=s.target.previousElementSibling)===null||l===void 0?void 0:l.select()}if(s.target.value.length>1){this.splitNumber(s)}}handlePaste(s){this.resetError();const i=salla.helpers.number(s.clipboardData.getData("text"))||"";let t=i.replace(/[^0-9]/g,"");t=t.substring(0,this.otpInputs.length);this.otpInputs.forEach((s=>s.value=""));this.modifyNext(this.otpInputs[0],t)}handleInput(s){this.resetError();salla.helpers.inputDigitsOnly(s.target);if(this.checkAllInputs()){setTimeout((()=>{this.toggleOTPSubmit()}),100)}}resetError(){this.hasError=false;this.errorMessage=""}handleFocus(s){var i;if(s.target===this.firstOtpInput)return;if(((i=this.firstOtpInput)===null||i===void 0?void 0:i.value)==""){this.firstOtpInput.focus()}if(s.target.previousElementSibling.value==""){s.target.previousElementSibling.focus()}}async getCode(){return this.code.value}async open(s){var i,t;this.data=s;this.data.type=this.data.type||this.type;this.type=this.data.type;this.resendTimer();this.otpInputs=this.body.querySelectorAll(".s-verify-input");this.firstOtpInput=this.body.querySelector("#otp-1");this.reset();this.resetError();this.display=="modal"&&((i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title));this.modal.open();(t=this.firstOtpInput)===null||t===void 0?void 0:t.addEventListener("input",(s=>this.splitNumber(s)));setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let s=[];this.otpInputs.forEach((i=>i.value&&s.push(i.value)));this.code.value=s.join("");if(s.length===4){this.btn.disable();this.btn.click();return}this.btn.enable()}reset(){this.otpInputs.forEach((s=>s.value=""));this.code.value="";this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block";this.resend.style.display="none";this.resendAfter=30;let s=setInterval((()=>{if(this.resendAfter<=0){clearInterval(s);this.resend.style.display="block";this.resendMessage.style.display="none"}else{this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`;this.resendAfter--}}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value=""));this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4){this.otpInputs[this.code.value.length].focus();salla.log("Trying to submit without 4 digits!");return}let s=Object.assign({code:this.code.value},this.data);return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,this.supportWebAuth))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((s=>{var i,t,e;this.hasError=true;this.errorMessage=((e=(t=(i=s.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||e===void 0?void 0:e.message)||salla.lang.get("common.errors.error_occurred");if(!s.response){console.log("Unexpected error",s)}else{salla.logger.error(s)}this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return this.display=="inline"?t(e,null,this.myBody()):t("salla-modal",{width:"xs",class:"s-verify",ref:s=>this.modal=s,"modal-title":this.title},t("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:this.type=="mobile"?h:r}),this.myBody())}myBody(){return t("div",{class:"s-verify-body",ref:s=>this.body=s},t("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),t("slot",{name:"mobile"}),t("slot",{name:"email"}),t("input",{type:"hidden",name:"code",maxlength:"4",required:true,ref:s=>this.code=s}),t("div",{class:{"s-verify-codes":true,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((s=>t("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:`otp-${s}`,class:{"s-verify-input":true,"s-has-error":this.hasError},onInput:s=>this.handleInput(s),onPaste:s=>this.handlePaste(s),onKeyUp:s=>this.handleKeyUp(s),onFocus:s=>this.handleFocus(s),required:true})))),this.hasError&&this.errorMessage?t("span",{class:"s-verify-error-message"},this.errorMessage):"",t("div",{slot:"footer",class:"s-verify-footer"},t("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:true,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),t("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),t("b",{class:"s-verify-timer",ref:s=>this.timer=s})),t("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),t("slot",{name:"after-footer"}))}get host(){return l(this)}};a.style=o;export{a as salla_verify};
|
|
5
|
+
//# sourceMappingURL=p-316e3ea9.entry.js.map
|
|
@@ -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-CayW-agT.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-33963e7d.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,c as t,h as i,H as e,g as a}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,c as t,h as i,H as e,g as a}from"./p-CayW-agT.js";import{H as h}from"./p-DjVGZdqd.js";import{F as l}from"./p-DL4h2bc3.js";import"./p-CgtvEd63.js";const r=":host{display:block}";const n=class{constructor(i){s(this,i);this.changed=t(this,"changed");this.initHeight=195;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}connectedCallback(){this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((()=>{this.page=salla.config.get("page")}));salla.lang.onLoaded((()=>{this.showMoreLabel=salla.lang.getWithDefault("common.titles.more",this.showMoreLabel);this.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",this.showLessLabel)}))}componentDidLoad(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight=`${this.initHeight}px`);this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}async setWidgetHeight(s=250){this.widgetContent.removeAttribute("style");setTimeout((()=>{let s=this.widgetContent.scrollHeight;this.widgetContent.style.height=s+"px"}),s)}async reset(){if(this.option.type===l.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((s=>s.checked=false))}async showMore(){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?`${this.widgetValues.scrollHeight}px`:`${this.initHeight}px`;setTimeout((()=>{this.widgetContent.style.height=`${this.widgetContent.scrollHeight}px`}),400)}async toggleWidget(){this.isOpen=!this.isOpen;h.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(()=>this.isOpen))}renderFilterOption(s){if(![l.VALUES,l.MINIMUM,l.VARIANTS].includes(s.type)){return""}return s.values.map(((t,e)=>{let a=typeof t=="number"?t:t.key||t.value;return i("label",{class:"s-filters-label",htmlFor:`${s.key}-option-${a}`,key:`${s.key}-option-${a}`},i("input",{id:`${s.key}-option-${a}`,name:s.key,type:"radio",checked:this.isSelectedOption(s,a),class:`s-filters-radio`,onChange:t=>this.changed.emit({event:t,option:s,value:a})}),this.getOptionLabel(s,t))}))}isSelectedOption(s,t){if(s.type===l.MINIMUM){return this.filtersData[s.key]==t}if(s.type===l.VARIANTS){return this.filtersData[s.type]&&this.filtersData[s.type][Object.keys(this.filtersData[s.type])[0]]==t}if(s.type===l.RANGE){return this.filtersData[s.key]&&this.filtersData[s.key].min==t.min&&this.filtersData[s.key].max==t.max}if(s.type===l.VALUES){return this.filtersData[s.key]&&Number(this.filtersData[s.key])==Number(t)}return false}getOptionLabel(s,t){if(s.key=="rating"){return i("salla-rating-stars",{size:"small",value:t})}let e=t.value||"null";return i("span",{class:"s-filters-option-name"},e)}render(){return i(e,{key:"faa16285c7c2dcd248f00230aa4b1eebc1814fdd",class:"s-filters-widget-container"},i("h3",{key:"019354d300116c2d567b75e5cc93d0d1dfc4785b",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},i("span",{key:"8ce2bc6a789a0f5d82308afad47cbae58467439a"},this.option.label),i("span",{key:"a5dcaa63ad18d41a324b499f36c82780c0670d4f",class:`s-filters-widget-plusminus ${this.isOpen?"s-filters-widget-plusminus-active":""}`})),i("div",{key:"bef8427341d94bb6eb6e37d9736f9ca3e9503058",class:"s-filters-widget-content",ref:s=>this.widgetContent=s},i("div",{key:"451025fa922e84970107fe6ab2752db780effd86",class:"s-filters-widget-values",ref:s=>this.widgetValues=s},i("slot",{key:"cbea119413f48c302684ae52c81786dcb69c6f29"}),this.option.type!==l.RANGE?this.renderFilterOption(this.option):i("salla-price-range",{onChanged:s=>{this.changed.emit(s.detail)},ref:s=>this.priceRange=s,filtersData:this.filtersData,option:this.option})),this.withLoadMore&&i("a",{key:"6b2e1b91b27509b445ad4af9367b4cc464bd2d4e",class:"s-filters-widget-more",onClick:()=>this.showMore()},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))}get host(){return a(this)}};n.style=r;export{n as salla_filters_widget};
|
|
5
|
+
//# sourceMappingURL=p-37a3c661.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as t,H as l}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as a,h as t,H as l}from"./p-CayW-agT.js";const e=".s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:-ms-flexbox !important;display:flex !important;-ms-flex-align:center !important;align-items:center !important;-ms-flex-pack:start !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:-webkit-max-content;width:-moz-max-content;width:max-content;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}";const s=class{constructor(t){a(this,t);this.isLoading=false;this.nextPageUrl="";this.handleClick=()=>{this.loadMoreTransactions()}}componentWillLoad(){return salla.onReady().then((()=>this.loadTransactions()))}async loadTransactions(){this.isLoading=true;try{let a=`/balance/wallet?per_page=10&page=1`;let t=await salla.api.request(a);this.nextPageUrl=t.data.transactions.next_page_url;this.transactionsArray=t.data.transactions;this.balance=t.data.balance}catch(a){console.error("Error loading wallet transactions",a)}finally{this.isLoading=false}}async loadMoreTransactions(){this.isLoading=true;try{let a=this.nextPageUrl||"/balance/wallet?page=2&per_page=10";let t=await salla.api.request(a);this.nextPageUrl=t.data.transactions.next_page_url;this.transactionsArray.push(...t.data.transactions.data);this.balance=t.data.balance}catch(a){console.error("Error loading wallet transactions",a)}finally{this.isLoading=false}}render(){if(this.transactionsArray.length>0){return t(l,null,t("table",{class:"s-wallet-table"},t("tbody",{class:"s-wallet-table-tbody"},t("tr",{class:"s-table__tr"},t("td",null,t("div",{class:"s-wallet-table-balance-container"},t("i",{class:"s-wallet-table-balance-icon sicon-wallet"}),t("div",null,t("div",{innerHTML:salla.money(this.balance)}),t("div",{class:"font-normal text-gray-400"}," ",salla.lang.get("pages.wallet.balance")))))))),t("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),t("table",{class:"s-wallet-table"},t("thead",{class:"s-wallet-table-head"},t("tr",{class:"s-wallet-table-head-tr"},t("th",{scope:"col"},salla.lang.get("pages.wallet.transaction_number")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.amount")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.date")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.order_no")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),t("th",{scope:"col",class:"s-wallet-table-head-tr-th"},salla.lang.get("pages.wallet.transaction_type")," "))),t("tbody",{class:"s-wallet-table-tbody"},this.transactionsArray.map((a=>t("tr",{class:"s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated"},t("td",{class:"s-wallet-table-tbody-tr-td"},t("div",{class:"s-wallet-table-tbody-tr-td-content"},t("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.transaction_number"),":"),a.id&&t("span",{class:"hidden md:inline-block"},"#",a.id),t("div",{class:"flex items-center md:hidden"},t("salla-button",{class:"relative",color:"dark",shape:"link","data-content":a.order_id},a.order_id&&t("span",null,"#",a.order_id))))),t("td",{id:"main123",class:"s-wallet-table-tbody-tr-td"},t("div",{id:"main124",class:"s-wallet-table-tbody-tr-td-content"},t("span",{id:"main125",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.amount"),":"),t("div",{innerHTML:salla.money(a.amount)}))),t("td",{class:"s-wallet-table-tbody-tr-td"},t("div",{class:"s-wallet-table-tbody-tr-td-content"},t("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.date"),":"),a.created_at&&new Date(a.created_at*1e3).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}))),t("td",{id:"main133",class:"s-wallet-table-tbody-tr-td"},t("div",{id:"main134",class:"s-wallet-table-tbody-tr-td-content"},t("span",{id:"main135",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.order_no"),":"),t("span",{class:"rtl:mr-auto ltr:ml-auto md:mx-0"},a.order_id&&t("span",null,"#",a.order_id)))),t("td",{id:"main143",class:"s-wallet-table-tbody-tr-td"},t("div",{id:"main144",class:"s-wallet-table-tbody-tr-td-content"},t("span",{id:"main145",class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.expiry_date"),":"),t("span",null,a.expired_at&&new Date(a.expired_at*1e3).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})))),t("td",{class:"s-wallet-table-tbody-tr-td"},t("div",{class:"s-wallet-table-tbody-tr-td-content"},t("div",null,t("span",{class:"s-wallet-mobile-title"},salla.lang.get("pages.wallet.transaction_type"),":")),t("div",{class:{"s-wallet-table-transaction-status-default":true,"s-wallet-table-transaction-status-cashback":a.action_type==="cashback","s-wallet-table-transaction-status-refund":a.action_type==="refund","s-wallet-table-transaction-status-purchase":a.action_type==="purchase_by_wallet"}},!!a.description&&t("i",{id:a.id.toString(),class:"sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"}),!!a.description&&t("salla-tooltip",{text:a.description,targetId:a.id.toString()}),t("span",null,a.title))))))))),t("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrl&&t("salla-button",{onClick:this.handleClick,loading:this.isLoading},salla.lang.get("common.elements.load_more"))))}else{return t(l,null,t("h2",{style:{"margin-top":"32px"}},salla.lang.get("pages.wallet.title")),t("div",{class:"s-wallet-table-empty-state"},t("i",{class:"sicon-full-wallet"}),t("div",{class:"text-center p-3 text-xl font-bold "},salla.lang.get("pages.wallet.no_transactions")),t("div",{class:"text-center text-gray-400 text-sm font-normal "},salla.lang.get("pages.wallet.zero_balance")," ")))}}};s.style=e;export{s as salla_wallet};
|
|
5
|
+
//# sourceMappingURL=p-41480e7b.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,H as a,g as c}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as s,H as a,g as c}from"./p-CayW-agT.js";import{w as e}from"./p-DWksgowB.js";import{M as n}from"./p-DmgxDvXL.js";var i=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n`;var l=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n`;const h=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";const r=class{constructor(s){t(this,s);var a;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:i,whatsapp:e,phone:o,telegram:l,email:n};this.contactSlot=((a=this.host.querySelector('[slot="contact"]'))===null||a===void 0?void 0:a.innerHTML)||`<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly&&"<span class='unicode'>{value}</span>"}</a>`;salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((()=>{this.contactsTitle=this.contactsTitle||salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>s!=="")).map((([t,s])=>({type:t,value:s})))}getContactLink(t){const s=this.contacts[t];switch(t){case"phone":case"mobile":return`tel:${s}`;case"whatsapp":return salla.url.get("whatsapp/send");case"email":return`mailto:${s}`;case"telegram":return s.startsWith("https://t.me/")?s:`https://t.me/${s}`;default:return s}}getContactIcon(t){return this.iconsList[t]}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}render(){const t=this.getContactsArray();if(!t||t.length==0){return}if(this.isHeader){return s(a,{class:"s-contacts s-contacts-header"},t.filter((t=>t.type=="phone"||t.type=="email")).map(((t,a)=>s("a",{href:this.getContactLink(t.type),key:a,class:"s-contacts-topnav-link"},t.type==="email"?t.value:[s("span",null,this.contactsTitle,": "),s("a",{class:"unicode",href:this.iconsList[t.type]},t.value)]))))}return s(a,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,a)=>s("div",{key:a,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()}get host(){return c(this)}};r.style=h;export{r as salla_contacts};
|
|
5
|
+
//# sourceMappingURL=p-41ecc4f7.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-CmumtzEL.system.js"],(function(t){"use strict";var a,r,e,n;return{setters:[function(t){a=t.r;r=t.h;e=t.H;n=t.g}],execute:function(){var s="";var i=t("salla_metadata",function(){function t(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(t){salla.log("Bad json passed via entityId prop")}}}t.prototype.getValue=function(t){if(t.type==="file"){return'<a href="'.concat(t.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(t.type==="url"){return'<a href="'.concat(t.value,'" class="text-blue-700 underline" target="_blank">').concat(t.value,"</a>")}if(t.type==="date"){var a=new Date(t.value);var r=String(a.getDate()).padStart(2,"0");var e=String(a.getMonth()+1).padStart(2,"0");var n=a.getFullYear();var s="".concat(r,"/").concat(e,"/").concat(n);return s}return t.value};t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){var t;if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("custom-fields"))){throw new Error("feature custom-fields is not activated")}})).then((function(){if(!t.entityId&&salla.url.is_page("product.single")){t.entityId=salla.config.get("page.id")}if(!t.entityId){throw new Error("can't render salla-metadata without enity-id prop!")}salla.lang.onLoaded((function(){return t.download=salla.lang.get("pages.thank_you.download")}));var a=Array.isArray(t.entityId)?t.entityId:[t.entityId];var r=a.map((function(t){return"entities[]=".concat(t)})).join("&");var e="https://api.salla.dev/store/v1/metadata/values?type=".concat(t.entity,"&").concat(r);return salla.api.request(e).then((function(t){var a;return(a=t.data[0])===null||a===void 0?void 0:a.sections}))})).then((function(a){return t.specs=a})).catch((function(t){return salla.logger.error("Error loading more specs:",t)}))};t.prototype.render=function(){var t=this;if(!this.specs.length){return}return r(e,{class:"s-metadata-wrapper"},this.specs.map((function(a){return r("div",{class:"s-metadata-box"},r("div",{class:"s-metadata-box-header"},r("i",{class:"sicon-list"}),a.name),a.fields.map((function(a){return r("div",{class:"s-metadata-row"},r("p",{class:"s-metadata-row-name"},a.name),r("p",{class:"s-metadata-row-value",innerHTML:t.getValue(a)}))})))})))};Object.defineProperty(t.prototype,"host",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());i.style=s}}}));
|
|
5
|
+
//# sourceMappingURL=p-44a213de.system.entry.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as e,c as t,h as a,H as i}from"./p-CayW-agT.js";const s="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";const c=class{constructor(a){e(this,a);this.prizeItemSelected=t(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return a(i,{key:"5434064e3e54117f4df4e16282f70e81503d7489"},a("div",{key:"28b5a19dcd1f239a74d69e91a1cda66ae7521e8e",onClick:this.onPrizeItemClick.bind(this)},a("img",{key:"82917e0074006f4e462b2328405714a31d168c17",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),a("div",{key:"089ac134ed2a0474067c79cd590154ca85a380c9",class:"s-loyalty-prize-item-title"},this.item.name),a("div",{key:"85d245c32c42701274fa29761c4345020532eac1",class:"s-loyalty-prize-item-subtitle"},this.item.description),a("div",{key:"5f37781c8c77998a0bb586ddcda4640741db0b6e",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};c.style=s;export{c as salla_loyalty_prize_item};
|
|
5
|
+
//# sourceMappingURL=p-4ced9aab.entry.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,s){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function i(e){try{l(s.next(e))}catch(e){a(e)}}function o(e){try{l(s["throw"](e))}catch(e){a(e)}}function l(e){e.done?r(e.value):n(e.value).then(i,o)}l((s=s.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,i;return i={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(e){return function(t){return l([e,t])}}function l(o){if(s)throw new TypeError("Generator is already executing.");while(i&&(i=0,o[0]&&(r=0)),r)try{if(s=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){r.label=o[1];break}if(o[0]===6&&r.label<a[1]){r.label=a[1];a=o;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(o);break}if(a[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];n=0}finally{s=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
|
+
/*!
|
|
3
|
+
* Crafted with ❤ by Salla
|
|
4
|
+
*/System.register(["./p-CmumtzEL.system.js"],(function(e){"use strict";var t,r,s;return{setters:[function(e){t=e.r;r=e.h;s=e.g}],execute:function(){var n;(function(e){e["ProductDetail"]="product.single";e["Cart"]="cart"})(n||(n={}));var a;(function(e){e["Conditional"]="conditional";e["PercentageOrFixed"]="fixed";e["DiscountsTable"]="discounts_table";e["Bank"]="bank";e["BuyXGetY"]="buy_x_get_y"})(a||(a={}));var i='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';var o=e("salla_offer",function(){function e(e){var r=this;t(this,e);var s;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){r.offer_with_price_text=salla.lang.get("pages.offer.with_price");r.with_discount_text=salla.lang.get("pages.products.with_a_discount");r.product_discount_text=salla.lang.get("pages.products.discount");r.special_offer_text=salla.lang.get("pages.products.special_offer");r.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");r.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");r.buy_quantity_text(0)}));salla.onReady((function(){r.currentPage=salla.config.get("page.slug");r.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((s=this.host.querySelector('[slot="category"]'))===null||s===void 0?void 0:s.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getEndpointByPageName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!(this.currentPage==n.Cart))return[3,2];return[4,Salla.cart.getCurrentCartId()];case 1:e=t.sent();return[2,"offers/cart/".concat(e)];case 2:if(this.currentPage==n.ProductDetail){return[2,"offers/product/".concat(salla.config.get("page.id"))]}return[2,"offers"]}}))}))};e.prototype.componentWillLoad=function(){var e=this;this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((function(e){return salla.onReady(e)})).then((function(){e.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(e.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((function(){return __awaiter(e,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:t=(e=salla.api).request;return[4,this.getEndpointByPageName()];case 1:return[2,t.apply(e,[r.sent()])]}}))}))})).then((function(t){if(!(e.offersList=t.data).length){throw new Error("salla-offers:: There is no offers!")}var r=e.offersList.find((function(e){return[a.Bank,a.BuyXGetY,a.DiscountsTable].includes(e.type)}));if(!r){throw new Error("salla-offers:: Offer type not supported yet!")}if(r.type===a.DiscountsTable){return e.offersList=[r]}if(e.isBankOffer=r.type===a.Bank){e.offersList=e.offersList.filter((function(e){return e.type===a.Bank}));e.isMultipleBank=e.offersList.length>1;return e.offersList}var s=r.details.get;return s.source==="products"?salla.product.api.fetch({source:"selected",source_value:s.source_value}).then((function(t){s.products=t.data;r.details.get=s;return e.offersList=[r]})):salla.product.api.categories().then((function(t){s.categories=e.findCategories(t.data,s.source_value);r.details.get=s;return e.offersList=[r]}))})).then((function(t){salla.storage.set(e.getStorageKey(),{offers:t,stored_at:(new Date).getTime()});e.canRender=true})).catch((function(e){salla.logger.warn(e)}))};e.prototype.componentDidLoad=function(){var e=this.host.querySelector(".s-slider-block__title-nav");e===null||e===void 0?void 0:e.classList.add("s-offer-bank-payment-nav")};e.prototype.findCategories=function(e,t){var r;var s=[];for(var n=0,a=e;n<a.length;n++){var i=a[n];if(t.includes(i.id_||i.id)){s.push(i)}if(((r=i.sub_categories)===null||r===void 0?void 0:r.length)>0){s=s.concat(this.findCategories(i.sub_categories,t))}}return s};e.prototype.getStorageKey=function(){try{var e=salla.config.get("page.slug").replace(".","_");var t=salla.lang.getLocale();var r=salla.config.currency().code;if(!e||!t||!r){throw new Error("Unable to get the storage key.")}return"s-offers-".concat(e,"-").concat(salla.config.get("page.id"),"-").concat(t,"-").concat(r)}catch(e){return""}};e.prototype.getOffersFromStorage=function(){var e=salla.storage.get(this.getStorageKey());if(!e||e.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(e.offers)};e.prototype.render=function(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;var e=this.offersList[0];var t=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:e.title;var s=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:e.description;var n={"block-title":t,"block-subTitle":s,"show-controls":this.isMultipleBank};return r("div",{class:"s-offer-wrapper"},r("p",{class:"s-offer-corner-badge"},this.special_offer_text),r("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},n),r("div",{slot:"items"},this.renderSectionForOfferType(e.type))))};e.prototype.renderSectionForOfferType=function(e){if(this.isBankOffer){return this.renderBankSection()}if(e==a.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()};e.prototype.getCategoriesSection=function(e){return r("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon||"sicon-store").replace(/\{name\}/g,e.name)})};e.prototype.renderBuyXGetYSection=function(){var e=this;var t,s;var n=this.offersList[0].details;return[(t=n.get.products)===null||t===void 0?void 0:t.map((function(t){return r("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?r(e.productCardComponent,{product:t}):r("salla-product-card",{"shadow-on-hover":true,product:t}))})),(s=n.get.categories)===null||s===void 0?void 0:s.map((function(t){return e.getCategoriesSection(t)}))]};e.prototype.renderBankSection=function(){var e=this;return this.offersList.map((function(t){return r("div",{class:{"s-offer-slide-one-sixth":e.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!e.isMultipleBank}},r("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!e.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":e.isMultipleBank}},r("div",{class:"s-offer-bank-logo"},r("img",{src:t.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":t.details.logo,alt:t.title+" offer"})),r("ul",{class:"s-offer-bank-payment-wrapper"},t.details.payments.map((function(e){return r("li",{class:"s-offer-bank-payment-single"},r("img",{src:salla.url.cdn("images/payment/"+e+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+".png"),alt:"payment"}))}))),e.isMultipleBank?r("p",{class:"s-offer-bank-payment-discount-percent"},"".concat(e.product_discount_text," ").concat(t.details.discount_value).concat(t.details.discount_type==="percentage"&&"%")):""),!e.isMultipleBank?r("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},r("h2",null,e.offersList[0].title),r("p",{innerHTML:e.generateBankDescription(e.offersList[0].description,t.details.discount_value)})):"")}))};e.prototype.generateBankDescription=function(e,t){return e.replace(new RegExp("".concat(t," %")),'<span class="s-offer-bank-message-amount">'.concat(t," %</span>"))};e.prototype.renderDiscountTableSection=function(){var e=this;var t;var s=this.offersList[0];var n=s.details.show_price_after_discount;return(t=this.offersList[0].details.discounts)===null||t===void 0?void 0:t.map((function(t){return r("div",{class:"s-offer-slide-one-fourth"},r("div",{class:"s-offer-slide-offer-entry"},r("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},r("p",{class:"s-offer-slide-offer-entry-quantity"},e.buy_quantity_text(t.quantity)),n?r("div",{class:"s-offer-slide-offer-entry-price"},r("span",null,e.offer_with_price_text),r("span",{class:"s-offer-slide-offer-entry-price-amount"},t.discounted_amount)," ",r("span",null,e.userCurrency)):""),r("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},e.with_discount_text,"(",r("span",null,t.percentage,!!t.percentage&&"%"),")")))}))};Object.defineProperty(e.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=i}}}));
|
|
5
|
+
//# sourceMappingURL=p-4fb112e6.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PageType","OfferType","sallaOfferCss","SallaOffer","exports","class_1","hostRef","_this","this","productCardComponent","offersList","isMultipleBank","isBankOffer","canRender","showOffer","salla","config","get","offer_with_price_text","lang","price","with_discount_text","product_discount_text","special_offer_text","multipleBankOfferTitleText","multipleBankOfferTitleDescription","buy_quantity_text","quantity","onLoaded","onReady","currentPage","userCurrency","symbol","categorySlot","_a","host","querySelector","innerHTML","prototype","getEndpointByPageName","Cart","Salla","cart","getCurrentCartId","cartId","_c","sent","concat","ProductDetail","componentWillLoad","hasCustomComponent","customElements","Promise","resolve","then","url","is_page","Error","__awaiter","_d","__generator","_e","api","request","apply","res","data","length","offer","find","Bank","BuyXGetY","DiscountsTable","includes","type","filter","getY","details","source","product","fetch","source_value","response","products","categories","findCategories","offers","storage","set","getStorageKey","stored_at","Date","getTime","catch","error","logger","warn","componentDidLoad","nav","classList","add","ids","found","_i","categories_1","category","id_","id","push","sub_categories","pageSlug","replace","locale","getLocale","currencyCode","currency","code","getOffersFromStorage","storageOffers","remove","render","blockTitle","title","blockSubTitle","description","titles","h","class","Object","assign","slot","renderSectionForOfferType","offerType","renderBankSection","renderBuyXGetYSection","renderDiscountTableSection","getCategoriesSection","icon","name","map","_b","bankOffer","src","logo","cdn","alt","payments","payment","discount_value","discount_type","generateBankDescription","desc","value","RegExp","show_discounted_price","show_price_after_discount","discounts","discount","discounted_amount","percentage"],"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}\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 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;\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, 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 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.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 //BuyXGetY offers\n const getY = (offer.details as BuyXGetYDetail).get;\n\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 }\n\n\n findCategories(categories: Category[], ids: any[]): Category[] {\n let found: Category[] = [];\n\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 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\">\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.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}\n"],"mappings":";;;qJAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,kCACAA,EAAA,cACD,EAHD,CAAYA,MAGX,KAED,IAAYC,GAAZ,SAAYA,GACVA,EAAA,6BACAA,EAAA,6B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AyBtF,EAAMS,QAAgC8E,0BACnE,OAAOzH,EAAC1B,KAAKE,WAAW,GAAGmE,QAAgC+E,aAAS,MAAA1H,SAAA,SAAAA,EAAEyG,KAAI,SAACkB,GAAuB,OAAA/B,EAAA,OAAKC,MAAM,4BAC3GD,EAAK,OAAAC,MAAM,6BACTD,EAAK,OAAAC,MAAM,sDACTD,EAAA,KAAGC,MAAM,sCAAsCxH,EAAKmB,kBAAkBmI,EAASlI,WAC9E+H,EACC5B,EAAK,OAAAC,MAAM,mCACTD,EAAO,YAAAvH,EAAKW,uBACZ4G,EAAA,QAAMC,MAAM,0CAA0C8B,EAASC,mBAAyB,IAAChC,EAAO,YAAAvH,EAAKwB,eAC9F,IAEb+F,EAAG,KAAAC,MAAM,kDAAkDxH,EAAKc,mBAAkB,IAC/EyG,EAAA,YAAO+B,EAASE,aAAcF,EAASE,YAAc,KAAW,MAX2B,G,yHArT/E,I","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as s,h as e,H as i,g as l}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,c as s,h as e,H as i,g as l}from"./p-CayW-agT.js";import{F as a}from"./p-DL4h2bc3.js";import{H as r}from"./p-DjVGZdqd.js";import"./p-CgtvEd63.js";const o=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";const n=class{constructor(e){t(this,e);this.changed=s(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(()=>this.host.style.display="none"));salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply");this.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=a.VALUES;let{max:s,min:e}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=e||t<=s))}if(this.filtersData.variants&&t.type==a.VARIANTS){s.variants=this.filtersData.variants}if(this.filtersData[t.key]&&t.type!==a.VARIANTS){s[t.key]=this.filtersData[t.key]}let e=new URLSearchParams(window.location.search);let i=false;for(let t of e.keys()){if(t.includes("filters")){i=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(s).length==0&&!i){let t=window.location.href;let e=salla.config.get("page.id");let i=t.indexOf("?")!==-1?"&":"?";let l=t+i+"filters[category_id]="+e;s.category_id=e;window.history.pushState({path:l},"",l)}return t}));this.filtersData=s;this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady){return}let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{var s;if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries()){if(s.startsWith("filters")){t.searchParams.delete(s)}}let s=this.encodeFilters(this.filtersData);let e=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");if(e){t.search=t.search.split("&filters")[0]+"&"+s}else{t.search=`?${s}`}window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);(s=t.searchParams)===null||s===void 0?void 0:s.delete("filters");window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData);this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const e=[];for(const i in t){if(Object.prototype.hasOwnProperty.call(t,i)){const l=t[i];const a=s?`${s}[${i}]`:i;if(Array.isArray(l)){for(let t=0;t<l.length;t++){e.push(`${a}[${t}]=${l[t]}`)}}else if(typeof l==="object"&&l!==null){e.push(this.encodeFilters(l,a))}else{let t=`${a}=${l}`;e.push(t)}}}return e.join("&")}async resetFilters(){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((t=>t.reset&&t.reset()));salla.event.emit("salla-filters::reset");return this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search);const s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&");const e=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",e)}handleOptionChange(t,s,e){if(s.type===a.RANGE){this.filtersData[s.key]=e}let i=t.target.checked;if(s.type===a.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[s.key]=e);i||delete this.filtersData.variants[s.key]}else if(t.target.type=="radio"){i&&(this.filtersData[s.key]=e);i||delete this.filtersData[s.key]}else if(t.target.type=="checkbox"){this.filtersData[s.key]=this.filtersData[s.key]||[];if(i){this.filtersData[s.key].push(e)}this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=e))}this.applyFilters()}render(){var t,s;return e(i,{key:"80fda46c33daf06c6a22d567d13375351db4e3cb"},(t=this.filters)===null||t===void 0?void 0:t.map((t=>e("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:e}})=>{this.handleOptionChange(t,s,e)}}))),((s=this.filters)===null||s===void 0?void 0:s.length)?e("div",{class:"s-filters-footer"},e("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=true}get host(){return l(this)}};n.style=o;export{n as salla_filters};
|
|
5
|
+
//# sourceMappingURL=p-51195e76.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-CmumtzEL.system.js"],(function(t){"use strict";var a,s,n,l;return{setters:[function(t){a=t.r;s=t.h;n=t.H;l=t.g}],execute:function(){var i=":host{display:block}";var e=t("salla_app_install_alert",function(){function t(t){a(this,t);this.alertDelay=null;this.data=salla.config.get("store.app_install_prompt");this.open=false;this.closing=false}t.prototype.connectedCallback=function(){var t=this;salla.onReady((function(){t.data=salla.config.get("store.app_install_prompt");if(!t.isMobileOrTabletDevice())return;if(!t.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");t.ctaLink=salla.url.get("app");t.alertDelay=setTimeout((function(){return t.open=true}),3e3)}))};t.prototype.disconnectedCallback=function(){clearTimeout(this.alertDelay)};t.prototype.isMobileOrTabletDevice=function(t){if(t===void 0){t=1024}var a=window.innerWidth<=t;var s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);var n="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&a&&n};t.prototype.closeAlert=function(){var t=this;salla.storage.set("app_install_prompt_disabled",true);this.closing=true;this.host.addEventListener("animationend",(function(){t.closing=false;t.open=false}),{once:true})};t.prototype.render=function(){var t=this;return this.data?s(n,{class:"s-app-install-alert-wrapper ".concat(this.open?"open":""," ").concat(this.closing?"closing":""),position:this.data.position},s("div",null,s("img",{src:this.data.icon,width:"58",height:"58",alt:"".concat(salla.config.get("store.name"))})),s("div",{class:"s-app-install-alert-content"},s("h2",{class:"s-app-install-alert-title"},this.data.title),s("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",s("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),s("button",{class:"s-app-install-alert-cancel-button",onClick:function(){return t.closeAlert()}},s("i",{class:"sicon-cancel"}))):null};Object.defineProperty(t.prototype,"host",{get:function(){return l(this)},enumerable:false,configurable:true});return t}());e.style=i}}}));
|
|
5
|
+
//# sourceMappingURL=p-54bd7e18.system.entry.js.map
|