@salla.sa/twilight-components 2.14.250 → 2.14.251
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-BgNFpKiG.js → app-globals-0qyY-ElC.js} +3 -3
- package/dist/cjs/{app-globals-BgNFpKiG.js.map → app-globals-0qyY-ElC.js.map} +1 -1
- package/dist/cjs/{index-DFk4JQs_.js → index-CxIOfeMA.js} +4 -4
- package/dist/cjs/{index-DFk4JQs_.js.map → index-CxIOfeMA.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +22 -1
- package/dist/cjs/salla-product-options.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-product-options.entry.cjs.js.map +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/collection/components/salla-product-options/salla-product-options.js +21 -0
- package/dist/collection/components/salla-product-options/salla-product-options.js.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-product-options.js +21 -0
- package/dist/components/salla-product-options.js.map +1 -1
- package/dist/esm/{app-globals-DoDOGg4t.js → app-globals-BBUHVW9U.js} +3 -3
- package/dist/esm/{app-globals-DoDOGg4t.js.map → app-globals-BBUHVW9U.js.map} +1 -1
- package/dist/esm/{index-Fh3juwdj.js → index-aC-cHVMV.js} +4 -4
- package/dist/esm/{index-Fh3juwdj.js.map → index-aC-cHVMV.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body.entry.js +1 -1
- package/dist/esm/salla-accordion-head.entry.js +1 -1
- package/dist/esm/salla-accordion.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +22 -1
- package/dist/esm/salla-product-options.entry.js.map +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-DoDOGg4t.js → app-globals-BBUHVW9U.js} +2 -2
- package/dist/esm-es5/{app-globals-DoDOGg4t.js.map → app-globals-BBUHVW9U.js.map} +1 -1
- package/dist/esm-es5/{index-Fh3juwdj.js → index-aC-cHVMV.js} +3 -3
- package/dist/esm-es5/{index-Fh3juwdj.js.map → index-aC-cHVMV.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
- package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
- package/dist/esm-es5/salla-accordion.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
- package/dist/esm-es5/salla-advertisement.entry.js +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
- package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js +2 -2
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-installment.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-notification-item.entry.js +1 -1
- package/dist/esm-es5/salla-notifications.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-order-summary.entry.js +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-product-options.entry.js.map +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-03f5a937.entry.js +5 -0
- package/dist/twilight/{p-a4373a58.entry.js → p-0443edb2.entry.js} +2 -2
- package/dist/twilight/{p-15109abe.entry.js → p-04b3d375.entry.js} +2 -2
- package/dist/twilight/{p-2fc264a5.system.entry.js → p-08b3ea63.system.entry.js} +2 -2
- package/dist/twilight/{p-48c8c116.system.entry.js → p-09117f81.system.entry.js} +2 -2
- package/dist/twilight/{p-90b19a52.entry.js → p-0d0836f3.entry.js} +2 -2
- package/dist/twilight/{p-5aa8dd63.system.entry.js → p-0e931dd0.system.entry.js} +2 -2
- package/dist/twilight/{p-8e87d5bb.entry.js → p-18bd19bd.entry.js} +2 -2
- package/dist/twilight/{p-65e55582.system.entry.js → p-1b9e31b1.system.entry.js} +2 -2
- package/dist/twilight/{p-c143cae6.system.entry.js → p-1d08e23e.system.entry.js} +2 -2
- package/dist/twilight/{p-8422a030.entry.js → p-21c35fec.entry.js} +2 -2
- package/dist/twilight/{p-DFHtpaXy.system.js.map → p-24T5fnEM.system.js.map} +1 -1
- package/dist/twilight/{p-af947a45.system.entry.js → p-29440936.system.entry.js} +2 -2
- package/dist/twilight/{p-eab0ef43.system.entry.js → p-2d2fce30.system.entry.js} +2 -2
- package/dist/twilight/{p-0d5aa57d.system.entry.js → p-2f85174e.system.entry.js} +2 -2
- package/dist/twilight/{p-1d675685.entry.js → p-3407c5ef.entry.js} +2 -2
- package/dist/twilight/{p-d3177b59.entry.js → p-342eda73.entry.js} +2 -2
- package/dist/twilight/{p-dca1a091.entry.js → p-3438bc0c.entry.js} +2 -2
- package/dist/twilight/{p-4f532944.system.entry.js → p-3b207dc4.system.entry.js} +2 -2
- package/dist/twilight/{p-89bfcbd9.entry.js → p-3e82f611.entry.js} +2 -2
- package/dist/twilight/{p-yR-D_QVV.system.js.map → p-3etOZ9ok.system.js.map} +1 -1
- package/dist/twilight/{p-f4dd7c30.entry.js → p-3fb416fa.entry.js} +2 -2
- package/dist/twilight/{p-cc88bd11.entry.js → p-47fc4553.entry.js} +2 -2
- package/dist/twilight/{p-84efc4e5.system.entry.js → p-49051076.system.entry.js} +2 -2
- package/dist/twilight/{p-c5bdc891.system.entry.js → p-4a4cad07.system.entry.js} +3 -3
- package/dist/twilight/{p-0093b63c.system.entry.js → p-4d318ffc.system.entry.js} +2 -2
- package/dist/twilight/{p-31c2d596.entry.js → p-5054fc18.entry.js} +2 -2
- package/dist/twilight/{p-d6d41f95.entry.js → p-56074b1e.entry.js} +2 -2
- package/dist/twilight/{p-777970a0.system.entry.js → p-56628b3c.system.entry.js} +2 -2
- package/dist/twilight/{p-f8232bd5.entry.js → p-5dda0431.entry.js} +2 -2
- package/dist/twilight/p-61471a8d.system.entry.js +5 -0
- package/dist/twilight/{p-AKVBtuMk.system.js.map → p-63hxYOEG.system.js.map} +1 -1
- package/dist/twilight/{p-3011ae50.entry.js → p-65d9d657.entry.js} +2 -2
- package/dist/twilight/{p-2ae3f0e1.system.entry.js → p-6943af29.system.entry.js} +2 -2
- package/dist/twilight/{p-f0ad1f7a.system.entry.js → p-6a16b86d.system.entry.js} +2 -2
- package/dist/twilight/{p-07e383ed.entry.js → p-70688702.entry.js} +2 -2
- package/dist/twilight/{p-8c4ff806.entry.js → p-75203eae.entry.js} +2 -2
- package/dist/twilight/{p-72dbdf8a.entry.js → p-779536eb.entry.js} +2 -2
- package/dist/twilight/{p-CuT3SRo-.system.js.map → p-7HslI1sO.system.js.map} +1 -1
- package/dist/twilight/{p-3f5fc0ac.entry.js → p-7e1c3fd9.entry.js} +2 -2
- package/dist/twilight/{p-ef1c9026.system.entry.js → p-7f9f9400.system.entry.js} +2 -2
- package/dist/twilight/p-7f9f9400.system.entry.js.map +1 -0
- package/dist/twilight/{p-CQ0P5lf7.system.js.map → p-81UxRwTN.system.js.map} +1 -1
- package/dist/twilight/{p-67a30d9c.entry.js → p-8a55a076.entry.js} +2 -2
- package/dist/twilight/{p-feb47383.system.entry.js → p-8c2a97cf.system.entry.js} +2 -2
- package/dist/twilight/p-8d02af0b.system.entry.js +5 -0
- package/dist/twilight/{p-6e2c5013.system.entry.js → p-9297d5d0.system.entry.js} +2 -2
- package/dist/twilight/{p-5e07c206.system.entry.js → p-92a2ce11.system.entry.js} +2 -2
- package/dist/twilight/{p-12ec4275.entry.js → p-92fb3adc.entry.js} +2 -2
- package/dist/twilight/{p-c8409d01.system.entry.js → p-939b203a.system.entry.js} +2 -2
- package/dist/twilight/{p-b0342394.entry.js → p-94b99a34.entry.js} +2 -2
- package/dist/twilight/{p-41858b7a.entry.js → p-98ca67d7.entry.js} +2 -2
- package/dist/twilight/p-9b7b035c.entry.js +5 -0
- package/dist/twilight/{p-a74c3613.entry.js → p-9c2bf5c2.entry.js} +2 -2
- package/dist/twilight/{p-CXK1rNlC.system.js → p-9cvlynxW.system.js} +3 -3
- package/dist/twilight/{p-CXK1rNlC.system.js.map → p-9cvlynxW.system.js.map} +1 -1
- package/dist/twilight/{p-969a72ac.entry.js → p-9f75e64f.entry.js} +2 -2
- package/dist/twilight/{p-xqp4ddQE.system.js.map → p-B-6fJi1f.system.js.map} +1 -1
- package/dist/twilight/{p-D7rVz8w9.system.js.map → p-B6pAHU4P.system.js.map} +1 -1
- package/dist/twilight/{p-RTeyQLWy.system.js.map → p-BSHk_PNC.system.js.map} +1 -1
- package/dist/twilight/{p-0Yb-UePn.system.js.map → p-BZAlfa8A.system.js.map} +1 -1
- package/dist/twilight/{p-BGI8pwzX.system.js.map → p-BaUsKGrq.system.js.map} +1 -1
- package/dist/twilight/{p-CsNoOX-E.system.js → p-Bl7BRAvB.system.js} +2 -2
- package/dist/twilight/{p-CsNoOX-E.system.js.map → p-Bl7BRAvB.system.js.map} +1 -1
- package/dist/twilight/{p-F0k7g9iY.system.js.map → p-C3l3EpVC.system.js.map} +1 -1
- package/dist/twilight/{p-6K3EacFl.system.js → p-CBqvheHa.system.js} +2 -2
- package/dist/twilight/{p-6K3EacFl.system.js.map → p-CBqvheHa.system.js.map} +1 -1
- package/dist/twilight/{p-I3V9OjUh.system.js.map → p-CHKd1ZbK.system.js.map} +1 -1
- package/dist/twilight/{p-CJCijTkx.system.js.map → p-CbFmk86R.system.js.map} +1 -1
- package/dist/twilight/{p-C7pQcCCO.system.js.map → p-Chh9LXws.system.js.map} +1 -1
- package/dist/twilight/{p-DXIfbc_E.system.js.map → p-Cie2T8Bo.system.js.map} +1 -1
- package/dist/twilight/{p-B_e6C9C7.system.js.map → p-Craz4PUF.system.js.map} +1 -1
- package/dist/twilight/{p-BqsAYW_z.system.js.map → p-D1othg3r.system.js.map} +1 -1
- package/dist/twilight/{p-JqK0adg-.system.js.map → p-D74Dhmc1.system.js.map} +1 -1
- package/dist/twilight/{p-BeIXRKnY.system.js.map → p-DFTLMdWL.system.js.map} +1 -1
- package/dist/twilight/{p-C1ANpTev.system.js.map → p-DOCHKq2e.system.js.map} +1 -1
- package/dist/twilight/{p-kq1kexdS.system.js.map → p-DOHYAySQ.system.js.map} +1 -1
- package/dist/twilight/{p-C7zV68dE.system.js.map → p-DbkDylL6.system.js.map} +1 -1
- package/dist/twilight/{p-OPHJjNOp.system.js.map → p-De28Pl5h.system.js.map} +1 -1
- package/dist/twilight/{p-DDYb73x9.system.js.map → p-DobF7Qkv.system.js.map} +1 -1
- package/dist/twilight/{p-BEv7FXnl.system.js.map → p-Dohhf_R_.system.js.map} +1 -1
- package/dist/twilight/{p-oQO9FKN9.system.js.map → p-DoomSogT.system.js.map} +1 -1
- package/dist/twilight/{p-ClGf-mQe.system.js.map → p-QCD41AKz.system.js.map} +1 -1
- package/dist/twilight/{p-BlIQW2lO.system.js.map → p-Uzujt2uQ.system.js.map} +1 -1
- package/dist/twilight/{p-DL20L4sR.system.js.map → p-YRdrauTw.system.js.map} +1 -1
- package/dist/twilight/{p-51fff39f.entry.js → p-a3c00836.entry.js} +2 -2
- package/dist/twilight/{p-CV9enCHU.system.js.map → p-a3gxDXSb.system.js.map} +1 -1
- package/dist/twilight/{p-314b3b1d.system.entry.js → p-a5b4c38f.system.entry.js} +2 -2
- package/dist/twilight/{p-be0c1dee.entry.js → p-a94e5163.entry.js} +2 -2
- package/dist/twilight/{p-Fh3juwdj.js → p-aC-cHVMV.js} +3 -3
- package/dist/twilight/{p-Fh3juwdj.js.map → p-aC-cHVMV.js.map} +1 -1
- package/dist/twilight/p-af7ace10.entry.js +5 -0
- package/dist/twilight/p-af7ace10.entry.js.map +1 -0
- package/dist/twilight/{p-b07d4935.entry.js → p-b0584206.entry.js} +2 -2
- package/dist/twilight/{p-bcb8b7a7.system.entry.js → p-b1f25cb5.system.entry.js} +3 -3
- package/dist/twilight/{p-11c6d38a.system.entry.js → p-b75d729a.system.entry.js} +2 -2
- package/dist/twilight/{p-aa17ca75.system.entry.js → p-b7bb5a85.system.entry.js} +2 -2
- package/dist/twilight/{p-0ecc5067.system.entry.js → p-b9a992c8.system.entry.js} +2 -2
- package/dist/twilight/{p-C5ceUSVS.js → p-cW_hSk8i.js} +2 -2
- package/dist/twilight/{p-C5ceUSVS.js.map → p-cW_hSk8i.js.map} +1 -1
- package/dist/twilight/{p-9b377923.entry.js → p-d01c0575.entry.js} +2 -2
- package/dist/twilight/{p-ed74ff73.system.entry.js → p-e1a599fb.system.entry.js} +2 -2
- package/dist/twilight/{p-d2f4c095.system.entry.js → p-e29eb090.system.entry.js} +2 -2
- package/dist/twilight/{p-5b0c8164.system.entry.js → p-e5cd34c3.system.entry.js} +2 -2
- package/dist/twilight/{p-cbd8cbee.entry.js → p-efcf803a.entry.js} +2 -2
- package/dist/twilight/{p-b3e42e7f.system.entry.js → p-f777295c.system.entry.js} +2 -2
- package/dist/twilight/{p-caf5e9c0.system.entry.js → p-f9735e19.system.entry.js} +2 -2
- package/dist/twilight/{p-ea4cddf9.system.entry.js → p-fabacea5.system.entry.js} +2 -2
- package/dist/twilight/{p-CjFC0ce0.system.js.map → p-fkQosYiP.system.js.map} +1 -1
- package/dist/twilight/{p-Dm-9Eytr.system.js.map → p-gyc8toCS.system.js.map} +1 -1
- package/dist/twilight/p-o3nk7iqR.system.js.map +1 -0
- package/dist/twilight/{p-B5711wvS.system.js.map → p-sLrIToFR.system.js.map} +1 -1
- package/dist/twilight/salla-product-options.entry.esm.js.map +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +1 -0
- package/package.json +5 -5
- package/dist/twilight/p-2c7106a0.entry.js +0 -5
- package/dist/twilight/p-3c7322ea.system.entry.js +0 -5
- package/dist/twilight/p-86a30b82.entry.js +0 -5
- package/dist/twilight/p-86a30b82.entry.js.map +0 -1
- package/dist/twilight/p-DydKtKGm.system.js.map +0 -1
- package/dist/twilight/p-ce2994fb.system.entry.js +0 -5
- package/dist/twilight/p-d8605d58.entry.js +0 -5
- package/dist/twilight/p-ef1c9026.system.entry.js.map +0 -1
- /package/dist/twilight/{p-d8605d58.entry.js.map → p-03f5a937.entry.js.map} +0 -0
- /package/dist/twilight/{p-a4373a58.entry.js.map → p-0443edb2.entry.js.map} +0 -0
- /package/dist/twilight/{p-15109abe.entry.js.map → p-04b3d375.entry.js.map} +0 -0
- /package/dist/twilight/{p-2fc264a5.system.entry.js.map → p-08b3ea63.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-48c8c116.system.entry.js.map → p-09117f81.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-90b19a52.entry.js.map → p-0d0836f3.entry.js.map} +0 -0
- /package/dist/twilight/{p-5aa8dd63.system.entry.js.map → p-0e931dd0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8e87d5bb.entry.js.map → p-18bd19bd.entry.js.map} +0 -0
- /package/dist/twilight/{p-65e55582.system.entry.js.map → p-1b9e31b1.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c143cae6.system.entry.js.map → p-1d08e23e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-8422a030.entry.js.map → p-21c35fec.entry.js.map} +0 -0
- /package/dist/twilight/{p-af947a45.system.entry.js.map → p-29440936.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-eab0ef43.system.entry.js.map → p-2d2fce30.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0d5aa57d.system.entry.js.map → p-2f85174e.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-1d675685.entry.js.map → p-3407c5ef.entry.js.map} +0 -0
- /package/dist/twilight/{p-d3177b59.entry.js.map → p-342eda73.entry.js.map} +0 -0
- /package/dist/twilight/{p-dca1a091.entry.js.map → p-3438bc0c.entry.js.map} +0 -0
- /package/dist/twilight/{p-4f532944.system.entry.js.map → p-3b207dc4.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-89bfcbd9.entry.js.map → p-3e82f611.entry.js.map} +0 -0
- /package/dist/twilight/{p-f4dd7c30.entry.js.map → p-3fb416fa.entry.js.map} +0 -0
- /package/dist/twilight/{p-cc88bd11.entry.js.map → p-47fc4553.entry.js.map} +0 -0
- /package/dist/twilight/{p-84efc4e5.system.entry.js.map → p-49051076.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-c5bdc891.system.entry.js.map → p-4a4cad07.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0093b63c.system.entry.js.map → p-4d318ffc.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-31c2d596.entry.js.map → p-5054fc18.entry.js.map} +0 -0
- /package/dist/twilight/{p-d6d41f95.entry.js.map → p-56074b1e.entry.js.map} +0 -0
- /package/dist/twilight/{p-777970a0.system.entry.js.map → p-56628b3c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f8232bd5.entry.js.map → p-5dda0431.entry.js.map} +0 -0
- /package/dist/twilight/{p-ce2994fb.system.entry.js.map → p-61471a8d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3011ae50.entry.js.map → p-65d9d657.entry.js.map} +0 -0
- /package/dist/twilight/{p-2ae3f0e1.system.entry.js.map → p-6943af29.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-f0ad1f7a.system.entry.js.map → p-6a16b86d.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-07e383ed.entry.js.map → p-70688702.entry.js.map} +0 -0
- /package/dist/twilight/{p-8c4ff806.entry.js.map → p-75203eae.entry.js.map} +0 -0
- /package/dist/twilight/{p-72dbdf8a.entry.js.map → p-779536eb.entry.js.map} +0 -0
- /package/dist/twilight/{p-3f5fc0ac.entry.js.map → p-7e1c3fd9.entry.js.map} +0 -0
- /package/dist/twilight/{p-67a30d9c.entry.js.map → p-8a55a076.entry.js.map} +0 -0
- /package/dist/twilight/{p-feb47383.system.entry.js.map → p-8c2a97cf.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-3c7322ea.system.entry.js.map → p-8d02af0b.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-6e2c5013.system.entry.js.map → p-9297d5d0.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5e07c206.system.entry.js.map → p-92a2ce11.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-12ec4275.entry.js.map → p-92fb3adc.entry.js.map} +0 -0
- /package/dist/twilight/{p-c8409d01.system.entry.js.map → p-939b203a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-b0342394.entry.js.map → p-94b99a34.entry.js.map} +0 -0
- /package/dist/twilight/{p-41858b7a.entry.js.map → p-98ca67d7.entry.js.map} +0 -0
- /package/dist/twilight/{p-2c7106a0.entry.js.map → p-9b7b035c.entry.js.map} +0 -0
- /package/dist/twilight/{p-a74c3613.entry.js.map → p-9c2bf5c2.entry.js.map} +0 -0
- /package/dist/twilight/{p-969a72ac.entry.js.map → p-9f75e64f.entry.js.map} +0 -0
- /package/dist/twilight/{p-51fff39f.entry.js.map → p-a3c00836.entry.js.map} +0 -0
- /package/dist/twilight/{p-314b3b1d.system.entry.js.map → p-a5b4c38f.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-be0c1dee.entry.js.map → p-a94e5163.entry.js.map} +0 -0
- /package/dist/twilight/{p-b07d4935.entry.js.map → p-b0584206.entry.js.map} +0 -0
- /package/dist/twilight/{p-bcb8b7a7.system.entry.js.map → p-b1f25cb5.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-11c6d38a.system.entry.js.map → p-b75d729a.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-aa17ca75.system.entry.js.map → p-b7bb5a85.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-0ecc5067.system.entry.js.map → p-b9a992c8.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-9b377923.entry.js.map → p-d01c0575.entry.js.map} +0 -0
- /package/dist/twilight/{p-ed74ff73.system.entry.js.map → p-e1a599fb.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-d2f4c095.system.entry.js.map → p-e29eb090.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-5b0c8164.system.entry.js.map → p-e5cd34c3.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-cbd8cbee.entry.js.map → p-efcf803a.entry.js.map} +0 -0
- /package/dist/twilight/{p-b3e42e7f.system.entry.js.map → p-f777295c.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-caf5e9c0.system.entry.js.map → p-f9735e19.system.entry.js.map} +0 -0
- /package/dist/twilight/{p-ea4cddf9.system.entry.js.map → p-fabacea5.system.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,s,e,n){function i(t){return t instanceof e?t:new e((function(s){s(t)}))}return new(e||(e=Promise))((function(e,r){function c(t){try{a(n.next(t))}catch(t){r(t)}}function o(t){try{a(n["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):i(t.value).then(c,o)}a((n=n.apply(t,s||[])).next())}))};var __generator=this&&this.__generator||function(t,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,c;return c={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function o(t){return function(s){return a([t,s])}}function a(o){if(n)throw new TypeError("Generator is already executing.");while(c&&(c=0,o[0]&&(e=0)),e)try{if(n=1,i&&(r=o[0]&2?i["return"]:o[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;if(i=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;i=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1];r=o;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(o);break}if(r[2])e.ops.pop();e.trys.pop();continue}o=s.call(t,e)}catch(t){o=[6,t];i=0}finally{n=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,h}from"./index-
|
|
4
|
+
*/import{r as registerInstance,h}from"./index-aC-cHVMV.js";import{S as SpecialDiscountIcon,A as ArrowDownIcon}from"./special-discount-yRO-ZESF.js";import{G as GiftIcon}from"./gift-C0JNGIpa.js";var TagMoneyIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n';var FireIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n';var DiscountCouponIcon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n';var sallaCartItemOffersCss=":host{display:block}";var SallaCartItemOffers=function(){function t(t){var s=this;registerInstance(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:DiscountCouponIcon,GiftIcon:GiftIcon,FireIcon:FireIcon,SpecialDiscountIcon:SpecialDiscountIcon,TagMoneyIcon:TagMoneyIcon};this.visibleOffersCount=3;this.handleCartItemUpdated=function(t){var e=t.data.cart.items.find((function(t){return t.id===s.itemId}));if((e===null||e===void 0?void 0:e.id)===s.itemId){s.internalQuantity=e.quantity;s.internalOffers=e.detailed_offers||[];s.internalProductPrice=e.product_price}};this.toggleShowAll=function(){s.showAll=!s.showAll}}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,Salla.onReady()];case 1:s.sent();return[4,salla.lang.onLoaded((function(){t.freeLabel=salla.lang.get("common.elements.freeExclam");t.receivedOffer=salla.lang.get("pages.cart.received_offer");t.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");t.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}))];case 2:s.sent();this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice;return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;salla.event.on("cart::item.updated",(function(s){return t.handleCartItemUpdated(s)}))};t.prototype.parseOffers=function(t){try{if(typeof t!=="string"){console.warn("Offers is not a string. Returning as-is.",t);return Array.isArray(t)?t:[]}return JSON.parse(t||"[]")}catch(t){console.error("Failed to parse offers",t);return[]}};Object.defineProperty(t.prototype,"visibleOffers",{get:function(){return this.internalOffers.slice(0,this.visibleOffersCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hiddenOffers",{get:function(){return this.internalOffers.slice(this.visibleOffersCount)},enumerable:false,configurable:true});t.prototype.getPaidQty=function(t,s){return t-s.free_quantity};t.prototype.renderOffer=function(t,s){var e=this.getPaidQty(t,s);return h("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&e>0&&h("div",{class:"s-cart-item-offers-paid-free"},h("div",{class:"s-cart-item-offers-line"},salla.helpers.number(e)," × ",h("span",{innerHTML:salla.money(this.internalProductPrice)})),h("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",h("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),h("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),h("div",{class:"s-cart-item-offers-details"},h("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),h("div",null,h("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),h("p",{class:"s-cart-item-offers-discount"},h("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))};t.prototype.render=function(){var t=this;var s,e;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return h("div",{class:"s-cart-item-offers-container",id:"offers_list_".concat(this.itemId)},this.visibleOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)})),((e=this.internalOffers)===null||e===void 0?void 0:e.length)>this.visibleOffersCount&&h("div",{class:"s-cart-item-offers-show-more"},h("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},h("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,h("span",{innerHTML:ArrowDownIcon,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&h("div",{class:"s-cart-item-offers-collapsed",id:"offers_".concat(this.itemId)},this.hiddenOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)}))))};return t}();SallaCartItemOffers.style=sallaCartItemOffersCss;export{SallaCartItemOffers as salla_cart_item_offers};
|
|
5
5
|
//# sourceMappingURL=salla-cart-item-offers.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host}from"./index-aC-cHVMV.js";var DiscountType;(function(i){i["PERCENTAGE"]="percentage";i["FIXED"]="fixed";i["FREE_PRODUCT"]="free_product"})(DiscountType||(DiscountType={}));var OfferType;(function(i){i["PRODUCT_COUNT"]="products_count";i["PRODUCT_PURCHASE"]="order_amount"})(OfferType||(OfferType={}));var sallaConditionalOfferCss=":host{display:block}";var SallaConditionalOffer=function(){function i(i){registerInstance(this,i);this.offer=null;this.products={};this.isLoading=false;this.canRender=true}i.prototype.componentWillLoad=function(){var i=this;salla.onReady().then((function(){var i,n,t;if(!((i=salla.config.get("store.features"))===null||i===void 0?void 0:i.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((t=(n=salla.storage.get("cart"))===null||n===void 0?void 0:n.summary)===null||t===void 0?void 0:t.count)){throw new Error("feature or cart object does not existed")}})).then((function(){return salla.api.cart.offers()})).then((function(n){var t=n.data;i.offer=t.find((function(i){return i.type==="conditional"}));if(!i.offer){i.canRender=false;return}i.isLoading=true;i.offer.details.discounts.unshift({value:0,min_spend:0});return i.updateInitialOfferValue()})).then((function(){if(!i.offer)return;return i.getProducts()})).then((function(){if(!i.offer)return;salla.event.on("cart::updated",(function(n){return i.updateOfferValues(n)}))})).catch((function(n){i.canRender=false;salla.logger.warn("salla-conditional-offer:: ",n)})).finally((function(){i.isLoading=false}))};i.prototype.getProducts=function(){var i=this;var n=this.offer.details.discounts.filter((function(i){var n=i.type;return n===DiscountType.FREE_PRODUCT})).map((function(i){var n=i.value;return n}));if(n.length>0){return salla.product.fetch({source:"selected",source_value:n}).then((function(n){var t=n.data;t.forEach((function(n){var t=n.id,e=n.url,o=n.image;i.products[t]={url:e,image:o}}))}))}};i.prototype.updateInitialOfferValue=function(){var i=this;return salla.api.cart.details().then((function(n){var t=n.data.cart;return i.updateOfferValues(t)}))};i.prototype.updateOfferValues=function(i){var n=i.items,t=i.sub_total;var e,o;var r=this.offer.details.based_on===OfferType.PRODUCT_COUNT?(e=n===null||n===void 0?void 0:n.reduce((function(i,n){var t=n.quantity;return i+t}),0))!==null&&e!==void 0?e:0:t;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(o=this.offer)===null||o===void 0?void 0:o.details),{current_value:r})});return this.offer};i.prototype.getCheckpointContent=function(i){var n,t;if(i.type===DiscountType.PERCENTAGE)return"".concat(i.value,"%");if(i.type===DiscountType.FIXED)return salla.money(i.value);if(i.type!==DiscountType.FREE_PRODUCT){salla.logger.error("salla-conditional-offer:: unexpected type (".concat(i.type,")!"));return""}var e=this.products[i.value];if(!e){salla.logger.error("salla-conditional-offer:: there is no product with id (".concat(i.value,")!"));return""}return h("a",{class:"s-conditional-offer-product-link",href:e.url},h("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((n=e===null||e===void 0?void 0:e.image)===null||n===void 0?void 0:n.alt)||"",src:(t=e===null||e===void 0?void 0:e.image)===null||t===void 0?void 0:t.url}))};i.prototype.getOfferType=function(i){var n;var t=(n=this.offer.details)===null||n===void 0?void 0:n.based_on;if(t===OfferType.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",i.min_spend);if(t===OfferType.PRODUCT_PURCHASE)return salla.money(i.min_spend);salla.logger.warn("salla-conditional-offer:: Unexpected offer detail's based_on value: ".concat(t));return"".concat(i.min_spend)};i.prototype.clamp=function(i,n,t){return Math.max(n,Math.min(i,t))};i.prototype.mapValueRanges=function(i,n,t,e,o){var r=(i-n)*(o-e)/(t-n)+e;if(r===Number.POSITIVE_INFINITY)return 100;if(r===Number.NEGATIVE_INFINITY)return 0;return this.clamp(r,0,100)};i.prototype.getCheckPointView=function(i,n){var t,e;var o=this.offer.details.discounts.findIndex((function(n){var t=n.min_spend;return t===i.min_spend}));var r=(e=(t=this.offer.details.discounts[o-1])===null||t===void 0?void 0:t.min_spend)!==null&&e!==void 0?e:0;var a=this.mapValueRanges(this.offer.details.current_value,r,i.min_spend,0,100);var s=i.min_spend<=this.offer.details.current_value;return h("div",{class:"s-conditional-offer-checkpoint-container"},n>0?[h("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},h("div",{class:"s-conditional-offer-progress-line-inactive"}),h("div",{class:"s-conditional-offer-progress-line-active",style:{width:"".concat(a,"%")}})),h("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint ".concat(s?"s-conditional-offer-active-checkpoint":"")},h("div",{class:"s-conditional-offer-item-avatar-content ".concat(s?"active":""),innerHTML:this.products&&this.getCheckpointContent(i)}),h("div",{class:"s-conditional-offer-checkpoint-label ".concat(s?"active":""),innerHTML:this.getOfferType(i)}))]:h("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":n===0,active:s},innerHTML:this.getOfferType(i)}))};i.prototype.getLoadingSkeletonView=function(){return h(Host,{class:"s-conditional-offer-container"},h("div",{class:"s-conditional-offer-skeleton-inner-container"},h("div",{class:"s-conditional-offer-skeleton-subtitle"},h("salla-skeleton",{height:"16px",width:"30%"})),h("div",{class:"s-conditional-offer-skeleton-subtitle"},h("salla-skeleton",{height:"16px",width:"35%"})),h("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((function(){return[h("salla-skeleton",{key:"checkpoint-line",height:"8px"}),h("div",{key:"checkpoint"},h("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))]})))))};i.prototype.render=function(){var i=this;if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;return h(Host,{class:"s-conditional-offer-container"},h("div",{class:"s-conditional-offer-title-wrapper"},h("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?h("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",h("i",{class:"sicon-information"})):null),h("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map((function(n,t){return h("div",{class:{"flex-1":t>0},key:n.min_spend},i.getCheckPointView(n,t))}))))};return i}();SallaConditionalOffer.style=sallaConditionalOfferCss;export{SallaConditionalOffer as salla_conditional_offer};
|
|
5
5
|
//# sourceMappingURL=salla-conditional-offer.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-aC-cHVMV.js";import{w as whatsapp}from"./whatsapp2-DWksgowB.js";import{M as MailIcon}from"./mail-DmgxDvXL.js";var mobile='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var phone='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n';var telegram='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n';var sallaContactsCss=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var SallaContacts=function(){function t(t){var s=this;registerInstance(this,t);var n;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:mobile,whatsapp:whatsapp,phone:phone,telegram:telegram,email:MailIcon};this.contactSlot=((n=this.host.querySelector('[slot="contact"]'))===null||n===void 0?void 0:n.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){s.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){s.contactsTitle=s.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var s=t[0],n=t[1];return n!==""})).map((function(t){var s=t[0],n=t[1];return{type:s,value:n}}))};t.prototype.getContactLink=function(t){var s=this.contacts[t];switch(t){case"phone":case"mobile":return"tel:".concat(s);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(s);case"telegram":return s.startsWith("https://t.me/")?s:"https://t.me/".concat(s);default:return s}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var s=this.getContactsArray();if(!s||s.length==0){return}if(this.isHeader){return h(Host,{class:"s-contacts s-contacts-header"},s.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(s,n){return h("a",{href:t.getContactLink(s.type),key:n,class:"s-contacts-topnav-link"},s.type==="email"?s.value:[h("span",null,t.contactsTitle,": "),h("a",{class:"unicode",href:t.iconsList[s.type]},s.value)])})))}return h(Host,{class:"s-contacts"},!this.hideTitle&&h("h3",{class:"s-contacts-title"},this.contactsTitle),h("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},s.map((function(s,n){return h("div",{key:n,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(s.type)).replace(/\{value\}/g,s.value.toString()).replace(/\{link\}/g,t.getContactLink(s.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaContacts.style=sallaContactsCss;export{SallaContacts as salla_contacts};
|
|
5
5
|
//# sourceMappingURL=salla-contacts.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function a(t){try{
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function a(t){try{c(n.next(t))}catch(t){r(t)}}function o(t){try{c(n["throw"](t))}catch(t){r(t)}}function c(t){t.done?i(t.value):s(t.value).then(a,o)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(t){return function(e){return c([t,e])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(i=0)),i)try{if(n=1,s&&(r=o[0]&2?s["return"]:o[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,o[1])).done)return r;if(s=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;s=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){i.label=o[1];break}if(o[0]===6&&i.label<r[1]){i.label=r[1];r=o;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(o);break}if(r[2])i.ops.pop();i.trys.pop();continue}o=e.call(t,i)}catch(t){o=[6,t];s=0}finally{n=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-aC-cHVMV.js";import{H as Helper}from"./Helper-DGKT_pIJ.js";import{F as FilterOptionTypes}from"./interfaces-DL4h2bc3.js";import"./anime.es-CgtvEd63.js";var sallaFiltersWidgetCss=":host{display:block}";var SallaFiltersWidget=function(){function t(t){registerInstance(this,t);this.changed=createEvent(this,"changed");this.initHeight=195;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}t.prototype.connectedCallback=function(){var t=this;this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((function(){t.page=salla.config.get("page")}));salla.lang.onLoaded((function(){t.showMoreLabel=salla.lang.getWithDefault("common.titles.more",t.showMoreLabel);t.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",t.showLessLabel)}))};t.prototype.componentDidLoad=function(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight="".concat(this.initHeight,"px"));this.widgetContent.style.height="".concat(this.widgetContent.scrollHeight,"px")};t.prototype.setWidgetHeight=function(){return __awaiter(this,arguments,void 0,(function(t){var e=this;if(t===void 0){t=250}return __generator(this,(function(i){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=e.widgetContent.scrollHeight;e.widgetContent.style.height=t+"px"}),t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.option.type===FilterOptionTypes.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((function(t){return t.checked=false}));return[2]}))}))};t.prototype.showMore=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?"".concat(this.widgetValues.scrollHeight,"px"):"".concat(this.initHeight,"px");setTimeout((function(){t.widgetContent.style.height="".concat(t.widgetContent.scrollHeight,"px")}),400);return[2]}))}))};t.prototype.toggleWidget=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isOpen=!this.isOpen;Helper.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var e=this;if(![FilterOptionTypes.VALUES,FilterOptionTypes.MINIMUM,FilterOptionTypes.VARIANTS].includes(t.type)){return""}return t.values.map((function(i,n){var s=typeof i=="number"?i:i.key||i.value;return h("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(s),key:"".concat(t.key,"-option-").concat(s)},h("input",{id:"".concat(t.key,"-option-").concat(s),name:t.key,type:"radio",checked:e.isSelectedOption(t,s),class:"s-filters-radio",onChange:function(i){return e.changed.emit({event:i,option:t,value:s})}}),e.getOptionLabel(t,i))}))};t.prototype.isSelectedOption=function(t,e){if(t.type===FilterOptionTypes.MINIMUM){return this.filtersData[t.key]==e}if(t.type===FilterOptionTypes.VARIANTS){return this.filtersData[t.type]&&this.filtersData[t.type][Object.keys(this.filtersData[t.type])[0]]==e}if(t.type===FilterOptionTypes.RANGE){return this.filtersData[t.key]&&this.filtersData[t.key].min==e.min&&this.filtersData[t.key].max==e.max}if(t.type===FilterOptionTypes.VALUES){return this.filtersData[t.key]&&Number(this.filtersData[t.key])==Number(e)}return false};t.prototype.getOptionLabel=function(t,e){if(t.key=="rating"){return h("salla-rating-stars",{size:"small",value:e})}var i=e.value||"null";return h("span",{class:"s-filters-option-name"},i)};t.prototype.render=function(){var t=this;return h(Host,{key:"d6f2078b058a8244a95a78e879886f3b04e0e1c0",class:"s-filters-widget-container"},h("h3",{key:"40ff9f985604de49752b38c0fc66611cd1811857",class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},h("span",{key:"06847af2f3f089afb3223e4ce4c56bfa1cb195d5"},this.option.label),h("span",{key:"8ecf9c638f7ad163cda5f7235ecac66661cf8e68",class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),h("div",{key:"15c98c71532ec2bf1f43f3e9bcc1d964a0f3d88d",class:"s-filters-widget-content",ref:function(e){return t.widgetContent=e}},h("div",{key:"f1221b0ce096e1fda0044776bfdba952a990230c",class:"s-filters-widget-values",ref:function(e){return t.widgetValues=e}},h("slot",{key:"1612242828f38a9c086d2a7887174bcdde05618b"}),this.option.type!==FilterOptionTypes.RANGE?this.renderFilterOption(this.option):h("salla-price-range",{onChanged:function(e){t.changed.emit(e.detail)},ref:function(e){return t.priceRange=e},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&h("a",{key:"5726822a429c26ee9ddadaf7351e8d32a3a98695",class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFiltersWidget.style=sallaFiltersWidgetCss;export{SallaFiltersWidget as salla_filters_widget};
|
|
5
5
|
//# sourceMappingURL=salla-filters-widget.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function s(t){try{l(i.next(t))}catch(t){a(t)}}function o(t){try{l(i["throw"](t))}catch(t){a(t)}}function l(t){t.done?r(t.value):n(t.value).then(s,o)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(o){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(i=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){r.label=o[1];break}if(o[0]===6&&r.label<a[1]){r.label=a[1];a=o;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(o);break}if(a[2])r.ops.pop();r.trys.pop();continue}o=e.call(t,r)}catch(t){o=[6,t];n=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-aC-cHVMV.js";import{F as FilterOptionTypes}from"./interfaces-DL4h2bc3.js";import{H as Helper}from"./Helper-DGKT_pIJ.js";import"./anime.es-CgtvEd63.js";var sallaFiltersCss=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";var SallaFilters=function(){function t(t){var e=this;registerInstance(this,t);this.changed=createEvent(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(function(){return e.host.style.display="none"}));salla.lang.onLoaded((function(){e.apply=salla.lang.get("pages.checkout.apply");e.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(function(t){var r=t.filters;e.host.style.display="";var i={};e.filters=r.map((function(t){t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=FilterOptionTypes.VALUES;var r=t.values,n=r.max,a=r.min;t.values=[5,4,3,2,1].filter((function(t){return t>=a||t<=n}))}if(e.filtersData.variants&&t.type==FilterOptionTypes.VARIANTS){i.variants=e.filtersData.variants}if(e.filtersData[t.key]&&t.type!==FilterOptionTypes.VARIANTS){i[t.key]=e.filtersData[t.key]}var s=new URLSearchParams(window.location.search);var o=false;for(var l=0,f=s.keys();l<f.length;l++){var c=f[l];if(c.includes("filters")){o=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(i).length==0&&!o){var u=window.location.href;var h=salla.config.get("page.id");var d=u.indexOf("?")!==-1?"&":"?";var v=u+d+"filters[category_id]="+h;i.category_id=h;window.history.pushState({path:v},"",v)}return t}));e.filtersData=i;e.host.childNodes.forEach((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:e=t.setWidgetHeight;if(!e)return[3,2];return[4,t.setWidgetHeight()];case 1:e=r.sent();r.label=2;case 2:return[2,e]}}))}))}))}))}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);t=new URLSearchParams(window.location.search);e=this;return[4,Helper.extractFiltersFromUrl(t)];case 1:e.filtersData=i.sent();return[3,3];case 2:r=i.sent();console.warn("failed to get filters from URL",r.message);return[3,3];case 3:return[2]}}))}))};t.prototype.getFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.filtersData]}))}))};t.prototype.applyFilters=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(r){if(!this.isReady){return[2]}t=Object.keys(this.filtersData).length>0;setTimeout((function(){var r;if(t){var i=new URL(window.location.href);for(var n=0,a=i.searchParams.entries();n<a.length;n++){var s=a[n][0];if(s.startsWith("filters")){i.searchParams.delete(s)}}var o=e.encodeFilters(e.filtersData);var l=i.search.split("&").filter((function(t){return!t.includes("filters")})).join("&");if(l){i.search=i.search.split("&filters")[0]+"&"+o}else{i.search="?".concat(o)}window.history.pushState({},"",i.href)}else{var i=new URL(window.location.href);(r=i.searchParams)===null||r===void 0?void 0:r.delete("filters");window.history.pushState({},"",i.toString())}salla.event.emit("salla-filters::changed",e.filtersData);e.changed.emit(e.filtersData)}),300);return[2]}))}))};t.prototype.encodeFilters=function(t,e){if(e===void 0){e="filters"}var r=[];for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];var a=e?"".concat(e,"[").concat(i,"]"):i;if(Array.isArray(n)){for(var s=0;s<n.length;s++){r.push("".concat(a,"[").concat(s,"]=").concat(n[s]))}}else if(typeof n==="object"&&n!==null){r.push(this.encodeFilters(n,a))}else{var o="".concat(a,"=").concat(n);r.push(o)}}}return r.join("&")};t.prototype.resetFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((function(t){return t.reset&&t.reset()}));salla.event.emit("salla-filters::reset");return[2,this.applyFilters()]}))}))};t.prototype.removeFiltersQueryParams=function(){var t=new URLSearchParams(window.location.search);var e=Array.from(t.keys()).filter((function(t){return!t.startsWith("filters[")})).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t.get(e)))})).join("&");var r=e?"".concat(window.location.pathname,"?").concat(e):window.location.pathname;window.history.pushState({},"",r)};t.prototype.handleOptionChange=function(t,e,r){if(e.type===FilterOptionTypes.RANGE){this.filtersData[e.key]=r}var i=t.target.checked;if(e.type===FilterOptionTypes.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[e.key]=r);i||delete this.filtersData.variants[e.key]}else if(t.target.type=="radio"){i&&(this.filtersData[e.key]=r);i||delete this.filtersData[e.key]}else if(t.target.type=="checkbox"){this.filtersData[e.key]=this.filtersData[e.key]||[];if(i){this.filtersData[e.key].push(r)}this.filtersData[e.key]=this.filtersData[e.key].filter((function(t){return t!=r}))}this.applyFilters()};t.prototype.render=function(){var t=this;var e,r;return h(Host,{key:"d62d9a867f140a911cb5da11a1034511fd230745"},(e=this.filters)===null||e===void 0?void 0:e.map((function(e){return h("salla-filters-widget",{option:e,filtersData:t.filtersData,onChanged:function(e){var r=e.detail,i=r.event,n=r.option,a=r.value;t.handleOptionChange(i,n,a)}})})),((r=this.filters)===null||r===void 0?void 0:r.length)?h("div",{class:"s-filters-footer"},h("salla-button",{color:"gray",fill:"outline",onClick:function(){return t.resetFilters()}},this.reset)):"")};t.prototype.componentDidLoad=function(){this.isReady=true};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFilters.style=sallaFiltersCss;export{SallaFilters as salla_filters};
|
|
5
5
|
//# sourceMappingURL=salla-filters.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,a,i,e){function n(t){return t instanceof i?t:new i((function(a){a(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{l(e.next(t))}catch(t){r(t)}}function o(t){try{l(e["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):n(t.value).then(s,o)}l((e=e.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},e,n,r,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(a){return l([t,a])}}function l(o){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(i=0)),i)try{if(e=1,n&&(r=o[0]&2?n["return"]:o[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;if(n=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){i.label=o[1];break}if(o[0]===6&&i.label<r[1]){i.label=r[1];r=o;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(o);break}if(r[2])i.ops.pop();i.trys.pop();continue}o=a.call(t,i)}catch(t){o=[6,t];n=0}finally{e=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,h,H as Host,g as getElement}from"./index-Fh3juwdj.js";var sallaInstallmentCss="salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:-ms-flexbox;display:flex;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:-ms-flexbox;display:flex;-ms-flex-direction:row-reverse;flex-direction:row-reverse;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";var SallaInstallment=function(){function t(t){registerInstance(this,t);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.country=salla.config.get("user.country_code");this.installment_sheria_text=function(t,a){return salla.lang.get(t,a)}}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a;var i=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,salla.onReady()];case 1:e.sent();return[4,salla.lang.onLoaded()];case 2:e.sent();this.currency=salla.config.get("user.currency_code")||"SAR";this.language=salla.config.get("user.language_code")||"ar";this.country=salla.config.get("user.country_code")||"SA";t=[{key:"pages.products.installments",installments:3},{key:"pages.products.installments_emkan",installments:5}];t.forEach((function(t){i.installment_sheria_text(t.key,{payment:salla.money(parseFloat(i.price)),amount:salla.money((parseFloat(i.price)/t.installments).toFixed(2)).replace(/\.00$/,""),installments:t.installments})}));a=salla.config.get("store.settings.installments");if(a){this.tamaraIsActive=a.tamara;this.tabbyIsActive=a.tabby;this.spotiiIsActive=a.spotii;this.mispayActive=a.mispay;this.emkanIsActive=a.emkan;this.madfuActive=a.madfu;this.rajehiIsActive=a.mokafaa_alrajhi}salla.event.on("product::price.updated",(function(t){var a=t.data;if(!a.price||a.price==i.price){return}i.price=a.price;i.renderInstallments(true)}));return[2]}}))}))};t.prototype.componentDidLoad=function(){this.renderInstallments()};t.prototype.render=function(){var t;var a=this.currency==="SAR";if(!this.isValidPrice(this.price)){return""}return h(Host,null,this.tamaraIsActive&&(((t=this.tamaraIsActive)===null||t===void 0?void 0:t.publicKey)?h("div",{class:"mb-5"},h("tamara-widget",{type:"tamara-summary","inline-type":"2",amount:this.price})):h("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"})),this.tabbyIsActive?h("div",{id:"tabbyPromoWrapper"},h("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?h("div",{class:"spotii-wrapper"},h("div",{class:"spotii-promo"})):"",this.shouldShowMispay()&&(this.mispayActive.publicKey?h("div",{class:"mb-5"},h("mispay-widget",{amount:this.price,lang:this.language})):h("div",{class:"s-installment-mispay-wrapper"},h("div",{class:"s-installment-mispay-content"},h("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),h("span",{class:"s-installment-mispay-content-text",innerHTML:this.installment_sheria_text("pages.products.installments",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/4).toFixed(2)),installments:4})})))),this.emkanIsActive&&this.currency==="SAR"?h("div",{class:"s-installment-emkan-wrapper"},h("div",{class:"s-installment-emkan-content"},h("img",{src:salla.url.cdn("images/payment/png/emkan.png"),alt:"emkan"}),h("span",{class:"s-installment-emkan-content-text",innerHTML:this.installment_sheria_text("pages.products.installments_emkan",{payment:salla.money(parseFloat(this.price)),installments:5})}))):"",this.madfuActive&&this.currency==="SAR"?h("div",{class:"s-installment-madfu-wrapper"},h("div",{class:"s-installment-madfu-content"},h("img",{src:salla.url.cdn("images/payment/png/madfu.png"),alt:"madfu"}),h("span",{class:"s-installment-madfu-content-text"},salla.lang.get("pages.products.installments_madfu")))):"",a&&this.rajehiIsActive?h("div",{class:"s-installment-rajehi-wrapper"},h("div",{class:"s-installment-rajehi-content"},h("img",{src:salla.url.cdn("images/payment/png/mokafaa_alrajhi_loyalty.png"),alt:"mokafaa_alrajhi_loyalty"}),h("span",{class:"s-installment-rajehi-content-text"},salla.lang.get("pages.products.rajahi_earn_points",{points:Math.floor(+this.price*this.rajehiIsActive.pointsPerRiyal)})))):"")};t.prototype.renderInstallments=function(t){var a=this;if(t===void 0){t=false}if(!this.isValidPrice(this.price)){return}if(this.tamaraIsActive){this.loadTamara({isUpdating:t})}if(this.tabbyIsActive){if(t){var i=this.host.querySelector("#tabbyPromoWrapper");if(i){i.remove()}var e=document.createElement("div");e.setAttribute("id","tabbyPromoWrapper");var n=document.createElement("div");n.setAttribute("id","tabbyPromo");e.appendChild(n);this.host.appendChild(e);var r=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');if(r){r.remove()}}var s=document.createElement("script");s.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(s);s.onload=function(){var t=window.TabbyPromo;new t({selector:"#tabbyPromo",currency:a.currency,price:a.price,lang:a.language,publicKey:salla.config.get("store.settings.installments.tabby.publicKey"),merchantCode:salla.config.get("store.settings.installments.tabby.merchantCode")});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var o=this.host.querySelector(".spotii-wrapper");if(o){o.remove()}var l=document.createElement("div");l.classList.add("spotii-wrapper");var p=document.createElement("div");p.classList.add("spotii-promo");l.appendChild(p);this.host.appendChild(l);var m=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');if(m){m.remove()}}var c=salla.money((Number(this.price)/3).toFixed(2),false);var d=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+c+"${logo} ${info}",textOne:d?"جزء الدفع على":"Split it into",textTwo:d?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var h=document.createElement("script");h.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(h)}if(this.shouldShowMispay()&&this.mispayActive.publicKey){this.loadExternalScript({position:"head",src:"https://widget.mispay.co/v1/sdk.js?authorize=".concat(this.mispayActive.publicKey)})}};t.prototype.isValidPrice=function(t){var a=/^\d+(\.\d{1,2})?$/;var i=a.test(t);var e=parseFloat(t)>0;return i&&e};t.prototype.loadExternalScript=function(t){var a=t.src,i=t.onLoad,e=t.position;var n=document.createElement("script");n.src=a;n.onload=i;document[e].appendChild(n)};t.prototype.loadTamara=function(t){var a=this;var i=t.isUpdating;var e,n;var r=!!((e=this.tamaraIsActive)===null||e===void 0?void 0:e.publicKey);if(i){setTimeout((function(){var t,a;if(r){return(t=window.TamaraWidgetV2)===null||t===void 0?void 0:t.refresh()}(a=window.TamaraProductWidget)===null||a===void 0?void 0:a.render()}),300)}else{if(r){var s=salla.config.get("user.language_code");var o=["ar","en"].includes(s)?s:"ar";var l=(n=this.currency)===null||n===void 0?void 0:n.slice(0,-1);var p=["SA","AE","KW","BH","OM","QA"].includes(l)?l:null;if(!p){console.error("Tamara: Country code is not supported",l)}else{window.tamaraWidgetConfig={lang:o,country:p,publicKey:this.tamaraIsActive.publicKey,style:{fontSize:"14px"}};this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget-v2/tamara-widget.js"})}}else{this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget/product-widget.min.js",onLoad:function(){window.TamaraProductWidget.init({lang:a.language});setTimeout((function(){window.TamaraProductWidget.render()}),300)}})}}};t.prototype.shouldShowMispay=function(){return this.currency==="SAR"&&this.mispayActive};t.prototype.removeTabbyBorder=function(){var t=this;if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((function(){var a=document.querySelector("#tabbyPromo>div>div");a=a&&a.shadowRoot?a.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(a){a.style="border: none; margin: 15px 0!important;";t.tabbyBorderRemoved=true}else{t.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaInstallment.style=sallaInstallmentCss;export{SallaInstallment as salla_installment};
|
|
4
|
+
*/import{r as registerInstance,h,H as Host,g as getElement}from"./index-aC-cHVMV.js";var sallaInstallmentCss="salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:-ms-flexbox;display:flex;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:-ms-flexbox;display:flex;-ms-flex-direction:row-reverse;flex-direction:row-reverse;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";var SallaInstallment=function(){function t(t){registerInstance(this,t);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.country=salla.config.get("user.country_code");this.installment_sheria_text=function(t,a){return salla.lang.get(t,a)}}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a;var i=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,salla.onReady()];case 1:e.sent();return[4,salla.lang.onLoaded()];case 2:e.sent();this.currency=salla.config.get("user.currency_code")||"SAR";this.language=salla.config.get("user.language_code")||"ar";this.country=salla.config.get("user.country_code")||"SA";t=[{key:"pages.products.installments",installments:3},{key:"pages.products.installments_emkan",installments:5}];t.forEach((function(t){i.installment_sheria_text(t.key,{payment:salla.money(parseFloat(i.price)),amount:salla.money((parseFloat(i.price)/t.installments).toFixed(2)).replace(/\.00$/,""),installments:t.installments})}));a=salla.config.get("store.settings.installments");if(a){this.tamaraIsActive=a.tamara;this.tabbyIsActive=a.tabby;this.spotiiIsActive=a.spotii;this.mispayActive=a.mispay;this.emkanIsActive=a.emkan;this.madfuActive=a.madfu;this.rajehiIsActive=a.mokafaa_alrajhi}salla.event.on("product::price.updated",(function(t){var a=t.data;if(!a.price||a.price==i.price){return}i.price=a.price;i.renderInstallments(true)}));return[2]}}))}))};t.prototype.componentDidLoad=function(){this.renderInstallments()};t.prototype.render=function(){var t;var a=this.currency==="SAR";if(!this.isValidPrice(this.price)){return""}return h(Host,null,this.tamaraIsActive&&(((t=this.tamaraIsActive)===null||t===void 0?void 0:t.publicKey)?h("div",{class:"mb-5"},h("tamara-widget",{type:"tamara-summary","inline-type":"2",amount:this.price})):h("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"})),this.tabbyIsActive?h("div",{id:"tabbyPromoWrapper"},h("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?h("div",{class:"spotii-wrapper"},h("div",{class:"spotii-promo"})):"",this.shouldShowMispay()&&(this.mispayActive.publicKey?h("div",{class:"mb-5"},h("mispay-widget",{amount:this.price,lang:this.language})):h("div",{class:"s-installment-mispay-wrapper"},h("div",{class:"s-installment-mispay-content"},h("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),h("span",{class:"s-installment-mispay-content-text",innerHTML:this.installment_sheria_text("pages.products.installments",{payment:salla.money(parseFloat(this.price)),amount:salla.money((parseFloat(this.price)/4).toFixed(2)),installments:4})})))),this.emkanIsActive&&this.currency==="SAR"?h("div",{class:"s-installment-emkan-wrapper"},h("div",{class:"s-installment-emkan-content"},h("img",{src:salla.url.cdn("images/payment/png/emkan.png"),alt:"emkan"}),h("span",{class:"s-installment-emkan-content-text",innerHTML:this.installment_sheria_text("pages.products.installments_emkan",{payment:salla.money(parseFloat(this.price)),installments:5})}))):"",this.madfuActive&&this.currency==="SAR"?h("div",{class:"s-installment-madfu-wrapper"},h("div",{class:"s-installment-madfu-content"},h("img",{src:salla.url.cdn("images/payment/png/madfu.png"),alt:"madfu"}),h("span",{class:"s-installment-madfu-content-text"},salla.lang.get("pages.products.installments_madfu")))):"",a&&this.rajehiIsActive?h("div",{class:"s-installment-rajehi-wrapper"},h("div",{class:"s-installment-rajehi-content"},h("img",{src:salla.url.cdn("images/payment/png/mokafaa_alrajhi_loyalty.png"),alt:"mokafaa_alrajhi_loyalty"}),h("span",{class:"s-installment-rajehi-content-text"},salla.lang.get("pages.products.rajahi_earn_points",{points:Math.floor(+this.price*this.rajehiIsActive.pointsPerRiyal)})))):"")};t.prototype.renderInstallments=function(t){var a=this;if(t===void 0){t=false}if(!this.isValidPrice(this.price)){return}if(this.tamaraIsActive){this.loadTamara({isUpdating:t})}if(this.tabbyIsActive){if(t){var i=this.host.querySelector("#tabbyPromoWrapper");if(i){i.remove()}var e=document.createElement("div");e.setAttribute("id","tabbyPromoWrapper");var n=document.createElement("div");n.setAttribute("id","tabbyPromo");e.appendChild(n);this.host.appendChild(e);var r=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');if(r){r.remove()}}var s=document.createElement("script");s.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(s);s.onload=function(){var t=window.TabbyPromo;new t({selector:"#tabbyPromo",currency:a.currency,price:a.price,lang:a.language,publicKey:salla.config.get("store.settings.installments.tabby.publicKey"),merchantCode:salla.config.get("store.settings.installments.tabby.merchantCode")});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var o=this.host.querySelector(".spotii-wrapper");if(o){o.remove()}var l=document.createElement("div");l.classList.add("spotii-wrapper");var p=document.createElement("div");p.classList.add("spotii-promo");l.appendChild(p);this.host.appendChild(l);var m=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');if(m){m.remove()}}var c=salla.money((Number(this.price)/3).toFixed(2),false);var d=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+c+"${logo} ${info}",textOne:d?"جزء الدفع على":"Split it into",textTwo:d?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var h=document.createElement("script");h.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(h)}if(this.shouldShowMispay()&&this.mispayActive.publicKey){this.loadExternalScript({position:"head",src:"https://widget.mispay.co/v1/sdk.js?authorize=".concat(this.mispayActive.publicKey)})}};t.prototype.isValidPrice=function(t){var a=/^\d+(\.\d{1,2})?$/;var i=a.test(t);var e=parseFloat(t)>0;return i&&e};t.prototype.loadExternalScript=function(t){var a=t.src,i=t.onLoad,e=t.position;var n=document.createElement("script");n.src=a;n.onload=i;document[e].appendChild(n)};t.prototype.loadTamara=function(t){var a=this;var i=t.isUpdating;var e,n;var r=!!((e=this.tamaraIsActive)===null||e===void 0?void 0:e.publicKey);if(i){setTimeout((function(){var t,a;if(r){return(t=window.TamaraWidgetV2)===null||t===void 0?void 0:t.refresh()}(a=window.TamaraProductWidget)===null||a===void 0?void 0:a.render()}),300)}else{if(r){var s=salla.config.get("user.language_code");var o=["ar","en"].includes(s)?s:"ar";var l=(n=this.currency)===null||n===void 0?void 0:n.slice(0,-1);var p=["SA","AE","KW","BH","OM","QA"].includes(l)?l:null;if(!p){console.error("Tamara: Country code is not supported",l)}else{window.tamaraWidgetConfig={lang:o,country:p,publicKey:this.tamaraIsActive.publicKey,style:{fontSize:"14px"}};this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget-v2/tamara-widget.js"})}}else{this.loadExternalScript({position:"head",src:"https://cdn.tamara.co/widget/product-widget.min.js",onLoad:function(){window.TamaraProductWidget.init({lang:a.language});setTimeout((function(){window.TamaraProductWidget.render()}),300)}})}}};t.prototype.shouldShowMispay=function(){return this.currency==="SAR"&&this.mispayActive};t.prototype.removeTabbyBorder=function(){var t=this;if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((function(){var a=document.querySelector("#tabbyPromo>div>div");a=a&&a.shadowRoot?a.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(a){a.style="border: none; margin: 15px 0!important;";t.tabbyBorderRemoved=true}else{t.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaInstallment.style=sallaInstallmentCss;export{SallaInstallment as salla_installment};
|
|
5
5
|
//# sourceMappingURL=salla-installment.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-
|
|
4
|
+
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-aC-cHVMV.js";var sallaLoyaltyPrizeItemCss="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";var SallaLoyaltyPrizeItem=function(){function e(e){registerInstance(this,e);this.prizeItemSelected=createEvent(this,"prizeItemSelected")}e.prototype.onPrizeItemClick=function(){this.prizeItemSelected.emit(this.item)};e.prototype.render=function(){return h(Host,{key:"601dbcf73e68678eecc912c14c2b1be612a78551"},h("div",{key:"074f8b4cb736bfabd5885d9df77bf74e7c4829a1",onClick:this.onPrizeItemClick.bind(this)},h("img",{key:"4bec672992f7e998bde639295831a5c9ad5f5088",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),h("div",{key:"c8f858a7f406fe8e9123c57df627a4b6a2cbd719",class:"s-loyalty-prize-item-title"},this.item.name),h("div",{key:"81b954aa730e07c7f32ee538692581dede3543db",class:"s-loyalty-prize-item-subtitle"},this.item.description),h("div",{key:"b7baeada2da364fec6ee7bd606b595b1f652d8a8",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))};return e}();SallaLoyaltyPrizeItem.style=sallaLoyaltyPrizeItemCss;export{SallaLoyaltyPrizeItem as salla_loyalty_prize_item};
|
|
5
5
|
//# sourceMappingURL=salla-loyalty-prize-item.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,a,r,l){function e(t){return t instanceof r?t:new r((function(a){a(t)}))}return new(r||(r=Promise))((function(r,s){function o(t){try{i(l.next(t))}catch(t){s(t)}}function n(t){try{i(l["throw"](t))}catch(t){s(t)}}function i(t){t.done?r(t.value):e(t.value).then(o,n)}i((l=l.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},l,e,s,o;return o={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function n(t){return function(a){return i([t,a])}}function i(n){if(l)throw new TypeError("Generator is already executing.");while(o&&(o=0,n[0]&&(r=0)),r)try{if(l=1,e&&(s=n[0]&2?e["return"]:n[0]?e["throw"]||((s=e["return"])&&s.call(e),0):e.next)&&!(s=s.call(e,n[1])).done)return s;if(e=0,s)n=[n[0]&2,s.value];switch(n[0]){case 0:case 1:s=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;e=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(s=r.trys,s=s.length>0&&s[s.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!s||n[1]>s[0]&&n[1]<s[3])){r.label=n[1];break}if(n[0]===6&&r.label<s[1]){r.label=s[1];s=n;break}if(s&&r.label<s[2]){r.label=s[2];r.ops.push(n);break}if(s[2])r.ops.pop();r.trys.pop();continue}n=a.call(t,r)}catch(t){n=[6,t];e=0}finally{l=s=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,a,r){if(r||arguments.length===2)for(var l=0,e=a.length,s;l<e;l++){if(s||!(l in a)){if(!s)s=Array.prototype.slice.call(a,0,l);s[l]=a[l]}}return t.concat(s||Array.prototype.slice.call(a))};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,h,H as Host}from"./index-
|
|
4
|
+
*/import{r as registerInstance,h,H as Host}from"./index-aC-cHVMV.js";import{G as GiftIcon}from"./gift-C0JNGIpa.js";var sallaLoyaltyProgramCss="";var formatDate=function(t){if(!t)return"";return new Date(Number(t)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})};var translateKey=function(t){if(!t)return"";try{var a=t.toLowerCase();var r=salla.lang.get("pages.loyalty_program.".concat(a));return r==="pages.loyalty_program.".concat(a)?t:r}catch(a){return t}};var SallaWalletTable=function(){function t(t){var a=this;registerInstance(this,t);this.loyaltyPointsArray=[];this.isLoadingLoyalty=false;this.nextPageUrlLoyalty="";this.handleClick=function(){a.loadMoreLoyaltyPoints()}}t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){t.loadLoyaltyPoints()}))};t.prototype.loadLoyaltyPoints=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,r;return __generator(this,(function(l){switch(l.label){case 0:this.isLoadingLoyalty=true;l.label=1;case 1:l.trys.push([1,3,4,5]);t="/balance/points?page=1";return[4,salla.api.request(t)];case 2:a=l.sent();this.loyaltyPointsArray=a.data;this.nextPageUrlLoyalty=a.cursor.next;return[3,5];case 3:r=l.sent();console.error("Error loading loyalty points transactions",r);return[3,5];case 4:this.isLoadingLoyalty=false;return[7];case 5:return[2]}}))}))};t.prototype.loadMoreLoyaltyPoints=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,r;return __generator(this,(function(l){switch(l.label){case 0:if(!this.nextPageUrlLoyalty)return[2];this.isLoadingLoyalty=true;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,salla.api.request(this.nextPageUrlLoyalty)];case 2:a=l.sent();this.loyaltyPointsArray=__spreadArray(__spreadArray([],this.loyaltyPointsArray,true),a.data,true);this.nextPageUrlLoyalty=((t=a.cursor)===null||t===void 0?void 0:t.next)||"";return[3,5];case 3:r=l.sent();console.error("Error loading more loyalty points",r);return[3,5];case 4:this.isLoadingLoyalty=false;return[7];case 5:return[2]}}))}))};t.prototype.render=function(){return h(Host,{key:"985386d18096b99ef6114a6e21363900c5dab374"},h("div",{key:"67bb4fceebc5ef047cd3b0ee5b94297e4c9d9d17"},this.isLoadingLoyalty?h("salla-loading",null):h("div",null,this.loyaltyPointsArray.length>0?h("div",null,h("table",{class:"s-loyalty-program-table"},h("thead",{class:"s-loyalty-program-table-head"},h("tr",{class:"s-loyalty-program-table-head-tr"},h("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.points")),h("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.date")),h("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),h("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.note")),h("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.status")))),h("tbody",{class:"s-loyalty-program-table-tbody"},this.loyaltyPointsArray.map((function(t){return h("tr",{class:"s-loyalty-program-table-tbody-tr"},h("td",{class:"s-loyalty-program-table-tbody-tr-td"},(t===null||t===void 0?void 0:t.type)==="plus"?"+":"",(t===null||t===void 0?void 0:t.points)||""," ",salla.lang.get("pages.loyalty_program.point")),h("td",{class:"s-loyalty-program-table-tbody-tr-td"},formatDate((t===null||t===void 0?void 0:t.created_at)?Number(t.created_at)*1e3:undefined)),h("td",{class:"s-loyalty-program-table-tbody-tr-td"},formatDate(t===null||t===void 0?void 0:t.points_expire_date)),h("td",{class:"s-loyalty-program-table-tbody-tr-td"},translateKey(t===null||t===void 0?void 0:t.key)),h("td",{class:"s-loyalty-program-table-tbody-tr-td"},translateKey(t===null||t===void 0?void 0:t.status_key)))})))),h("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrlLoyalty&&h("salla-button",{onClick:this.handleClick,loading:this.isLoadingLoyalty},salla.lang.get("common.elements.load_more")))):h("div",null,h("div",{class:"s-loyalty-program-table-empty-state"},h("span",{innerHTML:GiftIcon}),h("div",{class:"s-loyalty-program-table-placeholder-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_title")),h("div",{class:"s-loyalty-program-table-placeholder-sub-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_sub_title")))))))};return t}();SallaWalletTable.style=sallaLoyaltyProgramCss;export{SallaWalletTable as salla_loyalty_program};
|
|
5
5
|
//# sourceMappingURL=salla-loyalty-program.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,a,e,r){function n(t){return t instanceof e?t:new e((function(a){a(t)}))}return new(e||(e=Promise))((function(e,s){function i(t){try{l(r.next(t))}catch(t){s(t)}}function o(t){try{l(r["throw"](t))}catch(t){s(t)}}function l(t){t.done?e(t.value):n(t.value).then(i,o)}l((r=r.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,i;return i={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(t){return function(a){return l([t,a])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,o[0]&&(e=0)),e)try{if(r=1,n&&(s=o[0]&2?n["return"]:o[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,o[1])).done)return s;if(n=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;n=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){e.label=o[1];break}if(o[0]===6&&e.label<s[1]){e.label=s[1];s=o;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(o);break}if(s[2])e.ops.pop();e.trys.pop();continue}o=a.call(t,e)}catch(t){o=[6,t];n=0}finally{r=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
*/import{r as registerInstance,h,H as Host,g as getElement}from"./index-aC-cHVMV.js";var sallaMetadataCss="";var SallaMetadata=function(){function t(t){registerInstance(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(t){salla.log("Bad json passed via entityId prop")}}}t.prototype.getValue=function(t){if(t.type==="file"){return'<a href="'.concat(t.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(t.type==="url"){return'<a href="'.concat(t.value,'" class="text-blue-700 underline" target="_blank">').concat(t.value,"</a>")}if(t.type==="date"){var a=new Date(t.value);var e=String(a.getDate()).padStart(2,"0");var r=String(a.getMonth()+1).padStart(2,"0");var n=a.getFullYear();var s="".concat(e,"/").concat(r,"/").concat(n);return s}return t.value};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,salla.onReady()];case 1:r.sent();if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("custom-fields"))){return[2,salla.logger.error("feature custom-fields is not activated")]}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return[2,salla.logger.error("can't render salla-metadata without enity-id prop!")]}return[4,salla.lang.onLoaded()];case 2:r.sent();this.download=salla.lang.get("pages.thank_you.download");return[4,Salla.api.metadata.fetchValues(this.entity,this.entityId)];case 3:e=r.sent();this.specs=(a=e.data[0])===null||a===void 0?void 0:a.sections;return[2]}}))}))};t.prototype.render=function(){var t=this;if(!this.specs.length){return}return h(Host,{class:"s-metadata-wrapper"},this.specs.map((function(a){return h("div",{class:"s-metadata-box"},h("div",{class:"s-metadata-box-header"},h("i",{class:"sicon-list"}),a.name),a.fields.map((function(a){return h("div",{class:"s-metadata-row"},h("p",{class:"s-metadata-row-name"},a.name),h("p",{class:"s-metadata-row-value",innerHTML:t.getValue(a)}))})))})))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaMetadata.style=sallaMetadataCss;export{SallaMetadata as salla_metadata};
|
|
5
5
|
//# sourceMappingURL=salla-metadata.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h}from"./index-
|
|
4
|
+
import{r as registerInstance,h}from"./index-aC-cHVMV.js";var sallaNotificationsCss="";var SallaNotificationItem=function(){function i(i){registerInstance(this,i)}i.prototype.render=function(){return h("a",{key:"f4818ac9b7dc2573dd1ac8aa31aabc82454ea439",href:this.notification.url,class:{"s-notifications-item":true,"s-notifications-item-shadow":true,"s-notifications-item-read":!this.notification.is_new}},h("span",{key:"3766a4eb835408bf293054be3e04a561e1510728",class:"s-notifications-item-icon"},h("i",{key:"e9b1e4a18f22e765053b7d62f83a4af6e426bd47",class:{"s-notifications-item-icon sicon-bell-ring":true,"s-notifications-item-icon-new":this.notification.is_new}})),h("div",{key:"2005bcf68b61bb0aa5606480f703e4ee4cfbd415",class:"s-notifications-item-content"},h("div",{key:"a60fdc96431899c0c3183512ea81477f52e550d0",class:"s-notifications-item-content-leading"},h("h4",{key:"fb0eb1efe08440a1e2c12dc1af263adba0413d2b"},this.notification.title),h("p",{key:"c32790ad29bd267323d86e5c3abdec1ab75c09b2"},this.notification.sub_title)),h("span",{key:"e8fbfea5e91fe7d16c489a285502eaab08b16fd5",class:"s-notifications-item-content-trailing"},h("i",{key:"ea9fb9cf6ac2f9c84cde152fa1381e884971cba4",class:"sicon-time s-notifications-item-content-trailing-icon"}),h("span",{key:"1fb25f1463210c8ab467dff8aea22d9c4510301c"},this.notification.date))))};return i}();SallaNotificationItem.style=sallaNotificationsCss;export{SallaNotificationItem as salla_notification_item};
|
|
5
5
|
//# sourceMappingURL=salla-notification-item.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,n,i,e){function r(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,o){function a(t){try{u(e.next(t))}catch(t){o(t)}}function s(t){try{u(e["throw"](t))}catch(t){o(t)}}function u(t){t.done?i(t.value):r(t.value).then(a,s)}u((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},e,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(n){return u([t,n])}}function u(s){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(i=0)),i)try{if(e=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t];r=0}finally{e=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,h,g as getElement}from"./index-
|
|
4
|
+
*/import{r as registerInstance,h,g as getElement}from"./index-aC-cHVMV.js";import{H as Helper}from"./Helper-DGKT_pIJ.js";import"./anime.es-CgtvEd63.js";var sallaNotificationsCss="";var SallaNotifications=function(){function t(t){var n=this;registerInstance(this,t);this.itemPerPage=10;this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");this.load_more_text_trans=salla.lang.get("common.elements.load_more");salla.lang.onLoaded((function(){n.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");n.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}t.prototype.loading=function(t){if(t===void 0){t=true}var n;var i=(n=this.status)===null||n===void 0?void 0:n.querySelector(".s-button-text");if(i){Helper.toggleElementClassIf(i,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.getNotificationCard=function(t){var n=document.createElement("salla-notification-item");n.notification=t;n.classList.add("s-block");return n};t.prototype.render=function(){var t=this;var n;if(this.showPlaceholder){return h("div",{class:"s-notifications-no-content"},h("salla-placeholder",{alignment:"center"},h("span",{slot:"title"},this.no_notifications_trans)))}return h("div",{class:"s-notifications-wrapper"},h("div",{class:"s-notifications-container",ref:function(n){return t.wrapper=n}}),this.nextPage&&h("div",{class:"s-infinite-scroll-wrapper",ref:function(n){return t.status=n}},h("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},h("span",{class:"s-button-text s-infinite-scroll-btn-text"},(n=this.loadMoreText)!==null&&n!==void 0?n:this.load_more_text_trans),h("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(n){return t.btnLoader=n},style:{display:"none"}}))))};t.prototype.handleResponse=function(t){var n=this;return t.map((function(t){return n.getNotificationCard(t)}))};t.prototype.initiateInfiniteScroll=function(){var t=this;var n,i,e;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return t.nextPage},history:true,nextPage:this.nextPage,scrollThreshold:false},true);(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("request",(function(n){t.loading()}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(function(n){var i;t.loading(false);t.pagination=n.pagination;t.nextPage=((i=n.pagination.links)===null||i===void 0?void 0:i.next)||null;t.handleResponse(n.data).forEach((function(n){return t.wrapper.append(n)}));var e=t.host.querySelectorAll("salla-notification-item:not(.animated)");Helper.animateItems(e)}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("error",(function(t){salla.logger.error("Error loading more comments:",t)}))};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.api.notifications.fetch({per_page:this.itemPerPage}).then((function(n){var i;t.pagination=n.pagination;t.total=n.pagination.total;t.nextPage=((i=n.pagination.links)===null||i===void 0?void 0:i.next)||null;setTimeout((function(){if(!n.data.length){return t.showPlaceholder=true}t.handleResponse(n.data).forEach((function(n){return t.wrapper.append(n)}));t.initiateInfiniteScroll();var i=t.wrapper.querySelectorAll("salla-notification-item:not(.animated)");Helper.animateItems(i)}),100)})).catch((function(n){salla.logger.error(n);t.showPlaceholder=true;t.loading(false)}))];case 1:n.sent();return[2]}}))}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage();return[2]}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.loadInitialData()];case 1:t.sent();return[2]}}))}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaNotifications.style=sallaNotificationsCss;export{SallaNotifications as salla_notifications};
|
|
5
5
|
//# sourceMappingURL=salla-notifications.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,r,t,s){function n(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function i(e){try{f(s.next(e))}catch(e){a(e)}}function o(e){try{f(s["throw"](e))}catch(e){a(e)}}function f(e){e.done?t(e.value):n(e.value).then(i,o)}f((s=s.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,i;return i={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(e){return function(r){return f([e,r])}}function f(o){if(s)throw new TypeError("Generator is already executing.");while(i&&(i=0,o[0]&&(t=0)),t)try{if(s=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;n=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){t.label=o[1];break}if(o[0]===6&&t.label<a[1]){t.label=a[1];a=o;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(o);break}if(a[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];n=0}finally{s=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,h,g as getElement}from"./index-Fh3juwdj.js";var PageType;(function(e){e["ProductDetail"]="product.single";e["Cart"]="cart"})(PageType||(PageType={}));var OfferType;(function(e){e["Conditional"]="conditional";e["PercentageOrFixed"]="fixed";e["DiscountsTable"]="discounts_table";e["Bank"]="bank";e["BuyXGetY"]="buy_x_get_y";e["SpecialPrice"]="special_price"})(OfferType||(OfferType={}));var sallaOfferCss='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';var SallaOffer=function(){function e(e){var r=this;registerInstance(this,e);var t;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){r.offer_with_price_text=salla.lang.get("pages.offer.with_price");r.with_discount_text=salla.lang.get("pages.products.with_a_discount");r.product_discount_text=salla.lang.get("pages.products.discount");r.special_offer_text=salla.lang.get("pages.products.special_offer");r.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");r.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");r.buy_quantity_text(0)}));salla.onReady((function(){r.currentPage=salla.config.get("page.slug");r.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((t=this.host.querySelector('[slot="category"]'))===null||t===void 0?void 0:t.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getEndpointByPageName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:if(!(this.currentPage==PageType.Cart))return[3,2];return[4,Salla.cart.getCurrentCartId()];case 1:e=r.sent();return[2,"offers/cart/".concat(e)];case 2:if(this.currentPage==PageType.ProductDetail){return[2,"offers/product/".concat(salla.config.get("page.id"))]}return[2,"offers"]}}))}))};e.prototype.emitPromotionViewed=function(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;var e={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:1};salla.event.emit("promotion::viewed",[e])};e.prototype.emitPromotionClicked=function(e){if(e===void 0){e=1}if(!(this.offersList.length&&this.canRender&&this.showOffer))return;var r={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:e};salla.event.emit("promotion::clicked",[r])};e.prototype.componentWillLoad=function(){var e=this;this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((function(e){return salla.onReady(e)})).then((function(){e.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(e.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((function(){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(t){switch(t.label){case 0:r=(e=salla.api).request;return[4,this.getEndpointByPageName()];case 1:return[2,r.apply(e,[t.sent()])]}}))}))})).then((function(r){if(!(e.offersList=r.data).length){throw new Error("salla-offers:: There is no offers!")}var t=e.offersList.find((function(e){return[OfferType.SpecialPrice,OfferType.Bank,OfferType.BuyXGetY,OfferType.DiscountsTable].includes(e.type)}));if(!t){throw new Error("salla-offers:: Offer type not supported yet!")}if(t.type===OfferType.DiscountsTable){return e.offersList=[t]}if(e.isBankOffer=t.type===OfferType.Bank){e.offersList=e.offersList.filter((function(e){return e.type===OfferType.Bank}));e.isMultipleBank=e.offersList.length>1;return e.offersList}if(t.type===OfferType.SpecialPrice){var s=t.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((function(r){t.details.products=r.data;return e.offersList=[t]})):salla.product.api.categories().then((function(r){var n=e.findCategories(r.data,s.targets);t.details.categories=n;return e.offersList=[t]}))}var n=t.details.get;return n.source==="products"?salla.product.api.fetch({source:"selected",source_value:n.source_value}).then((function(r){n.products=r.data;t.details.get=n;return e.offersList=[t]})):salla.product.api.categories().then((function(r){n.categories=e.findCategories(r.data,n.source_value);t.details.get=n;return e.offersList=[t]}))})).then((function(r){salla.storage.set(e.getStorageKey(),{offers:r,stored_at:(new Date).getTime()});e.canRender=true})).catch((function(e){salla.logger.warn(e)}))};e.prototype.componentDidLoad=function(){var e=this.host.querySelector(".s-slider-block__title-nav");e===null||e===void 0?void 0:e.classList.add("s-offer-bank-payment-nav");this.emitPromotionViewed()};e.prototype.findCategories=function(e,r){var t;var s=[];for(var n=0,a=e;n<a.length;n++){var i=a[n];if(r.includes(i.id_||i.id)){s.push(i)}if(((t=i.sub_categories)===null||t===void 0?void 0:t.length)>0){s=s.concat(this.findCategories(i.sub_categories,r))}}return s};e.prototype.getStorageKey=function(){try{var e=salla.config.get("page.slug").replace(".","_");var r=salla.lang.getLocale();var t=salla.config.currency().code;if(!e||!r||!t){throw new Error("Unable to get the storage key.")}return"s-offers-".concat(e,"-").concat(salla.config.get("page.id"),"-").concat(r,"-").concat(t)}catch(e){return""}};e.prototype.getOffersFromStorage=function(){var e=salla.storage.get(this.getStorageKey());if(!e||e.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(e.offers)};e.prototype.render=function(){var e=this;if(!this.offersList.length||!this.canRender||!this.showOffer)return null;var r=this.offersList[0];var t=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:r.title;var s=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:r.description;var n={"block-title":t,"block-subTitle":s,"show-controls":this.isMultipleBank};return h("div",{class:"s-offer-wrapper",onClick:function(){return e.emitPromotionClicked()}},h("p",{class:"s-offer-corner-badge"},this.special_offer_text),h("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},n),h("div",{slot:"items"},this.renderSectionForOfferType(r.type))))};e.prototype.renderSectionForOfferType=function(e){if(this.isBankOffer){return this.renderBankSection()}if(e==OfferType.SpecialPrice){return this.renderSpecialPriceSection()}if(e==OfferType.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()};e.prototype.getCategoriesSection=function(e){return h("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon||"sicon-store").replace(/\{name\}/g,e.name)})};e.prototype.renderBuyXGetYSection=function(){var e=this;var r,t;var s=this.offersList[0].details;return[(r=s.get.products)===null||r===void 0?void 0:r.map((function(r){return h("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?h(e.productCardComponent,{product:r}):h("salla-product-card",{"shadow-on-hover":true,product:r}))})),(t=s.get.categories)===null||t===void 0?void 0:t.map((function(r){return e.getCategoriesSection(r)}))]};e.prototype.renderBankSection=function(){var e=this;return this.offersList.map((function(r){return h("div",{class:{"s-offer-slide-one-sixth":e.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!e.isMultipleBank}},h("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!e.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":e.isMultipleBank}},h("div",{class:"s-offer-bank-logo"},h("img",{src:r.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":r.details.logo,alt:r.title+" offer"})),h("ul",{class:"s-offer-bank-payment-wrapper"},r.details.payments.map((function(e){return h("li",{class:"s-offer-bank-payment-single"},h("img",{src:salla.url.cdn("images/payment/"+e+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+".png"),alt:"payment"}))}))),e.isMultipleBank?h("p",{class:"s-offer-bank-payment-discount-percent"},"".concat(e.product_discount_text," ").concat(r.details.discount_value).concat(r.details.discount_type==="percentage"&&"%")):""),!e.isMultipleBank?h("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},h("h2",null,e.offersList[0].title),h("p",{innerHTML:e.generateBankDescription(e.offersList[0].description,r.details.discount_value)})):"")}))};e.prototype.generateBankDescription=function(e,r){return e.replace(new RegExp("".concat(r," %")),'<span class="s-offer-bank-message-amount">'.concat(r," %</span>"))};e.prototype.renderDiscountTableSection=function(){var e=this;var r;var t=this.offersList[0];var s=t.details.show_price_after_discount;return(r=this.offersList[0].details.discounts)===null||r===void 0?void 0:r.map((function(r){return h("div",{class:"s-offer-slide-one-fourth"},h("div",{class:"s-offer-slide-offer-entry"},h("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},h("p",{class:"s-offer-slide-offer-entry-quantity"},e.buy_quantity_text(r.quantity)),s?h("div",{class:"s-offer-slide-offer-entry-price"},h("span",null,e.offer_with_price_text),h("span",{class:"s-offer-slide-offer-entry-price-amount"},r.discounted_amount)," ",h("span",null,e.userCurrency)):""),h("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},e.with_discount_text,"(",h("span",null,r.percentage,!!r.percentage&&"%"),")")))}))};e.prototype.renderSpecialPriceSection=function(){var e=this;var r,t;var s=this.offersList[0].details;return[s.apply_to==="product"&&((r=s.products)===null||r===void 0?void 0:r.map((function(r){return h("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?h(e.productCardComponent,{product:r}):h("salla-product-card",{"shadow-on-hover":true,product:r}))}))),s.apply_to==="category"&&((t=s.categories)===null||t===void 0?void 0:t.map((function(r){return e.getCategoriesSection(r)})))]};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaOffer.style=sallaOfferCss;export{SallaOffer as salla_offer};
|
|
4
|
+
*/import{r as registerInstance,h,g as getElement}from"./index-aC-cHVMV.js";var PageType;(function(e){e["ProductDetail"]="product.single";e["Cart"]="cart"})(PageType||(PageType={}));var OfferType;(function(e){e["Conditional"]="conditional";e["PercentageOrFixed"]="fixed";e["DiscountsTable"]="discounts_table";e["Bank"]="bank";e["BuyXGetY"]="buy_x_get_y";e["SpecialPrice"]="special_price"})(OfferType||(OfferType={}));var sallaOfferCss='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';var SallaOffer=function(){function e(e){var r=this;registerInstance(this,e);var t;this.productCardComponent="custom-salla-product-card";this.offersList=[];this.isMultipleBank=false;this.isBankOffer=false;this.canRender=false;this.showOffer=salla.config.get("store.settings.product.show_special_offers");this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");this.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");this.buy_quantity_text=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){r.offer_with_price_text=salla.lang.get("pages.offer.with_price");r.with_discount_text=salla.lang.get("pages.products.with_a_discount");r.product_discount_text=salla.lang.get("pages.products.discount");r.special_offer_text=salla.lang.get("pages.products.special_offer");r.multipleBankOfferTitleText=salla.lang.get("pages.offer.multiple_bank_offers_title");r.multipleBankOfferTitleDescription=salla.lang.get("pages.offer.multiple_bank_offers_message");r.buy_quantity_text(0)}));salla.onReady((function(){r.currentPage=salla.config.get("page.slug");r.userCurrency=salla.config.get("currencies")[salla.config.get("user.currency_code")].symbol}));this.categorySlot=((t=this.host.querySelector('[slot="category"]'))===null||t===void 0?void 0:t.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getEndpointByPageName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:if(!(this.currentPage==PageType.Cart))return[3,2];return[4,Salla.cart.getCurrentCartId()];case 1:e=r.sent();return[2,"offers/cart/".concat(e)];case 2:if(this.currentPage==PageType.ProductDetail){return[2,"offers/product/".concat(salla.config.get("page.id"))]}return[2,"offers"]}}))}))};e.prototype.emitPromotionViewed=function(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;var e={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:1};salla.event.emit("promotion::viewed",[e])};e.prototype.emitPromotionClicked=function(e){if(e===void 0){e=1}if(!(this.offersList.length&&this.canRender&&this.showOffer))return;var r={id:this.offersList[0].id,name:this.offersList[0].title,creative:this.offersList[0].description||"",position:e};salla.event.emit("promotion::clicked",[r])};e.prototype.componentWillLoad=function(){var e=this;this.hasCustomComponent=!!customElements.get(this.productCardComponent);return new Promise((function(e){return salla.onReady(e)})).then((function(){e.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers");if(e.showOffer){return}throw new Error("Merchant disabled showing the offers on product page")})).then((function(){return __awaiter(e,void 0,void 0,(function(){var e,r;return __generator(this,(function(t){switch(t.label){case 0:r=(e=salla.api).request;return[4,this.getEndpointByPageName()];case 1:return[2,r.apply(e,[t.sent()])]}}))}))})).then((function(r){if(!(e.offersList=r.data).length){throw new Error("salla-offers:: There is no offers!")}var t=e.offersList.find((function(e){return[OfferType.SpecialPrice,OfferType.Bank,OfferType.BuyXGetY,OfferType.DiscountsTable].includes(e.type)}));if(!t){throw new Error("salla-offers:: Offer type not supported yet!")}if(t.type===OfferType.DiscountsTable){return e.offersList=[t]}if(e.isBankOffer=t.type===OfferType.Bank){e.offersList=e.offersList.filter((function(e){return e.type===OfferType.Bank}));e.isMultipleBank=e.offersList.length>1;return e.offersList}if(t.type===OfferType.SpecialPrice){var s=t.details;return s.apply_to==="product"?salla.product.api.fetch({source:"selected",source_value:s.targets}).then((function(r){t.details.products=r.data;return e.offersList=[t]})):salla.product.api.categories().then((function(r){var n=e.findCategories(r.data,s.targets);t.details.categories=n;return e.offersList=[t]}))}var n=t.details.get;return n.source==="products"?salla.product.api.fetch({source:"selected",source_value:n.source_value}).then((function(r){n.products=r.data;t.details.get=n;return e.offersList=[t]})):salla.product.api.categories().then((function(r){n.categories=e.findCategories(r.data,n.source_value);t.details.get=n;return e.offersList=[t]}))})).then((function(r){salla.storage.set(e.getStorageKey(),{offers:r,stored_at:(new Date).getTime()});e.canRender=true})).catch((function(e){salla.logger.warn(e)}))};e.prototype.componentDidLoad=function(){var e=this.host.querySelector(".s-slider-block__title-nav");e===null||e===void 0?void 0:e.classList.add("s-offer-bank-payment-nav");this.emitPromotionViewed()};e.prototype.findCategories=function(e,r){var t;var s=[];for(var n=0,a=e;n<a.length;n++){var i=a[n];if(r.includes(i.id_||i.id)){s.push(i)}if(((t=i.sub_categories)===null||t===void 0?void 0:t.length)>0){s=s.concat(this.findCategories(i.sub_categories,r))}}return s};e.prototype.getStorageKey=function(){try{var e=salla.config.get("page.slug").replace(".","_");var r=salla.lang.getLocale();var t=salla.config.currency().code;if(!e||!r||!t){throw new Error("Unable to get the storage key.")}return"s-offers-".concat(e,"-").concat(salla.config.get("page.id"),"-").concat(r,"-").concat(t)}catch(e){return""}};e.prototype.getOffersFromStorage=function(){var e=salla.storage.get(this.getStorageKey());if(!e||e.stored_at<(new Date).getTime()-10*60*1e3){salla.storage.remove(this.getStorageKey());return null}this.canRender=true;return Promise.resolve(e.offers)};e.prototype.render=function(){var e=this;if(!this.offersList.length||!this.canRender||!this.showOffer)return null;var r=this.offersList[0];var t=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleText:null:r.title;var s=this.isBankOffer?this.isMultipleBank?this.multipleBankOfferTitleDescription:null:r.description;var n={"block-title":t,"block-subTitle":s,"show-controls":this.isMultipleBank};return h("div",{class:"s-offer-wrapper",onClick:function(){return e.emitPromotionClicked()}},h("p",{class:"s-offer-corner-badge"},this.special_offer_text),h("salla-slider",Object.assign({type:"carousel",id:"offer-slider"},n),h("div",{slot:"items"},this.renderSectionForOfferType(r.type))))};e.prototype.renderSectionForOfferType=function(e){if(this.isBankOffer){return this.renderBankSection()}if(e==OfferType.SpecialPrice){return this.renderSpecialPriceSection()}if(e==OfferType.BuyXGetY){return this.renderBuyXGetYSection()}return this.renderDiscountTableSection()};e.prototype.getCategoriesSection=function(e){return h("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:this.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon||"sicon-store").replace(/\{name\}/g,e.name)})};e.prototype.renderBuyXGetYSection=function(){var e=this;var r,t;var s=this.offersList[0].details;return[(r=s.get.products)===null||r===void 0?void 0:r.map((function(r){return h("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?h(e.productCardComponent,{product:r}):h("salla-product-card",{"shadow-on-hover":true,product:r}))})),(t=s.get.categories)===null||t===void 0?void 0:t.map((function(r){return e.getCategoriesSection(r)}))]};e.prototype.renderBankSection=function(){var e=this;return this.offersList.map((function(r){return h("div",{class:{"s-offer-slide-one-sixth":e.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!e.isMultipleBank}},h("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!e.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":e.isMultipleBank}},h("div",{class:"s-offer-bank-logo"},h("img",{src:r.details.logo||salla.url.cdn("images/s-empty.png"),"data-src":r.details.logo,alt:r.title+" offer"})),h("ul",{class:"s-offer-bank-payment-wrapper"},r.details.payments.map((function(e){return h("li",{class:"s-offer-bank-payment-single"},h("img",{src:salla.url.cdn("images/payment/"+e+".png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+".png"),alt:"payment"}))}))),e.isMultipleBank?h("p",{class:"s-offer-bank-payment-discount-percent"},"".concat(e.product_discount_text," ").concat(r.details.discount_value).concat(r.details.discount_type==="percentage"&&"%")):""),!e.isMultipleBank?h("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},h("h2",null,e.offersList[0].title),h("p",{innerHTML:e.generateBankDescription(e.offersList[0].description,r.details.discount_value)})):"")}))};e.prototype.generateBankDescription=function(e,r){return e.replace(new RegExp("".concat(r," %")),'<span class="s-offer-bank-message-amount">'.concat(r," %</span>"))};e.prototype.renderDiscountTableSection=function(){var e=this;var r;var t=this.offersList[0];var s=t.details.show_price_after_discount;return(r=this.offersList[0].details.discounts)===null||r===void 0?void 0:r.map((function(r){return h("div",{class:"s-offer-slide-one-fourth"},h("div",{class:"s-offer-slide-offer-entry"},h("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},h("p",{class:"s-offer-slide-offer-entry-quantity"},e.buy_quantity_text(r.quantity)),s?h("div",{class:"s-offer-slide-offer-entry-price"},h("span",null,e.offer_with_price_text),h("span",{class:"s-offer-slide-offer-entry-price-amount"},r.discounted_amount)," ",h("span",null,e.userCurrency)):""),h("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},e.with_discount_text,"(",h("span",null,r.percentage,!!r.percentage&&"%"),")")))}))};e.prototype.renderSpecialPriceSection=function(){var e=this;var r,t;var s=this.offersList[0].details;return[s.apply_to==="product"&&((r=s.products)===null||r===void 0?void 0:r.map((function(r){return h("div",{class:"s-offer-slide-one-fourth"},e.hasCustomComponent?h(e.productCardComponent,{product:r}):h("salla-product-card",{"shadow-on-hover":true,product:r}))}))),s.apply_to==="category"&&((t=s.categories)===null||t===void 0?void 0:t.map((function(r){return e.getCategoriesSection(r)})))]};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaOffer.style=sallaOfferCss;export{SallaOffer as salla_offer};
|
|
5
5
|
//# sourceMappingURL=salla-offer.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,s){function a(n){try{o(r.next(n))}catch(n){s(n)}}function c(n){try{o(r["throw"](n))}catch(n){s(n)}}function o(n){n.done?e(n.value):i(n.value).then(a,c)}o((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(n){return function(t){return o([n,t])}}function o(c){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(e=0)),e)try{if(r=1,i&&(s=c[0]&2?i["return"]:c[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;if(i=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){e.label=c[1];break}if(c[0]===6&&e.label<s[1]){e.label=s[1];s=c;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(c);break}if(s[2])e.ops.pop();e.trys.pop();continue}c=t.call(n,e)}catch(n){c=[6,n];i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,h}from"./index-
|
|
4
|
+
*/import{r as registerInstance,h}from"./index-aC-cHVMV.js";import{I as IconVerified}from"./check-uTyAzPSy.js";var iconFileArchive='\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>file-archive</title>\n<path d="M17.333 16h-5.333c-0.737 0-1.333 0.597-1.333 1.333v2.667c0 2.205 1.795 4 4 4s4-1.795 4-4v-2.667c0-0.736-0.596-1.333-1.333-1.333zM16 20c0 0.735-0.597 1.333-1.333 1.333s-1.333-0.599-1.333-1.333v-1.333h2.667zM17.333 12h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28.943 8.391l-8-8c-0.249-0.251-0.588-0.391-0.943-0.391h-13.333c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-18.667c0-0.353-0.14-0.693-0.391-0.943zM26.667 28c0 0.735-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h12.781l7.219 7.219zM17.333 8h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM17.333 4h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333z"></path>\n</svg>\n';var iconDownload='\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>download</title>\n<path d="M15.056 20.941c0.123 0.124 0.271 0.221 0.435 0.289 0.163 0.067 0.336 0.103 0.509 0.103s0.347-0.036 0.509-0.103c0.164-0.068 0.311-0.165 0.435-0.289l5.332-5.332c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-3.057 3.057v-12.781c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v12.781l-3.057-3.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885zM25.333 26.667h-18.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h18.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';var iconCopy='\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-stroke</title>\n<path d="M6.667 18.667h-2.667c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333v2.667c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-2.667c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h2.667c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM28 10.667h-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-4v-13.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.597 1.333-1.333 1.333h-13.333c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333z"></path>\n</svg>\n';var iconCreditCard='\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>debit-card-back</title>\n<path d="M30 28h-28c-1.105 0-2-0.895-2-2v0-18c0-1.105 0.895-2 2-2v0h28c1.105 0 2 0.895 2 2v0 18c0 1.105-0.895 2-2 2v0zM30 26v0zM2 8v18h28v-18zM31 14h-30c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h30c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM11 22h-6c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM24 24c-2.209 0-4-1.791-4-4s1.791-4 4-4c2.209 0 4 1.791 4 4v0c0 2.209-1.791 4-4 4v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2v0c0-1.105-0.895-2-2-2v0zM20 24c-2.209 0-4-1.791-4-4s1.791-4 4-4v0c0.002 0 0.005 0 0.007 0 1.032 0 1.972 0.398 2.673 1.048l-0.003-0.002c0.191 0.183 0.311 0.439 0.311 0.724 0 0.552-0.448 1-1 1-0.257 0-0.492-0.097-0.669-0.257l0.001 0.001c-0.345-0.319-0.807-0.514-1.315-0.514-0.002 0-0.003 0-0.005 0h0c-1.105 0-2 0.895-2 2s0.895 2 2 2v0c0.002 0 0.004 0 0.007 0 0.508 0 0.971-0.195 1.317-0.515l-0.001 0.001c0.179-0.171 0.422-0.276 0.689-0.276 0.552 0 1 0.448 1 1 0 0.295-0.128 0.56-0.331 0.743l-0.001 0.001c-0.699 0.648-1.638 1.046-2.671 1.046-0.003 0-0.007 0-0.010 0h0.001z"></path>\n</svg>\n';var sallaOrderSummaryCss=":host{display:block}";var SallaOrderSummary=function(){function n(n){registerInstance(this,n);this.codeCopied=null;this.noItemFound=true;this.order_items=[];this.isDigitalCard=function(n){return n.product.type==="codes"};this.isDigitalProduct=function(n){return n.product.type==="digital"}}n.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var n=this;return __generator(this,(function(t){switch(t.label){case 0:salla.lang.onLoaded((function(){n.codes_text=salla.lang.get("pages.thank_you.codes");n.copy_text=salla.lang.get("common.elements.copy");n.files_text=salla.lang.get("pages.thank_you.files");n.download_text=salla.lang.get("pages.thank_you.download")}));return[4,this.getOrderItems()];case 1:return[2,t.sent()]}}))}))};n.prototype.copyToClipboardHandler=function(n){var t=this;if(navigator&&"clipboard"in navigator){try{navigator.clipboard.writeText(n).then((function(){t.codeCopied=n;t.copyCodeButtonTimeout=setTimeout((function(){t.codeCopied=null}),3e3)}))}catch(n){salla.loggers.error("copy functionality is not supported by the browser")}}};n.prototype.getOrderItems=function(){return __awaiter(this,void 0,void 0,(function(){var n,t,e,r,i,s;var a=this;return __generator(this,(function(c){switch(c.label){case 0:n=this.orderId||salla.config.get("page.id");t="Failed to fetch order items";if(!n){salla.logger.error(t);throw new Error(t)}c.label=1;case 1:c.trys.push([1,3,,4]);return[4,salla.api.request("orders/".concat(n))];case 2:e=c.sent().data.items,r=e===void 0?[]:e;i=r.some((function(n){return a.isDigitalCard(n)||a.isDigitalProduct(n)}));if(i){this.order_items=r;this.noItemFound=false}return[3,4];case 3:s=c.sent();salla.logger.error(t);return[3,4];case 4:return[2]}}))}))};n.prototype.disconnectedCallback=function(){this.copyCodeButtonTimeout&&clearTimeout(this.copyCodeButtonTimeout)};n.prototype.render=function(){var n=this;return h("ul",{key:"6358d81e74e1fd966b7046deab946f33391b2fc6",class:"s-order-summary-wrapper"},this.noItemFound?h("salla-placeholder",{alignment:"center"},h("span",{slot:"title"})):this.order_items.map((function(t){return n.isDigitalCard(t)?h("li",{key:t.product.id,class:"s-order-summary-item"},h("h2",{class:"s-order-summary-item-title"},n.codes_text," (",t.name,")"),t.codes.map((function(t){return h("div",{key:t.code,class:"s-order-summary-code-item-wrapper"},h("p",null,h("span",{innerHTML:iconCreditCard}),h("span",null,t.code)),h("salla-button",{class:"s-order-summary-item-copy-button ".concat(n.codeCopied===t.code?"copied":""),onClick:function(){return n.copyToClipboardHandler(t.code)},shape:"link"},h("span",{innerHTML:n.codeCopied===t.code?IconVerified:iconCopy}),h("span",null,n.copy_text)))}))):n.isDigitalProduct(t)?h("li",{key:t.product.id,class:"s-order-summary-item"},h("h2",{class:"s-order-summary-item-title"},n.files_text," (",t.name,")"),h("ul",null,t.files.map((function(t){return h("li",{class:"s-order-summary-digital-item-wrapper"},h("div",null,h("span",{innerHTML:iconFileArchive}),h("span",null,t.name)),h("a",{href:t.url,target:"_blank",class:"s-order-summary-item-download"},h("span",{innerHTML:iconDownload}),h("span",null,n.download_text)))})))):null})))};return n}();SallaOrderSummary.style=sallaOrderSummaryCss;export{SallaOrderSummary as salla_order_summary};
|
|
5
5
|
//# sourceMappingURL=salla-order-summary.entry.js.map
|