@salla.sa/twilight-components 2.14.261 → 2.14.262
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-9KVXzA9b.js → app-globals-e3kKmuwC.js} +3 -3
- package/dist/cjs/{app-globals-9KVXzA9b.js.map → app-globals-e3kKmuwC.js.map} +1 -1
- package/dist/cjs/{index-CfmOwvmC.js → index-BJv-nH8x.js} +4 -4
- package/dist/cjs/index-BJv-nH8x.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion_4.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-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.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-BgG-hCSq.js → app-globals-VqthM5f6.js} +3 -3
- package/dist/esm/{app-globals-BgG-hCSq.js.map → app-globals-VqthM5f6.js.map} +1 -1
- package/dist/esm/{index-LSZwJPPB.js → index-gdhHvm6V.js} +4 -4
- package/dist/esm/index-gdhHvm6V.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion_4.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-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details.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-BgG-hCSq.js → app-globals-VqthM5f6.js} +2 -2
- package/dist/esm-es5/{app-globals-BgG-hCSq.js.map → app-globals-VqthM5f6.js.map} +1 -1
- package/dist/esm-es5/{index-LSZwJPPB.js → index-gdhHvm6V.js} +3 -3
- package/dist/esm-es5/index-gdhHvm6V.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion_4.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 +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm-es5/salla-order-details.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +1 -1
- package/dist/esm-es5/salla-orders.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-price-range.entry.js +1 -1
- package/dist/esm-es5/salla-product-options.entry.js +1 -1
- package/dist/esm-es5/salla-review-card.entry.js +1 -1
- package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
- package/dist/esm-es5/salla-reviews.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
- package/dist/esm-es5/salla-tooltip.entry.js +1 -1
- package/dist/esm-es5/salla-verify.entry.js +1 -1
- package/dist/esm-es5/salla-wallet.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-64c8b0e2.system.entry.js → p-00d05d4c.system.entry.js} +2 -2
- package/dist/twilight/{p-de2b1078.system.entry.js → p-07327345.system.entry.js} +2 -2
- package/dist/twilight/{p-1f93b886.system.entry.js → p-16493b31.system.entry.js} +2 -2
- package/dist/twilight/{p-ea832823.system.entry.js → p-18eaeb07.system.entry.js} +2 -2
- package/dist/twilight/{p-09bc1f72.system.entry.js → p-1e3e4a84.system.entry.js} +2 -2
- package/dist/twilight/{p-aa49c07f.entry.js → p-1e4e21ab.entry.js} +2 -2
- package/dist/twilight/{p-fcfd9a2b.entry.js → p-1e5c48d0.entry.js} +2 -2
- package/dist/twilight/{p-39d68fc1.system.entry.js → p-229e4f73.system.entry.js} +2 -2
- package/dist/twilight/{p-4eef3c0e.system.entry.js → p-2314d050.system.entry.js} +2 -2
- package/dist/twilight/{p-059405fc.system.entry.js → p-243cd247.system.entry.js} +2 -2
- package/dist/twilight/{p-143dd94c.system.entry.js → p-28cc1200.system.entry.js} +2 -2
- package/dist/twilight/{p-ce02710a.entry.js → p-2f3b050a.entry.js} +2 -2
- package/dist/twilight/{p-c09565da.entry.js → p-36f043a4.entry.js} +2 -2
- package/dist/twilight/{p-f0cc5b35.entry.js → p-37bdeacb.entry.js} +2 -2
- package/dist/twilight/{p-0e1cd76c.system.entry.js → p-42aa8f00.system.entry.js} +3 -3
- package/dist/twilight/{p-47de107e.entry.js → p-4446d80b.entry.js} +6 -6
- package/dist/twilight/{p-88e53a1e.system.entry.js → p-4f54efd1.system.entry.js} +2 -2
- package/dist/twilight/{p-9e6c5671.entry.js → p-513eb3ab.entry.js} +2 -2
- package/dist/twilight/{p-fa5ead87.entry.js → p-51563172.entry.js} +2 -2
- package/dist/twilight/{p-d660efad.entry.js → p-545204c4.entry.js} +2 -2
- package/dist/twilight/{p-1f8bf87a.entry.js → p-58702c6a.entry.js} +2 -2
- package/dist/twilight/{p-c38dbed0.entry.js → p-5fb7d021.entry.js} +2 -2
- package/dist/twilight/{p-b0d88d59.entry.js → p-6234d5b1.entry.js} +2 -2
- package/dist/twilight/{p-5bae6d14.system.entry.js → p-66440eaf.system.entry.js} +2 -2
- package/dist/twilight/{p-c5fa09d1.system.entry.js → p-68e96348.system.entry.js} +2 -2
- package/dist/twilight/{p-675d4ab7.entry.js → p-6d9239fa.entry.js} +2 -2
- package/dist/twilight/{p-d1ef5396.entry.js → p-7a849013.entry.js} +2 -2
- package/dist/twilight/{p-d62c20f1.system.entry.js → p-7d8494a1.system.entry.js} +2 -2
- package/dist/twilight/{p-Xd4af-0t.system.js.map → p-7hzBIbI9.system.js.map} +1 -1
- package/dist/twilight/{p-fe0234a1.entry.js → p-8aa7e30f.entry.js} +2 -2
- package/dist/twilight/{p-87d32e2f.entry.js → p-8f3dec24.entry.js} +2 -2
- package/dist/twilight/{p-Cnbdx_CN.system.js.map → p-93DWpqSw.system.js.map} +1 -1
- package/dist/twilight/{p-4806aee6.system.entry.js → p-953d84e6.system.entry.js} +2 -2
- package/dist/twilight/{p-d3a36873.entry.js → p-9a8f94bd.entry.js} +2 -2
- package/dist/twilight/{p-H5xAa3Fp.system.js.map → p-B1BJxOVi.system.js.map} +1 -1
- package/dist/twilight/{p-B52cxJwt.system.js → p-BEQYXrdz.system.js} +2 -2
- package/dist/twilight/{p-B52cxJwt.system.js.map → p-BEQYXrdz.system.js.map} +1 -1
- package/dist/twilight/{p-CNqf1L3p.system.js.map → p-BKXNNMLm.system.js.map} +1 -1
- package/dist/twilight/{p-DQg5Q6X-.js → p-BReGkw3Y.js} +2 -2
- package/dist/twilight/{p-DQg5Q6X-.js.map → p-BReGkw3Y.js.map} +1 -1
- package/dist/twilight/{p-BMe9fgvJ.system.js.map → p-Bmkf6XAv.system.js.map} +1 -1
- package/dist/twilight/{p-DN3CCyG-.system.js.map → p-BmwVeBpY.system.js.map} +1 -1
- package/dist/twilight/{p-CLHJmBGj.system.js.map → p-BvtfE2-2.system.js.map} +1 -1
- package/dist/twilight/{p-BBjPvuu7.system.js.map → p-C6KNQG1y.system.js.map} +1 -1
- package/dist/twilight/{p-D3JDyRUW.system.js.map → p-C8x80jPq.system.js.map} +1 -1
- package/dist/twilight/{p-BC-cnFy-.system.js.map → p-CClJfpon.system.js.map} +1 -1
- package/dist/twilight/{p-Cb9M2a-j.system.js.map → p-CLWUAiQH.system.js.map} +1 -1
- package/dist/twilight/{p-jGMZVThE.system.js.map → p-COFul74p.system.js.map} +1 -1
- package/dist/twilight/{p-DaTp8sB1.system.js.map → p-COYoK3Au.system.js.map} +1 -1
- package/dist/twilight/{p-B7SRc_rs.system.js.map → p-CXqdittj.system.js.map} +1 -1
- package/dist/twilight/{p-C51w7Au-.system.js.map → p-Cbo44k63.system.js.map} +1 -1
- package/dist/twilight/{p-DS9HrJPI.system.js.map → p-D-3lG5I2.system.js.map} +1 -1
- package/dist/twilight/{p-B4sHNRyB.system.js.map → p-D3R0t76R.system.js.map} +1 -1
- package/dist/twilight/{p-D8jKZnWs.system.js.map → p-D6LCDuHg.system.js.map} +1 -1
- package/dist/twilight/{p-8i-yI1XS.system.js.map → p-DBvyXCi6.system.js.map} +1 -1
- package/dist/twilight/{p-DzjfnKbb.system.js.map → p-DJmCwgGP.system.js.map} +1 -1
- package/dist/twilight/{p-C_Jmr6ar.system.js.map → p-DR264Rhr.system.js.map} +1 -1
- package/dist/twilight/{p-DHFCX5Dz.system.js.map → p-DbmggJGw.system.js.map} +1 -1
- package/dist/twilight/{p-DVEvrSjN.system.js.map → p-Dko7YEnJ.system.js.map} +1 -1
- package/dist/twilight/{p-DNiwBHdX.system.js.map → p-DmPhtn_C.system.js.map} +1 -1
- package/dist/twilight/{p-BtWTphPP.system.js.map → p-DnJZZ7tb.system.js.map} +1 -1
- package/dist/twilight/{p-NCpDIEN8.system.js.map → p-DoWBCSPK.system.js.map} +1 -1
- package/dist/twilight/{p-MzTS1h7j.system.js.map → p-DpeEK_nM.system.js.map} +1 -1
- package/dist/twilight/{p-aff393D5.system.js.map → p-Dr_IaU2s.system.js.map} +1 -1
- package/dist/twilight/{p-CGmIt4gq.system.js.map → p-J6Yhk9LX.system.js.map} +1 -1
- package/dist/twilight/{p-Co12cj-7.system.js.map → p-UvhFktOU.system.js.map} +1 -1
- package/dist/twilight/{p-BL3DMysj.system.js.map → p-WTZEldbP.system.js.map} +1 -1
- package/dist/twilight/{p-d02a08e9.entry.js → p-a13b8146.entry.js} +2 -2
- package/dist/twilight/{p-f80b373d.system.entry.js → p-a15f23df.system.entry.js} +2 -2
- package/dist/twilight/{p-b94bc357.entry.js → p-a2128c52.entry.js} +2 -2
- package/dist/twilight/{p-ccffcd08.entry.js → p-a48c5028.entry.js} +2 -2
- package/dist/twilight/{p-aa357e2b.system.entry.js → p-a51585ee.system.entry.js} +2 -2
- package/dist/twilight/{p-2957c27c.entry.js → p-a56f6418.entry.js} +2 -2
- package/dist/twilight/{p-528aa2c4.system.entry.js → p-afecdf40.system.entry.js} +2 -2
- package/dist/twilight/{p-008a771c.entry.js → p-b589f4db.entry.js} +2 -2
- package/dist/twilight/{p-f1218836.system.entry.js → p-b9708fef.system.entry.js} +2 -2
- package/dist/twilight/{p-B2wed4KP.system.js.map → p-bGMoB2qG.system.js.map} +1 -1
- package/dist/twilight/{p-42bcde7d.entry.js → p-bad5d163.entry.js} +2 -2
- package/dist/twilight/{p-6a8ba65f.system.entry.js → p-c0871d45.system.entry.js} +2 -2
- package/dist/twilight/{p-6b1753ce.entry.js → p-c0951c06.entry.js} +2 -2
- package/dist/twilight/{p-5271a9e8.entry.js → p-c7973d48.entry.js} +2 -2
- package/dist/twilight/{p-188e8d1c.system.entry.js → p-c9fdaf20.system.entry.js} +3 -3
- package/dist/twilight/{p-3ede6721.entry.js → p-caac9050.entry.js} +2 -2
- package/dist/twilight/{p-71bd4d79.system.entry.js → p-d17bcd5b.system.entry.js} +2 -2
- package/dist/twilight/{p-6ad30bc0.entry.js → p-e2930923.entry.js} +2 -2
- package/dist/twilight/{p-b7572664.entry.js → p-e5ab5482.entry.js} +2 -2
- package/dist/twilight/{p-a13fcfe1.entry.js → p-e63915a5.entry.js} +2 -2
- package/dist/twilight/{p-68285203.system.entry.js → p-e6558318.system.entry.js} +2 -2
- package/dist/twilight/{p-81b99416.system.entry.js → p-e8c5510b.system.entry.js} +2 -2
- package/dist/twilight/{p-68327c54.entry.js → p-eb8c92b5.entry.js} +2 -2
- package/dist/twilight/{p-53e00642.system.entry.js → p-ef0d3f01.system.entry.js} +2 -2
- package/dist/twilight/{p-DaMdjqfe.system.js.map → p-etxkGBiL.system.js.map} +1 -1
- package/dist/twilight/{p-275332fa.system.entry.js → p-f065dc14.system.entry.js} +2 -2
- package/dist/twilight/{p-d1ca52ee.system.entry.js → p-f0aabe3f.system.entry.js} +2 -2
- package/dist/twilight/p-f1e1d569.system.entry.js +5 -0
- package/dist/twilight/{p-0407da23.entry.js → p-f342f449.entry.js} +2 -2
- package/dist/twilight/{p-2ed6d081.system.entry.js → p-f65cfedf.system.entry.js} +2 -2
- package/dist/twilight/{p-64de4869.system.entry.js → p-f9981248.system.entry.js} +2 -2
- package/dist/twilight/{p-a6961af5.entry.js → p-fbc449aa.entry.js} +2 -2
- package/dist/twilight/{p-e5eae8ce.system.entry.js → p-fc0f5c2e.system.entry.js} +2 -2
- package/dist/twilight/{p-9847a4f4.entry.js → p-fc37604a.entry.js} +2 -2
- package/dist/twilight/{p-dad1b603.system.entry.js → p-fc72825e.system.entry.js} +2 -2
- package/dist/twilight/{p-ef823dbd.system.entry.js → p-fc7808d3.system.entry.js} +2 -2
- package/dist/twilight/{p-LSZwJPPB.js → p-gdhHvm6V.js} +3 -3
- package/dist/twilight/p-gdhHvm6V.js.map +1 -0
- package/dist/twilight/{p-CCJYFUxF.system.js.map → p-kuWGCb9j.system.js.map} +1 -1
- package/dist/twilight/{p-Ce2XJNsy.system.js → p-sMaYJNRW.system.js} +3 -3
- package/dist/twilight/p-sMaYJNRW.system.js.map +1 -0
- package/dist/twilight/{p-BMCxvVxH.system.js → p-womksxIV.system.js} +2 -2
- package/dist/twilight/{p-BMCxvVxH.system.js.map → p-womksxIV.system.js.map} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-CfmOwvmC.js.map +0 -1
- package/dist/esm/index-LSZwJPPB.js.map +0 -1
- package/dist/esm-es5/index-LSZwJPPB.js.map +0 -1
- package/dist/twilight/p-13a2e582.system.entry.js +0 -5
- package/dist/twilight/p-Ce2XJNsy.system.js.map +0 -1
- package/dist/twilight/p-LSZwJPPB.js.map +0 -1
- /package/dist/twilight/{p-64c8b0e2.system.entry.js.map → p-00d05d4c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-de2b1078.system.entry.js.map → p-07327345.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1f93b886.system.entry.js.map → p-16493b31.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ea832823.system.entry.js.map → p-18eaeb07.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-09bc1f72.system.entry.js.map → p-1e3e4a84.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-aa49c07f.entry.js.map → p-1e4e21ab.entry.js.map} +0 -0
- /package/dist/twilight/{p-fcfd9a2b.entry.js.map → p-1e5c48d0.entry.js.map} +0 -0
- /package/dist/twilight/{p-39d68fc1.system.entry.js.map → p-229e4f73.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-4eef3c0e.system.entry.js.map → p-2314d050.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-059405fc.system.entry.js.map → p-243cd247.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-143dd94c.system.entry.js.map → p-28cc1200.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ce02710a.entry.js.map → p-2f3b050a.entry.js.map} +0 -0
- /package/dist/twilight/{p-c09565da.entry.js.map → p-36f043a4.entry.js.map} +0 -0
- /package/dist/twilight/{p-f0cc5b35.entry.js.map → p-37bdeacb.entry.js.map} +0 -0
- /package/dist/twilight/{p-0e1cd76c.system.entry.js.map → p-42aa8f00.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-47de107e.entry.js.map → p-4446d80b.entry.js.map} +0 -0
- /package/dist/twilight/{p-88e53a1e.system.entry.js.map → p-4f54efd1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9e6c5671.entry.js.map → p-513eb3ab.entry.js.map} +0 -0
- /package/dist/twilight/{p-fa5ead87.entry.js.map → p-51563172.entry.js.map} +0 -0
- /package/dist/twilight/{p-d660efad.entry.js.map → p-545204c4.entry.js.map} +0 -0
- /package/dist/twilight/{p-1f8bf87a.entry.js.map → p-58702c6a.entry.js.map} +0 -0
- /package/dist/twilight/{p-c38dbed0.entry.js.map → p-5fb7d021.entry.js.map} +0 -0
- /package/dist/twilight/{p-b0d88d59.entry.js.map → p-6234d5b1.entry.js.map} +0 -0
- /package/dist/twilight/{p-5bae6d14.system.entry.js.map → p-66440eaf.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c5fa09d1.system.entry.js.map → p-68e96348.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-675d4ab7.entry.js.map → p-6d9239fa.entry.js.map} +0 -0
- /package/dist/twilight/{p-d1ef5396.entry.js.map → p-7a849013.entry.js.map} +0 -0
- /package/dist/twilight/{p-d62c20f1.system.entry.js.map → p-7d8494a1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-fe0234a1.entry.js.map → p-8aa7e30f.entry.js.map} +0 -0
- /package/dist/twilight/{p-87d32e2f.entry.js.map → p-8f3dec24.entry.js.map} +0 -0
- /package/dist/twilight/{p-4806aee6.system.entry.js.map → p-953d84e6.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d3a36873.entry.js.map → p-9a8f94bd.entry.js.map} +0 -0
- /package/dist/twilight/{p-d02a08e9.entry.js.map → p-a13b8146.entry.js.map} +0 -0
- /package/dist/twilight/{p-f80b373d.system.entry.js.map → p-a15f23df.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b94bc357.entry.js.map → p-a2128c52.entry.js.map} +0 -0
- /package/dist/twilight/{p-ccffcd08.entry.js.map → p-a48c5028.entry.js.map} +0 -0
- /package/dist/twilight/{p-aa357e2b.system.entry.js.map → p-a51585ee.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-2957c27c.entry.js.map → p-a56f6418.entry.js.map} +0 -0
- /package/dist/twilight/{p-528aa2c4.system.entry.js.map → p-afecdf40.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-008a771c.entry.js.map → p-b589f4db.entry.js.map} +0 -0
- /package/dist/twilight/{p-f1218836.system.entry.js.map → p-b9708fef.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-42bcde7d.entry.js.map → p-bad5d163.entry.js.map} +0 -0
- /package/dist/twilight/{p-6a8ba65f.system.entry.js.map → p-c0871d45.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6b1753ce.entry.js.map → p-c0951c06.entry.js.map} +0 -0
- /package/dist/twilight/{p-5271a9e8.entry.js.map → p-c7973d48.entry.js.map} +0 -0
- /package/dist/twilight/{p-188e8d1c.system.entry.js.map → p-c9fdaf20.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3ede6721.entry.js.map → p-caac9050.entry.js.map} +0 -0
- /package/dist/twilight/{p-71bd4d79.system.entry.js.map → p-d17bcd5b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6ad30bc0.entry.js.map → p-e2930923.entry.js.map} +0 -0
- /package/dist/twilight/{p-b7572664.entry.js.map → p-e5ab5482.entry.js.map} +0 -0
- /package/dist/twilight/{p-a13fcfe1.entry.js.map → p-e63915a5.entry.js.map} +0 -0
- /package/dist/twilight/{p-68285203.system.entry.js.map → p-e6558318.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-81b99416.system.entry.js.map → p-e8c5510b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-68327c54.entry.js.map → p-eb8c92b5.entry.js.map} +0 -0
- /package/dist/twilight/{p-53e00642.system.entry.js.map → p-ef0d3f01.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-275332fa.system.entry.js.map → p-f065dc14.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d1ca52ee.system.entry.js.map → p-f0aabe3f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-13a2e582.system.entry.js.map → p-f1e1d569.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0407da23.entry.js.map → p-f342f449.entry.js.map} +0 -0
- /package/dist/twilight/{p-2ed6d081.system.entry.js.map → p-f65cfedf.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-64de4869.system.entry.js.map → p-f9981248.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-a6961af5.entry.js.map → p-fbc449aa.entry.js.map} +0 -0
- /package/dist/twilight/{p-e5eae8ce.system.entry.js.map → p-fc0f5c2e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9847a4f4.entry.js.map → p-fc37604a.entry.js.map} +0 -0
- /package/dist/twilight/{p-dad1b603.system.entry.js.map → p-fc72825e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ef823dbd.system.entry.js.map → p-fc7808d3.system.entry.js.map} +0 -0
|
@@ -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,s){function o(r){try{l(i.next(r))}catch(r){s(r)}}function a(r){try{l(i["throw"](r))}catch(r){s(r)}}function l(r){r.done?e(r.value):n(r.value).then(o,a)}l((i=i.apply(r,t||[])).next())}))};var __generator=this&&this.__generator||function(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(r){return function(t){return l([r,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(e=0)),e)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;n=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){e.label=a[1];break}if(a[0]===6&&e.label<s[1]){e.label=s[1];s=a;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(a);break}if(s[2])e.ops.pop();e.trys.pop();continue}a=t.call(r,e)}catch(r){a=[6,r];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[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,s;i<n;i++){if(s||!(i in t)){if(!s)s=Array.prototype.slice.call(t,0,i);s[i]=t[i]}}return r.concat(s||Array.prototype.slice.call(t))};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/System.register(["./p-Ce2XJNsy.system.js"],(function(r){"use strict";var t,e,i;return{setters:[function(r){t=r.r;e=r.h;i=r.H}],execute:function(){var n;(function(r){r["PERCENTAGE"]="percentage";r["FIXED"]="fixed"})(n||(n={}));var s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>';var a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>';var l='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var f={staticIcons:[s,o,a,l],staticColors:["#993018","#444444","#D18F36","#315F9C"]};var u=function(){function r(){}r.findTierByIndex=function(r,t){return r.find((function(r){return r.index===t}))||null};r.findTierByName=function(r,t){return r.find((function(r){return r.tier_name===t}))||null};r.getTierNameByIndex=function(r,t){var e;return(e=this.findTierByIndex(r,t))===null||e===void 0?void 0:e.tier_name};r.findCurrentTierIndex=function(r,t){if(!t)return 0;for(var e=t.length-1;e>=0;e--){if(r>=t[e].threshold){return t[e].index}}return 0};return r}();var c=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{-webkit-transform:scaleX(-1);transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{-webkit-transform:scaleX(-1);transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{-webkit-transform:scaleX(-1);transform:scaleX(-1)}";var d=r("salla_tiered_offer",function(){function r(r){var e=this;t(this,r);this.currentTierIndex=0;this.canRender=false;this.isLoading=false;this.handleTabClick=function(r){e.activeTabTier=r};salla.lang.onLoaded((function(){e.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title");e.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier");e.discountText=salla.lang.get("blocks.tiered_offer.discount");e.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}r.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var r,t;return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,3,4,5]);return[4,salla.onReady()];case 1:e.sent();if(!this.checkFeatureEnabled()){return[2]}if(!this.checkCartExists()){return[2]}this.isLoading=true;return[4,this.fetchTieredOfferData()];case 2:r=e.sent();if(!r){return[2]}this.initializeComponent(r);return[3,5];case 3:t=e.sent();this.canRender=false;salla.logger.warn("salla-tiered-offer:: ",t);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};r.prototype.checkFeatureEnabled=function(){var r;return(r=salla.config.get("store.features"))===null||r===void 0?void 0:r.includes("tiered-offer")};r.prototype.checkCartExists=function(){var r,t;return!!((t=(r=salla.storage.get("cart"))===null||r===void 0?void 0:r.summary)===null||t===void 0?void 0:t.count)};r.prototype.validateCouponCompatibility=function(r,t){var e;return!(t&&!((e=r.details)===null||e===void 0?void 0:e.applied_with_coupon))};r.prototype.fetchTieredOfferData=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,2,,3]);return[4,salla.api.cart.offers()];case 1:t=n.sent().data;e=t.find((function(r){return r.type==="tiered_offer"}));if(!e){return[2,null]}if(!this.validateCouponCompatibility(e,(r=salla.storage.get("cart"))===null||r===void 0?void 0:r.coupon)){this.canRender=false;return[2,null]}return[2,e];case 2:i=n.sent();throw i;case 3:return[2]}}))}))};r.prototype.initializeComponent=function(r){var t;this.apiOfferData=r;this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData);this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;var e=((t=this.apiOfferData.details)===null||t===void 0?void 0:t.current_value)||0;var i=this.findCurrentTierIndex(e);if(i===0){this.canRender=false;return}this.currentTierIndex=i;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,i);this.activeTabTier=this.currentTier;this.canRender=true};r.prototype.componentDidLoad=function(){var r=this;salla.event.on("cart::updated",(function(t){return __awaiter(r,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.fetchTieredOfferData()];case 1:r=e.sent();if(r){this.updateOfferValues(t,r)}return[2]}}))}))}))};r.prototype.mapApiDataToTiers=function(r){var t=__spreadArray([],r.details.discounts,true).sort((function(r,t){return r.min_spend-t.min_spend}));var e=t.map((function(r,t){return{name:r.name,tier_name:r.name,discount:r.type===n.PERCENTAGE?"".concat(salla.helpers.number(r.value),"%"):salla.money(r.value),icon:f.staticIcons[t]||f.staticIcons[0],threshold:r.min_spend,text_color:f.staticColors[t],index:t+1}}));return{current_tier:u.getTierNameByIndex(e,this.findCurrentTierIndex(r.details.current_value,e)),tiers:e}};r.prototype.findCurrentTierIndex=function(r,t){var e;if(t===void 0){t=(e=this.tieredOfferData)===null||e===void 0?void 0:e.tiers}return u.findCurrentTierIndex(r,t||[])};r.prototype.updateOfferValues=function(r,t){var e,i;if(!t||!this.tieredOfferData){return}if(!this.validateCouponCompatibility(t,r.coupon)){this.canRender=false;return}this.canRender=true;if(((e=t.details)===null||e===void 0?void 0:e.with_current_cart)===false){return}var n=((i=t.details)===null||i===void 0?void 0:i.current_value)||0;this.apiOfferData=t;var s=this.findCurrentTierIndex(n);if(s===0){this.canRender=false;return}this.canRender=true;this.currentTierIndex=s;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,s);if(this.activeTabTier!==this.currentTier){this.activeTabTier=this.currentTier}};r.prototype.getLoadingSkeletonView=function(){return e(i,null,e("div",{class:"s-tiered-offer-container"},e("div",{class:"s-tiered-offer-skeleton-wrapper"},e("div",{class:"s-tiered-offer-skeleton-title"},e("salla-skeleton",{height:"16px",width:"40%"})),e("div",{class:"s-tiered-offer-skeleton-subtitle"},e("salla-skeleton",{height:"20px",width:"60%"})),e("div",{class:"s-tiered-offer-skeleton-progress"},e("salla-skeleton",{height:"16px",width:"100%"})),e("div",{class:"s-tiered-offer-skeleton-tabs"},e("salla-skeleton",{height:"50px",width:"100%"})))))};r.prototype.getCurrentTierData=function(){return u.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]};r.prototype.getProgressWidth=function(){var r;var t=((r=this.apiOfferData.details)===null||r===void 0?void 0:r.current_value)||0;var e=this.tieredOfferData.tiers.length;var i=this.findCurrentTierIndex(t);var n=i;return n/e*100};r.prototype.calculateMilestonePosition=function(r,t){if(t===1){return"calc(100% - 18px)"}var e=(r+1)/t*100;var i=8/t;return"".concat(Math.max(2,Math.min(95,e-i)),"%")};r.prototype.getMilestoneStyles=function(r,t,e){var i;var n=document.documentElement.dir==="rtl";var s=this.calculateMilestonePosition(t,e);var o=r.name.length>6?"flex-end":"center";return i={},i[n?"right":"left"]=s,i.alignItems=o,i.position="absolute",i.transform=n?"translateX(50%)":"translateX(-50%)",i};r.prototype.getMilestoneIconStyles=function(r,t,e){if(t){return{color:r.text_color}}if(e){return{color:"var(--color-primary)"}}return{}};r.prototype.renderProgressBarBackground=function(r){return[e("div",{class:"s-tiered-offer-progress-bg"}),e("div",{class:"s-tiered-offer-progress-fill",style:{width:"".concat(r,"%")}})]};r.prototype.renderMilestoneIcon=function(r,t,i){var n=["s-tiered-offer-milestone-icon",t?"s-tiered-offer-milestone-active":"",i?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return e("div",{class:n,style:this.getMilestoneIconStyles(r,t,i)},e("span",{innerHTML:r.icon}))};r.prototype.renderMilestoneName=function(r,t){return e("div",{class:"s-tiered-offer-milestone-name"},t&&e("span",{style:{color:r.text_color}},r.name))};r.prototype.renderMilestones=function(r,t){var i=this;var n=t===1?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones";return e("div",{class:"s-tiered-offer-milestones-wrapper"},e("div",{class:n},this.tieredOfferData.tiers.map((function(n,s){var o=r>=n.threshold;var a=n.tier_name===i.currentTier;return e("div",{class:"s-tiered-offer-milestone",style:i.getMilestoneStyles(n,s,t)},i.renderMilestoneIcon(n,a,o),i.renderMilestoneName(n,a))}))))};r.prototype.renderProgressBar=function(){var r;var t=this.getProgressWidth();var i=this.tieredOfferData.tiers.length;var n=((r=this.apiOfferData.details)===null||r===void 0?void 0:r.current_value)||0;return e("div",{class:"s-tiered-offer-progress-container"},e("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(t),this.renderMilestones(n,i)))};r.prototype.renderTabs=function(){var r=this;return e("div",{class:"s-tiered-offer-tabs-container"},e("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((function(t){var i=t.tier_name===r.activeTabTier;return e("button",{class:"s-tiered-offer-tab-header ".concat(i?"s-tiered-offer-tab-active":""),onClick:function(){return r.handleTabClick(t.tier_name)}},e("span",null,t.name))}))),e("div",{class:"s-tiered-offer-tab-content-wrapper"},function(){var t=u.findTierByName(r.tieredOfferData.tiers,r.activeTabTier);if(!t)return null;return e("div",{class:"s-tiered-offer-tab-content"},e("div",{class:"s-tiered-offer-tab-content-inner"},e("div",{class:"s-tiered-offer-discount-section"},e("p",{class:"s-tiered-offer-discount-title"},r.discountText," ",e("span",{innerHTML:t.discount})),e("p",{class:"s-tiered-offer-benefit-description"},r.benefitText," ",t.name))))}()))};r.prototype.render=function(){if(this.isLoading){return this.getLoadingSkeletonView()}if(!this.canRender||!this.tieredOfferData){return null}var r=this.getCurrentTierData();return e(i,null,e("div",{class:"s-tiered-offer-container"},e("div",{class:"s-tiered-offer-header"},e("div",{class:"s-tiered-offer-header-content"},e("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),e("div",{class:"s-tiered-offer-current-tier-name-wrapper"},e("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",e("span",{class:"s-tiered-offer-tier-name"},r.name)),e("span",{innerHTML:r.icon})))),this.renderProgressBar(),this.renderTabs()))};return r}());d.style=c}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
*/System.register(["./p-sMaYJNRW.system.js"],(function(r){"use strict";var t,e,i;return{setters:[function(r){t=r.r;e=r.h;i=r.H}],execute:function(){var n;(function(r){r["PERCENTAGE"]="percentage";r["FIXED"]="fixed"})(n||(n={}));var s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>';var a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>';var l='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>';var f={staticIcons:[s,o,a,l],staticColors:["#993018","#444444","#D18F36","#315F9C"]};var u=function(){function r(){}r.findTierByIndex=function(r,t){return r.find((function(r){return r.index===t}))||null};r.findTierByName=function(r,t){return r.find((function(r){return r.tier_name===t}))||null};r.getTierNameByIndex=function(r,t){var e;return(e=this.findTierByIndex(r,t))===null||e===void 0?void 0:e.tier_name};r.findCurrentTierIndex=function(r,t){if(!t)return 0;for(var e=t.length-1;e>=0;e--){if(r>=t[e].threshold){return t[e].index}}return 0};return r}();var c=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{-webkit-transform:scaleX(-1);transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{-webkit-transform:scaleX(-1);transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{-webkit-transform:scaleX(-1);transform:scaleX(-1)}";var d=r("salla_tiered_offer",function(){function r(r){var e=this;t(this,r);this.currentTierIndex=0;this.canRender=false;this.isLoading=false;this.handleTabClick=function(r){e.activeTabTier=r};salla.lang.onLoaded((function(){e.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title");e.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier");e.discountText=salla.lang.get("blocks.tiered_offer.discount");e.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}r.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var r,t;return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,3,4,5]);return[4,salla.onReady()];case 1:e.sent();if(!this.checkFeatureEnabled()){return[2]}if(!this.checkCartExists()){return[2]}this.isLoading=true;return[4,this.fetchTieredOfferData()];case 2:r=e.sent();if(!r){return[2]}this.initializeComponent(r);return[3,5];case 3:t=e.sent();this.canRender=false;salla.logger.warn("salla-tiered-offer:: ",t);return[3,5];case 4:this.isLoading=false;return[7];case 5:return[2]}}))}))};r.prototype.checkFeatureEnabled=function(){var r;return(r=salla.config.get("store.features"))===null||r===void 0?void 0:r.includes("tiered-offer")};r.prototype.checkCartExists=function(){var r,t;return!!((t=(r=salla.storage.get("cart"))===null||r===void 0?void 0:r.summary)===null||t===void 0?void 0:t.count)};r.prototype.validateCouponCompatibility=function(r,t){var e;return!(t&&!((e=r.details)===null||e===void 0?void 0:e.applied_with_coupon))};r.prototype.fetchTieredOfferData=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,2,,3]);return[4,salla.api.cart.offers()];case 1:t=n.sent().data;e=t.find((function(r){return r.type==="tiered_offer"}));if(!e){return[2,null]}if(!this.validateCouponCompatibility(e,(r=salla.storage.get("cart"))===null||r===void 0?void 0:r.coupon)){this.canRender=false;return[2,null]}return[2,e];case 2:i=n.sent();throw i;case 3:return[2]}}))}))};r.prototype.initializeComponent=function(r){var t;this.apiOfferData=r;this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData);this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;var e=((t=this.apiOfferData.details)===null||t===void 0?void 0:t.current_value)||0;var i=this.findCurrentTierIndex(e);if(i===0){this.canRender=false;return}this.currentTierIndex=i;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,i);this.activeTabTier=this.currentTier;this.canRender=true};r.prototype.componentDidLoad=function(){var r=this;salla.event.on("cart::updated",(function(t){return __awaiter(r,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.fetchTieredOfferData()];case 1:r=e.sent();if(r){this.updateOfferValues(t,r)}return[2]}}))}))}))};r.prototype.mapApiDataToTiers=function(r){var t=__spreadArray([],r.details.discounts,true).sort((function(r,t){return r.min_spend-t.min_spend}));var e=t.map((function(r,t){return{name:r.name,tier_name:r.name,discount:r.type===n.PERCENTAGE?"".concat(salla.helpers.number(r.value),"%"):salla.money(r.value),icon:f.staticIcons[t]||f.staticIcons[0],threshold:r.min_spend,text_color:f.staticColors[t],index:t+1}}));return{current_tier:u.getTierNameByIndex(e,this.findCurrentTierIndex(r.details.current_value,e)),tiers:e}};r.prototype.findCurrentTierIndex=function(r,t){var e;if(t===void 0){t=(e=this.tieredOfferData)===null||e===void 0?void 0:e.tiers}return u.findCurrentTierIndex(r,t||[])};r.prototype.updateOfferValues=function(r,t){var e,i;if(!t||!this.tieredOfferData){return}if(!this.validateCouponCompatibility(t,r.coupon)){this.canRender=false;return}this.canRender=true;if(((e=t.details)===null||e===void 0?void 0:e.with_current_cart)===false){return}var n=((i=t.details)===null||i===void 0?void 0:i.current_value)||0;this.apiOfferData=t;var s=this.findCurrentTierIndex(n);if(s===0){this.canRender=false;return}this.canRender=true;this.currentTierIndex=s;this.currentTier=u.getTierNameByIndex(this.tieredOfferData.tiers,s);if(this.activeTabTier!==this.currentTier){this.activeTabTier=this.currentTier}};r.prototype.getLoadingSkeletonView=function(){return e(i,null,e("div",{class:"s-tiered-offer-container"},e("div",{class:"s-tiered-offer-skeleton-wrapper"},e("div",{class:"s-tiered-offer-skeleton-title"},e("salla-skeleton",{height:"16px",width:"40%"})),e("div",{class:"s-tiered-offer-skeleton-subtitle"},e("salla-skeleton",{height:"20px",width:"60%"})),e("div",{class:"s-tiered-offer-skeleton-progress"},e("salla-skeleton",{height:"16px",width:"100%"})),e("div",{class:"s-tiered-offer-skeleton-tabs"},e("salla-skeleton",{height:"50px",width:"100%"})))))};r.prototype.getCurrentTierData=function(){return u.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]};r.prototype.getProgressWidth=function(){var r;var t=((r=this.apiOfferData.details)===null||r===void 0?void 0:r.current_value)||0;var e=this.tieredOfferData.tiers.length;var i=this.findCurrentTierIndex(t);var n=i;return n/e*100};r.prototype.calculateMilestonePosition=function(r,t){if(t===1){return"calc(100% - 18px)"}var e=(r+1)/t*100;var i=8/t;return"".concat(Math.max(2,Math.min(95,e-i)),"%")};r.prototype.getMilestoneStyles=function(r,t,e){var i;var n=document.documentElement.dir==="rtl";var s=this.calculateMilestonePosition(t,e);var o=r.name.length>6?"flex-end":"center";return i={},i[n?"right":"left"]=s,i.alignItems=o,i.position="absolute",i.transform=n?"translateX(50%)":"translateX(-50%)",i};r.prototype.getMilestoneIconStyles=function(r,t,e){if(t){return{color:r.text_color}}if(e){return{color:"var(--color-primary)"}}return{}};r.prototype.renderProgressBarBackground=function(r){return[e("div",{class:"s-tiered-offer-progress-bg"}),e("div",{class:"s-tiered-offer-progress-fill",style:{width:"".concat(r,"%")}})]};r.prototype.renderMilestoneIcon=function(r,t,i){var n=["s-tiered-offer-milestone-icon",t?"s-tiered-offer-milestone-active":"",i?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return e("div",{class:n,style:this.getMilestoneIconStyles(r,t,i)},e("span",{innerHTML:r.icon}))};r.prototype.renderMilestoneName=function(r,t){return e("div",{class:"s-tiered-offer-milestone-name"},t&&e("span",{style:{color:r.text_color}},r.name))};r.prototype.renderMilestones=function(r,t){var i=this;var n=t===1?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones";return e("div",{class:"s-tiered-offer-milestones-wrapper"},e("div",{class:n},this.tieredOfferData.tiers.map((function(n,s){var o=r>=n.threshold;var a=n.tier_name===i.currentTier;return e("div",{class:"s-tiered-offer-milestone",style:i.getMilestoneStyles(n,s,t)},i.renderMilestoneIcon(n,a,o),i.renderMilestoneName(n,a))}))))};r.prototype.renderProgressBar=function(){var r;var t=this.getProgressWidth();var i=this.tieredOfferData.tiers.length;var n=((r=this.apiOfferData.details)===null||r===void 0?void 0:r.current_value)||0;return e("div",{class:"s-tiered-offer-progress-container"},e("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(t),this.renderMilestones(n,i)))};r.prototype.renderTabs=function(){var r=this;return e("div",{class:"s-tiered-offer-tabs-container"},e("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((function(t){var i=t.tier_name===r.activeTabTier;return e("button",{class:"s-tiered-offer-tab-header ".concat(i?"s-tiered-offer-tab-active":""),onClick:function(){return r.handleTabClick(t.tier_name)}},e("span",null,t.name))}))),e("div",{class:"s-tiered-offer-tab-content-wrapper"},function(){var t=u.findTierByName(r.tieredOfferData.tiers,r.activeTabTier);if(!t)return null;return e("div",{class:"s-tiered-offer-tab-content"},e("div",{class:"s-tiered-offer-tab-content-inner"},e("div",{class:"s-tiered-offer-discount-section"},e("p",{class:"s-tiered-offer-discount-title"},r.discountText," ",e("span",{innerHTML:t.discount})),e("p",{class:"s-tiered-offer-benefit-description"},r.benefitText," ",t.name))))}()))};r.prototype.render=function(){if(this.isLoading){return this.getLoadingSkeletonView()}if(!this.canRender||!this.tieredOfferData){return null}var r=this.getCurrentTierData();return e(i,null,e("div",{class:"s-tiered-offer-container"},e("div",{class:"s-tiered-offer-header"},e("div",{class:"s-tiered-offer-header-content"},e("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),e("div",{class:"s-tiered-offer-current-tier-name-wrapper"},e("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",e("span",{class:"s-tiered-offer-tier-name"},r.name)),e("span",{innerHTML:r.icon})))),this.renderProgressBar(),this.renderTabs()))};return r}());d.style=c}}}));
|
|
5
|
+
//# sourceMappingURL=p-7d8494a1.system.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-7hzBIbI9.system.js","sources":["src/components/salla-apps-icons/salla-apps-icons.scss?tag=salla-apps-icons","src/components/salla-apps-icons/salla-apps-icons.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot app - Replaces app item, has replaceable props `{icon}`, `{name}`.\n */\n@Component({\n tag: 'salla-apps-icons',\n styleUrl: 'salla-apps-icons.scss',\n})\nexport class SallaAppsIcons {\n constructor() {\n this.appSlot = this.host.querySelector('[slot=\"app\"]')?.innerHTML || `<img alt={name} src={icon} />`;\n salla.onReady(() => {\n this.apps = salla.config.get('store.apps');\n });\n\n salla.lang.onLoaded(() => {\n this.appsTitle = salla.lang.get('blocks.footer.download_apps');\n });\n }\n private readonly appSlot: string;\n @Element() host: HTMLElement;\n @State() apps = salla.config.get('store.apps');\n\n /**\n * Flag to show or hide title.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * The title to display.\n */\n @Prop() appsTitle: string;\n\n /**\n * Display flag to horizontal/vertical.\n */\n @Prop() vertical: boolean;\n\n private getAppsArray() {\n return Object.entries(this.apps)\n .map(([name, value]) => ({ name, value }));\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n render() {\n const appsArray = this.getAppsArray();\n if (Array.isArray(appsArray) && !appsArray.length) {\n return;\n }\n return (\n <Host class=\"s-apps-icons\">\n {!this.hideTitle && <h3>{this.appsTitle}</h3>}\n <div class={{\"s-apps-icons-list\": true, \"vertical\": this.vertical}}>\n {appsArray.map((app, index) => (\n <a key={index} href={app.value as string} rel=\"noreferrer\" target=\"_blank\" class=\"s-apps-icons-item\" id=\"app-slot\" innerHTML={this.appSlot\n .replace(/\\{icon\\}/g, salla.url.cdn(`images/${app.name}.png`))\n .replace(/\\{name\\}/g, app.name)}>\n </a>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n this.host.querySelector('[slot=\"app\"]')?.remove();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAAA,MAAM,iBAAiB,GAAG,sBAAsB;;YCQnC,cAAc,+BAAA,MAAA;MACzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;cAYS,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;MAX5C,QAAA,IAAI,CAAC,OAAO,GAAG,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,0CAAE,SAAS,KAAI,+BAA+B;MACpG,QAAA,KAAK,CAAC,OAAO,CAAC,MAAK;kBACjB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;MAC5C,SAAC,CAAC;MAEF,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;kBACvB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC;MAChE,SAAC,CAAC;MACH;UAoBO,YAAY,GAAA;MAClB,QAAA,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;MAC5B,a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AAA,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 s,h as t,H as e,g as a,c as o}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,H as e,g as a,c as o}from"./p-gdhHvm6V.js";import{p as i,m as r}from"./p-DfeagqF1.js";const c="";const l=class{constructor(t){s(this,t);this.collapsible=true;this.bordered=false;this.size="md";this.collapsed=true;this.dir=document.dir||"rtl"}directionChangedHandler(s){this.dir=s.detail.dir}handleCollapse(s){this.collapsed=s.detail.payload.collapsed}setcollapsibleProp(){const s=this.host.querySelector("salla-accordion-head");if(this.collapsible&&s){s.setAttribute("collapsible","true");s.setAttribute("collapsed",this.collapsed.toString())}}componentDidRender(){this.setcollapsibleProp();const s=this.host.querySelector("salla-accordion-body");if(this.collapsible){this.host.setAttribute("data-collapsed",this.collapsed.toString());s===null||s===void 0?void 0:s.setAttribute("data-collapsed",this.collapsed.toString())}}render(){return t(e,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:`s-accordion-wrapper ${this.dir} ${this.bordered?"s-accordion-wrapper-bordered":""} ${this.size?`size-${this.size}`:""}`,"data-collapsed":this.collapsed.toString()},t("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))}get host(){return a(this)}};l.style=c;const d="";const n=class{constructor(t){s(this,t)}render(){return t(e,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},t("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))}};n.style=d;const h="";const p=class{constructor(t){s(this,t);this.accordionToggle=o(this,"accordionToggle");this.collapsible=false;this.collapsed=true}emitCollapsePanel(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})}toggleCollapse(){var s,t,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(s=this.host.parentElement)===null||s===void 0?void 0:s.setAttribute("data-collapsed",this.collapsed.toString());(e=(t=this.host.parentElement)===null||t===void 0?void 0:t.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()}render(){return t(e,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},t("div",{key:"6826492e1c552440d6407435dfe4e0ca3915cdf4",class:"s-accordion-head-wrapper-start"},t("slot",{key:"2c19c500b57444ac8f69c2f64616904a819f54da",name:"title"}),t("slot",{key:"a6ed0daccd969ec94128f5f749ccddfa9f62e5d3",name:"subtitle"}),t("slot",{key:"adc2122dce76eee34653bc3f47324188c89d80f1",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&t("div",{key:"f61363b6836fb857a0e832de99175936ec4bce29",class:"s-accordion-head-wrapper-end"},t("slot",{key:"15ee81e943714b30bfbaf718364f5d34b14617eb",name:"note"}),this.collapsible&&t("button",{key:"c5f8d32af544ddfba7b2fc2f273ae5b2e8cb7ae5",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:s=>{s.stopPropagation();this.toggleCollapse()}},t("span",{key:"4c4e3fa6ddeda1a59f65ba47665a9203356037a6",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?i:r}))))}get host(){return a(this)}};p.style=h;var f=`\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>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n`;const b="";const u=class{constructor(t){s(this,t);this.bordered=true;this.placeholderImage="images/placeholder.png";this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(!this.options){this.optionsData=[];return}if(typeof this.options==="string"){try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}}else{this.optionsData=Array.isArray(this.options)?this.options:[]}}renderOptionValue(s){if(s.is_image){return t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name})))}if(s.color){return t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}})}if(s.is_file){return t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},"Attachments")}if(s.is_color_picker){return t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:f})))}if(s.is_map&&s.latitude&&s.longitude){return t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:true,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},"Show Location")))}return t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault();if(navigator.clipboard){navigator.clipboard.writeText(t)}}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);if(t&&t.open){t.open()}}render(){if(!this.optionsData.length){return null}const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(e,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};u.style=b;export{l as salla_accordion,n as salla_accordion_body,p as salla_accordion_head,u as salla_order_details_options};
|
|
5
|
+
//# sourceMappingURL=p-8aa7e30f.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as a,g as i}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as s,h as t,H as a,g as i}from"./p-gdhHvm6V.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{var s,t,a;if(typeof this.exclude==="string"){try{this.exclude=JSON.parse(this.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude);this.exclude=[]}}this.placeholderImage=salla.url.cdn(`images/s-empty.png`);this.paymentSlot=((s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||`<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="${this.placeholderImage}" data-src="{image}" alt={payment} /><li>`;this.sbcSlot=((t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.innerHTML)||`<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="${this.placeholderImage}" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>`;this.codSlot=((a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.innerHTML)||`<li class="s-payments-list-item"> <img width="100%" height="100%" src="${this.placeholderImage}" data-src={image} class="lazy" alt="COD"/><li>`;this.payments=salla.config.get("store.settings.payments")}))}render(){const s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");const i=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return t(a,{key:"a1a26ba03aa60491071f0e63bac40de3ad91bce6",class:"s-payments-list-wrap"},t("ul",{key:"d31ca162e83aade956f45d8f517029942a748646",class:"s-payments-list"},s&&t("li",{key:"552e3e57345d01ab33bfd20094cbcf8f702c6efa",class:"s-payments-list-item"},t("img",{key:"04eb9c9a1950edc9ea3c2e218fbe6c5c21d65f6a",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn(`images/made-in-ksa.svg`,58,58),alt:"made in KSA certified"})),this.payments.map((s=>s=="cod"?t("div",{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/cod_mini.png`,58,58))}):t("div",{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/${s}_mini.png`,58,58)).replace(/\{payment\}/g,s)}))),i&&t("div",{key:"5f69b3c936edf8039006d6ecd73e3c44b74b9167",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn(`images/sbc.png`,58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${i}`)})))}componentDidLoad(){var s;(s=document.lazyLoadInstance)===null||s===void 0?void 0:s.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((s=>{s.addEventListener("load",(()=>{s.setAttribute("width","100%");s.setAttribute("height","100%")}))}))}componentDidRender(){var s,t,a;this.host.querySelectorAll("#payment-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#sbc-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#cod-slot").forEach((s=>s.replaceWith(s.firstChild)));(s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.remove();(t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.remove();(a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.remove()}get host(){return i(this)}};l.style=e;export{l as salla_payments};
|
|
5
|
+
//# sourceMappingURL=p-8f3dec24.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-
|
|
1
|
+
{"version":3,"file":"p-93DWpqSw.system.js","sources":["src/components/salla-order-details/salla-order-details.scss?tag=salla-order-details","src/components/salla-order-details/salla-order-details.tsx"],"sourcesContent":["","import { Component, Host, h, Prop, State, Watch, Fragment } from '@stencil/core';\nimport { OrderProduct } from './interfaces';\n\n/**\n * @salla/ui-components\n * The `salla-order-details` component renders a collapsible summary for an order product with optional options list.\n * It uses the salla-accordion component to provide collapsible functionality.\n */\n@Component({\n tag: 'salla-order-details',\n styleUrl: 'salla-order-details.scss',\n})\nexport class SallaOrderDetails {\n @Prop() orderDetails: string | OrderProduct;\n\n @State() parsedOrderDetailsData: OrderProduct;\n\n @Watch('orderDetails')\n private parseOrderDetailsData(newValue: string | OrderProduct) {\n this.parsedOrderDetailsData = newValue as OrderProduct;\n if (typeof this.orderDetails === 'string') {\n this.parsedOrderDetailsData = JSON.parse(newValue as string);\n } else {\n this.parsedOrderDetailsData = newValue as OrderProduct;\n }\n }\n\n componentWillLoad() {\n this.parseOrderDetailsData(this.orderDetails);\n console.log('Parent componentWillLoad - parsedOrderDetailsData:', this.parsedOrderDetailsData);\n }\n\n private renderOrderDetailsContent() {\n // Check if we have parsed data\n if (!this.parsedOrderDetailsData) {\n console.warn('No parsedOrderDetailsData available');\n return null;\n }\n\n return [\n /* Product Options */\n this.parsedOrderDetailsData.options && this.parsedOrderDetailsData.options.length > 0 && (\n <salla-order-details-options options={this.parsedOrderDetailsData.options} />\n ),\n\n /* Bundle Subproducts */\n this.parsedOrderDetailsData.sub_products &&\n this.parsedOrderDetailsData.sub_products.length > 0 && (\n <Fragment>\n <h2 class=\"s-order-details-bundle-title\">\n {salla.lang.get('pages.orders.sub_products')}\n </h2>\n <div class=\"s-order-details-bundle-content\">\n {this.parsedOrderDetailsData.sub_products.map(product => (\n <salla-order-details-multiple-bundle-product\n key={product?.id}\n productDetails={product}\n />\n ))}\n </div>\n </Fragment>\n ),\n ];\n }\n\n render() {\n return <Host class=\"s-order-details-wrapper\">{this.renderOrderDetailsContent()}</Host>;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;YAAA,MAAM,oBAAoB,GAAG,EAAE;;kBCYlB,iBAAiB,kCAAA,MAAA;;;;YAMpB,IAAA,qBAAqB,CAAC,QAA+B,EAAA;YAC3D,QAAA,IAAI,CAAC,sBAAsB,GAAG,QAAwB;YACtD,QAAA,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ,EAAE;wBACzC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAkB,CAAC;;yBACvD;YACL,YAAA,IAAI,CAAC,sBAAsB,GAAG,QAAwB;;;gBAI1D,iBAAiB,GAAA;YACf,QAAA,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,CAAC;oBAC7C,OAAO,CAAC,GAAG,CAAC,oDAAoD,EAAE,IAAI,CAAC,sBAAsB,CAAC;;gBAGxF,yBAAyB,GAAA;;YAE/B,QAAA,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE;YAChC,YAAA,OAAO,CAAC,IAAI,CAAC,qCAAqC,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var s,e,i,a,o,n,r;return{setters:[function(t){s=t.r;e=t.h;i=t.H;a=t.g;o=t.c},function(t){n=t.p;r=t.m}],execute:function(){var c="";var l=t("salla_accordion",function(){function t(t){s(this,t);this.collapsible=true;this.bordered=false;this.size="md";this.collapsed=true;this.dir=document.dir||"rtl"}t.prototype.directionChangedHandler=function(t){this.dir=t.detail.dir};t.prototype.handleCollapse=function(t){this.collapsed=t.detail.payload.collapsed};t.prototype.setcollapsibleProp=function(){var t=this.host.querySelector("salla-accordion-head");if(this.collapsible&&t){t.setAttribute("collapsible","true");t.setAttribute("collapsed",this.collapsed.toString())}};t.prototype.componentDidRender=function(){this.setcollapsibleProp();var t=this.host.querySelector("salla-accordion-body");if(this.collapsible){this.host.setAttribute("data-collapsed",this.collapsed.toString());t===null||t===void 0?void 0:t.setAttribute("data-collapsed",this.collapsed.toString())}};t.prototype.render=function(){return e(i,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:"s-accordion-wrapper ".concat(this.dir," ").concat(this.bordered?"s-accordion-wrapper-bordered":""," ").concat(this.size?"size-".concat(this.size):""),"data-collapsed":this.collapsed.toString()},e("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());l.style=c;var d="";var h=t("salla_accordion_body",function(){function t(t){s(this,t)}t.prototype.render=function(){return e(i,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},e("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))};return t}());h.style=d;var u="";var f=t("salla_accordion_head",function(){function t(t){s(this,t);this.accordionToggle=o(this,"accordionToggle");this.collapsible=false;this.collapsed=true}t.prototype.emitCollapsePanel=function(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})};t.prototype.toggleCollapse=function(){var t,s,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(t=this.host.parentElement)===null||t===void 0?void 0:t.setAttribute("data-collapsed",this.collapsed.toString());(e=(s=this.host.parentElement)===null||s===void 0?void 0:s.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()};t.prototype.render=function(){var t=this;return e(i,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:function(){return t.toggleCollapse()},class:"s-accordion-head-wrapper"},e("div",{key:"6826492e1c552440d6407435dfe4e0ca3915cdf4",class:"s-accordion-head-wrapper-start"},e("slot",{key:"2c19c500b57444ac8f69c2f64616904a819f54da",name:"title"}),e("slot",{key:"a6ed0daccd969ec94128f5f749ccddfa9f62e5d3",name:"subtitle"}),e("slot",{key:"adc2122dce76eee34653bc3f47324188c89d80f1",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&e("div",{key:"f61363b6836fb857a0e832de99175936ec4bce29",class:"s-accordion-head-wrapper-end"},e("slot",{key:"15ee81e943714b30bfbaf718364f5d34b14617eb",name:"note"}),this.collapsible&&e("button",{key:"c5f8d32af544ddfba7b2fc2f273ae5b2e8cb7ae5",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:function(s){s.stopPropagation();t.toggleCollapse()}},e("span",{key:"4c4e3fa6ddeda1a59f65ba47665a9203356037a6",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?n:r}))))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());f.style=u;var p='\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>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n';var b="";var v=t("salla_order_details_options",function(){function t(t){s(this,t);this.bordered=true;this.placeholderImage="images/placeholder.png";this.optionsData=[]}t.prototype.componentWillLoad=function(){this.parseOptionsData()};t.prototype.componentWillUpdate=function(){this.parseOptionsData()};t.prototype.parseOptionsData=function(){if(!this.options){this.optionsData=[];return}if(typeof this.options==="string"){try{this.optionsData=JSON.parse(this.options)}catch(t){this.optionsData=[]}}else{this.optionsData=Array.isArray(this.options)?this.options:[]}};t.prototype.renderOptionValue=function(t){var s=this;if(t.is_image){return e("div",{class:"s-order-details-option-image-container"},e("a",{href:t.value,target:"_blank"},e("img",{class:"s-order-details-option-image",src:t.value||this.placeholderImage,alt:t.name})))}if(t.color){return e("span",{title:t.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:t.color}})}if(t.is_file){return e("a",{href:t.value,target:"_blank",class:"s-order-details-option-file-link"},"Attachments")}if(t.is_color_picker){return e("div",{class:"s-order-details-option-color-picker"},e("div",{class:"s-order-details-option-color-picker-content"},e("span",{class:"s-order-details-option-color-picker-text"},t.value),e("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:t.value,width:"1rem"}})),e("salla-button",{onClick:function(e){return s.copyToClipboard(e,t.value)},shape:"link",class:"s-order-details-option-color-picker-button"},e("span",{class:"s-order-details-option-color-copy-icon",innerHTML:p})))}if(t.is_map&&t.latitude&&t.longitude){return e("salla-map",{id:"location_map_".concat(t.id),class:"map_".concat(t.id),zoom:15,readonly:true,lat:t.latitude,lng:t.longitude},e("div",{slot:"button"},e("button",{type:"button",class:"s-order-details-option-map-button",onClick:function(){return s.openMap(t.id)}},"Show Location")))}return e("span",{class:"s-order-details-option-default-text"},t.display_value||t.value)};t.prototype.copyToClipboard=function(t,s){t.preventDefault();if(navigator.clipboard){navigator.clipboard.writeText(s)}};t.prototype.openMap=function(t){var s=document.querySelector("salla-map.map_".concat(t));if(s&&s.open){s.open()}};t.prototype.render=function(){var t=this;if(!this.optionsData.length){return null}var s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return e(i,{class:"s-order-details-options-wrapper"},e("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),e("div",{class:s},e("dl",{class:"s-order-details-options-list"},this.optionsData.map((function(s){return e("div",{key:s.id,class:"s-order-details-options-item"},e("dt",{class:"s-order-details-options-item-name"},s.name,":"),e("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},t.renderOptionValue(s)))})))))};return t}());v.style=b}}}));
|
|
5
|
+
//# sourceMappingURL=p-953d84e6.system.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,g as o}from"./p-
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as t,h as s,g as o}from"./p-gdhHvm6V.js";import{H as e}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const r=":host{display:block}";const a=class{constructor(s){t(this,s);this.orderNumberText=salla.lang.get("pages.thank_you.order_id");this.totalOrderText=salla.lang.get("pages.orders.total");this.orderDateText=salla.lang.get("pages.orders.date");this.orderStatusText=salla.lang.get("pages.orders.status");this.noOrderText=salla.lang.get("pages.orders.non_orders");this.load_more_text_trans=salla.lang.get("common.elements.load_more");this.languageCode=salla.lang.locale;this.orders=[];salla.lang.onLoaded((()=>{this.languageCode=salla.lang.locale;this.orderNumberText=salla.lang.get("pages.thank_you.order_id");this.totalOrderText=salla.lang.get("pages.orders.total");this.orderDateText=salla.lang.get("pages.orders.date");this.orderStatusText=salla.lang.get("pages.orders.status");this.noOrderText=salla.lang.get("pages.orders.non_orders");this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=true){var s;let o=(s=this.status)===null||s===void 0?void 0:s.querySelector(".s-button-text");if(o){e.toggleElementClassIf(o,"s-button-hide","s-button-show",(()=>t));this.btnLoader.style.display=t?"inherit":"none"}}initiateInfiniteScroll(){var t,s,o;if(!this.hasInfiniteScroll){return}if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:false,nextPage:this.nextPage,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(t=>{this.loading()}));(s=this.infiniteScroll)===null||s===void 0?void 0:s.on("load",(t=>{var s,o;this.loading(false);this.pagination=t.pagination;this.nextPage=((o=(s=t.pagination)===null||s===void 0?void 0:s.links)===null||o===void 0?void 0:o.next)||null;this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));let r=this.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(r)}));(o=this.infiniteScroll)===null||o===void 0?void 0:o.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))}async loadMore(){this.infiniteScroll.loadNextPage()}handleResponse(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadInitialData(){const t=new URL(window.location.href);await salla.order.api.fetch(Object.assign(Object.assign({},this.params),{types:[""],feedback_status:t.searchParams.get("feedback_status")})).then((t=>{var s,o,r,a;this.orders=t.data;this.hasInfiniteScroll=!!((s=t.pagination)===null||s===void 0?void 0:s.links.next);this.pagination=t.pagination;this.total=(o=t.pagination)===null||o===void 0?void 0:o.total;this.nextPage=((a=(r=t.pagination)===null||r===void 0?void 0:r.links)===null||a===void 0?void 0:a.next)||null;if(!this.orders.length){this.showPlaceholder=true;return this.loading(false)}setTimeout((()=>{this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)}),100)})).catch((t=>{this.showPlaceholder=true;this.loading(false);salla.logger.error(t)}))}getSingleOrderItem(t){const s=document.createElement("tr");s.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const o=document.createElement("td");o.classList.add("s-orders-table-tbody-tr-td");const r=document.createElement("div");r.classList.add("s-orders-table-tbody-tr-td-content");const a=document.createElement("span");a.classList.add("s-orders-mobile-title");a.textContent=this.orderNumberText+":";const i=document.createElement("span");i.classList.add("s-orders-reference-id");i.textContent="#"+t.reference_id;r.appendChild(a);r.appendChild(i);if(t.source=="buy_as_gift"){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon");r.appendChild(t)}const n=document.createElement("a");n.href=t.url;r.appendChild(n);const l=document.createElement("div");l.classList.add("s-orders-copy-to-clipboard-button");const d=document.createElement("salla-button");d.classList.add("relative");d.setAttribute("color","dark");d.setAttribute("shape","link");d.dataset.content=t.reference_id.toString();d.addEventListener("click",(t=>{e.copyToClipboard(t);e.toggleElementClassIf(d,"copied","code-to-copy",(()=>true));setTimeout((()=>{e.toggleElementClassIf(d,"code-to-copy","copied",(()=>true))}),1e3)}));const c=document.createElement("span");c.textContent="#"+t.reference_id;const h=document.createElement("i");h.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon");let u=salla.config.get("theme.is_rtl",true);if(u){d.appendChild(h);d.appendChild(c)}else{d.appendChild(c);d.appendChild(h)}l.appendChild(d);r.appendChild(l);o.appendChild(r);s.appendChild(o);const b=document.createElement("td");b.classList.add("s-orders-table-tbody-tr-td");const m=document.createElement("div");m.classList.add("s-orders-table-tbody-tr-td-content");const p=document.createElement("span");p.classList.add("s-orders-mobile-title");p.textContent=this.totalOrderText+":";const v=document.createElement("div");v.innerHTML=salla.money(t.total);const f=document.createElement("a");f.href=t.url;m.appendChild(p);m.appendChild(v);m.appendChild(f);b.appendChild(m);s.appendChild(b);const y=document.createElement("td");y.classList.add("s-orders-table-tbody-tr-td");const g=document.createElement("div");g.classList.add("s-orders-table-tbody-tr-td-content");const _=document.createElement("span");_.classList.add("s-orders-mobile-title");_.textContent=this.orderDateText+":";const k=document.createElement("div");k.textContent=e.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);const w=document.createElement("a");w.href=t.url;g.appendChild(_);g.appendChild(k);g.appendChild(w);y.appendChild(g);s.appendChild(y);const x=document.createElement("td");x.classList.add("s-orders-table-tbody-tr-td");const j=document.createElement("div");j.classList.add("s-orders-table-tbody-tr-td-content");const C=document.createElement("span");C.classList.add("s-orders-mobile-title");C.textContent=this.orderStatusText+":";const H=document.createElement("span");H.classList.add("s-orders-status-container");H.style.color=t.status.color;const I=document.createElement("i");I.classList.add(t.status.icon);const O=document.createElement("span");O.textContent=t.status.name;H.appendChild(I);H.appendChild(O);j.appendChild(C);j.appendChild(H);const S=document.createElement("i");S.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text");j.appendChild(S);const T=document.createElement("a");T.href=t.url;j.appendChild(T);x.appendChild(j);s.appendChild(x);return s}render(){var t;if(this.showPlaceholder){return s("div",{class:"s-orders-no-content"},s("i",{class:"sicon-packed-box icon"}),s("p",null,this.noOrderText))}return s("div",{class:"s-orders-wrapper"},s("table",{class:"s-orders-table"},s("thead",{class:"s-orders-table-head"},s("tr",{class:"s-orders-table-head-tr"},s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),s("tbody",{class:"s-orders-table-tbody",ref:t=>this.wrapper=t})),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},(t=this.loadMoreText)!==null&&t!==void 0?t:this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}componentWillLoad(){return salla.onReady().then((()=>this.loadInitialData())).then((()=>this.initiateInfiniteScroll()))}get host(){return o(this)}};a.style=r;export{a as salla_orders};
|
|
5
|
+
//# sourceMappingURL=p-9a8f94bd.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-H5xAa3Fp.system.js","sources":["src/components/salla-filters/salla-filters.scss?tag=salla-filters","src/components/salla-filters/salla-filters.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.s-rating-stars-small {\n line-height: 12px;\n}\n.s-filters-radio{\n background-image: none !important;\n}","import { Component, Element, h, Event, EventEmitter, Host, Method, Prop, State } from '@stencil/core';\nimport { Filter, FilterOptionTypes } from \"./interfaces\";\nimport Helper from '../../Helpers/Helper';\n@Component({\n tag: 'salla-filters',\n styleUrl: 'salla-filters.scss',\n})\nexport class SallaFilters {\n\n constructor() {\n salla.event.on('filters::hidden', () => this.host.style.display = 'none');\n\n salla.lang.onLoaded(() => {\n this.apply = salla.lang.get('pages.checkout.apply');\n this.reset = salla.lang.get('pages.categories.filters_reset');\n });\n\n salla.event.on('filters::fetched', ({ filters }) => {\n this.host.style.display = '';\n let freshFilterData: any = {};\n this.filters = filters\n .map((filter: Filter) => {\n filter.label = {\n category_id: salla.lang.get('common.titles.categories'),\n brand_id: salla.lang.get('common.titles.brands'),\n rating: salla.lang.get('pages.categories.filter_rating'),\n price: salla.lang.get('pages.categories.filter_price'),\n }[filter.key] || filter.label;\n // filter.type = FilterOptionTypes.VALUES;\n if (filter.key == 'rating') {\n filter.type = FilterOptionTypes.VALUES;\n //@ts-ignore\n let { max, min } = filter.values;\n //@ts-ignore\n filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max)\n }\n if (this.filtersData.variants && filter.type == FilterOptionTypes.VARIANTS) {\n freshFilterData.variants = this.filtersData.variants;\n }\n if (this.filtersData[filter.key] && filter.type !== FilterOptionTypes.VARIANTS) {\n freshFilterData[filter.key] = this.filtersData[filter.key];\n }\n let searchParams = new URLSearchParams(window.location.search);\n let hasFilters = false;\n for (let key of searchParams.keys()) {\n if (key.includes('filters')) {\n hasFilters = true;\n break; // No need to continue checking once a match is found\n }\n }\n if (salla.config.get('page.slug') == \"product.index\" && Object.keys(freshFilterData).length == 0 && !hasFilters) {\n // Append the current category to the url if there are no pre-selected filters\n let currentUrl = window.location.href;\n let filterValue = salla.config.get('page.id');\n let separator = currentUrl.indexOf('?') !== -1 ? '&' : '?';\n let newUrl = currentUrl + separator + 'filters[category_id]=' + filterValue;\n freshFilterData.category_id = filterValue;\n window.history.pushState({ path: newUrl }, '', newUrl);\n }\n return filter;\n });\n this.filtersData = freshFilterData;\n this.host.childNodes.forEach(async (widget: HTMLSallaFiltersWidgetElement) => widget.setWidgetHeight && await widget.setWidgetHeight())\n });\n }\n\n async componentWillLoad() {\n try {\n const searchParams = new URLSearchParams(window.location.search);\n this.filtersData = await Helper.extractFiltersFromUrl(searchParams);\n } catch (e) {\n console.warn('failed to get filters from URL', e.message);\n }\n }\n\n\n @Element() host: HTMLElement;\n\n /**\n * Array of filter options\n */\n @Prop({ reflect: true, mutable: true }) filters?: Filter[];\n\n private isReady = false;//to avoid triggering the changed event\n\n @State() isSidebarOpen: boolean;\n @State() filtersData: object | any = {}\n @State() apply: string;\n @State() reset: string;\n\n /**\n * Custom event fired when the selected filters are changed.\n */\n @Event() changed: EventEmitter;\n\n /**\n * Method to get filter data.\n */\n @Method()\n async getFilters() {\n return this.filtersData;\n }\n\n /**\n * Apply filter action.\n */\n @Method()\n async applyFilters() {\n if (!this.isReady) {\n return;\n }\n let hasFilters = Object.keys(this.filtersData).length > 0;\n setTimeout(() => {\n if (hasFilters) {\n let url = new URL(window.location.href);\n for (const [key] of url.searchParams.entries()) {\n if (key.startsWith(\"filters\")) {\n url.searchParams.delete(key);\n }\n }\n let encodedFilterValues = this.encodeFilters(this.filtersData)\n let sanitizedFilterValues = url.search.split(\"&\").filter(item => !item.includes('filters')).join(\"&\")\n if (sanitizedFilterValues) {\n url.search = url.search.split(\"&filters\")[0] + \"&\" + encodedFilterValues\n } else {\n url.search = `?${encodedFilterValues}`\n }\n window.history.pushState({}, '', url.href);\n }\n else {\n let url = new URL(window.location.href);\n url.searchParams?.delete('filters');\n window.history.pushState({}, '', url.toString());\n }\n salla.event.emit('salla-filters::changed', this.filtersData);\n this.changed.emit(this.filtersData);\n }, 300);\n }\n\n\n private encodeFilters(filters, parentKey = 'filters') {\n const encodedFilters = [];\n\n for (const key in filters) {\n if (Object.prototype.hasOwnProperty.call(filters, key)) {\n const value = filters[key];\n\n const fullKey = parentKey ? `${parentKey}[${key}]` : key;\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n encodedFilters.push(`${fullKey}[${i}]=${value[i]}`)\n }\n }\n else if (typeof value === 'object' && value !== null) {\n encodedFilters.push(this.encodeFilters(value, fullKey));\n } else {\n // const encodedKey = encodeURIComponent(fullKey);\n // const encodedValue = encodeURIComponent(value);\n let result = `${fullKey}=${value}`\n encodedFilters.push(result);\n }\n }\n }\n return encodedFilters.join('&');\n };\n\n /**\n * Reset selected filters.\n */\n @Method()\n async resetFilters() {\n this.removeFiltersQueryParams()\n this.filtersData = {};\n this.host.childNodes.forEach((widget: HTMLSallaFiltersWidgetElement) => widget.reset && widget.reset())\n salla.event.emit('salla-filters::reset');\n return this.applyFilters();\n }\n\n private removeFiltersQueryParams() {\n const searchParams = new URLSearchParams(window.location.search);\n\n const newUrl = Array.from(searchParams.keys())\n .filter(key => !key.startsWith('filters['))\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(searchParams.get(key))}`)\n .join('&');\n\n const finalUrl = newUrl ? `${window.location.pathname}?${newUrl}` : window.location.pathname;\n window.history.pushState({}, '', finalUrl);\n }\n\n /**\n * @param {{target:HTMLInputElement}} event\n * @param option\n * @param value\n * @private\n */\n private handleOptionChange(event, option: Filter, value) {\n if (option.type === FilterOptionTypes.RANGE) {\n this.filtersData[option.key] = value;\n\n }\n let isChecked = event.target.checked;\n\n if (option.type === FilterOptionTypes.VARIANTS) {\n this.filtersData.variants = this.filtersData.variants || {};\n isChecked && (this.filtersData.variants[option.key] = value);\n isChecked || (delete this.filtersData.variants[option.key]);\n }\n\n else if (event.target.type == \"radio\") {\n isChecked && (this.filtersData[option.key] = value);\n isChecked || (delete this.filtersData[option.key]);\n }\n\n //it's checkbox\n // add if condition to avoid error when the filter is not existed in the filtersData\n else if (event.target.type == \"checkbox\") {\n this.filtersData[option.key] = this.filtersData[option.key] || [];\n if (isChecked) {\n this.filtersData[option.key].push(value);\n\n }\n this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);\n }\n this.applyFilters();\n }\n\n\n\n render() {\n return <Host>\n {this.filters?.map(option => <salla-filters-widget\n option={option}\n filtersData={this.filtersData}\n onChanged={({ detail: { event, option, value } }) => {\n this.handleOptionChange(event, option, value)\n }} />)}\n\n {this.filters?.length ? <div class=\"s-filters-footer\">\n {/* <salla-button color='primary' onClick={() => this.applyFilters()}>{this.apply}</salla-button> */}\n <salla-button color='gray' fill='outline' onClick={() => this.resetFilters()}>{this.reset}</salla-button>\n </div> : ''}\n </Host>;\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAAA,MAAM,eAAe,GAAG,+GAA+G;;YCO1H,YAAY,4BAAA,MAAA;MAEvB,IAAA,WAAA,CAAA,OAAA,EAAA;;;MA0EQ,QAAA,IAAA,CAAA,OAAO,GAAG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IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA;MAAE,YAAA,EAAA,CAAA,GAAG,CAAC,MAAM,IAAI,CAAA,CAAA,sBAAA,EAAA,EAC3B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAI;0BAClD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;MAC/C,iBAAC,GAAI,CAAC,EAEP,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,MAAM,IAAG,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,kBAAkB,EAAA,EAEnD,CAAA,CAAA,cAAA,EAAA,EAAc,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAAA,EAAG,IAAI,CAAC,KAAK,CAAgB,CACrG,GAAG,EAAE,CACN;;UAGT,gBAAgB,GAAA;MACd,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-B1BJxOVi.system.js","sources":["src/components/salla-filters/salla-filters.scss?tag=salla-filters","src/components/salla-filters/salla-filters.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.s-rating-stars-small {\n line-height: 12px;\n}\n.s-filters-radio{\n background-image: none !important;\n}","import { Component, Element, h, Event, EventEmitter, Host, Method, Prop, State } from '@stencil/core';\nimport { Filter, FilterOptionTypes } from \"./interfaces\";\nimport Helper from '../../Helpers/Helper';\n@Component({\n tag: 'salla-filters',\n styleUrl: 'salla-filters.scss',\n})\nexport class SallaFilters {\n\n constructor() {\n salla.event.on('filters::hidden', () => this.host.style.display = 'none');\n\n salla.lang.onLoaded(() => {\n this.apply = salla.lang.get('pages.checkout.apply');\n this.reset = salla.lang.get('pages.categories.filters_reset');\n });\n\n salla.event.on('filters::fetched', ({ filters }) => {\n this.host.style.display = '';\n let freshFilterData: any = {};\n this.filters = filters\n .map((filter: Filter) => {\n filter.label = {\n category_id: salla.lang.get('common.titles.categories'),\n brand_id: salla.lang.get('common.titles.brands'),\n rating: salla.lang.get('pages.categories.filter_rating'),\n price: salla.lang.get('pages.categories.filter_price'),\n }[filter.key] || filter.label;\n // filter.type = FilterOptionTypes.VALUES;\n if (filter.key == 'rating') {\n filter.type = FilterOptionTypes.VALUES;\n //@ts-ignore\n let { max, min } = filter.values;\n //@ts-ignore\n filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max)\n }\n if (this.filtersData.variants && filter.type == FilterOptionTypes.VARIANTS) {\n freshFilterData.variants = this.filtersData.variants;\n }\n if (this.filtersData[filter.key] && filter.type !== FilterOptionTypes.VARIANTS) {\n freshFilterData[filter.key] = this.filtersData[filter.key];\n }\n let searchParams = new URLSearchParams(window.location.search);\n let hasFilters = false;\n for (let key of searchParams.keys()) {\n if (key.includes('filters')) {\n hasFilters = true;\n break; // No need to continue checking once a match is found\n }\n }\n if (salla.config.get('page.slug') == \"product.index\" && Object.keys(freshFilterData).length == 0 && !hasFilters) {\n // Append the current category to the url if there are no pre-selected filters\n let currentUrl = window.location.href;\n let filterValue = salla.config.get('page.id');\n let separator = currentUrl.indexOf('?') !== -1 ? '&' : '?';\n let newUrl = currentUrl + separator + 'filters[category_id]=' + filterValue;\n freshFilterData.category_id = filterValue;\n window.history.pushState({ path: newUrl }, '', newUrl);\n }\n return filter;\n });\n this.filtersData = freshFilterData;\n this.host.childNodes.forEach(async (widget: HTMLSallaFiltersWidgetElement) => widget.setWidgetHeight && await widget.setWidgetHeight())\n });\n }\n\n async componentWillLoad() {\n try {\n const searchParams = new URLSearchParams(window.location.search);\n this.filtersData = await Helper.extractFiltersFromUrl(searchParams);\n } catch (e) {\n console.warn('failed to get filters from URL', e.message);\n }\n }\n\n\n @Element() host: HTMLElement;\n\n /**\n * Array of filter options\n */\n @Prop({ reflect: true, mutable: true }) filters?: Filter[];\n\n private isReady = false;//to avoid triggering the changed event\n\n @State() isSidebarOpen: boolean;\n @State() filtersData: object | any = {}\n @State() apply: string;\n @State() reset: string;\n\n /**\n * Custom event fired when the selected filters are changed.\n */\n @Event() changed: EventEmitter;\n\n /**\n * Method to get filter data.\n */\n @Method()\n async getFilters() {\n return this.filtersData;\n }\n\n /**\n * Apply filter action.\n */\n @Method()\n async applyFilters() {\n if (!this.isReady) {\n return;\n }\n let hasFilters = Object.keys(this.filtersData).length > 0;\n setTimeout(() => {\n if (hasFilters) {\n let url = new URL(window.location.href);\n for (const [key] of url.searchParams.entries()) {\n if (key.startsWith(\"filters\")) {\n url.searchParams.delete(key);\n }\n }\n let encodedFilterValues = this.encodeFilters(this.filtersData)\n let sanitizedFilterValues = url.search.split(\"&\").filter(item => !item.includes('filters')).join(\"&\")\n if (sanitizedFilterValues) {\n url.search = url.search.split(\"&filters\")[0] + \"&\" + encodedFilterValues\n } else {\n url.search = `?${encodedFilterValues}`\n }\n window.history.pushState({}, '', url.href);\n }\n else {\n let url = new URL(window.location.href);\n url.searchParams?.delete('filters');\n window.history.pushState({}, '', url.toString());\n }\n salla.event.emit('salla-filters::changed', this.filtersData);\n this.changed.emit(this.filtersData);\n }, 300);\n }\n\n\n private encodeFilters(filters, parentKey = 'filters') {\n const encodedFilters = [];\n\n for (const key in filters) {\n if (Object.prototype.hasOwnProperty.call(filters, key)) {\n const value = filters[key];\n\n const fullKey = parentKey ? `${parentKey}[${key}]` : key;\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n encodedFilters.push(`${fullKey}[${i}]=${value[i]}`)\n }\n }\n else if (typeof value === 'object' && value !== null) {\n encodedFilters.push(this.encodeFilters(value, fullKey));\n } else {\n // const encodedKey = encodeURIComponent(fullKey);\n // const encodedValue = encodeURIComponent(value);\n let result = `${fullKey}=${value}`\n encodedFilters.push(result);\n }\n }\n }\n return encodedFilters.join('&');\n };\n\n /**\n * Reset selected filters.\n */\n @Method()\n async resetFilters() {\n this.removeFiltersQueryParams()\n this.filtersData = {};\n this.host.childNodes.forEach((widget: HTMLSallaFiltersWidgetElement) => widget.reset && widget.reset())\n salla.event.emit('salla-filters::reset');\n return this.applyFilters();\n }\n\n private removeFiltersQueryParams() {\n const searchParams = new URLSearchParams(window.location.search);\n\n const newUrl = Array.from(searchParams.keys())\n .filter(key => !key.startsWith('filters['))\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(searchParams.get(key))}`)\n .join('&');\n\n const finalUrl = newUrl ? `${window.location.pathname}?${newUrl}` : window.location.pathname;\n window.history.pushState({}, '', finalUrl);\n }\n\n /**\n * @param {{target:HTMLInputElement}} event\n * @param option\n * @param value\n * @private\n */\n private handleOptionChange(event, option: Filter, value) {\n if (option.type === FilterOptionTypes.RANGE) {\n this.filtersData[option.key] = value;\n\n }\n let isChecked = event.target.checked;\n\n if (option.type === FilterOptionTypes.VARIANTS) {\n this.filtersData.variants = this.filtersData.variants || {};\n isChecked && (this.filtersData.variants[option.key] = value);\n isChecked || (delete this.filtersData.variants[option.key]);\n }\n\n else if (event.target.type == \"radio\") {\n isChecked && (this.filtersData[option.key] = value);\n isChecked || (delete this.filtersData[option.key]);\n }\n\n //it's checkbox\n // add if condition to avoid error when the filter is not existed in the filtersData\n else if (event.target.type == \"checkbox\") {\n this.filtersData[option.key] = this.filtersData[option.key] || [];\n if (isChecked) {\n this.filtersData[option.key].push(value);\n\n }\n this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);\n }\n this.applyFilters();\n }\n\n\n\n render() {\n return <Host>\n {this.filters?.map(option => <salla-filters-widget\n option={option}\n filtersData={this.filtersData}\n onChanged={({ detail: { event, option, value } }) => {\n this.handleOptionChange(event, option, value)\n }} />)}\n\n {this.filters?.length ? <div class=\"s-filters-footer\">\n {/* <salla-button color='primary' onClick={() => this.applyFilters()}>{this.apply}</salla-button> */}\n <salla-button color='gray' fill='outline' onClick={() => this.resetFilters()}>{this.reset}</salla-button>\n </div> : ''}\n </Host>;\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAAA,MAAM,eAAe,GAAG,+GAA+G;;YCO1H,YAAY,4BAAA,MAAA;MAEvB,IAAA,WAAA,CAAA,OAAA,EAAA;;;MA0EQ,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC;MAGf,QAAA,IAAW,CAAA,WAAA,GAAiB,EAAE;cA5ErC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;MAEzE,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK;kBACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC;kBACnD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC;MAC/D,SAAC,CAAC;MAEF,QAAA,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC,EAAE,OAAO,EAAE,KAAI;kBACjD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE;kBAC5B,IAAI,eAAe,GAAQ,EAAE;kBAC7B,IAAI,CAAC,OAAO,GAAG;MACZ,iBAAA,GAAG,CAAC,CAAC,MAAc,KAAI;sBACtB,MAAM,CAAC,KAAK,GAAG;0BACb,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC;0BACvD,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC;0BAChD,MA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