function emarsysrecommendcallback(lo_result,pf_render){ls_targetid=$(lo_result.recommender.container).attr('id');pf_render(lo_result);if(ls_targetid=='emarsysrecommendproduct'){$(`#${ls_targetid}`).each(function(){const currentSlider=$(this).find('.s-gallery__slider');const numberDesktop=4;const numberTablet=2;const numberMobile=1;function loadSlider(){currentSlider.imagesLoaded(()=>{currentSlider.slick({slidesToShow:numberDesktop,responsive:[{breakpoint:1201,settings:{slidesToShow:numberTablet,arrows:!0,},},{breakpoint:751,settings:{slidesToShow:numberMobile,centerMode:!0,centerPadding:'0',arrows:!0,},},],})})}
if(currentSlider.hasClass('slick-initialized')){currentSlider.slick('unslick');loadSlider()}else{loadSlider()}})}
if(lo_result.hasOwnProperty('page')&&lo_result.page.hasOwnProperty('products')){pushImpressions(lo_result.page.products,'emarsys')}}
function pushImpressions(pa_products,ps_type){switch(ps_type){case 'emarsys':data=getEmarsysImpressions(pa_products);break}
if(data){const lo_ecom={event:'impressions',ecommerce:{},};lo_ecom.ecommerce.impressions=data;window.dataLayer.push(lo_ecom)}}
function getEmarsysImpressions(pa_products){const impressions=[];let i=1;for(index in pa_products){const product=pa_products[index];if(!product.id&&!product.name){continue}
const impression={};product.c_item_group_id&&(impression.id=product.c_item_group_id);product.title&&(impression.name=product.title);product.price&&(impression.price=product.price);product.brand&&(impression.brand=product.brand);product.trackingCode&&(impression.list=`EMARSYS ${product.trackingCode}`);impression.position=i;impressions.push(impression);i+=1}
if(impressions.length==0){return!1}
return impressions}