jQuery(".lazy").lazy(),console.log("Carga de lazy load");var isDebug=!0;if(void 0===window.replaceAll)function replaceAll(text,busca,reemplaza){for(;-1!=text.toString().indexOf(busca);)text=text.toString().replace(busca,reemplaza);return text}if(void 0===window.currency)function currency(value,decimals,separators){decimals=decimals>=0?parseInt(decimals,0):2,separators=separators||[".","'",","];var number=(parseFloat(value)||0).toFixed(decimals);if(number.length<=4+decimals)return number.replace(".",separators[separators.length-1]);for(var parts=number.split(/[-.]/),result=(value=parts[parts.length>1?parts.length-2:0]).substr(value.length-3,3)+(parts.length>1?separators[separators.length-1]+parts[parts.length-1]:""),start=value.length-6,idx=0;start>-3;)result=(start>0?value.substr(start,3):value.substr(0,3+start))+separators[idx]+result,idx=++idx%2,start-=3;return(3==parts.length?"-":"")+result}if(void 0===window.createCookie)function createCookie(name,value,days){if(days){var date=new Date;date.setTime(date.getTime()+24*days*60*60*1e3);var expires="; expires="+date.toGMTString()}else expires="";document.cookie=name+"="+value+expires+"; path=/"}if(void 0===window.readCookie)function readCookie(name){for(var nameEQ=name+"=",ca=document.cookie.split(";"),i=0;i{const user=await(async()=>{const response=await fetch("/api/vtexid/pub/authenticated/user"),user=await response.json();return await user})(),urlParams=new URLSearchParams(window.location.search);if(user||urlParams.get("email")){const myEmail=user?user.user:urlParams.get("email");myEmail&&($("#email_user").val(myEmail),setTimeout(function(){$("#buttonSend").click()},1500))}};var tiendasHeader=function(){var citysAll=[],listCitys="";$.ajax({url:"/api/dataentities/CT/search?_fields=ciudad,latitud,longitud",type:"GET",cache:!1,beforeSend:function(request){request.setRequestHeader("Rest-Range","resources=0-300")},success:function(data){data.forEach(function(item){citysAll.push(item)});var contador=0;listCitys+="",citysAll.forEach(function(item){0==contador?(listCitys+='",contador++):listCitys+='"}),$(".contentLocalizador select").html(listCitys),$(".contentLocalizador select ").change(function(){var optionSelected=$(this).find("option:selected"),latSelected=optionSelected.data("lat"),lngSelected=optionSelected.data("lng");location.href="/nuestras-tiendas?lat="+latSelected+"&lng="+lngSelected})},error:function(jqXHR,textStatus,errorThrown){console.log(jqXHR)}})},tiendas=function(latitud,longitud){var citysAll=[],listCitys="",tiendas="",totaltiendas=[];$.ajax({url:"/api/dataentities/TI/search?_fields=tienda,ciudad,horario,telefono,direccion,latitud,longitud",type:"GET",cache:!1,beforeSend:function(request){request.setRequestHeader("Rest-Range","resources=0-300")},success:function(data){data.forEach(function(item){citysAll.push(item.ciudad),totaltiendas.push(item)});var contador=0;citysAll.filter(function(item,index,array){return array.indexOf(item)===index}).forEach(function(item){0==contador?(listCitys+='",contador++):listCitys+='"}),$("#prov").html(listCitys);var value=$("select[id=prov]").val();tiendas=data.filter(function(item){return item.ciudad==value}),$(".locales ul").empty(),tiendas.forEach(function(item){$(".locales ul").append('
'+item.tienda+'
'+item.direccion+'
'+item.horario+" "+item.telefono+"
")}),mapaTiendas(totaltiendas,latitud,longitud),$("#prov").change(function(){console.log("entro");var value=$("select[id=prov]").val();tiendas=data.filter(function(item){return item.ciudad==value}),$(".locales ul").empty(),tiendas.forEach(function(item){$(".locales ul").append('
'+item.tienda+'
'+item.direccion+'
'+item.horario+" "+item.telefono+"
")}),mapaTiendas(totaltiendas,tiendas[0].latitud,tiendas[0].longitud)})},error:function(jqXHR,textStatus,errorThrown){console.log(jqXHR)}})},mapaTiendas=function(totaltiendas,lat,lng){var center_lat=lat,center_lng=lng,mapOptions={center:new google.maps.LatLng(center_lat,center_lng),zoom:10,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.BOTTOM_CENTER},panControl:!1,panControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT},zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE,position:google.maps.ControlPosition.RIGHT_CENTER},scaleControl:!1,streetViewControl:!1,streetViewControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP}};map=new google.maps.Map(document.getElementById("map-canvas"),mapOptions),mark_items(totaltiendas),$(".ciudades").click(function(){var lat=$(this).data("lat"),lng=$(this).data("lng"),tienda=$(this).data("tienda"),direccion=$(this).data("direccion"),telefono=$(this).data("telefono"),extension=$(this).data("extension"),horario=$(this).data("horario");if(void 0!=lat&&void 0!=lng){$(this).addClass("active").siblings(".ciudades").removeClass("active");var latlng=new google.maps.LatLng(lat,lng);map.panTo(latlng),add_marker(latlng,tienda,direccion,telefono,extension,horario),void 0!=map&&null!=map&&void 0!=map.setZoom&&null!=map.setZoom&&map.setZoom(15),map.setCenter(latlng)}})},add_marker=function(latlng,tienda,direccion,telefono,extension,horario){const contentString='

'+tienda+'

Dirección: '+direccion+"

Número: "+telefono+"

Extensión: "+extension+"

Horario: "+horario+"

",infowindow=new google.maps.InfoWindow({content:contentString});var marker=new google.maps.Marker({position:latlng,map:map,animation:google.maps.Animation.DROP});google.maps.event.addListener(marker,"click",function(){infowindow.open(map,marker)}),markers.push(marker)},mark_items=function(items){$.each(items,function(i,e){var lat=e.latitud,lng=e.longitud,tienda=e.tienda,direccion=e.direccion,telefono=e.telefono,extension=e.extension,horario=e.horario;if(void 0!=lat&&void 0!=lng){var latlng=new google.maps.LatLng(lat,lng);add_marker(latlng,tienda,direccion,telefono,extension,horario)}})},formatearMoneda=function(numero,numDecimales,separadorMiles,separadorDecimales){var n=numero,s=(numDecimales=isNaN(numDecimales=Math.abs(numDecimales))?2:numDecimales,separadorDecimales=void 0==separadorDecimales?".":separadorDecimales,separadorMiles=void 0==separadorMiles?",":separadorMiles,n<0?"-":""),i=parseInt(n=Math.abs(+n||0).toFixed(numDecimales))+"",j=(j=i.length)>3?j%3:0;return s+(j?i.substr(0,j)+separadorMiles:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+separadorMiles)+(numDecimales?separadorDecimales+Math.abs(n-i).toFixed(numDecimales).slice(2):"")},ajustarPrecios=function(bestPrice,listPrice,taxBestPrice){return{bestPriceTax:"$"+formatearMoneda(bestPrice+taxBestPrice,0,".",","),listPriceTax:"$"+formatearMoneda(Math.round((taxBestPrice/bestPrice+1)*listPrice),0,".",",")}},ajustarPrecioVitrinas=function(){$(".product-vitrine").each(function(){var objVitrine=$(this),idproduct=$(this).attr("data-idproduct"),objListPrice=$(this).find(".prices .productList"),objBestPrice=$(this).find(".prices .uniquePrice");$(this).find(".tagDescuento");vtexjs.catalog.getProductWithVariations(idproduct).done(function(product){$.each(product.skus,function(indexSku,valueSku){if(drawPUM(valueSku,objVitrine.find(".pricePUMVitrine")),valueSku.available){var prices=ajustarPrecios(valueSku.bestPrice/100,valueSku.listPrice/100,valueSku.taxAsInt/100);return objListPrice.text("$0"===prices.listPriceTax?"":prices.listPriceTax),objBestPrice.text(prices.bestPriceTax),!1}})})})},drawPUM=function(valueSku,objDraw){if(void 0!==valueSku.dimensions["Tamaño"]&&"Único"!=valueSku.dimensions["Tamaño"]&&!$.isEmptyObject(valueSku.dimensions)){var divisorPUM=valueSku.dimensions["Tamaño"].split(" ")[0],textPUM="gr"==valueSku.dimensions["Tamaño"].split(" ")[1]?" Gramo a ":" Mililitro a ";objDraw.html(""+textPUM+"$"+(valueSku.bestPrice/100/divisorPUM).toFixed(2))}},generalesMenu=function(){setTimeout(function(){$(".menuContainer").height()>=66&&$(".subMenu").css("top","58px")},1e4)},quitarBoton=function(){console.log("fuera"),setInterval(()=>{try{const div=document.querySelector(".force-desktop"),div2=document.querySelector(".waves-button_builder"),div3=document.querySelector(".smt-app-button_builder"),div4=document.querySelector(".smt-app");div4&&(div.style.display="none",div2.style.display="none",div3.style.display="none",div4.style.display="none")}catch(error){console.log(error.message)}},5e3)};return{init:function(){if(quitarBoton(),generalesMenu(),$("body").hasClass("wishlistBlind")&&Wishlist(),ajustarPrecioVitrinas(),newsletterPopupClose(),tiendasHeader(),$(".nuestras-tiendas").length>0){var limpiezaUrl=window.location.href.split("?")[1],latitud=limpiezaUrl.split("&")[0].split("=")[1],longitud=limpiezaUrl.split("&")[1].split("=")[1];tiendas(latitud,longitud)}},ajustarPrecioVitrinas:ajustarPrecioVitrinas,formatearMoneda:formatearMoneda,ajustarPrecios:ajustarPrecios,drawPUM:drawPUM,renderProduct:function(){$(".product-vitrine").each(function(){var productId=$(this).attr("data-idproduct");vtexjs.catalog.getProductWithVariations(productId).done(function(product){$(document).trigger("Product:Render",product)})})}}}();function newsletterPopupClose(e){$(document).on("click",".newsletter h3,.luego",function(){$("#newsletter-popup-wrapper.open").css({opacity:"",display:"none"}),$("#newsletter-popup-wrapper.open").removeClass("open")})}if($(window).load(function(){}),$(window).bind("load resize",function(){$(".img_mobile_change").each(function(){var thisDesk=$(this).attr("data-desktop");$(this).attr("src",thisDesk)})}),$(window).bind("load scroll resize",function(){if($(window).scrollTop()>10){$("header").addClass("scroll_header"),$(".menuContainer").addClass("scroll_header"),$("#grid-page").addClass("header_flow");$("header").height(),$(".menuContainer").height(),$(".subHeaderContainer").height()}else $("header").removeClass("scroll_header"),$(".menuContainer").removeClass("scroll_header"),$(".mainContent").css({"padding-top":0}),$("#grid-page").removeClass("header_flow")}),void 0===window.formatDate)function formatDate(date){var hours=date.getHours(),minutes=date.getMinutes(),strTime=hours+":"+(minutes=minutes<10?"0"+minutes:minutes),month=9>=date.getMonth()+1?"0"+(date.getMonth()+1):date.getMonth()+1,day=9>=date.getDate()?"0"+date.getDate():date.getDate();return date.getFullYear()+"-"+month+"-"+day+" "+strTime}if(void 0===window.sleep_s)function sleep_s(secs){for(secs=+new Date+1e3*secs;+new Date=0?parseInt(decimals,0):2,separators=separators||[".","'",","];var number=(parseFloat(value)||0).toFixed(decimals);if(number.length<=3+decimals)return number.replace(".",separators[separators.length-1]);for(var parts=number.split(/[-.]/),result=(value=parts[parts.length>1?parts.length-2:0]).substr(value.length-3,3)+(parts.length>1?separators[separators.length-1]+parts[parts.length-1]:""),start=value.length-6,idx=0;start>-3;)result=(start>0?value.substr(start,3):value.substr(0,3+start))+separators[idx]+result,idx=++idx%2,start-=3;return(3==parts.length?"-":"")+result}if(void 0===window.replaceAll)function replaceAll(text,busca,reemplaza){for(;-1!=text.toString().indexOf(busca);)text=text.toString().replace(busca,reemplaza);return text}if(void 0===window.addCommas)function addCommas(nStr){for(var x=(nStr+="").split("."),x1=x[0],x2=x.length>1?"."+x[1]:"",rgx=/(\d+)(\d{3})/;rgx.test(x1);)x1=x1.replace(rgx,"$1.$2");return x1+x2}if(void 0===window.addTax)function addTax(priceToAdd,taxToAdd,promotion){var priceWithTax=Number(Number.parseFloat(priceToAdd/100).toFixed())+(taxToAdd?Number(Number.parseFloat(taxToAdd/100).toFixed()):0);return"$"+addCommas(priceWithTax=priceWithTax.toFixed(0))}var CALCULOS_BB={calcularDiasEnvio:function(datos){var transitTime=datos.transitTime,dockTime=datos.dockTime,timeToDockPlusDockTime=datos.timeToDockPlusDockTime,aditionalTimeBlockedDays=datos.aditionalTimeBlockedDays,obj_transitTime=this.obtenerDatosFecha(transitTime),obj_dockTime=this.obtenerDatosFecha(dockTime),obj_timeToDockPlusDockTime=this.obtenerDatosFecha(timeToDockPlusDockTime),obj_aditionalTimeBlockedDays=this.obtenerDatosFecha(aditionalTimeBlockedDays);return{dias:obj_transitTime.dias+obj_dockTime.dias+obj_timeToDockPlusDockTime.dias+obj_aditionalTimeBlockedDays.dias,horas:obj_transitTime.horas+obj_dockTime.horas+obj_timeToDockPlusDockTime.horas+obj_aditionalTimeBlockedDays.horas,minutos:obj_transitTime.minutos+obj_dockTime.minutos+obj_timeToDockPlusDockTime.minutos+obj_aditionalTimeBlockedDays.minutos}},obtenerDatosFecha:function(fecha){var fecha1=fecha.split(":"),fecha2=fecha1[0].split(".");return{dias:fecha2[0]?parseInt(fecha2[0]):0,horas:fecha2[1]?parseInt(fecha2[1]):0,minutos:fecha1[1]?parseInt(fecha1[1]):0}}};jQuery(document).ajaxStop(function(){var hoy=new Date,fechaInicio=new Date(2021,8,23,23,59),fechaFin=new Date(2021,8,30,23,59);hoy>=fechaInicio&&hoy<=fechaFin&&jQuery(".tercer_precio:not(.rendered)").each(function(){if(jQuery(this).addClass("rendered"),jQuery(this).find(".product_field_41 ul li").not(":empty").length){jQuery(this).show(),$(".prices .productList").hide();var tercerPrecioBest=jQuery(this).find(".product_field_41 ul li").html().replace(" ","").replace(" ",""),tercerPrecioBestCurrency=currency(tercerPrecioBest).replaceAll(",00","");jQuery(this).find(".img-descuento").after(' $'+tercerPrecioBestCurrency+"")}})});var GLOBAL={init:function(){this.newsLetter(),this.cuantoFaltaEnvioGratis(),this.vitrinaHome(),this.searchBox(),this.departamentCarousel(),this.countDown(),this.vitrineNewHome(),this.slideBrandsNewHome(),this.placeHolderHubSpot(),this.bannerBrands(),$("#blackfriday-page").length>0&&(this.sliderProductosblackFriday(),this.bannerblackFriday()),$("#blackfriday-2020").length>0&&this.bannerHotDays()},popupNewsletter:function(){0==readCookie("visited").length&&jQuery("#newsletter-popup").show(0,function(){jQuery(this).addClass("visible"),createCookie("visited","true",1),window.dataLayer&&dataLayer.push({event:"trackEvent",eventCategory:"newsletter",eventAction:"pop-up",eventLabel:"impresion"})}),$(document).on("click","#cierre-popup-newsletter",function(){$("#newsletter-popup.visible").css({opacity:"",display:"none"}),$("#newsletter-popup-wrapper.open").removeClass("visible")})},bannerblackFriday:function(){$(".fullbanner").slick({lazyLoad:"ondemand",slidesToShow:1,slidesToScroll:1,autoplay:!0,arrows:!0,dots:!0,accessibility:!0,autoplaySpeed:3e3,speed:1e3,fade:!0,cssEase:"linear",infinite:!0})},bannerHotDays:function(){$(".section-1").slick({lazyLoad:"ondemand",slidesToShow:1,slidesToScroll:1,autoplay:!0,arrows:!0,dots:!0,accessibility:!0,autoplaySpeed:3e3,speed:1e3,fade:!0,cssEase:"linear",infinite:!0})},bannerBrands:function(){$(".fullBannerCategoria").slick({lazyLoad:"ondemand",slidesToShow:1,slidesToScroll:1,autoplay:!0,arrows:!0,dots:!0,accessibility:!0,autoplaySpeed:3e3,speed:1e3,fade:!0,cssEase:"linear",infinite:!0})},sliderProductosblackFriday:function(){var $sectionsliderBlackfriday=$("#blackfriday-page .destacados .prateleira > ul");$("#blackfriday-page .destacados .helperComplement").remove(),$sectionsliderBlackfriday.slick({autoplay:!1,dots:!1,infinite:!0,speed:1e3,slidesToShow:3,slidesToScroll:3});var $sectionsliderBlackfriday2=$("#blackfriday-page .carousel .prateleira > ul");$("#blackfriday-page .carousel .helperComplement").remove(),$sectionsliderBlackfriday2.slick({autoplay:!1,dots:!1,infinite:!0,speed:1e3,slidesToShow:4,slidesToScroll:4})},cerrarCountDown:function(){createCookie("contador","true",1),$("#countDown").remove()},countDown:function(){if($("#countDown").hide(),0==readCookie("contador").length){var atributos=Array("countDown","countDownDateFinish","countDownUrlImage","countDownUrl","countDownColor","countDownDateStart");GLOBAL.valorAtributoGlobal(atributos,function(returnValue){if(void 0!==returnValue&&null!==returnValue&&Object.keys(returnValue).length>0){for(var i=0;i=(countDownDateStart=new Date(fechasola2[0],parseInt(fechasola2[1])-1,fechasola2[2],horasola2[0],horasola2[1])))if(fechaActual<=countDownDate){jQuery("#countDown .imagen img").attr("src",countDownUrlImage),jQuery("#countDown .link a").attr("href",countDownUrl),jQuery("#countDown .link a").css("color",countDownColor),jQuery("#countDown").css("background-color",countDownColor);var x=setInterval(function(){var now=(new Date).getTime(),distance=countDownDate-now,days=Math.floor(Number(distance)/864e5),hours=Math.floor(Number(distance)%864e5/36e5),minutes=Math.floor(Number(distance)%36e5/6e4),seconds=Math.floor(Number(distance)%6e4/1e3);jQuery("#countDown .Days p").html(days),jQuery("#countDown .Hours p").html(hours),jQuery("#countDown .Minutes p").html(minutes),jQuery("#countDown .Seconds p").html(seconds),distance<0&&(clearInterval(x),document.getElementById("countDown").innerHTML="EXPIRED")},10);$("#countDown").show()}else $("#countDown").hide(),$("#countDown").remove();else $("#countDown").hide(),$("#countDown").remove()}}else $("#countDown").remove()})}else $("#countDown").remove()},valorAtributoGlobal:function(atributoArray,cb_func){var datos=void 0;if(atributoArray.length>0){var atributoString=atributoArray.join(" OR atributo=");return $.ajax({url:"/api/dataentities/AG/search?_fields=atributo,valor&_where=(atributo="+atributoString+")",type:"GET",success:cb_func,beforeSend:function(request){request.setRequestHeader("Rest-Range","resources=0-300")},error:function(jqXHR,textStatus,errorThrown){datos=void 0},cache:!1}),datos}return datos},cuantoFaltaEnvioGratis:function(){jQuery(document).ajaxStop(async function(){var total=jQuery(".carritoCompras .cartFooter .cartTotal .totalCart").html();if(void 0===total||null===total);else{total=replaceAll(total,"$",""),total=replaceAll(total,".","");var montoDeEnvioGratisFetch=await fetch("/api/dataentities/EG/search?_fields=montoEnvioGratis");if(total>=(montoDeEnvioGratis=(await montoDeEnvioGratisFetch.json())[0].montoEnvioGratis))$(".envioGratis").length>0||(jQuery(".carritoCompras .cartFooter .envioGratis").remove(),jQuery(".prod-agregado__detalles .envioGratis").remove(),jQuery(".infoenvio .enviogratis .info").remove(),jQuery(".carritoCompras .cartFooter").append('
Ahora tu pedido califica para Envío Gratuito
'),jQuery(".infoenvio .enviogratis").append('
Ahora tu pedido califica para Envío Gratuito
'));else if($(".envioGratis").length>0);else{montoDeEnvioGratisFetch=await fetch("/api/dataentities/EG/search?_fields=montoEnvioGratis");var montoDeEnvioGratis,falta=(montoDeEnvioGratis=(await montoDeEnvioGratisFetch.json())[0].montoEnvioGratis)-total;falta=currency(falta,0);var porcentaje=100*total/montoDeEnvioGratis;jQuery(".carritoCompras .cartFooter .envioGratis").remove(),jQuery(".prod-agregado__detalles .envioGratis").remove(),jQuery(".infoenvio .enviogratis .info").remove(),jQuery(".prod-agregado__detalles").append("Te falta $"+falta+" para el envío gratis"),jQuery(".carritoCompras .cartFooter").append('
Te falta $'+falta+' para el envío gratis
'),jQuery(".infoenvio .enviogratis").append('
Te falta $'+falta+' para el envío gratis
')}}})},newsLetter:function(){console.log("newsletter"),jQuery(".formulario-newsletter").on("submit",function(e){var divNewsletter=jQuery(this).closest("div.newsletter"),name=jQuery(divNewsletter).find("#newsletterClientName").val(),email=jQuery(divNewsletter).find("#newsletterClientEmail").val(),telefono=jQuery(divNewsletter).find("#newsletterClientTelephone").val(),documento=jQuery(divNewsletter).find("#newsletterClientDocument").val(),tym=jQuery(divNewsletter).find("#tym input").prop("checked");jQuery(divNewsletter).find("#storeName").val(),jQuery(divNewsletter).find("#dataEntity").val();if(""==name||null==name||void 0==name||""==email||null==email||void 0==email||""==telefono||null==telefono||void 0==telefono||""==documento||null==documento||void 0==documento||0==tym)jQuery(divNewsletter).find("fieldset.formulario").hide(),jQuery(divNewsletter).find("fieldset.success").hide(),jQuery(divNewsletter).find("fieldset.error").show();else{var jsonCO={firstName:name,email:email,document:documento,phone:telefono};$.ajax({beforeSend:function(xhrObj){xhrObj.setRequestHeader("Content-Type","application/json")},data:JSON.stringify(jsonCO),type:"PATCH",url:"/api/dataentities/NW/documents",dataType:"json",contentType:"application/json",success:function(data){jQuery(divNewsletter).find("fieldset.formulario").hide(),jQuery(divNewsletter).find("fieldset.success").show(),jQuery(divNewsletter).find("fieldset.error").hide()},error:function(data){var obj=JSON.parse(data.responseText);400==data.status&&"O documento já existe"==obj.Message?(jQuery(divNewsletter).find("fieldset.formulario").hide(),jQuery(divNewsletter).find("fieldset.success").show(),jQuery(divNewsletter).find("fieldset.error").hide()):(jQuery(divNewsletter).find("fieldset.formulario").hide(),jQuery(divNewsletter).find("fieldset.success").hide(),jQuery(divNewsletter).find("fieldset.error").show())}})}e.preventDefault()}),jQuery("input.newsletter-button-back").on("click",function(){var divNewsletter=jQuery(this).closest("div.newsletter");jQuery(divNewsletter).find("fieldset.formulario").show(),jQuery(divNewsletter).find("fieldset.success").hide(),jQuery(divNewsletter).find("fieldset.error").hide()})},vitrineNewHome:function(){$("body").hasClass("newHome")&&(console.log($(".newvitrine ul")),$(".newvitrine ul").slick({slidesToShow:5,slidesToScroll:1,autoplaySpeed:6e3,infinite:!0}))},slideBrandsNewHome:function(){$("body").hasClass("newHome")&&$(".contentBrands").slick({slidesToShow:5,slidesToScroll:1,autoplay:!0,autoplaySpeed:6e3,infinite:!0})},vitrinaHome:function(){setTimeout(function(){$(".showcase-owl .prateleira ul").length&&$(".showcase-owl .prateleira ul").slick({slidesToShow:5,slidesToScroll:1,autoplay:!0,autoplaySpeed:6e3})},1e3)},departamentCarousel:function(){setTimeout(function(){$(".vitrinaDptonew .prateleira ul").length&&$(".vitrinaDptonew .prateleira ul").slick({slidesToShow:5,slidesToScroll:5,autoplay:!0,autoplaySpeed:6e3}),$(".slick-carousel-marca").length&&$(".slick-carousel-marca").slick({slidesToShow:5,slidesToScroll:5,autoplay:!0,infinite:!0,autoplaySpeed:6e3})},1e3)},searchBox:function(){$(".search-menu .new-search a.skip-link").click(function(){$(".x-search-box-wrapper").slideDown(800),$("body").addClass("fixedSearch"),setTimeout(function(){$("#x-autocomplete-input").focus()},1500)}),$(".x-search-box-wrapper .x-close_search-box").click(function(){$(".x-search-box-wrapper").slideUp(800),$("body.fixedSearch").removeClass("fixedSearch")}),$(".x-search-box-wrapper .x-form form").submit(function(){var word=$(".x-search-box-wrapper .x-form #x-autocomplete-input2").val();return window.location.href="/"+word,!1}),$(document).ready(function(){$("#x-autocomplete-input2").keyup(function(event){var busca=$("#x-autocomplete-input2").val();$(".x-produt-list").append(""),busca.length>2&&$.ajax({url:"/buscapagina?ft="+busca+"&sl=add558c8-8388-4f69-a518-39a46a2188d8&cc=1&sm=0&PS=50",type:"GET",searchWord2:"pruebas",dataType:"html",beforeSend:function(msg){$(".x-produt-list ul").html("
  • ")},success:function(data){$(".x-produt-list").html(data)},error:function(xhr,status){alert("Sorry, there was a problem!")}})})})},placeHolderHubSpot:function(){setInterval(function(){$("#firstname-789be01e-517d-47e0-9b9a-5ea4b9da7fc1").attr("placeholder"," Ingresa tu nombre"),$("#email-789be01e-517d-47e0-9b9a-5ea4b9da7fc1").attr("placeholder"," Ingresa tu e-mail"),$("#cromantic_documento-789be01e-517d-47e0-9b9a-5ea4b9da7fc1").attr("placeholder"," Ingresa tu identificación"),$("#cromantic_telefono-789be01e-517d-47e0-9b9a-5ea4b9da7fc1").attr("placeholder"," Ingresa tu celular"),$("#cromantic_fecha_nacimiento-789be01e-517d-47e0-9b9a-5ea4b9da7fc1").attr("placeholder"," Tu fecha de nacimiento")},300)}},CHLOE={init:function(){"chloe-home"===document.body.id&&this.videoChloe()},videoChloe:function(){$(".img_grande img").click(function(){$(".banner_video").show()}),$(".close-modal").click(function(){$(".banner_video").hide()})}},HOME={init:function(){"home-page"!==document.body.id&&"blackfriday-2020"!==document.body.id||(isDebug&&console.log("====== HOME ======"),this.newBannerHome(),this.carruselSlide(),this.newsletterPopupOpen()),"blackfriday-page"===document.body.id&&this.newsletterPopupOpen(),"landing_julio_2021"===document.body.id&&(this.landind_julio_2021(),this.categorias1_julio_2021(),this.categorias1_julio_2021_2())},newsletterPopupOpen:()=>{0==readCookie("visited").length&&jQuery("#newsletter-popup-wrapper").show(0,function(){jQuery(this).addClass("open"),createCookie("visited","true",1),window.dataLayer&&dataLayer.push({event:"trackEvent",eventCategory:"newsletter",eventAction:"pop-up",eventLabel:"impresion"})})},newBannerHome:function(){$(".fullbanner").slick({lazyLoad:"ondemand",slidesToShow:1,slidesToScroll:1,autoplay:!0,arrows:!0,dots:!0,accessibility:!0,autoplaySpeed:3e3,speed:1e3,fade:!0,cssEase:"linear",infinite:!0})},carruselSlide:function(){$(".brand-blind").slick({infinite:!0,slidesToShow:5,slidesToScroll:5})},landind_julio_2021:function(){$(".bannerPrimero-agosto20201").slick({infinite:!0,slidesToShow:1,slidesToScroll:1})},categorias1_julio_2021:function(){$(".bannerCollecciones_agosto_2021").slick({infinite:!0,slidesToShow:1,slidesToScroll:1})},categorias1_julio_2021_2:function(){$(".bannerCollecciones_agosto_2021-2").slick({infinite:!0,slidesToShow:1,slidesToScroll:1})}},TERMINOS={init:function(){"terminos"===document.body.id&&(isDebug&&console.log("====== terminos ======"),this.terminos(),this.tabs())},tabs:function(){var el=$(".terminoscondiciones");$(el).find(".menu-preguntas ul li").hasClass("tab-active")&&$(el).find(".panel").hide().eq(0).show(),$(el).find(".menu-preguntas ul li").click(function(e){e.preventDefault(),$(el).find(".panel").stop(!0,!0).slideUp("fast"),$(el).find(".menu-preguntas ul li").removeClass("tab-active");var id=$(el).find(this).find("a").attr("href");jQuery(id).slideDown("2000"),$(el).find(this).addClass("tab-active")})},terminos:function(){var Accordion=function(el,multiple){this.el=el||{},this.multiple=multiple||!1,this.el.find(".link").on("click",{el:this.el,multiple:this.multiple},this.dropdown)};Accordion.prototype.dropdown=function(e){var $el=e.data.el;$this=$(this),$next=$this.next(),$next.slideToggle(),$this.parent().toggleClass("open"),e.data.multiple||$el.find(".submenu").not($next).slideUp().parent().removeClass("open")};new Accordion($("#accordion"),!1)}},BLACKFRIDAY={init:function(){"blackfriday-2020"===document.body.id&&(isDebug&&console.log("====== BLACKFRIDAY ======"),this.carrouselSection2(),this.carrouselSection5(),this.carrouselSection7())},carrouselSection2:function(){setTimeout(function(){$(".section-2-mobile").length&&$(".section-2-mobile").slick({slidesToShow:1,slidesToScroll:1,autoplay:!0,arrows:!1,dots:!0,autoplaySpeed:6e3})},1e3)},carrouselSection5:function(){setTimeout(function(){$(".section-5 .prateleira ul").length>5?$(".section-5 .prateleira ul").slick({slidesToShow:5,slidesToScroll:1,autoplay:!0,autoplaySpeed:6e3}):$(".section-5 .prateleira ul").length&&$(".section-5 .prateleira ul").slick({slidesToShow:5,slidesToScroll:1})},1e3)},carrouselSection7:function(){setTimeout(function(){$(".section-7 .prateleira ul").length&&($(".helperComplement").remove(),$(".section-7 .prateleira ul").slick({slidesToShow:5,slidesToScroll:1,autoplay:!0,autoplaySpeed:6e3}))},1e3)}};$(document).ready(function(){FuncionalidadesGenerales.init(),GLOBAL.init(),HOME.init(),BLACKFRIDAY.init(),CHLOE.init(),$(window).scroll(function(event){$(window).scrollTop()>=300?$(".menu-list").addClass("fixed-menu"):$(".menu-list").removeClass("fixed-menu")}),TERMINOS.init(),$(window).scroll(function(event){$(window).scrollTop()>=300?$(".menu-list").addClass("fixed-menu"):$(".menu-list").removeClass("fixed-menu")})});