@salla.sa/twilight-components 2.14.230 → 2.14.232
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-CzeN2gey.js → app-globals-CcyMxulT.js} +3 -3
- package/dist/cjs/{app-globals-CzeN2gey.js.map → app-globals-CcyMxulT.js.map} +1 -1
- package/dist/cjs/{index-DAzolwX4.js → index-B0NlbfpT.js} +4 -4
- package/dist/cjs/{index-DAzolwX4.js.map → index-B0NlbfpT.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{app-globals-Bwee9N87.js → app-globals-BrKspgg9.js} +3 -3
- package/dist/esm/{app-globals-Bwee9N87.js.map → app-globals-BrKspgg9.js.map} +1 -1
- package/dist/esm/{index-DWuTKtBW.js → index-iZNAXsJF.js} +4 -4
- package/dist/esm/{index-DWuTKtBW.js.map → index-iZNAXsJF.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body.entry.js +1 -1
- package/dist/esm/salla-accordion-head.entry.js +1 -1
- package/dist/esm/salla-accordion.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm-es5/{app-globals-Bwee9N87.js → app-globals-BrKspgg9.js} +2 -2
- package/dist/esm-es5/{app-globals-Bwee9N87.js.map → app-globals-BrKspgg9.js.map} +1 -1
- package/dist/esm-es5/{index-DWuTKtBW.js → index-iZNAXsJF.js} +5 -5
- package/dist/esm-es5/{index-DWuTKtBW.js.map → index-iZNAXsJF.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
- package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
- package/dist/esm-es5/salla-accordion.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_51.entry.js +4 -4
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +2 -2
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +2 -2
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-f542d77e.system.entry.js → p-057afa3a.system.entry.js} +2 -2
- package/dist/twilight/{p-2a4341a8.entry.js → p-0982ae0c.entry.js} +2 -2
- package/dist/twilight/{p-92b6f034.system.entry.js → p-0de28fb7.system.entry.js} +2 -2
- package/dist/twilight/p-0fc9426e.entry.js +5 -0
- package/dist/twilight/{p-4b614548.system.entry.js → p-16a50b65.system.entry.js} +2 -2
- package/dist/twilight/{p-0ad41836.entry.js → p-18e52705.entry.js} +2 -2
- package/dist/twilight/{p-7a0ce5d1.entry.js → p-1a11ce17.entry.js} +2 -2
- package/dist/twilight/{p-e4e860d1.entry.js → p-1bad59b6.entry.js} +2 -2
- package/dist/twilight/{p-0f1b1e46.entry.js → p-1befac00.entry.js} +2 -2
- package/dist/twilight/{p-4c539fcc.system.entry.js → p-2160ba49.system.entry.js} +2 -2
- package/dist/twilight/{p-20f238a0.system.entry.js → p-21e71847.system.entry.js} +2 -2
- package/dist/twilight/{p-516f3218.system.entry.js → p-22ca5347.system.entry.js} +2 -2
- package/dist/twilight/{p-ae750319.system.entry.js → p-2458c9e9.system.entry.js} +2 -2
- package/dist/twilight/{p-6245cde6.system.entry.js → p-26d71929.system.entry.js} +2 -2
- package/dist/twilight/{p-1066d12e.system.entry.js → p-2991e23f.system.entry.js} +2 -2
- package/dist/twilight/{p-3562d025.entry.js → p-2b25255a.entry.js} +2 -2
- package/dist/twilight/{p-b86b81a0.entry.js → p-2bebea74.entry.js} +2 -2
- package/dist/twilight/{p-5c76c2b2.system.entry.js → p-30d982df.system.entry.js} +2 -2
- package/dist/twilight/{p-1bebbe3d.entry.js → p-3130b171.entry.js} +2 -2
- package/dist/twilight/{p-6a996e8a.system.entry.js → p-36270495.system.entry.js} +2 -2
- package/dist/twilight/{p-ddfa5a64.system.entry.js → p-36d9d5e4.system.entry.js} +2 -2
- package/dist/twilight/{p-9bce1b54.system.entry.js → p-373a82c2.system.entry.js} +2 -2
- package/dist/twilight/{p-37d553e5.system.entry.js → p-39c0fcdc.system.entry.js} +2 -2
- package/dist/twilight/p-3f0ee015.entry.js +5 -0
- package/dist/twilight/{p-2aee6a68.system.entry.js → p-40cff812.system.entry.js} +2 -2
- package/dist/twilight/{p-f20798f6.entry.js → p-421c90fe.entry.js} +2 -2
- package/dist/twilight/{p-83cea4f0.system.entry.js → p-4d9d2f2f.system.entry.js} +2 -2
- package/dist/twilight/{p-e755c300.entry.js → p-544ec514.entry.js} +2 -2
- package/dist/twilight/{p-445886ad.entry.js → p-566d369f.entry.js} +2 -2
- package/dist/twilight/{p-c175787a.system.entry.js → p-5786e162.system.entry.js} +2 -2
- package/dist/twilight/{p-5d7fff02.entry.js → p-63ee2845.entry.js} +2 -2
- package/dist/twilight/{p-df0c4065.entry.js → p-68cc3edc.entry.js} +2 -2
- package/dist/twilight/{p-51831df7.entry.js → p-6951c737.entry.js} +2 -2
- package/dist/twilight/{p-9e9ec157.entry.js → p-69fe102d.entry.js} +7 -7
- package/dist/twilight/{p-739a5124.system.entry.js → p-6a0239a0.system.entry.js} +2 -2
- package/dist/twilight/{p-4ff2bbf4.system.entry.js → p-6b819095.system.entry.js} +2 -2
- package/dist/twilight/{p-7586a50e.system.entry.js → p-78e05bb6.system.entry.js} +2 -2
- package/dist/twilight/{p-BdwSnv-_.system.js.map → p-7QLbY7pn.system.js.map} +1 -1
- package/dist/twilight/{p-9063b7d7.entry.js → p-7b775a0a.entry.js} +2 -2
- package/dist/twilight/{p-3277f8a3.entry.js → p-7e753e64.entry.js} +2 -2
- package/dist/twilight/{p-68078462.system.entry.js → p-7ed15e04.system.entry.js} +2 -2
- package/dist/twilight/{p-65939c80.system.entry.js → p-85c72e65.system.entry.js} +2 -2
- package/dist/twilight/{p-63b3ea2f.entry.js → p-86c566a4.entry.js} +2 -2
- package/dist/twilight/{p-5a7bad68.system.entry.js → p-8939d913.system.entry.js} +2 -2
- package/dist/twilight/{p-698a3693.entry.js → p-9d1baca1.entry.js} +2 -2
- package/dist/twilight/{p-DUa8YmqN.system.js.map → p-B1lAX1eT.system.js.map} +1 -1
- package/dist/twilight/{p-DGMCd6h5.system.js.map → p-BKbsOtA4.system.js.map} +1 -1
- package/dist/twilight/{p-BTqyH9zP.system.js → p-BX7FZkqj.system.js} +6 -6
- package/dist/twilight/{p-BTqyH9zP.system.js.map → p-BX7FZkqj.system.js.map} +1 -1
- package/dist/twilight/{p-3jVXRqU4.system.js.map → p-B_lAnNzk.system.js.map} +1 -1
- package/dist/twilight/{p-D79MBbJJ.system.js.map → p-BjsCwr-n.system.js.map} +1 -1
- package/dist/twilight/{p-BPhhu2Q7.system.js.map → p-BqlaCeFh.system.js.map} +1 -1
- package/dist/twilight/{p-DN10t2cI.system.js.map → p-BwyB2Y88.system.js.map} +1 -1
- package/dist/twilight/{p-48yJmYvC.system.js.map → p-C0rbCaH-.system.js.map} +1 -1
- package/dist/twilight/{p-rD_uaRHC.js → p-C1MNzkpX.js} +2 -2
- package/dist/twilight/{p-rD_uaRHC.js.map → p-C1MNzkpX.js.map} +1 -1
- package/dist/twilight/{p-CLFMzH2N.system.js.map → p-C3uMI7LH.system.js.map} +1 -1
- package/dist/twilight/{p-CsndEHxH.system.js.map → p-C6QVrIqT.system.js.map} +1 -1
- package/dist/twilight/{p-D6LiKG0S.system.js.map → p-C91gYM7p.system.js.map} +1 -1
- package/dist/twilight/{p-fwGmpkUD.system.js.map → p-C9zdn0OW.system.js.map} +1 -1
- package/dist/twilight/{p-Cm-NUOuA.system.js.map → p-CDnKHc30.system.js.map} +1 -1
- package/dist/twilight/{p-pn78bMUz.system.js.map → p-CELhJQir.system.js.map} +1 -1
- package/dist/twilight/{p-DguvW8UE.system.js.map → p-COrex3bO.system.js.map} +1 -1
- package/dist/twilight/{p-DmwqyKEf.system.js.map → p-CVRY93V8.system.js.map} +1 -1
- package/dist/twilight/{p-X9KT5ssu.system.js.map → p-Chfya8RP.system.js.map} +1 -1
- package/dist/twilight/{p-Bwzf6l2m.system.js.map → p-CntO0wq_.system.js.map} +1 -1
- package/dist/twilight/{p-HcXgKso7.system.js.map → p-CvFPj4ep.system.js.map} +1 -1
- package/dist/twilight/{p-CrkO_aXc.system.js.map → p-Cw-fI614.system.js.map} +1 -1
- package/dist/twilight/{p-BD76JVV3.system.js.map → p-DBDgCHAM.system.js.map} +1 -1
- package/dist/twilight/{p-BTZj9ahe.system.js → p-DGaEjwoZ.system.js} +2 -2
- package/dist/twilight/{p-BTZj9ahe.system.js.map → p-DGaEjwoZ.system.js.map} +1 -1
- package/dist/twilight/{p--7AXCfED.system.js.map → p-DIPaEAtp.system.js.map} +1 -1
- package/dist/twilight/{p-CCLDyorI.system.js.map → p-DO3gGatK.system.js.map} +1 -1
- package/dist/twilight/{p-BPEkR7Uz.system.js.map → p-DOAtGeo-.system.js.map} +1 -1
- package/dist/twilight/{p-Cgf31f5d.system.js.map → p-DRm-kRxH.system.js.map} +1 -1
- package/dist/twilight/{p-wbYBcJxh.system.js.map → p-Ddtzn0jx.system.js.map} +1 -1
- package/dist/twilight/{p-BgTOBm1J.system.js.map → p-DirBq3yR.system.js.map} +1 -1
- package/dist/twilight/{p-DwRDwfPU.system.js.map → p-DtFlYfss.system.js.map} +1 -1
- package/dist/twilight/{p-C_Gx4fNg.system.js.map → p-DyG11xn8.system.js.map} +1 -1
- package/dist/twilight/{p-CnsQrhjY.system.js.map → p-UIAI3aBI.system.js.map} +1 -1
- package/dist/twilight/{p-CB2HThNi.system.js.map → p-YeDOL4oD.system.js.map} +1 -1
- package/dist/twilight/{p-DRtUXiV3.system.js.map → p-_kxfhicb.system.js.map} +1 -1
- package/dist/twilight/{p-7aefaf33.entry.js → p-a08e9a73.entry.js} +2 -2
- package/dist/twilight/{p-f02d527f.system.entry.js → p-a181358b.system.entry.js} +2 -2
- package/dist/twilight/{p-20faf731.system.entry.js → p-b00e784a.system.entry.js} +2 -2
- package/dist/twilight/{p-e7901c9d.system.entry.js → p-b235449d.system.entry.js} +2 -2
- package/dist/twilight/{p-81b6008d.system.entry.js → p-b7d02240.system.entry.js} +2 -2
- package/dist/twilight/{p-CwbK3391.system.js.map → p-bBjviUXV.system.js.map} +1 -1
- package/dist/twilight/{p-9a63eaf0.entry.js → p-c2bf57ee.entry.js} +2 -2
- package/dist/twilight/{p-ab55d416.entry.js → p-cd254480.entry.js} +2 -2
- package/dist/twilight/{p-e4b88ce5.system.entry.js → p-cd531bea.system.entry.js} +2 -2
- package/dist/twilight/{p-5087750a.system.entry.js → p-ce7bc5bd.system.entry.js} +2 -2
- package/dist/twilight/{p-2c9efa34.system.entry.js → p-ce7cead8.system.entry.js} +2 -2
- package/dist/twilight/{p-38b6b862.entry.js → p-cec3c889.entry.js} +2 -2
- package/dist/twilight/p-cf3ead3a.entry.js +5 -0
- package/dist/twilight/{p-6ea49b56.entry.js → p-cf8b52bf.entry.js} +2 -2
- package/dist/twilight/{p-0f1a8a47.entry.js → p-d5fae15b.entry.js} +2 -2
- package/dist/twilight/{p-77007b51.system.entry.js → p-d6e8290c.system.entry.js} +2 -2
- package/dist/twilight/{p-9ae63c85.entry.js → p-dba83eaf.entry.js} +2 -2
- package/dist/twilight/{p-d75b04f0.entry.js → p-e37d593d.entry.js} +2 -2
- package/dist/twilight/{p-39744d46.entry.js → p-ef23379f.entry.js} +2 -2
- package/dist/twilight/{p-1344b38f.entry.js → p-ef344e7e.entry.js} +2 -2
- package/dist/twilight/{p-94056702.entry.js → p-f75b098c.entry.js} +2 -2
- package/dist/twilight/{p-3363633a.system.entry.js → p-f89d5c9a.system.entry.js} +2 -2
- package/dist/twilight/{p-58af07d1.system.entry.js → p-ff4273e3.system.entry.js} +2 -2
- package/dist/twilight/{p-DWuTKtBW.js → p-iZNAXsJF.js} +6 -6
- package/dist/twilight/{p-DWuTKtBW.js.map → p-iZNAXsJF.js.map} +1 -1
- package/dist/twilight/{p-B6ITtzm0.system.js → p-sHV9JMb-.system.js} +2 -2
- package/dist/twilight/{p-B6ITtzm0.system.js.map → p-sHV9JMb-.system.js.map} +1 -1
- package/dist/twilight/{p-DkuJrfYK.system.js.map → p-vilQp7C7.system.js.map} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-3ee481e4.entry.js +0 -5
- package/dist/twilight/p-8d0c6a10.entry.js +0 -5
- package/dist/twilight/p-b7f713fe.entry.js +0 -5
- /package/dist/twilight/{p-f542d77e.system.entry.js.map → p-057afa3a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2a4341a8.entry.js.map → p-0982ae0c.entry.js.map} +0 -0
- /package/dist/twilight/{p-92b6f034.system.entry.js.map → p-0de28fb7.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3ee481e4.entry.js.map → p-0fc9426e.entry.js.map} +0 -0
- /package/dist/twilight/{p-4b614548.system.entry.js.map → p-16a50b65.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0ad41836.entry.js.map → p-18e52705.entry.js.map} +0 -0
- /package/dist/twilight/{p-7a0ce5d1.entry.js.map → p-1a11ce17.entry.js.map} +0 -0
- /package/dist/twilight/{p-e4e860d1.entry.js.map → p-1bad59b6.entry.js.map} +0 -0
- /package/dist/twilight/{p-0f1b1e46.entry.js.map → p-1befac00.entry.js.map} +0 -0
- /package/dist/twilight/{p-4c539fcc.system.entry.js.map → p-2160ba49.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-20f238a0.system.entry.js.map → p-21e71847.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-516f3218.system.entry.js.map → p-22ca5347.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ae750319.system.entry.js.map → p-2458c9e9.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6245cde6.system.entry.js.map → p-26d71929.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1066d12e.system.entry.js.map → p-2991e23f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3562d025.entry.js.map → p-2b25255a.entry.js.map} +0 -0
- /package/dist/twilight/{p-b86b81a0.entry.js.map → p-2bebea74.entry.js.map} +0 -0
- /package/dist/twilight/{p-5c76c2b2.system.entry.js.map → p-30d982df.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1bebbe3d.entry.js.map → p-3130b171.entry.js.map} +0 -0
- /package/dist/twilight/{p-6a996e8a.system.entry.js.map → p-36270495.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ddfa5a64.system.entry.js.map → p-36d9d5e4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9bce1b54.system.entry.js.map → p-373a82c2.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-37d553e5.system.entry.js.map → p-39c0fcdc.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b7f713fe.entry.js.map → p-3f0ee015.entry.js.map} +0 -0
- /package/dist/twilight/{p-2aee6a68.system.entry.js.map → p-40cff812.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f20798f6.entry.js.map → p-421c90fe.entry.js.map} +0 -0
- /package/dist/twilight/{p-83cea4f0.system.entry.js.map → p-4d9d2f2f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e755c300.entry.js.map → p-544ec514.entry.js.map} +0 -0
- /package/dist/twilight/{p-445886ad.entry.js.map → p-566d369f.entry.js.map} +0 -0
- /package/dist/twilight/{p-c175787a.system.entry.js.map → p-5786e162.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5d7fff02.entry.js.map → p-63ee2845.entry.js.map} +0 -0
- /package/dist/twilight/{p-df0c4065.entry.js.map → p-68cc3edc.entry.js.map} +0 -0
- /package/dist/twilight/{p-51831df7.entry.js.map → p-6951c737.entry.js.map} +0 -0
- /package/dist/twilight/{p-9e9ec157.entry.js.map → p-69fe102d.entry.js.map} +0 -0
- /package/dist/twilight/{p-739a5124.system.entry.js.map → p-6a0239a0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4ff2bbf4.system.entry.js.map → p-6b819095.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-7586a50e.system.entry.js.map → p-78e05bb6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9063b7d7.entry.js.map → p-7b775a0a.entry.js.map} +0 -0
- /package/dist/twilight/{p-3277f8a3.entry.js.map → p-7e753e64.entry.js.map} +0 -0
- /package/dist/twilight/{p-68078462.system.entry.js.map → p-7ed15e04.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-65939c80.system.entry.js.map → p-85c72e65.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-63b3ea2f.entry.js.map → p-86c566a4.entry.js.map} +0 -0
- /package/dist/twilight/{p-5a7bad68.system.entry.js.map → p-8939d913.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-698a3693.entry.js.map → p-9d1baca1.entry.js.map} +0 -0
- /package/dist/twilight/{p-7aefaf33.entry.js.map → p-a08e9a73.entry.js.map} +0 -0
- /package/dist/twilight/{p-f02d527f.system.entry.js.map → p-a181358b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-20faf731.system.entry.js.map → p-b00e784a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-e7901c9d.system.entry.js.map → p-b235449d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-81b6008d.system.entry.js.map → p-b7d02240.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9a63eaf0.entry.js.map → p-c2bf57ee.entry.js.map} +0 -0
- /package/dist/twilight/{p-ab55d416.entry.js.map → p-cd254480.entry.js.map} +0 -0
- /package/dist/twilight/{p-e4b88ce5.system.entry.js.map → p-cd531bea.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5087750a.system.entry.js.map → p-ce7bc5bd.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2c9efa34.system.entry.js.map → p-ce7cead8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-38b6b862.entry.js.map → p-cec3c889.entry.js.map} +0 -0
- /package/dist/twilight/{p-8d0c6a10.entry.js.map → p-cf3ead3a.entry.js.map} +0 -0
- /package/dist/twilight/{p-6ea49b56.entry.js.map → p-cf8b52bf.entry.js.map} +0 -0
- /package/dist/twilight/{p-0f1a8a47.entry.js.map → p-d5fae15b.entry.js.map} +0 -0
- /package/dist/twilight/{p-77007b51.system.entry.js.map → p-d6e8290c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9ae63c85.entry.js.map → p-dba83eaf.entry.js.map} +0 -0
- /package/dist/twilight/{p-d75b04f0.entry.js.map → p-e37d593d.entry.js.map} +0 -0
- /package/dist/twilight/{p-39744d46.entry.js.map → p-ef23379f.entry.js.map} +0 -0
- /package/dist/twilight/{p-1344b38f.entry.js.map → p-ef344e7e.entry.js.map} +0 -0
- /package/dist/twilight/{p-94056702.entry.js.map → p-f75b098c.entry.js.map} +0 -0
- /package/dist/twilight/{p-3363633a.system.entry.js.map → p-f89d5c9a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-58af07d1.system.entry.js.map → p-ff4273e3.system.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-CnsQrhjY.system.js","sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items?.reduce((count: number, { quantity }) => count + quantity, 0) ?? 0 : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_spend}>\n {this.getCheckPointView(discount, index)}\n </div>\n ))}\n </div>\n </Host>\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAEA,IAAY,YAIX;YAJD,CAAA,UAAY,YAAY,EAAA;YACpB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;YACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;YACf,IAAA,YAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;YACjC,CAAC,EAJW,YAAY,KAAZ,YAAY,GAIvB,EAAA,CAAA,CAAA;YAED,IAAY,SAGX;YAHD,CAAA,UAAY,SAAS,EAAA;YACjB,IAAA,SAAA,CAAA,eAAA,CAAA,GAAA,gBAAgC;YAChC,IAAA,SAAA,CAAA,kBAAA,CAAA,GAAA,cAAiC;YACrC,CAAC,EAHW,SAAS,KAAT,SAAS,GAGpB,EAAA,CAAA,CAAA;;YCXD,MAAM,wBAAwB,GAAG,sBAAsB;;kBCc1C,qBAAqB,sCAAA,MAAA;YAJlC,IAAA,WAAA,CAAA,OAAA,EAAA;;YAMa,QAAA,IAAK,CAAA,KAAA,GAAU,IAAI;YACnB,QAAA,IAAQ,CAAA,QAAA,GAAmD,EAAE;YAC7D,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;YACjB,QAAA,IAAS,CAAA,SAAA,GAAG,IAAI;YA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OAAO,IAAI;oBAChC,IAAI,IAAI,CAAC,SAAS;YAAE,YAAA,OAAO,IAAI,CAAC,sBAAsB,EAAE;oBACxD,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,YAAA,OAAO,IAAI;YAE5B,QAAA,OAAO,CAAC,CAAA,IAAI,EAAC,EAAA,KAAK,EAAC,+BAA+B,EAAA,EAC9C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,mCAAmC,EAAA,EAC1C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,2BAA2B,EAAA,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAO,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAA,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,OAAE,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EAAA,CAAG,CACtD,GAAG,IAAI,CACX,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,wCAAwC,EAC9C,EAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,MAC9C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EACvD,EAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CACtC,CACT,CAAC,CACA,CACH;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-UIAI3aBI.system.js","sources":["src/components/salla-conditional-offer/interfaces.ts","src/components/salla-conditional-offer/salla-conditional-offer.scss?tag=salla-conditional-offer","src/components/salla-conditional-offer/salla-conditional-offer.tsx"],"sourcesContent":["import type { Product } from \"@salla.sa/twilight/types/common\";\n\nexport enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n FREE_PRODUCT = \"free_product\",\n}\n\nexport enum OfferType {\n PRODUCT_COUNT = \"products_count\",\n PRODUCT_PURCHASE = \"order_amount\",\n}\n\nexport interface Discount {\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n max_discount?: number;\n}\n\nexport interface OfferDetails {\n based_on?: OfferType;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: OfferDetails | null;\n}\n\n\nexport interface ProductDetail {\n id?: number;\n sku?: string;\n name?: string;\n description?: string;\n url?: string;\n promotion_title?: null;\n subtitle?: null;\n type?: string;\n status?: string;\n price?: number;\n base_currency_price?: BaseCurrencyPrice;\n sale_price?: number;\n regular_price?: number;\n starting_price?: null;\n quantity?: null;\n max_quantity?: number;\n discount_ends?: null;\n is_taxable?: boolean;\n has_read_more?: boolean;\n can_add_note?: boolean;\n can_show_remained_quantity?: boolean;\n can_upload_file?: boolean;\n has_custom_form?: boolean;\n has_metadata?: boolean;\n is_on_sale?: boolean;\n is_hidden_quantity?: boolean;\n is_available?: boolean;\n is_out_of_stock?: boolean;\n is_require_shipping?: boolean;\n weight?: null;\n calories?: null;\n image?: Image;\n currency?: string;\n}\n\nexport interface BaseCurrencyPrice {\n currency?: string;\n amount?: number;\n}\n\nexport interface Image {\n url?: string;\n alt?: string;\n}\n\nexport interface UpdatedCart {\n items: Array<Product>;\n sub_total: number;\n}\n",":host {\n display: block;\n}","import { Component, Host, State, h } from \"@stencil/core\";\nimport {\n type Discount,\n DiscountType,\n type Offer,\n OfferType,\n type UpdatedCart,\n} from \"./interfaces\";\nimport type { Product } from \"@salla.sa/twilight/types/common\";\n\n@Component({\n tag: \"salla-conditional-offer\",\n styleUrl: \"salla-conditional-offer.scss\",\n})\nexport class SallaConditionalOffer {\n\n @State() offer: Offer = null;\n @State() products: Record<string, Pick<Product, 'image' | 'url'>> = {}\n @State() isLoading = false\n @State() canRender = true\n\n componentWillLoad() {\n salla.onReady().then(() => {\n if (!salla.config.get('store.features')?.includes('conditional-offer') || (salla.storage.get(\"cart\") !== '' && !salla.storage.get(\"cart\")?.summary?.count)) {\n throw new Error('feature or cart object does not existed');\n }\n })\n .then(() => salla.api.cart.offers())\n .then(({ data }: { data: Offer[] }) => {\n this.offer = data.find(offer => offer.type === \"conditional\")\n\n if (!this.offer) {\n this.canRender = false\n return;\n }\n\n this.isLoading = true\n this.offer.details.discounts.unshift(({ value: 0, min_spend: 0 }))\n return this.updateInitialOfferValue()\n }).then(() => {\n if (!this.offer) return;\n return this.getProducts()\n }).then(() => {\n if (!this.offer) return;\n salla.event.on(\"cart::updated\", (updatedCart: UpdatedCart) => this.updateOfferValues(updatedCart))\n })\n .catch(error => {\n this.canRender = false\n salla.logger.warn('salla-conditional-offer:: ', error)\n }).finally(() => {\n this.isLoading = false\n })\n\n }\n\n private getProducts() {\n const freeProductIDs = this.offer.details.discounts.filter(({ type }) => type === DiscountType.FREE_PRODUCT).map(({ value }) => value)\n if (freeProductIDs.length > 0) {\n return salla.product.fetch({ source: 'selected', source_value: freeProductIDs }).then(({ data }: { data: Array<Product> }) => {\n data.forEach(({ id, url, image }) => {\n this.products[id] = { url, image }\n })\n })\n }\n }\n\n private updateInitialOfferValue() {\n return salla.api.cart.details().then(({ data: { cart } }: { data: { cart: UpdatedCart } }) => this.updateOfferValues(cart))\n }\n\n private updateOfferValues({ items, sub_total }: UpdatedCart) {\n const current_value = this.offer.details.based_on === OfferType.PRODUCT_COUNT ? items?.reduce((count: number, { quantity }) => count + quantity, 0) ?? 0 : sub_total\n //we need to assign the offer object a new reference to trigger re-rendering\n this.offer = {\n ...this.offer, details: {\n ...this.offer?.details, current_value,\n }\n }\n return this.offer\n }\n\n private getCheckpointContent(discount: Discount) {\n\n if (discount.type === DiscountType.PERCENTAGE) return `${discount.value}%`\n\n if (discount.type === DiscountType.FIXED) return salla.money(discount.value)\n\n if (discount.type !== DiscountType.FREE_PRODUCT) {\n salla.logger.error(`salla-conditional-offer:: unexpected type (${discount.type})!`);\n return \"\";\n }\n\n const productItem = this.products[discount.value]\n\n if (!productItem) {\n salla.logger.error(`salla-conditional-offer:: there is no product with id (${discount.value})!`);\n return \"\";\n }\n\n return <a class=\"s-conditional-offer-product-link\" href={productItem.url} >\n <img\n class=\"s-conditional-offer-checkpoint-image-content\"\n loading=\"lazy\"\n decoding=\"async\"\n alt={productItem?.image?.alt || \"\"}\n src={productItem?.image?.url} />\n </a>\n }\n\n private getOfferType(discount: Discount): string {\n const basedOn = this.offer.details?.based_on;\n if (basedOn === OfferType.PRODUCT_COUNT) return salla.lang.choice(\"blocks.header.products_count\", discount.min_spend);\n if (basedOn === OfferType.PRODUCT_PURCHASE) return salla.money(discount.min_spend);\n\n salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${basedOn}`);\n return `${discount.min_spend}`;\n }\n\n private clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max));\n }\n\n private mapValueRanges(value: number, initialMinRange: number, initialMaxRange: number, newMinRange: number, newMaxRange: number) {\n\n const newRange = ((value - initialMinRange) * (newMaxRange - newMinRange)) / (initialMaxRange - initialMinRange) + newMinRange;\n\n if (newRange === Number.POSITIVE_INFINITY) return 100\n\n if (newRange === Number.NEGATIVE_INFINITY) return 0\n\n return this.clamp(newRange, 0, 100)\n }\n\n private getCheckPointView(discount: Discount, index: number) {\n const checkpointIndex = this.offer.details.discounts.findIndex(({ min_spend }) => min_spend === discount.min_spend);\n const previousCheckpointValue = this.offer.details.discounts[checkpointIndex - 1]?.min_spend ?? 0;\n const progressPercentage = this.mapValueRanges(this.offer.details.current_value, previousCheckpointValue, discount.min_spend, 0, 100);\n const isActive = discount.min_spend <= this.offer.details.current_value;\n\n return (\n <div class=\"s-conditional-offer-checkpoint-container\">\n {index > 0 ? [\n <div key=\"progress-line\" class=\"s-conditional-offer-progress-line-container\">\n <div class=\"s-conditional-offer-progress-line-inactive\" />\n <div class=\"s-conditional-offer-progress-line-active\" style={{ width: `${progressPercentage}%` }} />\n </div>,\n <div key=\"checkpoint\" class={`s-conditional-offer-checkpoint ${isActive ? \"s-conditional-offer-active-checkpoint\" : \"\"}`} >\n <div class={`s-conditional-offer-item-avatar-content ${isActive ? \"active\" : \"\"}`} innerHTML={this.products && this.getCheckpointContent(discount)}>\n </div>\n <div class={`s-conditional-offer-checkpoint-label ${isActive ? \"active\" : \"\"}`} innerHTML={this.getOfferType(discount)} />\n\n </div>\n ] :\n <div key=\"label\" class={{ \"s-conditional-offer-checkpoint-label\": true, \"first-checkpoint\": index === 0, active: isActive }} innerHTML={this.getOfferType(discount)} />\n }\n </div>\n );\n }\n\n private getLoadingSkeletonView() {\n return <Host class=\"s-conditional-offer-container\" >\n <div class=\"s-conditional-offer-skeleton-inner-container\">\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"30%\" />\n </div>\n\n <div class=\"s-conditional-offer-skeleton-subtitle\">\n <salla-skeleton height=\"16px\" width=\"35%\" />\n </div>\n <div class=\"s-conditional-offer-skeleton-checkpoints-wrapper\">\n {Array(3).fill(null).map(() => (\n [<salla-skeleton key=\"checkpoint-line\" height=\"8px\" />,\n <div key=\"checkpoint\">\n <salla-skeleton height=\"60px\" width=\"60px\" type=\"circle\" />\n </div>]\n ))}\n </div>\n\n </div>\n </Host>\n }\n\n render() {\n if (!this.canRender) return null\n if (this.isLoading) return this.getLoadingSkeletonView()\n if (!this.offer) return null\n\n return <Host class=\"s-conditional-offer-container\">\n <div class=\"s-conditional-offer-title-wrapper\">\n <div class=\"s-conditional-offer-title\">{this.offer.title}</div>\n {this.offer.description ? <div class=\"s-conditional-offer-subtitle\">\n {this.offer.description} <i class=\"sicon-information\" />\n </div> : null}\n </div>\n <div class=\"s-conditional-offer-progress-container\">\n {this.offer.details.discounts.map((discount, index) => (\n <div class={{ \"flex-1\": index > 0 }} key={discount.min_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O,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,8BAA8B,EAAA,EAC9D,IAAI,CAAC,KAAK,CAAC,WAAW,OAAE,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EAAA,CAAG,CACtD,GAAG,IAAI,CACX,EACN,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,wCAAwC,EAC9C,EAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,MAC9C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EACvD,EAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CACtC,CACT,CAAC,CACA,CACH;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-YeDOL4oD.system.js","sources":["src/components/salla-loyalty/salla-loyalty-prize-item.scss?tag=salla-loyalty-prize-item","src/components/salla-loyalty/salla-loyalty-prize-item.tsx"],"sourcesContent":["\nsalla-loyalty-prize-item:hover {\n box-shadow: 0 5px 15px 1px rgb(0 0 0 / 4%)!important;\n}\n\n","import { Component, h, Prop, Host, Event, EventEmitter } from '@stencil/core';\nimport { Item } from \"./loyalty-schema\"\n\n\n@Component({\n tag: 'salla-loyalty-prize-item',\n styleUrl: 'salla-loyalty-prize-item.scss',\n})\nexport class SallaLoyaltyPrizeItem {\n\n /**\n * Prize item to be displayed in this component.\n */\n @Prop() item: Item;\n\n /**\n * Event emmited when the user select this item.\n */\n @Event() prizeItemSelected: EventEmitter<Item>\n\n onPrizeItemClick() {\n this.prizeItemSelected.emit(this.item)\n }\n\n render() {\n return (\n <Host>\n <div onClick={this.onPrizeItemClick.bind(this)}>\n <img class=\"s-loyalty-prize-item-image\" src={this.item.image} alt={this.item.name} />\n <div class=\"s-loyalty-prize-item-title\">{this.item.name}</div>\n <div class=\"s-loyalty-prize-item-subtitle\">{this.item.description}</div>\n <div class=\"s-loyalty-prize-item-points\">{this.item.cost_points} Points</div>\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAAA,MAAM,wBAAwB,GAAG,2JAA2J;;YCQ/K,qBAAqB,uCAAA,MAAA;;;;;UAY9B,gBAAgB,GAAA;cACZ,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;;UAG1C,MAAM,GAAA;MACF,QAAA,QACI,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACD,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA,EAC1C,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,4BAA4B,EAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAI,CAAA,EACrF,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,4BAA4B,EAAA,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAO,EAC9D,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,+BAA+B,EAAA,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAO,EACxE,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,6BAA6B,EAAA,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,YAAc,CAC3E,CACH;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-_kxfhicb.system.js","sources":["src/components/salla-apps-icons/salla-apps-icons.scss?tag=salla-apps-icons","src/components/salla-apps-icons/salla-apps-icons.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot app - Replaces app item, has replaceable props `{icon}`, `{name}`.\n */\n@Component({\n tag: 'salla-apps-icons',\n styleUrl: 'salla-apps-icons.scss',\n})\nexport class SallaAppsIcons {\n constructor() {\n this.appSlot = this.host.querySelector('[slot=\"app\"]')?.innerHTML || `<img alt={name} src={icon} />`;\n salla.onReady(() => {\n this.apps = salla.config.get('store.apps');\n });\n\n salla.lang.onLoaded(() => {\n this.appsTitle = salla.lang.get('blocks.footer.download_apps');\n });\n }\n private readonly appSlot: string;\n @Element() host: HTMLElement;\n @State() apps = salla.config.get('store.apps');\n\n /**\n * Flag to show or hide title.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * The title to display.\n */\n @Prop() appsTitle: string;\n\n /**\n * Display flag to horizontal/vertical.\n */\n @Prop() vertical: boolean;\n\n private getAppsArray() {\n return Object.entries(this.apps)\n .map(([name, value]) => ({ name, value }));\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n render() {\n const appsArray = this.getAppsArray();\n if (Array.isArray(appsArray) && !appsArray.length) {\n return;\n }\n return (\n <Host class=\"s-apps-icons\">\n {!this.hideTitle && <h3>{this.appsTitle}</h3>}\n <div class={{\"s-apps-icons-list\": true, \"vertical\": this.vertical}}>\n {appsArray.map((app, index) => (\n <a key={index} href={app.value as string} rel=\"noreferrer\" target=\"_blank\" class=\"s-apps-icons-item\" id=\"app-slot\" innerHTML={this.appSlot\n .replace(/\\{icon\\}/g, salla.url.cdn(`images/${app.name}.png`))\n .replace(/\\{name\\}/g, app.name)}>\n </a>\n ))}\n </div>\n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AAK,EAAC,cAAc,EAAA,EACrB,CAAC,IAAI,CAAC,SAAS,IAAI,cAAK,IAAI,CAAC,SAAS,CAAM,EAC7C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAC,mBAAmB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAC,IAC/D,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,MACvB,CAAG,CAAA,GAAA,EAAA,EAAA,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,KAAe,EAAE,GAAG,EAAC,YAAY,EAAC,MAAM,EAAC,QAAQ,EAAC,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAC,UAAU,EAAC,SAAS,EAAE,IAAI,CAAC;MACjI,iBAAA,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,IAAI,CAAA,IAAA,CAAM,CAAC;MAC5D,iBAAA,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA,CAC7B,CACL,CAAC,CACE,CACH;;UAGX,kBAAkB,GAAA;;MAChB,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,EAAE;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as e,g as o}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as e,g as o}from"./p-iZNAXsJF.js";const i='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;-webkit-transform:translateX(-39%);transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){-webkit-transform:translateX(-72%);transform:translateX(-72%)}';const s=class{constructor(e){t(this,e);this.show=false;this.targetElement=null}handleMouseOver(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=true}}handleMouseOut(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=false}}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){return e("div",{key:"87a485eeb144377502782b6a7ac61417349423e2",class:"s-tooltip-container"},e("slot",{key:"8329e929fce52cd2ef4f9258548770576e67ee96"}),this.show&&e("div",{key:"18f9cd55110713d0b472601dc0a9ef20dd31af19",class:"s-tooltip-item"},this.text))}get el(){return o(this)}};s.style=i;export{s as salla_tooltip};
|
|
5
|
+
//# sourceMappingURL=p-a08e9a73.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,a,r,e){function l(t){return t instanceof r?t:new r((function(a){a(t)}))}return new(r||(r=Promise))((function(r,s){function o(t){try{i(e.next(t))}catch(t){s(t)}}function n(t){try{i(e["throw"](t))}catch(t){s(t)}}function i(t){t.done?r(t.value):l(t.value).then(o,n)}i((e=e.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,l,s,o;return o={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function n(t){return function(a){return i([t,a])}}function i(n){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,n[0]&&(r=0)),r)try{if(e=1,l&&(s=n[0]&2?l["return"]:n[0]?l["throw"]||((s=l["return"])&&s.call(l),0):l.next)&&!(s=s.call(l,n[1])).done)return s;if(l=0,s)n=[n[0]&2,s.value];switch(n[0]){case 0:case 1:s=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;l=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(s=r.trys,s=s.length>0&&s[s.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!s||n[1]>s[0]&&n[1]<s[3])){r.label=n[1];break}if(n[0]===6&&r.label<s[1]){r.label=s[1];s=n;break}if(s&&r.label<s[2]){r.label=s[2];r.ops.push(n);break}if(s[2])r.ops.pop();r.trys.pop();continue}n=a.call(t,r)}catch(t){n=[6,t];l=0}finally{e=s=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,a,r){if(r||arguments.length===2)for(var e=0,l=a.length,s;e<l;e++){if(s||!(e in a)){if(!s)s=Array.prototype.slice.call(a,0,e);s[e]=a[e]}}return t.concat(s||Array.prototype.slice.call(a))};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-BX7FZkqj.system.js","./p-Ik1kuM1-.system.js"],(function(t){"use strict";var a,r,e,l;return{setters:[function(t){a=t.r;r=t.h;e=t.H},function(t){l=t.G}],execute:function(){var s="";var o=function(t){if(!t)return"";return new Date(Number(t)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})};var n=function(t){if(!t)return"";try{var a=t.toLowerCase();var r=salla.lang.get("pages.loyalty_program.".concat(a));return r==="pages.loyalty_program.".concat(a)?t:r}catch(a){return t}};var i=t("salla_loyalty_program",function(){function t(t){var r=this;a(this,t);this.loyaltyPointsArray=[];this.isLoadingLoyalty=false;this.nextPageUrlLoyalty="";this.handleClick=function(){r.loadMoreLoyaltyPoints()}}t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){t.loadLoyaltyPoints()}))};t.prototype.loadLoyaltyPoints=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,r;return __generator(this,(function(e){switch(e.label){case 0:this.isLoadingLoyalty=true;e.label=1;case 1:e.trys.push([1,3,4,5]);t="/balance/points?page=1";return[4,salla.api.request(t)];case 2:a=e.sent();this.loyaltyPointsArray=a.data;this.nextPageUrlLoyalty=a.cursor.next;return[3,5];case 3:r=e.sent();console.error("Error loading loyalty points transactions",r);return[3,5];case 4:this.isLoadingLoyalty=false;return[7];case 5:return[2]}}))}))};t.prototype.loadMoreLoyaltyPoints=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,r;return __generator(this,(function(e){switch(e.label){case 0:if(!this.nextPageUrlLoyalty)return[2];this.isLoadingLoyalty=true;e.label=1;case 1:e.trys.push([1,3,4,5]);return[4,salla.api.request(this.nextPageUrlLoyalty)];case 2:a=e.sent();this.loyaltyPointsArray=__spreadArray(__spreadArray([],this.loyaltyPointsArray,true),a.data,true);this.nextPageUrlLoyalty=((t=a.cursor)===null||t===void 0?void 0:t.next)||"";return[3,5];case 3:r=e.sent();console.error("Error loading more loyalty points",r);return[3,5];case 4:this.isLoadingLoyalty=false;return[7];case 5:return[2]}}))}))};t.prototype.render=function(){return r(e,{key:"985386d18096b99ef6114a6e21363900c5dab374"},r("div",{key:"67bb4fceebc5ef047cd3b0ee5b94297e4c9d9d17"},this.isLoadingLoyalty?r("salla-loading",null):r("div",null,this.loyaltyPointsArray.length>0?r("div",null,r("table",{class:"s-loyalty-program-table"},r("thead",{class:"s-loyalty-program-table-head"},r("tr",{class:"s-loyalty-program-table-head-tr"},r("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.points")),r("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.date")),r("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),r("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.note")),r("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.status")))),r("tbody",{class:"s-loyalty-program-table-tbody"},this.loyaltyPointsArray.map((function(t){return r("tr",{class:"s-loyalty-program-table-tbody-tr"},r("td",{class:"s-loyalty-program-table-tbody-tr-td"},(t===null||t===void 0?void 0:t.type)==="plus"?"+":"",(t===null||t===void 0?void 0:t.points)||""," ",salla.lang.get("pages.loyalty_program.point")),r("td",{class:"s-loyalty-program-table-tbody-tr-td"},o((t===null||t===void 0?void 0:t.created_at)?Number(t.created_at)*1e3:undefined)),r("td",{class:"s-loyalty-program-table-tbody-tr-td"},o(t===null||t===void 0?void 0:t.points_expire_date)),r("td",{class:"s-loyalty-program-table-tbody-tr-td"},n(t===null||t===void 0?void 0:t.key)),r("td",{class:"s-loyalty-program-table-tbody-tr-td"},n(t===null||t===void 0?void 0:t.status_key)))})))),r("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrlLoyalty&&r("salla-button",{onClick:this.handleClick,loading:this.isLoadingLoyalty},salla.lang.get("common.elements.load_more")))):r("div",null,r("div",{class:"s-loyalty-program-table-empty-state"},r("span",{innerHTML:l}),r("div",{class:"s-loyalty-program-table-placeholder-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_title")),r("div",{class:"s-loyalty-program-table-placeholder-sub-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_sub_title")))))))};return t}());i.style=s}}}));
|
|
5
|
+
//# sourceMappingURL=p-a181358b.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,s,e,n){function i(t){return t instanceof e?t:new e((function(s){s(t)}))}return new(e||(e=Promise))((function(e,r){function c(t){try{a(n.next(t))}catch(t){r(t)}}function o(t){try{a(n["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):i(t.value).then(c,o)}a((n=n.apply(t,s||[])).next())}))};var __generator=this&&this.__generator||function(t,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,c;return c={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function o(t){return function(s){return a([t,s])}}function a(o){if(n)throw new TypeError("Generator is already executing.");while(c&&(c=0,o[0]&&(e=0)),e)try{if(n=1,i&&(r=o[0]&2?i["return"]:o[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;if(i=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;i=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1];r=o;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(o);break}if(r[2])e.ops.pop();e.trys.pop();continue}o=s.call(t,e)}catch(t){o=[6,t];i=0}finally{n=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-BX7FZkqj.system.js","./p-BAa1Mtv9.system.js","./p-Ik1kuM1-.system.js"],(function(t){"use strict";var s,e,n,i,r;return{setters:[function(t){s=t.r;e=t.h},function(t){n=t.S;i=t.A},function(t){r=t.G}],execute:function(){var c='\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>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></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>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n';var a='\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>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n';var l=":host{display:block}";var f=t("salla_cart_item_offers",function(){function t(t){var e=this;s(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:a,GiftIcon:r,FireIcon:o,SpecialDiscountIcon:n,TagMoneyIcon:c};this.visibleOffersCount=3;this.handleCartItemUpdated=function(t){var s=t.data.cart.items.find((function(t){return t.id===e.itemId}));if((s===null||s===void 0?void 0:s.id)===e.itemId){e.internalQuantity=s.quantity;e.internalOffers=s.detailed_offers||[];e.internalProductPrice=s.product_price}};this.toggleShowAll=function(){e.showAll=!e.showAll}}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,Salla.onReady()];case 1:s.sent();return[4,salla.lang.onLoaded((function(){t.freeLabel=salla.lang.get("common.elements.freeExclam");t.receivedOffer=salla.lang.get("pages.cart.received_offer");t.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");t.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}))];case 2:s.sent();this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice;return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;salla.event.on("cart::item.updated",(function(s){return t.handleCartItemUpdated(s)}))};t.prototype.parseOffers=function(t){try{if(typeof t!=="string"){console.warn("Offers is not a string. Returning as-is.",t);return Array.isArray(t)?t:[]}return JSON.parse(t||"[]")}catch(t){console.error("Failed to parse offers",t);return[]}};Object.defineProperty(t.prototype,"visibleOffers",{get:function(){return this.internalOffers.slice(0,this.visibleOffersCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hiddenOffers",{get:function(){return this.internalOffers.slice(this.visibleOffersCount)},enumerable:false,configurable:true});t.prototype.getPaidQty=function(t,s){return t-s.free_quantity};t.prototype.renderOffer=function(t,s){var n=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&n>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(n)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))};t.prototype.render=function(){var t=this;var s,n;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return e("div",{class:"s-cart-item-offers-container",id:"offers_list_".concat(this.itemId)},this.visibleOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)})),((n=this.internalOffers)===null||n===void 0?void 0:n.length)>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:i,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:"offers_".concat(this.itemId)},this.hiddenOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)}))))};return t}());f.style=l}}}));
|
|
5
|
+
//# sourceMappingURL=p-b00e784a.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-BX7FZkqj.system.js","./p-CmE8W9Xg.system.js","./p-Be8TJdpm.system.js"],(function(t){"use strict";var n,s,e,c,i,a;return{setters:[function(t){n=t.r;s=t.h;e=t.H;c=t.g},function(t){i=t.w},function(t){a=t.M}],execute:function(){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>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 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>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 r='\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';var h=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var u=t("salla_contacts",function(){function t(t){var s=this;n(this,t);var e;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:o,whatsapp:i,phone:l,telegram:r,email:a};this.contactSlot=((e=this.host.querySelector('[slot="contact"]'))===null||e===void 0?void 0:e.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){s.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){s.contactsTitle=s.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var n=t[0],s=t[1];return s!==""})).map((function(t){var n=t[0],s=t[1];return{type:n,value:s}}))};t.prototype.getContactLink=function(t){var n=this.contacts[t];switch(t){case"phone":case"mobile":return"tel:".concat(n);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(n);case"telegram":return n.startsWith("https://t.me/")?n:"https://t.me/".concat(n);default:return n}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var n=this.getContactsArray();if(!n||n.length==0){return}if(this.isHeader){return s(e,{class:"s-contacts s-contacts-header"},n.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(n,e){return s("a",{href:t.getContactLink(n.type),key:e,class:"s-contacts-topnav-link"},n.type==="email"?n.value:[s("span",null,t.contactsTitle,": "),s("a",{class:"unicode",href:t.iconsList[n.type]},n.value)])})))}return s(e,{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}},n.map((function(n,e){return s("div",{key:e,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(n.type)).replace(/\{value\}/g,n.value.toString()).replace(/\{link\}/g,t.getContactLink(n.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return c(this)},enumerable:false,configurable:true});return t}());u.style=h}}}));
|
|
5
|
+
//# sourceMappingURL=p-b235449d.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(r,t,e,i){function n(r){return r instanceof e?r:new e((function(t){t(r)}))}return new(e||(e=Promise))((function(e,a){function s(r){try{o(i.next(r))}catch(r){a(r)}}function u(r){try{o(i["throw"](r))}catch(r){a(r)}}function o(r){r.done?e(r.value):n(r.value).then(s,u)}o((i=i.apply(r,t||[])).next())}))};var __generator=this&&this.__generator||function(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(r){return function(t){return o([r,t])}}function o(u){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(i=1,n&&(a=u[0]&2?n["return"]:u[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;if(n=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;n=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1];a=u;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(u);break}if(a[2])e.ops.pop();e.trys.pop();continue}u=t.call(r,e)}catch(r){u=[6,r];n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var i=0,n=t.length,a;i<n;i++){if(a||!(i in t)){if(!a)a=Array.prototype.slice.call(t,0,i);a[i]=t[i]}}return r.concat(a||Array.prototype.slice.call(t))};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-BTqyH9zP.system.js","./p-B8FGqfEh.system.js","./p-CSGkUch3.system.js","./p-CLqFzsVe.system.js"],(function(r){"use strict";var t,e,i,n,a,s,u,o,f;return{setters:[function(r){t=r.a;e=r.d;i=r.e;n=r.f;a=r.r;s=r.h;u=r.g},function(r){o=r.S},function(r){f=r.H},null],execute:function(){var l;var c;function v(){if(c)return l;c=1;var r=t();var e=function(){return r.Date.now()};l=e;return l}var h;var d;function p(){if(d)return h;d=1;var r=/\s/;function t(t){var e=t.length;while(e--&&r.test(t.charAt(e))){}return e}h=t;return h}var g;var w;function y(){if(w)return g;w=1;var r=p();var t=/^\s+/;function e(e){return e?e.slice(0,r(e)+1).replace(t,""):e}g=e;return g}var m;var b;function _(){if(b)return m;b=1;var r=y(),t=e(),n=i();var a=0/0;var s=/^[-+]0x[0-9a-f]+$/i;var u=/^0b[01]+$/i;var o=/^0o[0-7]+$/i;var f=parseInt;function l(e){if(typeof e=="number"){return e}if(n(e)){return a}if(t(e)){var i=typeof e.valueOf=="function"?e.valueOf():e;e=t(i)?i+"":i}if(typeof e!="string"){return e===0?e:+e}e=r(e);var l=u.test(e);return l||o.test(e)?f(e.slice(2),l?2:8):s.test(e)?a:+e}m=l;return m}var k;var T;function A(){if(T)return k;T=1;var r=e(),t=v(),i=_();var n="Expected a function";var a=Math.max,s=Math.min;function u(e,u,o){var f,l,c,v,h,d,p=0,g=false,w=false,y=true;if(typeof e!="function"){throw new TypeError(n)}u=i(u)||0;if(r(o)){g=!!o.leading;w="maxWait"in o;c=w?a(i(o.maxWait)||0,u):c;y="trailing"in o?!!o.trailing:y}function m(r){var t=f,i=l;f=l=undefined;p=r;v=e.apply(i,t);return v}function b(r){p=r;h=setTimeout(T,u);return g?m(r):v}function _(r){var t=r-d,e=r-p,i=u-t;return w?s(i,c-e):i}function k(r){var t=r-d,e=r-p;return d===undefined||t>=u||t<0||w&&e>=c}function T(){var r=t();if(k(r)){return A(r)}h=setTimeout(T,_(r))}function A(r){h=undefined;if(y&&f){return m(r)}f=l=undefined;return v}function E(){if(h!==undefined){clearTimeout(h)}p=0;f=d=l=h=undefined}function x(){return h===undefined?v:A(t())}function S(){var r=t(),e=k(r);f=arguments;l=this;d=r;if(e){if(h===undefined){return b(d)}if(w){clearTimeout(h);h=setTimeout(T,u);return m(d)}}if(h===undefined){h=setTimeout(T,u)}return v}S.cancel=E;S.flush=x;return S}k=u;return k}var E;var x;function S(){if(x)return E;x=1;var r=A(),t=e();var i="Expected a function";function n(e,n,a){var s=true,u=true;if(typeof e!="function"){throw new TypeError(i)}if(t(a)){s="leading"in a?!!a.leading:s;u="trailing"in a?!!a.trailing:u}return r(e,n,{leading:s,maxWait:n,trailing:u})}E=n;return E}var M=S();var j=n(M);var C=function(){function r(r){var t=this;this.grid=r;this.create=function(){t.mutationObserver.observe(t.grid,{childList:true});for(var r=0,e=Array.from(t.grid.children);r<e.length;r++){var i=e[r];t.resizeObserver.observe(i)}};this.onContainerMutation=function(r){var e=r.flatMap((function(r){return Array.from(r.removedNodes)}));var i=r.flatMap((function(r){return Array.from(r.addedNodes)}));for(var n=0,a=e;n<a.length;n++){var s=a[n];if(s instanceof Element){t.resizeObserver.unobserve(s)}}for(var u=0,o=i;u<o.length;u++){var s=o[u];if(s instanceof Element){t.resizeObserver.observe(s)}}if(e.length>0&&i.length===0){t.update()}};this.onChildrenResize=function(r){var e=r.filter((function(r){return r.target.parentElement!==null}));if(e.length>0){t.update()}};this.update=j((function(){var r=window.getComputedStyle(t.grid);if(r.getPropertyValue("display").includes("grid")===false){t.clean();return}var e=q(t.grid);if(e.length<=1){t.clean();return}var i=Number.parseFloat(r.getPropertyValue("row-gap").trim())||0;var n=Array.from(t.grid.children);for(var a=0;a<e.length;a++){var s=n[a];s===null||s===void 0?void 0:s.style.removeProperty("margin-top")}for(var u=0;u<n.length;u++){var o=n[u-e.length];var f=n[u];if(o!==undefined&&f!==undefined){var l=o.getBoundingClientRect().bottom;f.style.removeProperty("margin-top");var c=f.getBoundingClientRect().top;if(c-i!==l){var v=Math.round((l-(c-i)+Number.EPSILON)*100)/100;f.style.setProperty("margin-top","".concat(v,"px"))}}}}),32);this.destroy=function(){t.resizeObserver.disconnect();t.mutationObserver.disconnect();t.clean()};this.clean=function(){for(var r=0,e=Array.from(t.grid.children);r<e.length;r++){var i=e[r];i.style.removeProperty("margin-top")}};this.mutationObserver=new MutationObserver(this.onContainerMutation);this.resizeObserver=new ResizeObserver(this.onChildrenResize);if(CSS.supports("grid-template-rows","masonry")===false){this.create()}}r.prototype[Symbol.dispose]=function(){this.destroy()};return r}();function q(r){var t=window.getComputedStyle(r);var e=t.getPropertyValue("grid-template-columns");return e.trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}var z=":host{display:block}";var L=r("salla_reviews_page",function(){function r(r){a(this,r);this.reviews=[];this.isLoading=false;this.pagination=null;this.sort="latest"}r.prototype.getUrlParams=function(){var r=new URLSearchParams(window.location.search);return{sort:r.get("sort")||null,page:Number.parseInt(r.get("page"))||1}};r.prototype.updateUrlParams=function(r){var t=new URL(window.location.href);for(var e=0,i=Object.entries(r);e<i.length;e++){var n=i[e],a=n[0],s=n[1];if(s){t.searchParams.set(a,s.toString())}else{t.searchParams.delete(a)}}window.history.replaceState({},"",t.toString())};r.prototype.fetchReviews=function(r,t){var e=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:t||e.page||1,sort:r||e.sort||null}})};r.prototype.initializeMasonry=function(){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(t){r=this.el.querySelector(".s-reviews-page-grid");if(!r)return[2];try{new C(r);salla.logger.info("Masonry initialized successfully")}catch(r){salla.logger.error("Masonry initialization failed:",r)}return[2]}))}))};r.prototype.animateReviewCards=function(){var r=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");f.animateItems(r)};r.prototype.initiateInfiniteScroll=function(){var r=this;var t,e,i;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){var t,e;return((e=(t=r.pagination)===null||t===void 0?void 0:t.links)===null||e===void 0?void 0:e.next)||null},history:false,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(function(){r.isLoading=true}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(t){r.pagination=t.pagination;r.reviews=__spreadArray(__spreadArray([],r.reviews,true),t.data,true);r.isLoading=false;r.updateUrlParams({page:t.pagination.current_page})}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("error",(function(t){salla.logger.error("Error loading more reviews:",t);r.isLoading=false}))};r.prototype.componentDidRender=function(){var r=this;setTimeout((function(){requestAnimationFrame(r.animateReviewCards.bind(r))}),176)};r.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var r,t,e,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,salla.onReady()];case 1:n.sent();this.langTitlesReviews=salla.lang.get("common.titles.reviews");this.langSorting=salla.lang.get("pages.categories.sorting");this.placeholderText=salla.lang.choice("pages.rating.reviews",0);this.langLoadMore=salla.lang.get("common.elements.load_more");this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc");this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc");this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc");this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");t=this.getUrlParams();return[4,this.fetchReviews(t.sort)];case 2:e=n.sent();this.sort=t.sort;this.reviews=e.data;this.pagination=e.pagination;this.langRatingReviews=salla.lang.choice("pages.rating.reviews",(r=this.pagination)===null||r===void 0?void 0:r.total);return[3,4];case 3:i=n.sent();salla.logger.error("Error loading reviews:",i);return[3,4];case 4:return[2]}}))}))};r.prototype.handleSorting=function(r){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:t=r.target.value;this.sort=t;this.updateUrlParams({sort:t,page:1});return[4,this.fetchReviews(t,1)];case 1:e=i.sent();this.reviews=e.data;this.pagination=e.pagination;return[2]}}))}))};r.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this.initializeMasonry()];case 1:r.sent();this.initiateInfiniteScroll();this.sort=this.getUrlParams().sort||"latest";this.updateUrlParams({sort:this.sort,page:1});return[2]}}))}))};r.prototype.disconnectedCallback=function(){if(this.infiniteScroll){this.infiniteScroll.destroy()}};r.prototype.renderSortingOptions=function(){var r=this;var t=[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}];return t.map((function(t){return s("option",{key:t.value,value:t.value,selected:t.value===r.sort},t.label)}))};r.prototype.render=function(){var r=this;var t,e;return s("host",{key:"2108b6bebdc8a651705e45d169fb10127c3c215e"},s("div",{key:"84972824884151462a1040bdc53c334b733cd7fb",class:"s-reviews-page-header-wrapper"},s("h2",{key:"80905de0950443f7e2b1c28d63bcb7f3fa47dc0c",class:"s-reviews-page-title"},this.langTitlesReviews,s("span",{key:"d51385e66a1dee802786b50d063501b6397ce345",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),s("div",{key:"2fc74d0b61d0377f0d14a5fd15a4d852e6850932",class:"s-reviews-page-filter-wrapper"},s("label",{key:"8d1363a2b2f6722f1c56445b5ba33a98f241b106",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),s("select",{key:"eb27d82e25fa609b25d5ca825381285c0a40cc5b",onChange:function(t){return r.handleSorting(t)},disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?s("main",{class:"s-reviews-page-grid",ref:function(t){r.wrapper=t}},this.reviews.map((function(r){return s("salla-review-card",{key:r.id,review:r})}))):s("div",{class:"s-products-list-placeholder"},s("span",{innerHTML:o}),s("p",null,this.placeholderText)),((e=(t=this.pagination)===null||t===void 0?void 0:t.links)===null||e===void 0?void 0:e.next)&&this.reviews.length?s("div",{class:"s-reviews-page-load-more-container"},s("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:function(){var t;return(t=r.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()},onKeyUp:function(){var t;return(t=r.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()}},this.langLoadMore)):null)};Object.defineProperty(r.prototype,"el",{get:function(){return u(this)},enumerable:false,configurable:true});return r}());L.style=z}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-BX7FZkqj.system.js","./p-B8FGqfEh.system.js","./p-CSGkUch3.system.js","./p-CLqFzsVe.system.js"],(function(r){"use strict";var t,e,i,n,a,s,u,o,f;return{setters:[function(r){t=r.a;e=r.d;i=r.e;n=r.f;a=r.r;s=r.h;u=r.g},function(r){o=r.S},function(r){f=r.H},null],execute:function(){var l;var c;function v(){if(c)return l;c=1;var r=t();var e=function(){return r.Date.now()};l=e;return l}var h;var d;function p(){if(d)return h;d=1;var r=/\s/;function t(t){var e=t.length;while(e--&&r.test(t.charAt(e))){}return e}h=t;return h}var g;var w;function m(){if(w)return g;w=1;var r=p();var t=/^\s+/;function e(e){return e?e.slice(0,r(e)+1).replace(t,""):e}g=e;return g}var y;var b;function _(){if(b)return y;b=1;var r=m(),t=e(),n=i();var a=0/0;var s=/^[-+]0x[0-9a-f]+$/i;var u=/^0b[01]+$/i;var o=/^0o[0-7]+$/i;var f=parseInt;function l(e){if(typeof e=="number"){return e}if(n(e)){return a}if(t(e)){var i=typeof e.valueOf=="function"?e.valueOf():e;e=t(i)?i+"":i}if(typeof e!="string"){return e===0?e:+e}e=r(e);var l=u.test(e);return l||o.test(e)?f(e.slice(2),l?2:8):s.test(e)?a:+e}y=l;return y}var k;var T;function A(){if(T)return k;T=1;var r=e(),t=v(),i=_();var n="Expected a function";var a=Math.max,s=Math.min;function u(e,u,o){var f,l,c,v,h,d,p=0,g=false,w=false,m=true;if(typeof e!="function"){throw new TypeError(n)}u=i(u)||0;if(r(o)){g=!!o.leading;w="maxWait"in o;c=w?a(i(o.maxWait)||0,u):c;m="trailing"in o?!!o.trailing:m}function y(r){var t=f,i=l;f=l=undefined;p=r;v=e.apply(i,t);return v}function b(r){p=r;h=setTimeout(T,u);return g?y(r):v}function _(r){var t=r-d,e=r-p,i=u-t;return w?s(i,c-e):i}function k(r){var t=r-d,e=r-p;return d===undefined||t>=u||t<0||w&&e>=c}function T(){var r=t();if(k(r)){return A(r)}h=setTimeout(T,_(r))}function A(r){h=undefined;if(m&&f){return y(r)}f=l=undefined;return v}function E(){if(h!==undefined){clearTimeout(h)}p=0;f=d=l=h=undefined}function x(){return h===undefined?v:A(t())}function S(){var r=t(),e=k(r);f=arguments;l=this;d=r;if(e){if(h===undefined){return b(d)}if(w){clearTimeout(h);h=setTimeout(T,u);return y(d)}}if(h===undefined){h=setTimeout(T,u)}return v}S.cancel=E;S.flush=x;return S}k=u;return k}var E;var x;function S(){if(x)return E;x=1;var r=A(),t=e();var i="Expected a function";function n(e,n,a){var s=true,u=true;if(typeof e!="function"){throw new TypeError(i)}if(t(a)){s="leading"in a?!!a.leading:s;u="trailing"in a?!!a.trailing:u}return r(e,n,{leading:s,maxWait:n,trailing:u})}E=n;return E}var j=S();var M=n(j);var C=function(){function r(r){var t=this;this.grid=r;this.create=function(){t.mutationObserver.observe(t.grid,{childList:true});for(var r=0,e=Array.from(t.grid.children);r<e.length;r++){var i=e[r];t.resizeObserver.observe(i)}};this.onContainerMutation=function(r){var e=r.flatMap((function(r){return Array.from(r.removedNodes)}));var i=r.flatMap((function(r){return Array.from(r.addedNodes)}));for(var n=0,a=e;n<a.length;n++){var s=a[n];if(s instanceof Element){t.resizeObserver.unobserve(s)}}for(var u=0,o=i;u<o.length;u++){var s=o[u];if(s instanceof Element){t.resizeObserver.observe(s)}}if(e.length>0&&i.length===0){t.update()}};this.onChildrenResize=function(r){var e=r.filter((function(r){return r.target.parentElement!==null}));if(e.length>0){t.update()}};this.update=M((function(){var r=window.getComputedStyle(t.grid);if(r.getPropertyValue("display").includes("grid")===false){t.clean();return}var e=q(t.grid);if(e.length<=1){t.clean();return}var i=Number.parseFloat(r.getPropertyValue("row-gap").trim())||0;var n=Array.from(t.grid.children);for(var a=0;a<e.length;a++){var s=n[a];s===null||s===void 0?void 0:s.style.removeProperty("margin-top")}for(var u=0;u<n.length;u++){var o=n[u-e.length];var f=n[u];if(o!==undefined&&f!==undefined){var l=o.getBoundingClientRect().bottom;f.style.removeProperty("margin-top");var c=f.getBoundingClientRect().top;if(c-i!==l){var v=Math.round((l-(c-i)+Number.EPSILON)*100)/100;f.style.setProperty("margin-top","".concat(v,"px"))}}}}),32);this.destroy=function(){t.resizeObserver.disconnect();t.mutationObserver.disconnect();t.clean()};this.clean=function(){for(var r=0,e=Array.from(t.grid.children);r<e.length;r++){var i=e[r];i.style.removeProperty("margin-top")}};this.mutationObserver=new MutationObserver(this.onContainerMutation);this.resizeObserver=new ResizeObserver(this.onChildrenResize);if(CSS.supports("grid-template-rows","masonry")===false){this.create()}}r.prototype[Symbol.dispose]=function(){this.destroy()};return r}();function q(r){var t=window.getComputedStyle(r);var e=t.getPropertyValue("grid-template-columns");return e.trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}var F=":host{display:block}";var L=r("salla_reviews_page",function(){function r(r){a(this,r);this.reviews=[];this.isLoading=false;this.pagination=null;this.sort="latest"}r.prototype.getUrlParams=function(){var r=new URLSearchParams(window.location.search);return{sort:r.get("sort")||null,page:Number.parseInt(r.get("page"))||1}};r.prototype.updateUrlParams=function(r){var t=new URL(window.location.href);for(var e=0,i=Object.entries(r);e<i.length;e++){var n=i[e],a=n[0],s=n[1];if(s){t.searchParams.set(a,s.toString())}else{t.searchParams.delete(a)}}window.history.replaceState({},"",t.toString())};r.prototype.fetchReviews=function(r,t){var e=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:t||e.page||1,sort:r||e.sort||null}})};r.prototype.initializeMasonry=function(){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(t){r=this.el.querySelector(".s-reviews-page-grid");if(!r)return[2];try{new C(r);salla.logger.info("Masonry initialized successfully")}catch(r){salla.logger.error("Masonry initialization failed:",r)}return[2]}))}))};r.prototype.animateReviewCards=function(){var r=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");f.animateItems(r)};r.prototype.initiateInfiniteScroll=function(){var r=this;var t,e,i;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){var t,e;return((e=(t=r.pagination)===null||t===void 0?void 0:t.links)===null||e===void 0?void 0:e.next)||null},history:false,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(function(){r.isLoading=true}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(t){r.pagination=t.pagination;r.reviews=__spreadArray(__spreadArray([],r.reviews,true),t.data,true);r.isLoading=false;r.updateUrlParams({page:t.pagination.current_page})}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("error",(function(t){salla.logger.error("Error loading more reviews:",t);r.isLoading=false}))};r.prototype.componentDidRender=function(){var r=this;setTimeout((function(){requestAnimationFrame(r.animateReviewCards.bind(r))}),176)};r.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var r,t,e,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,salla.onReady()];case 1:n.sent();this.langTitlesReviews=salla.lang.get("common.titles.reviews");this.langSorting=salla.lang.get("pages.categories.sorting");this.placeholderText=salla.lang.choice("pages.rating.reviews",0);this.langLoadMore=salla.lang.get("common.elements.load_more");this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc");this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc");this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc");this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");t=this.getUrlParams();return[4,this.fetchReviews(t.sort)];case 2:e=n.sent();this.sort=t.sort;this.reviews=e.data;this.pagination=e.pagination;this.langRatingReviews=salla.lang.choice("pages.rating.reviews",(r=this.pagination)===null||r===void 0?void 0:r.total);return[3,4];case 3:i=n.sent();salla.logger.error("Error loading reviews:",i);return[3,4];case 4:return[2]}}))}))};r.prototype.handleSorting=function(r){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:t=r.target.value;this.sort=t;this.updateUrlParams({sort:t,page:1});return[4,this.fetchReviews(t,1)];case 1:e=i.sent();this.reviews=e.data;this.pagination=e.pagination;return[2]}}))}))};r.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this.initializeMasonry()];case 1:r.sent();this.initiateInfiniteScroll();this.sort=this.getUrlParams().sort||"latest";this.updateUrlParams({sort:this.sort,page:1});return[2]}}))}))};r.prototype.disconnectedCallback=function(){if(this.infiniteScroll){this.infiniteScroll.destroy()}};r.prototype.renderSortingOptions=function(){var r=this;var t=[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}];return t.map((function(t){return s("option",{key:t.value,value:t.value,selected:t.value===r.sort},t.label)}))};r.prototype.render=function(){var r=this;var t,e;return s("host",{key:"2108b6bebdc8a651705e45d169fb10127c3c215e"},s("div",{key:"84972824884151462a1040bdc53c334b733cd7fb",class:"s-reviews-page-header-wrapper"},s("h2",{key:"80905de0950443f7e2b1c28d63bcb7f3fa47dc0c",class:"s-reviews-page-title"},this.langTitlesReviews,s("span",{key:"d51385e66a1dee802786b50d063501b6397ce345",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),s("div",{key:"2fc74d0b61d0377f0d14a5fd15a4d852e6850932",class:"s-reviews-page-filter-wrapper"},s("label",{key:"8d1363a2b2f6722f1c56445b5ba33a98f241b106",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),s("select",{key:"eb27d82e25fa609b25d5ca825381285c0a40cc5b",onChange:function(t){return r.handleSorting(t)},disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?s("main",{class:"s-reviews-page-grid",ref:function(t){r.wrapper=t}},this.reviews.map((function(r){return s("salla-review-card",{key:r.id,review:r})}))):s("div",{class:"s-products-list-placeholder"},s("span",{innerHTML:o}),s("p",null,this.placeholderText)),((e=(t=this.pagination)===null||t===void 0?void 0:t.links)===null||e===void 0?void 0:e.next)&&this.reviews.length?s("div",{class:"s-reviews-page-load-more-container"},s("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:function(){var t;return(t=r.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()},onKeyUp:function(){var t;return(t=r.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()}},this.langLoadMore)):null)};Object.defineProperty(r.prototype,"el",{get:function(){return u(this)},enumerable:false,configurable:true});return r}());L.style=F}}}));
|
|
5
|
+
//# sourceMappingURL=p-b7d02240.system.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-CwbK3391.system.js","sources":["src/components/salla-tiered-offer/interfaces.ts","src/components/salla-tiered-offer/constants.ts","src/components/salla-tiered-offer/utils.ts","src/components/salla-tiered-offer/salla-tiered-offer.scss?tag=salla-tiered-offer","src/components/salla-tiered-offer/salla-tiered-offer.tsx"],"sourcesContent":["export enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n}\n\n\nexport interface Discount {\n name?: string;\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n}\n\nexport interface TieredOfferDetails {\n based_on?: string;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n with_current_cart?: boolean;\n applied_with_coupon?: boolean;\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: TieredOfferDetails | null;\n}\n\nexport interface TieredOfferTier {\n name: string;\n tier_name: string;\n discount: string;\n icon: string;\n threshold: number;\n text_color?: string;\n index: number;\n}\n\nexport interface TieredOfferData {\n current_tier: string;\n tiers: TieredOfferTier[];\n}\n\nexport interface TieredOfferConfig {\n staticIcons: string[];\n staticColors: string[];\n}\n","import { TieredOfferConfig } from './interfaces';\nimport StarIcon from '../../assets/svg/star-rounded.svg';\nimport StarsIcon from '../../assets/svg/stars.svg';\nimport GoldIcon from '../../assets/svg/gold.svg';\nimport DiamondIcon from '../../assets/svg/diamond-02.svg';\n\nexport const TIERED_OFFER_CONFIG: TieredOfferConfig = {\n staticIcons: [StarIcon, StarsIcon, GoldIcon, DiamondIcon],\n staticColors: ['#993018', '#444444', '#D18F36', '#315F9C']\n};","import { TieredOfferTier } from './interfaces';\n\nexport class TierUtils {\n /**\n * Find tier by index\n */\n static findTierByIndex(tiers: TieredOfferTier[], index: number): TieredOfferTier | null {\n return tiers.find(tier => tier.index === index) || null;\n }\n\n /**\n * Find tier by tier name\n */\n static findTierByName(tiers: TieredOfferTier[], tierName: string): TieredOfferTier | null {\n return tiers.find(tier => tier.tier_name === tierName) || null;\n }\n\n /**\n * Get tier name by index\n */\n static getTierNameByIndex(tiers: TieredOfferTier[], index: number): string | undefined {\n return this.findTierByIndex(tiers, index)?.tier_name;\n }\n\n /**\n * Find current tier index based on current value\n */\n static findCurrentTierIndex(currentValue: number, tiers: TieredOfferTier[]): number {\n if (!tiers) return 0;\n \n for (let i = tiers.length - 1; i >= 0; i--) {\n if (currentValue >= tiers[i].threshold) {\n return tiers[i].index;\n }\n }\n return 0;\n }\n}","\n// SVG styling for milestone icons \n.s-tiered-offer-milestone-icon {\n svg {\n color: currentColor;\n \n path {\n stroke: currentColor;\n fill: none;\n }\n }\n \n // Active and completed states - fill the star icon, keep others as stroke\n &.s-tiered-offer-milestone-active,\n &.s-tiered-offer-milestone-completed {\n svg {\n path {\n fill: currentColor;\n stroke: none;\n }\n \n // For stroke-based icons (crown, stars, diamond) \n &[fill=\"none\"] path {\n fill: none;\n stroke: currentColor;\n }\n }\n }\n}\n\n// RTL Support \n[dir=\"rtl\"] {\n .s-tiered-offer-progress-wrapper {\n .s-tiered-offer-progress-bg {\n transform: scaleX(-1);\n }\n \n .s-tiered-offer-progress-fill {\n transform: scaleX(-1);\n left: auto;\n }\n }\n\n .flip-x {\n transform: scaleX(-1);\n }\n}\n","import { Component, Host, h, State } from '@stencil/core';\nimport { Offer, TieredOfferTier, TieredOfferData, DiscountType } from './interfaces';\nimport { TIERED_OFFER_CONFIG } from './constants';\nimport { TierUtils } from './utils';\n\n@Component({\n tag: 'salla-tiered-offer',\n styleUrl: 'salla-tiered-offer.scss',\n})\nexport class SallaTieredOffer {\n\n constructor() {\n salla.lang.onLoaded(() => {\n this.loyaltyProgramText = salla.lang.get('blocks.tiered_offer.program_title');\n this.currentTierText = salla.lang.get('blocks.tiered_offer.current_tier');\n this.discountText = salla.lang.get('blocks.tiered_offer.discount');\n this.benefitText = salla.lang.get('blocks.tiered_offer.tier_description');\n });\n }\n\n\n @State() tieredOfferData: TieredOfferData;\n @State() apiOfferData: Offer;\n @State() currentTierIndex: number = 0;\n @State() currentTier: string;\n @State() activeTabTier: string;\n\n @State() canRender: boolean = false;\n @State() isLoading: boolean = false;\n\n // Language strings\n @State() loyaltyProgramText: string;\n @State() currentTierText: string;\n @State() discountText: string;\n @State() benefitText: string;\n\n async componentWillLoad() {\n try {\n await salla.onReady();\n \n if (!this.checkFeatureEnabled()) {\n return;\n }\n \n if (!this.checkCartExists()) {\n return;\n }\n \n this.isLoading = true;\n \n const offerData = await this.fetchTieredOfferData();\n if (!offerData) {\n return;\n }\n \n this.initializeComponent(offerData);\n \n } catch (error) {\n this.canRender = false;\n salla.logger.warn('salla-tiered-offer:: ', error);\n } finally {\n this.isLoading = false;\n }\n }\n \n private checkFeatureEnabled(): boolean {\n return salla.config.get('store.features')?.includes('tiered-offer');\n }\n \n private checkCartExists(): boolean {\n return !!salla.storage.get(\"cart\")?.summary?.count;\n }\n \n private validateCouponCompatibility(offerData: Offer, cartCoupon?: any): boolean {\n // If coupon is applied but offer doesn't support coupons, widget should be hidden\n return !(cartCoupon && !offerData.details?.applied_with_coupon);\n }\n \n private async fetchTieredOfferData(): Promise<Offer | null> {\n try {\n const { data }: { data: Offer[] } = await salla.api.cart.offers();\n const tieredOffer = data.find(offer => offer.type === \"tiered_offer\");\n \n if (!tieredOffer) {\n return null;\n }\n \n // Hide widget if coupon is applied and offer doesn't support coupons\n if (!this.validateCouponCompatibility(tieredOffer, salla.storage.get(\"cart\")?.coupon)) {\n this.canRender = false;\n return null;\n }\n \n return tieredOffer;\n } catch (error) {\n throw error;\n }\n }\n \n private initializeComponent(apiOfferData: Offer): void {\n this.apiOfferData = apiOfferData;\n \n // Map tiered details data to component format\n this.tieredOfferData = this.mapApiDataToTiers(this.apiOfferData);\n this.loyaltyProgramText = this.apiOfferData.title || this.loyaltyProgramText;\n \n // Find current tier index based on current_value from API\n const currentValue = this.apiOfferData.details?.current_value || 0;\n const currentTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Only render if user has reached at least the first tier\n if (currentTierIndex === 0) {\n this.canRender = false;\n return;\n }\n \n this.currentTierIndex = currentTierIndex;\n this.currentTier = TierUtils.getTierNameByIndex(this.tieredOfferData.tiers, currentTierIndex);\n this.activeTabTier = this.currentTier;\n this.canRender = true;\n }\n\n componentDidLoad() {\n salla.event.on(\"cart::updated\", (updatedCart) => {\n this.updateOfferValues(updatedCart);\n });\n }\n\n private mapApiDataToTiers(apiData: Offer): TieredOfferData {\n // Sort discounts by min_spend to create proper tier order\n const sortedDiscounts = [...apiData.details.discounts].sort((a, b) => a.min_spend - b.min_spend);\n\n const tiers: TieredOfferTier[] = sortedDiscounts.map((discount, index) => ({\n name: discount.name, \n tier_name: discount.name, \n discount: discount.type === DiscountType.PERCENTAGE ? `${salla.helpers.number(discount.value)}%` : salla.money(discount.value),\n icon: TIERED_OFFER_CONFIG.staticIcons[index] || TIERED_OFFER_CONFIG.staticIcons[0], \n threshold: discount.min_spend,\n text_color: TIERED_OFFER_CONFIG.staticColors[index], \n index: index + 1\n }));\n\n return {\n current_tier: TierUtils.getTierNameByIndex(tiers, this.findCurrentTierIndex(apiData.details.current_value, tiers)),\n tiers\n };\n }\n\n private findCurrentTierIndex(currentValue: number, tiers = this.tieredOfferData?.tiers): number {\n return TierUtils.findCurrentTierIndex(currentValue, tiers || []);\n }\n\n private updateOfferValues(updatedCart: { items: any[], sub_total: number, coupon?: any }) {\n if (!this.apiOfferData || !this.tieredOfferData) {\n return;\n }\n\n // Check coupon compatibility\n if (!this.validateCouponCompatibility(this.apiOfferData, updatedCart.coupon)) {\n this.canRender = false;\n return;\n }\n\n // If no coupon conflict, show widget\n this.canRender = true;\n\n // Check if this offer should update with cart changes\n if (this.apiOfferData.details?.with_current_cart === false) {\n return;\n }\n\n // Update current_value in API offer data\n const currentValue = updatedCart.sub_total;\n this.apiOfferData = {\n ...this.apiOfferData,\n details: {\n ...this.apiOfferData.details,\n current_value: currentValue\n }\n };\n\n // Update current tier based on new value\n const newTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Check if user qualifies for any tier\n if (newTierIndex === 0) {\n this.canRender = false;\n return;\n }\n\n // user qualifies show widget\n this.canRender = true;\n this.currentTierIndex = newTierIndex;\n this.currentTier = TierUtils.getTierNameByIndex(this.tieredOfferData.tiers, newTierIndex);\n \n // Update active tab if needed\n if (this.activeTabTier !== this.currentTier) {\n this.activeTabTier = this.currentTier;\n }\n }\n\n private getLoadingSkeletonView() {\n return <Host>\n <div class=\"s-tiered-offer-container\">\n <div class=\"s-tiered-offer-skeleton-wrapper\">\n <div class=\"s-tiered-offer-skeleton-title\">\n <salla-skeleton height=\"16px\" width=\"40%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-subtitle\">\n <salla-skeleton height=\"20px\" width=\"60%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-progress\">\n <salla-skeleton height=\"16px\" width=\"100%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-tabs\">\n <salla-skeleton height=\"50px\" width=\"100%\" />\n </div>\n </div>\n </div>\n </Host>\n }\n\n private getCurrentTierData(): TieredOfferTier {\n return TierUtils.findTierByIndex(this.tieredOfferData.tiers, this.currentTierIndex) || this.tieredOfferData.tiers[0];\n }\n\n private getProgressWidth(): number {\n const currentValue = this.apiOfferData.details?.current_value || 0;\n const totalTiers = this.tieredOfferData.tiers.length;\n \n // Use existing method to find current tier index (which already handles the logic)\n const currentTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Convert to 0-based index for progress calculation\n const completedTiers = currentTierIndex;\n return (completedTiers / totalTiers) * 100;\n }\n\n private handleTabClick = (tierName: string) => {\n this.activeTabTier = tierName;\n }\n \n private calculateMilestonePosition(index: number, totalTiers: number): string {\n if (totalTiers === 1) {\n return 'calc(100% - 18px)';\n }\n const milestonePercent = ((index + 1) / totalTiers) * 100;\n const offsetPercent = 8 / totalTiers;\n return `${Math.max(2, Math.min(95, milestonePercent - offsetPercent))}%`;\n }\n \n private getMilestoneStyles(tier: TieredOfferTier, index: number, totalTiers: number) {\n const isRtl = document.documentElement.dir === 'rtl';\n const adjustedPercent = this.calculateMilestonePosition(index, totalTiers);\n const alignItems = tier.name.length > 6 ? 'flex-end' : 'center';\n \n return {\n [isRtl ? 'right' : 'left']: adjustedPercent,\n alignItems,\n position: 'absolute' as const,\n transform: isRtl ? 'translateX(50%)' : 'translateX(-50%)'\n };\n }\n \n private getMilestoneIconStyles(tier: TieredOfferTier, isCurrent: boolean, isReached: boolean) {\n if (isCurrent) {\n return { color: tier.text_color };\n }\n if (isReached) {\n return { color: 'var(--color-primary)' };\n }\n return {};\n }\n \n private renderProgressBarBackground(progressWidth: number) {\n return [\n <div class=\"s-tiered-offer-progress-bg\"></div>,\n <div \n class=\"s-tiered-offer-progress-fill\"\n style={{ width: `${progressWidth}%` }}>\n </div>\n ];\n }\n \n private renderMilestoneIcon(tier: TieredOfferTier, isCurrent: boolean, isReached: boolean) {\n const iconClasses = [\n 's-tiered-offer-milestone-icon',\n isCurrent ? 's-tiered-offer-milestone-active' : '',\n isReached ? 's-tiered-offer-milestone-completed' : ''\n ].filter(Boolean).join(' ');\n \n return (\n <div \n class={iconClasses}\n style={this.getMilestoneIconStyles(tier, isCurrent, isReached)}>\n <span innerHTML={tier.icon}></span>\n </div>\n );\n }\n \n private renderMilestoneName(tier: TieredOfferTier, isCurrent: boolean) {\n return (\n <div class=\"s-tiered-offer-milestone-name\">\n {isCurrent && (\n <span style={{ color: tier.text_color }}>\n {tier.name}\n </span>\n )}\n </div>\n );\n }\n \n private renderMilestones(currentValue: number, totalTiers: number) {\n const containerClass = totalTiers === 1 \n ? 's-tiered-offer-single-milestone-justify-end' \n : 's-tiered-offer-milestones';\n \n return (\n <div class=\"s-tiered-offer-milestones-wrapper\">\n <div class={containerClass}>\n {this.tieredOfferData.tiers.map((tier, index) => {\n const isReached = currentValue >= tier.threshold;\n const isCurrent = tier.tier_name === this.currentTier;\n \n return (\n <div \n class=\"s-tiered-offer-milestone\"\n style={this.getMilestoneStyles(tier, index, totalTiers)}>\n {this.renderMilestoneIcon(tier, isCurrent, isReached)}\n {this.renderMilestoneName(tier, isCurrent)}\n </div>\n );\n })}\n </div>\n </div>\n );\n }\n\n private renderProgressBar() {\n const progressWidth = this.getProgressWidth();\n const totalTiers = this.tieredOfferData.tiers.length;\n const currentValue = this.apiOfferData.details?.current_value || 0;\n\n return (\n <div class=\"s-tiered-offer-progress-container\">\n <div class=\"s-tiered-offer-progress-wrapper\">\n {this.renderProgressBarBackground(progressWidth)}\n {this.renderMilestones(currentValue, totalTiers)}\n </div>\n </div>\n );\n }\n\n private renderTabs() {\n return (\n <div class=\"s-tiered-offer-tabs-container\">\n {/* Tab Headers */}\n <div class=\"s-tiered-offer-tab-headers\">\n {this.tieredOfferData.tiers.map(tier => {\n const isActive = tier.tier_name === this.activeTabTier;\n return (\n <button \n class={`s-tiered-offer-tab-header ${isActive ? 's-tiered-offer-tab-active' : ''}`}\n onClick={() => this.handleTabClick(tier.tier_name)}>\n <span>{tier.name}</span>\n </button>\n );\n })}\n </div>\n\n {/* Tab Content */}\n <div class=\"s-tiered-offer-tab-content-wrapper\">\n {(() => {\n const activeTier = TierUtils.findTierByName(this.tieredOfferData.tiers, this.activeTabTier);\n if (!activeTier) return null;\n \n return (\n <div class=\"s-tiered-offer-tab-content\">\n <div class=\"s-tiered-offer-tab-content-inner\">\n <div class=\"s-tiered-offer-discount-section\">\n <p class=\"s-tiered-offer-discount-title\">\n {this.discountText} <span innerHTML={activeTier.discount}></span>\n </p>\n <p class=\"s-tiered-offer-benefit-description\">\n {this.benefitText} {activeTier.name}\n </p>\n </div>\n </div>\n </div>\n );\n })()}\n </div>\n </div>\n );\n }\n\n render() {\n \n if (this.isLoading) {\n return this.getLoadingSkeletonView();\n }\n\n if (!this.canRender || !this.tieredOfferData) {\n return null;\n }\n \n\n const currentTierData = this.getCurrentTierData();\n\n return (\n <Host>\n <div class=\"s-tiered-offer-container\">\n {/* Header Section */}\n <div class=\"s-tiered-offer-header\">\n <div class=\"s-tiered-offer-header-content\">\n <p class=\"s-tiered-offer-program-title\">{this.loyaltyProgramText}</p>\n <div class=\"s-tiered-offer-current-tier-name-wrapper\">\n <h2 class=\"s-tiered-offer-current-tier\">\n {this.currentTierText} <span class=\"s-tiered-offer-tier-name\">{currentTierData.name}</span>\n </h2>\n <span innerHTML={currentTierData.icon}></span>\n </div>\n </div>\n </div>\n\n {/* Progress Bar */}\n {this.renderProgressBar()}\n\n {/* Tabs */}\n {this.renderTabs()}\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,IAAY,YAGX;YAHD,CAAA,UAAY,YAAY,EAAA;YACtB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;YACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;YACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,GAGvB,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;YCGM,MAAM,mBAAmB,GAAsB;gBACpD,WAAW,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC;gBACzD,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;aAC1D;;kBCPY,SAAS,CAAA;YACpB;;YAEG;YACH,IAAA,OAAO,eAAe,CAAC,KAAwB,EAAE,KAAa,EAAA;YAC5D,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,IAAI;;YAGzD;;YAEG;YACH,IAAA,OAAO,cAAc,CAAC,KAAwB,EAAE,QAAgB,EAAA;YAC9D,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,IAAI,IAAI;;YAGhE;;YAEG;YACH,IA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A,EAAA,EAAA,KAAK,EAAC,uBAAuB,EAAA,EAChC,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,+BAA+B,EAAA,EACxC,CAAA,CAAA,GAAA,EAAA,EAAG,KAAK,EAAC,8BAA8B,IAAE,IAAI,CAAC,kBAAkB,CAAK,EACrE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,0CAA0C,EAAA,EACnD,CAAI,CAAA,IAAA,EAAA,EAAA,KAAK,EAAC,6BAA6B,EAAA,EACpC,IAAI,CAAC,eAAe,OAAE,CAAM,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,0BAA0B,EAAA,EAAE,eAAe,CAAC,IAAI,CAAQ,CACxF,EACL,CAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,eAAe,CAAC,IAAI,EAAS,CAAA,CAC1C,CACF,CACF,EAGL,IAAI,CAAC,iBAAiB,EAAE,EAGxB,IAAI,CAAC,UAAU,EAAE,CACd,CACD;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-bBjviUXV.system.js","sources":["src/components/salla-tiered-offer/interfaces.ts","src/components/salla-tiered-offer/constants.ts","src/components/salla-tiered-offer/utils.ts","src/components/salla-tiered-offer/salla-tiered-offer.scss?tag=salla-tiered-offer","src/components/salla-tiered-offer/salla-tiered-offer.tsx"],"sourcesContent":["export enum DiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n}\n\n\nexport interface Discount {\n name?: string;\n type?: DiscountType;\n value?: number;\n min_spend?: number;\n}\n\nexport interface TieredOfferDetails {\n based_on?: string;\n ends_at?: number;\n start_value?: number;\n end_value?: number;\n current_value?: number;\n discounts?: Discount[];\n with_current_cart?: boolean;\n applied_with_coupon?: boolean;\n}\n\nexport interface Offer {\n id?: number;\n type?: string;\n title?: string;\n description?: string;\n details?: TieredOfferDetails | null;\n}\n\nexport interface TieredOfferTier {\n name: string;\n tier_name: string;\n discount: string;\n icon: string;\n threshold: number;\n text_color?: string;\n index: number;\n}\n\nexport interface TieredOfferData {\n current_tier: string;\n tiers: TieredOfferTier[];\n}\n\nexport interface TieredOfferConfig {\n staticIcons: string[];\n staticColors: string[];\n}\n","import { TieredOfferConfig } from './interfaces';\nimport StarIcon from '../../assets/svg/star-rounded.svg';\nimport StarsIcon from '../../assets/svg/stars.svg';\nimport GoldIcon from '../../assets/svg/gold.svg';\nimport DiamondIcon from '../../assets/svg/diamond-02.svg';\n\nexport const TIERED_OFFER_CONFIG: TieredOfferConfig = {\n staticIcons: [StarIcon, StarsIcon, GoldIcon, DiamondIcon],\n staticColors: ['#993018', '#444444', '#D18F36', '#315F9C']\n};","import { TieredOfferTier } from './interfaces';\n\nexport class TierUtils {\n /**\n * Find tier by index\n */\n static findTierByIndex(tiers: TieredOfferTier[], index: number): TieredOfferTier | null {\n return tiers.find(tier => tier.index === index) || null;\n }\n\n /**\n * Find tier by tier name\n */\n static findTierByName(tiers: TieredOfferTier[], tierName: string): TieredOfferTier | null {\n return tiers.find(tier => tier.tier_name === tierName) || null;\n }\n\n /**\n * Get tier name by index\n */\n static getTierNameByIndex(tiers: TieredOfferTier[], index: number): string | undefined {\n return this.findTierByIndex(tiers, index)?.tier_name;\n }\n\n /**\n * Find current tier index based on current value\n */\n static findCurrentTierIndex(currentValue: number, tiers: TieredOfferTier[]): number {\n if (!tiers) return 0;\n \n for (let i = tiers.length - 1; i >= 0; i--) {\n if (currentValue >= tiers[i].threshold) {\n return tiers[i].index;\n }\n }\n return 0;\n }\n}","\n// SVG styling for milestone icons \n.s-tiered-offer-milestone-icon {\n svg {\n color: currentColor;\n \n path {\n stroke: currentColor;\n fill: none;\n }\n }\n \n // Active and completed states - fill the star icon, keep others as stroke\n &.s-tiered-offer-milestone-active,\n &.s-tiered-offer-milestone-completed {\n svg {\n path {\n fill: currentColor;\n stroke: none;\n }\n \n // For stroke-based icons (crown, stars, diamond) \n &[fill=\"none\"] path {\n fill: none;\n stroke: currentColor;\n }\n }\n }\n}\n\n// RTL Support \n[dir=\"rtl\"] {\n .s-tiered-offer-progress-wrapper {\n .s-tiered-offer-progress-bg {\n transform: scaleX(-1);\n }\n \n .s-tiered-offer-progress-fill {\n transform: scaleX(-1);\n left: auto;\n }\n }\n\n .flip-x {\n transform: scaleX(-1);\n }\n}\n","import { Component, Host, h, State } from '@stencil/core';\nimport { Offer, TieredOfferTier, TieredOfferData, DiscountType } from './interfaces';\nimport { TIERED_OFFER_CONFIG } from './constants';\nimport { TierUtils } from './utils';\n\n@Component({\n tag: 'salla-tiered-offer',\n styleUrl: 'salla-tiered-offer.scss',\n})\nexport class SallaTieredOffer {\n\n constructor() {\n salla.lang.onLoaded(() => {\n this.loyaltyProgramText = salla.lang.get('blocks.tiered_offer.program_title');\n this.currentTierText = salla.lang.get('blocks.tiered_offer.current_tier');\n this.discountText = salla.lang.get('blocks.tiered_offer.discount');\n this.benefitText = salla.lang.get('blocks.tiered_offer.tier_description');\n });\n }\n\n\n @State() tieredOfferData: TieredOfferData;\n @State() apiOfferData: Offer;\n @State() currentTierIndex: number = 0;\n @State() currentTier: string;\n @State() activeTabTier: string;\n\n @State() canRender: boolean = false;\n @State() isLoading: boolean = false;\n\n // Language strings\n @State() loyaltyProgramText: string;\n @State() currentTierText: string;\n @State() discountText: string;\n @State() benefitText: string;\n\n async componentWillLoad() {\n try {\n await salla.onReady();\n \n if (!this.checkFeatureEnabled()) {\n return;\n }\n \n if (!this.checkCartExists()) {\n return;\n }\n \n this.isLoading = true;\n \n const offerData = await this.fetchTieredOfferData();\n if (!offerData) {\n return;\n }\n \n this.initializeComponent(offerData);\n \n } catch (error) {\n this.canRender = false;\n salla.logger.warn('salla-tiered-offer:: ', error);\n } finally {\n this.isLoading = false;\n }\n }\n \n private checkFeatureEnabled(): boolean {\n return salla.config.get('store.features')?.includes('tiered-offer');\n }\n \n private checkCartExists(): boolean {\n return !!salla.storage.get(\"cart\")?.summary?.count;\n }\n \n private validateCouponCompatibility(offerData: Offer, cartCoupon?: any): boolean {\n // If coupon is applied but offer doesn't support coupons, widget should be hidden\n return !(cartCoupon && !offerData.details?.applied_with_coupon);\n }\n \n private async fetchTieredOfferData(): Promise<Offer | null> {\n try {\n const { data }: { data: Offer[] } = await salla.api.cart.offers();\n const tieredOffer = data.find(offer => offer.type === \"tiered_offer\");\n \n if (!tieredOffer) {\n return null;\n }\n \n // Hide widget if coupon is applied and offer doesn't support coupons\n if (!this.validateCouponCompatibility(tieredOffer, salla.storage.get(\"cart\")?.coupon)) {\n this.canRender = false;\n return null;\n }\n \n return tieredOffer;\n } catch (error) {\n throw error;\n }\n }\n \n private initializeComponent(apiOfferData: Offer): void {\n this.apiOfferData = apiOfferData;\n \n // Map tiered details data to component format\n this.tieredOfferData = this.mapApiDataToTiers(this.apiOfferData);\n this.loyaltyProgramText = this.apiOfferData.title || this.loyaltyProgramText;\n \n // Find current tier index based on current_value from API\n const currentValue = this.apiOfferData.details?.current_value || 0;\n const currentTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Only render if user has reached at least the first tier\n if (currentTierIndex === 0) {\n this.canRender = false;\n return;\n }\n \n this.currentTierIndex = currentTierIndex;\n this.currentTier = TierUtils.getTierNameByIndex(this.tieredOfferData.tiers, currentTierIndex);\n this.activeTabTier = this.currentTier;\n this.canRender = true;\n }\n\n componentDidLoad() {\n salla.event.on(\"cart::updated\", (updatedCart) => {\n this.updateOfferValues(updatedCart);\n });\n }\n\n private mapApiDataToTiers(apiData: Offer): TieredOfferData {\n // Sort discounts by min_spend to create proper tier order\n const sortedDiscounts = [...apiData.details.discounts].sort((a, b) => a.min_spend - b.min_spend);\n\n const tiers: TieredOfferTier[] = sortedDiscounts.map((discount, index) => ({\n name: discount.name, \n tier_name: discount.name, \n discount: discount.type === DiscountType.PERCENTAGE ? `${salla.helpers.number(discount.value)}%` : salla.money(discount.value),\n icon: TIERED_OFFER_CONFIG.staticIcons[index] || TIERED_OFFER_CONFIG.staticIcons[0], \n threshold: discount.min_spend,\n text_color: TIERED_OFFER_CONFIG.staticColors[index], \n index: index + 1\n }));\n\n return {\n current_tier: TierUtils.getTierNameByIndex(tiers, this.findCurrentTierIndex(apiData.details.current_value, tiers)),\n tiers\n };\n }\n\n private findCurrentTierIndex(currentValue: number, tiers = this.tieredOfferData?.tiers): number {\n return TierUtils.findCurrentTierIndex(currentValue, tiers || []);\n }\n\n private updateOfferValues(updatedCart: { items: any[], sub_total: number, coupon?: any }) {\n if (!this.apiOfferData || !this.tieredOfferData) {\n return;\n }\n\n // Check coupon compatibility\n if (!this.validateCouponCompatibility(this.apiOfferData, updatedCart.coupon)) {\n this.canRender = false;\n return;\n }\n\n // If no coupon conflict, show widget\n this.canRender = true;\n\n // Check if this offer should update with cart changes\n if (this.apiOfferData.details?.with_current_cart === false) {\n return;\n }\n\n // Update current_value in API offer data\n const currentValue = updatedCart.sub_total;\n this.apiOfferData = {\n ...this.apiOfferData,\n details: {\n ...this.apiOfferData.details,\n current_value: currentValue\n }\n };\n\n // Update current tier based on new value\n const newTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Check if user qualifies for any tier\n if (newTierIndex === 0) {\n this.canRender = false;\n return;\n }\n\n // user qualifies show widget\n this.canRender = true;\n this.currentTierIndex = newTierIndex;\n this.currentTier = TierUtils.getTierNameByIndex(this.tieredOfferData.tiers, newTierIndex);\n \n // Update active tab if needed\n if (this.activeTabTier !== this.currentTier) {\n this.activeTabTier = this.currentTier;\n }\n }\n\n private getLoadingSkeletonView() {\n return <Host>\n <div class=\"s-tiered-offer-container\">\n <div class=\"s-tiered-offer-skeleton-wrapper\">\n <div class=\"s-tiered-offer-skeleton-title\">\n <salla-skeleton height=\"16px\" width=\"40%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-subtitle\">\n <salla-skeleton height=\"20px\" width=\"60%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-progress\">\n <salla-skeleton height=\"16px\" width=\"100%\" />\n </div>\n <div class=\"s-tiered-offer-skeleton-tabs\">\n <salla-skeleton height=\"50px\" width=\"100%\" />\n </div>\n </div>\n </div>\n </Host>\n }\n\n private getCurrentTierData(): TieredOfferTier {\n return TierUtils.findTierByIndex(this.tieredOfferData.tiers, this.currentTierIndex) || this.tieredOfferData.tiers[0];\n }\n\n private getProgressWidth(): number {\n const currentValue = this.apiOfferData.details?.current_value || 0;\n const totalTiers = this.tieredOfferData.tiers.length;\n \n // Use existing method to find current tier index (which already handles the logic)\n const currentTierIndex = this.findCurrentTierIndex(currentValue);\n \n // Convert to 0-based index for progress calculation\n const completedTiers = currentTierIndex;\n return (completedTiers / totalTiers) * 100;\n }\n\n private handleTabClick = (tierName: string) => {\n this.activeTabTier = tierName;\n }\n \n private calculateMilestonePosition(index: number, totalTiers: number): string {\n if (totalTiers === 1) {\n return 'calc(100% - 18px)';\n }\n const milestonePercent = ((index + 1) / totalTiers) * 100;\n const offsetPercent = 8 / totalTiers;\n return `${Math.max(2, Math.min(95, milestonePercent - offsetPercent))}%`;\n }\n \n private getMilestoneStyles(tier: TieredOfferTier, index: number, totalTiers: number) {\n const isRtl = document.documentElement.dir === 'rtl';\n const adjustedPercent = this.calculateMilestonePosition(index, totalTiers);\n const alignItems = tier.name.length > 6 ? 'flex-end' : 'center';\n \n return {\n [isRtl ? 'right' : 'left']: adjustedPercent,\n alignItems,\n position: 'absolute' as const,\n transform: isRtl ? 'translateX(50%)' : 'translateX(-50%)'\n };\n }\n \n private getMilestoneIconStyles(tier: TieredOfferTier, isCurrent: boolean, isReached: boolean) {\n if (isCurrent) {\n return { color: tier.text_color };\n }\n if (isReached) {\n return { color: 'var(--color-primary)' };\n }\n return {};\n }\n \n private renderProgressBarBackground(progressWidth: number) {\n return [\n <div class=\"s-tiered-offer-progress-bg\"></div>,\n <div \n class=\"s-tiered-offer-progress-fill\"\n style={{ width: `${progressWidth}%` }}>\n </div>\n ];\n }\n \n private renderMilestoneIcon(tier: TieredOfferTier, isCurrent: boolean, isReached: boolean) {\n const iconClasses = [\n 's-tiered-offer-milestone-icon',\n isCurrent ? 's-tiered-offer-milestone-active' : '',\n isReached ? 's-tiered-offer-milestone-completed' : ''\n ].filter(Boolean).join(' ');\n \n return (\n <div \n class={iconClasses}\n style={this.getMilestoneIconStyles(tier, isCurrent, isReached)}>\n <span innerHTML={tier.icon}></span>\n </div>\n );\n }\n \n private renderMilestoneName(tier: TieredOfferTier, isCurrent: boolean) {\n return (\n <div class=\"s-tiered-offer-milestone-name\">\n {isCurrent && (\n <span style={{ color: tier.text_color }}>\n {tier.name}\n </span>\n )}\n </div>\n );\n }\n \n private renderMilestones(currentValue: number, totalTiers: number) {\n const containerClass = totalTiers === 1 \n ? 's-tiered-offer-single-milestone-justify-end' \n : 's-tiered-offer-milestones';\n \n return (\n <div class=\"s-tiered-offer-milestones-wrapper\">\n <div class={containerClass}>\n {this.tieredOfferData.tiers.map((tier, index) => {\n const isReached = currentValue >= tier.threshold;\n const isCurrent = tier.tier_name === this.currentTier;\n \n return (\n <div \n class=\"s-tiered-offer-milestone\"\n style={this.getMilestoneStyles(tier, index, totalTiers)}>\n {this.renderMilestoneIcon(tier, isCurrent, isReached)}\n {this.renderMilestoneName(tier, isCurrent)}\n </div>\n );\n })}\n </div>\n </div>\n );\n }\n\n private renderProgressBar() {\n const progressWidth = this.getProgressWidth();\n const totalTiers = this.tieredOfferData.tiers.length;\n const currentValue = this.apiOfferData.details?.current_value || 0;\n\n return (\n <div class=\"s-tiered-offer-progress-container\">\n <div class=\"s-tiered-offer-progress-wrapper\">\n {this.renderProgressBarBackground(progressWidth)}\n {this.renderMilestones(currentValue, totalTiers)}\n </div>\n </div>\n );\n }\n\n private renderTabs() {\n return (\n <div class=\"s-tiered-offer-tabs-container\">\n {/* Tab Headers */}\n <div class=\"s-tiered-offer-tab-headers\">\n {this.tieredOfferData.tiers.map(tier => {\n const isActive = tier.tier_name === this.activeTabTier;\n return (\n <button \n class={`s-tiered-offer-tab-header ${isActive ? 's-tiered-offer-tab-active' : ''}`}\n onClick={() => this.handleTabClick(tier.tier_name)}>\n <span>{tier.name}</span>\n </button>\n );\n })}\n </div>\n\n {/* Tab Content */}\n <div class=\"s-tiered-offer-tab-content-wrapper\">\n {(() => {\n const activeTier = TierUtils.findTierByName(this.tieredOfferData.tiers, this.activeTabTier);\n if (!activeTier) return null;\n \n return (\n <div class=\"s-tiered-offer-tab-content\">\n <div class=\"s-tiered-offer-tab-content-inner\">\n <div class=\"s-tiered-offer-discount-section\">\n <p class=\"s-tiered-offer-discount-title\">\n {this.discountText} <span innerHTML={activeTier.discount}></span>\n </p>\n <p class=\"s-tiered-offer-benefit-description\">\n {this.benefitText} {activeTier.name}\n </p>\n </div>\n </div>\n </div>\n );\n })()}\n </div>\n </div>\n );\n }\n\n render() {\n \n if (this.isLoading) {\n return this.getLoadingSkeletonView();\n }\n\n if (!this.canRender || !this.tieredOfferData) {\n return null;\n }\n \n\n const currentTierData = this.getCurrentTierData();\n\n return (\n <Host>\n <div class=\"s-tiered-offer-container\">\n {/* Header Section */}\n <div class=\"s-tiered-offer-header\">\n <div class=\"s-tiered-offer-header-content\">\n <p class=\"s-tiered-offer-program-title\">{this.loyaltyProgramText}</p>\n <div class=\"s-tiered-offer-current-tier-name-wrapper\">\n <h2 class=\"s-tiered-offer-current-tier\">\n {this.currentTierText} <span class=\"s-tiered-offer-tier-name\">{currentTierData.name}</span>\n </h2>\n <span innerHTML={currentTierData.icon}></span>\n </div>\n </div>\n </div>\n\n {/* Progress Bar */}\n {this.renderProgressBar()}\n\n {/* Tabs */}\n {this.renderTabs()}\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;YAAA,IAAY,YAGX;YAHD,CAAA,UAAY,YAAY,EAAA;YACtB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;YACzB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;YACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,GAGvB,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;YCGM,MAAM,mBAAmB,GAA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❤ 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-iZNAXsJF.js";import{H as h}from"./p-DVKz7ZDb.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:"d6f2078b058a8244a95a78e879886f3b04e0e1c0",class:"s-filters-widget-container"},i("h3",{key:"40ff9f985604de49752b38c0fc66611cd1811857",class:"s-filters-widget-title",onClick:()=>this.toggleWidget()},i("span",{key:"06847af2f3f089afb3223e4ce4c56bfa1cb195d5"},this.option.label),i("span",{key:"8ecf9c638f7ad163cda5f7235ecac66661cf8e68",class:`s-filters-widget-plusminus ${this.isOpen?"s-filters-widget-plusminus-active":""}`})),i("div",{key:"15c98c71532ec2bf1f43f3e9bcc1d964a0f3d88d",class:"s-filters-widget-content",ref:s=>this.widgetContent=s},i("div",{key:"f1221b0ce096e1fda0044776bfdba952a990230c",class:"s-filters-widget-values",ref:s=>this.widgetValues=s},i("slot",{key:"1612242828f38a9c086d2a7887174bcdde05618b"}),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:"5726822a429c26ee9ddadaf7351e8d32a3a98695",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-c2bf57ee.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as t,h as s,H as i}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as e,c as t,h as s,H as i}from"./p-iZNAXsJF.js";import{a}from"./p-BedNk7k1.js";var r=`\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>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n`;const l=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";const h=class{constructor(s){e(this,s);this.changed=t(this,"changed");this.min=0;this.max=1e4;this.moreThanLabel="أكثر من";this.lessThanLabel="أقل من";this.toLabel="الى";this.fromLabel="من";this.typing=false;this.isMin=false;this.isRTL=salla.config.get("theme.is_rtl",true);this.filterValues=[]}connectedCallback(){var e;if(this.filtersData&&((e=this.filtersData)===null||e===void 0?void 0:e.price)){this.minPrice=this.filtersData.price.min;this.maxPrice=this.filtersData.price.max}salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel);this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel);this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel);this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)}));if(this.option.values.length==1){return}if(this.option.values.length<=5){this.filterValues=this.option.values;return}const t=Math.ceil(this.option.values.length/5);for(let e=0;e<this.option.values.length;e+=t){this.filterValues.push(this.option.values.slice(e,e+t).reduce(((e,t)=>{e.to=t.to;e.count+=t.count;return e})))}}async reset(){this.minInput.value=null;this.maxInput.value=null;this.minPrice=null;this.maxPrice=null}getPriceLabel(e){if(isNaN(e.from)||e.from<1){return`${this.lessThanLabel} ${salla.money(e.to)}`}if(isNaN(e.to)||e.to<1){return`${this.moreThanLabel} ${salla.money(e.from)}`}return`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){if(e&&(e>this.max||this.maxPrice&&e>this.maxPrice)){return}if(e<this.min){this.minPrice=this.min;return}if(e){this.minPrice=e}}maxInputValidation(e){if(e&&(e<this.min||this.minPrice&&e<this.minPrice)){return}if(e>this.max){this.maxPrice=this.max;return}}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput);salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?+this.minPrice*1:null;const s=this.maxPrice?+this.maxPrice*1:null;if(!this.maxPrice){this.maxPrice=""}if(this.isMin){this.minInputValidation(t)}else{if(!this.minPrice){this.minPrice=0}this.maxInputValidation(s)}this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from;this.maxPrice=t.to!=="*"?t.to:"";this.changedEventHandler(e)}isChecked(e){if(!this.minPrice&&!this.maxPrice){return false}let t=(e.from<1||e.from=="*")&&this.minPrice==0||e.from==this.minPrice;let s=e.to=="*"||!e.to||e.to==this.maxPrice;return t&&s}handleMinPrice(e){this.isMin=true;const t=e.target.value;this.minPrice=t===""?0:t}handleMaxPrice(e){this.isMin=false;const t=e.target.value;this.maxPrice=t===undefined?"":t}render(){return s(i,{key:"e257e65621d724438fd4fdd74cdec45596a81cd0"},this.filterValues.map(((e,t)=>s("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},s("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),s("span",{innerHTML:this.getPriceLabel(e)})))),s("div",{key:"097faf8d72b3c441bc22041a5643f91f61bbdd40",class:"flex justify-center items-center"},s("div",{key:"6adaa2b16c015de4ab5e254d4a9be05bb65b7848",class:"relative max-w-xl w-full"},s("div",{key:"3667d98c1e0886fc31600d23dd5a41a18d5ff8d0",class:"s-price-range-inputs"},s("div",{key:"98fdc0fdc9632318daa4664d4798154a17fe700a",class:"s-price-range-relative"},s("div",{key:"addd7b56c1e2496dba50db7ec320f8f5ea129d42",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"d36e129fd777ccfe30cf8d974dd96cf82e64c805",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),s("div",{key:"b1fcc176d31d724c646291262e42c6a74e75f299",class:"s-price-range-gray-text"}," -"),s("div",{key:"93db8728b9f118be78549c6839a4d85d4664a3dc",class:"s-price-range-relative"},s("div",{key:"7b63ca0ffd946d34549768bf87876868842478a4",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"ba005f3834bc2179e1346cae746b7c734abaf0dd",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),s("salla-button",{key:"74283ca210bf2f85a4e5d7dde69372e55453a5a5",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},s("span",{key:"04600f026e465f96f98d54841e8c7bd7d1c849bd",innerHTML:this.isRTL?a:r}))))))}componentDidLoad(){this.isReady=true}};h.style=l;export{h as salla_price_range};
|
|
5
|
+
//# sourceMappingURL=p-cd254480.entry.js.map
|