"use strict";function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"cybermonday",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cyber";Fizzmod.Utils.getCookie("close-"+t)?$(".overlay."+e).hide():($(".overlay."+e).fadeIn(100),$(".overlay.bienvenida .content").hide(),$(document).on("click",".overlay."+e+" .close, .overlay."+e+" a",function(){$(".overlay").fadeOut(),$("body, html").removeClass("modal-open"),Fizzmod.Utils.setCookie("close-"+t,!0,1),localStorage.setItem("suscrito",1)}))}function justNumbers(e){var t=window.event?window.event.keyCode:e.which;return 8==t||46==t||/\d/.test(String.fromCharCode(t))}function setPosition(e){var t=$(window).innerWidth(),i=e.offset(),n=parseFloat(i.left)+parseFloat(t),o=e.innerWidth();return parseFloat(n)-parseFloat(t)0?Math.round(Math.trunc(p)*(100-u.valor))/100:p,f=i.sellers[0].commertialOffer.ListPrice,h=i.sellers[0].commertialOffer.AvailableQuantity;if(h>0){var g=i.itemId,v=$("").text(d).addClass("available");n==i.images[0].imageText&&o==Math.trunc(p)&&0==l&&($(v).addClass("selected"),$(a).attr("data-skuId",g),$(a).attr("href",""),s.attr("data-max",h),generateDiscountDesignIfExist(e,m,f,u,i),l=1),$(v).click({itemId:e.data("id"),name:i.nameComplete,img:i.images[0].imageUrl.replace(i.images[0].imageId,i.images[0].imageId+"-210-210"),listPrice:f,price:m,skuId:g,maxQuantity:h,currentSkuData:i},changeVariant)}else var v=$("").text(d).addClass("not-available");$(v).hide(),$(v).appendTo(r),$(v).fadeIn(200),$(".available").removeAttr("style")}),0!=l&&1!=s.attr("data-max")||s.addClass("disabled"),i.text("loaded")}}function befaft(){if($("#product .descricao-preco").children().hasClass("valor-de")){var e=$("#product .valor-de").html(),t=e.replace("De:",'
');$("#product .valor-de").children().hasClass("beforePrice")&&$("#product .valor-por").children().hasClass("beforePrice")||($("#product .valor-de").html(t).children(".skuListPrice").addClass("line-through"),$("#product .valor-por").children().before("
"))}}function rounded(){function e(e){e.each(function(){if($(this).html().search(",")>=0){var t=$(this).html().replace("$",""),i=t.length,n=t.indexOf(","),o=t.substr(n,i);t=t.replace(o,"").replace(/\./g,"");var a=formatearPrecio(t);if(e.hasClass("bestPrice"))$(this).html(a).attr("style","display: block !important;");else if($(this).hasClass("hide"))$(this).html(a).attr("style","display: none !important;");else if($(this).hasClass("skuBestPrice")){$(this).html(a);var s=$(this).parent().html().replace("Por:","");$(this).parent().html(s).children().attr("style","display: block !important;")}else $(this).html(a).attr("style","display: block !important;")}})}e($(".listPrice")),e($(".bestPrice")),e($(".skuListPrice")),e($(".skuBestPrice")),e($("#fixedProduct .price-best-price")),e($(".cartDetailContainer .price")),e($(".cartTotal .total")),e($(".header .amount")),e($(".quantity-price .total-selling-price")),e($(".quantity-price .total-price")),e($(".totalizers-list .monetary")),e($("tfoot .monetary")),e($(".shipping-option-item-value")),e($(".hproduct .price"))}function carrouselSly(e){var t=e.parents(".prodContainer");try{e.sly({horizontal:1,itemNav:"basic",smart:1,activateOn:null,mouseDragging:1,touchDragging:1,releaseSwing:1,startAt:0,activatePageOn:"click",speed:1500,elasticBounds:1,easing:"easeOutExpo",dragHandle:1,dynamicHandle:1,clickBar:1,cycleBy:"pages",startPaused:1,prevPage:t.find(".icn.arrowLeft.productsHome"),nextPage:t.find(".icn.arrowRight.productsHome")})}catch(e){console.warn("Error with Sly")}}function createCarrousels(){$(".product-list h2").each(function(){$(this).prependTo($(this).closest(".content"))}),$(".product-list .helperComplement").remove(),$.each($(".productsHome .product-list"),function(e,t){carrouselSly($(t).eq(0))}),$.each($(".carrouselprods"),function(e,t){0==$(t).find("li").length&&$(t).find(".next,.prev").hide()})}function updateCarrouselPromociones(e){$(".product-list h2").each(function(){$(this).prependTo($(this).closest(".content"))}),$(".product-list .helperComplement").remove();var t=".productsHome"+e+" .product-list";carrouselSly($(t))}function onResizeWindow(){var e=$(this).scrollTop()>$("#header").height();$(window).width()<1110?($("#searchProducts").attr("placeholder",""),$("#header").hasClass("fixedHeader")||($("#header").addClass("fixedHeader"),$("#header").show(),$("body").addClass("scroll")),$(".categorySelector").css("left",$("#header .icn.logo").position().left)):($("#searchProducts").attr("placeholder","Buscar alimentos, marcas, mascotas..."),$("#header").hasClass("fixedHeader")&&!e?($("#header").removeClass("fixedHeader"),$("body").removeClass("fixedCart"),$("body").removeClass("scroll")):$(".categorySelector").css("left",$("#header .icn.logo").position().left))}function fixHeaderWidths(){}function menuFixedOut(){$("#mainMenu").fadeOut(300,function(){$("#mainMenu").css({position:"static",background:"#f6c327",display:"block"}),$("body").removeClass("scrollMenu")}),$("#header .categorySelector").find("span").toggleClass("selected"),categorySelectorActive=!1,$("#fixedProduct").length>0&&$("#fixedProduct").css("top","60px")}function chargeBrands(e){$(".selector.brand .options *").remove(),$.each($("#topContainerBrowser .informationBrands div[data-category='"+e+"']"),function(){$(".selector.brand .options").append($(this).clone())})}function getProductInfo(e,t){if(void 0!==e)for(var i=0;i0&&(t.available=!0,t.index=i)}function filterProducts(e,t){for(var i=0;i0&&e[i].productName.toUpperCase().search(t.toUpperCase())>=0){n=!0,e[i].availableIndex=o;break}n||(e.splice(i,1),i--)}}function isResolutionDesktop(){return!isResolutionMobile()}function isResolutionMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function callProducts(e,t){$("#productsContainer .promociones .product-list").fadeOut(200),$.ajax({url:"/buscapagina?sl=011623d5-661c-4e57-86c4-e150fb278333&PS=18&cc=18&sm=0&"+t,type:"GET",beforeSend:function(){$(".promociones .loader."+e).length>0&&$(".loader."+e).fadeIn(100)},success:function(t){var t=t;setTimeout(function(){$(".promociones .loader."+e).length>0&&$(".loader."+e).fadeOut(300),$(".product-list").fadeIn(200),skuadd(),$(".product .productName, .product .productNameContent").dotdotdot(),setTimeout(updateCarrouselPromociones(".promociones"),200)},500),$("#productsContainer .promociones .product-list").remove();var i=$("#productsContainer .prodDestiny.productsHome.promociones");$(t).appendTo(i).hide(),$("#productsContainer .promociones").find("meta[name='ROBOTS']").remove(),rounded()}})}function changeBanner(){bannerLoading||(bannerLoading=!0,$("#topContainerImages .box-banner").eq(bannerActual).fadeOut(200,function(){$("#topContainerMenu li .icn").eq(bannerActual).hide(),$("#topContainerMenu li a").eq(bannerActual).css({background:"#c30e50",color:"#c6c6c6"}),clickActive?(bannerActual=nextBanner,clickActive=!1):bannerActual=(bannerActual+1)%$("#topContainerImages .box-banner").length,$("#topContainerMenu li a").eq(bannerActual).css({background:"#df225f",color:"#fff"}),$("#topContainerMenu li .icn").eq(bannerActual).show(),$("#topContainerImages .box-banner").eq(bannerActual).fadeIn(200,function(){bannerLoading=!1})}))}function changeSubCategories(){$("#subCategoriesMenu .loader").fadeOut(100),flagSubCat=!1,$.each($("#subCategoriesMenu a"),function(e,t){$(t).text(subCategories[dataCat][e].name),$(t).data("prodcontext",subCategories[dataCat][e].context)})}function categoryExists(){var e;try{e=void 0!=nameCategory[categoria]}catch(t){e=!1}return e}function checkIfhasProduct(e,t){$.get("/buscapagina?sl=011623d5-661c-4e57-86c4-e150fb278333&PS=1&cc=1&sm=0&PageNumber=1&"+t+"&"+e).done(function(i){rounded(),(""==i||$.isEmptyObject(i)||void 0!==i.activeElement)&&$("#categoriesMenu .item a[data-prodcontext='"+t+"&"+e+"']").parents().addClass("inactive")})}function alignProducts(){if("loaded"==$("label[name='lblVariantes']").last().text()){$(".variantes").height("auto");var e=$(".product-list").find("ul");$(e).each(function(){var e=$(this).find(".variantes"),t=-1;$(e).each(function(){t=t>$(this).height()?t:$(this).height()}),0==t&&(t="auto"),$(e).each(function(){$(this).height(t)})})}}function skuadd(){$(".product .productName, .product .productNameContent").dotdotdot(),$(".helperComplement").remove();var e=0;$(".product").each(function(t,i){var n=$(this).find("label[name='lblVariantes']");if("loaded"!=n.text()){var o=this,a=$(this).find(".productName").height();e=e>=a?e:a,$(this).find(".productName").height(e);if(void 0===$(this).find(".productImage").attr("href"))return;var s=$(this).find(".productImage").attr("href").split("/"),s=s[3]+"/p",r=$(this).find(".variantes"),c=$(this).find("noscript").html()||$(this).find("img")[0].alt;-1!=c.search("img")&&(c=c.split('"'),c=c[7]);var l=$(this).find(".bestPrice")[0].innerHTML.replace("$","").replace(/\./g,""),d=l.length,u=l.indexOf(",");if(u>-1){var p=l.substr(u,d);l=l.replace(p,"")}var m=!1,f=$(o).find(".buyButton, .switch"),h=$(o).find(".quantitySelector .btn.more"),g=$(o).find(".highlights").find("p").map(function(){return $(this).attr("class")}).get();$.ajax({type:"GET",url:"/api/catalog_system/pub/products/search/"+s,success:function(e){var t=0,i=e[0].items[0].isKit;$.each(e[0].items,function(e,n){isACustomTagProduct(n,o,m),isACustomGiftCardProduct(n,o,m);var a=checkIfItemHasSubscriptionData(n),s=void 0!==n.variations?n.variations.indexOf(n.variations.filter(function(e){return new RegExp("Presentación/Talla/Tamaño","ig").test(e)})[0]):0,d=void 0!==n.variations?n[n.variations[s]]:"",u=checkDiscountsInSku(n.sellers[0].commertialOffer.Teasers,g),p=checkBankDiscountsInSku(n.sellers[0].commertialOffer.Teasers,g),v=n.sellers[0].commertialOffer.Price,b=n.sellers[0].commertialOffer.ListPrice,y=u.valor>0?Math.round(Math.trunc(b)*(100-u.valor))/100:v,C=n.sellers[0].commertialOffer.ListPrice,w=n.sellers[0].commertialOffer.AvailableQuantity;if(w>0){var S=n.itemId,T=$("").text(d).addClass("available"),k=0,_=0;if(a){var I=g.filter(function(e){return-1!=e.indexOf("autocompra")});k=I.length>0?I[0].match(/\d+/)[0]:10,_=Math.round(Math.trunc(y)*(100-k))/100}if(c==n.images[0].imageText&&l==Math.trunc(v)&&0==t){$(T).addClass("selected"),$(f).attr("data-skuId",S),$(f).attr("href",""),h.attr("data-max",w),addHashToProductURL(o,".productName",S),addHashToProductURL(o,".productImage",S),checkUTMsRoyalCanin(o,S);var A=$(o).find(".switch");A.length>0&&checkSkuInCart(S)&&(A.prop("checked",!0),A.attr("value","1")),generateDiscountDesignIfExist(o,y,C,u,n,i),generateBankDiscount(o,n,p),rounded(),t=1}var P=null;P=y!=C?{valor:C-y,tipo:1}:u,l==Math.trunc(v)&&generateDiscountDesignIfExist(o,y,C,P,n,i),$(T).click({thisProductBox:o,specialDiscount:P,specialBankDiscount:p,itemId:$(o).context.attributes["data-id"].nodeValue,name:n.nameComplete,img:n.images[0].imageUrl.replace(n.images[0].imageId,n.images[0].imageId+"-210-210"),listPrice:C,price:y,skuId:S,maxQuantity:w,CP:a?formatearPrecio(_):0,currentSkuData:n},changeVariant)}else var T=$("").text(d).addClass("not-available");$(T).hide(),$(T).appendTo(r),$(T).fadeIn(200),$(".available").removeAttr("style")}),0!=t&&1!=h.attr("data-max")||h.addClass("disabled"),"undefined"==typeof PuppisInsiderListing||/kiosko/gi.test(window.location.host)||PuppisInsiderListing.setListProductData(e[0])},complete:function(){alignProducts(),$(document).on("click",".product .abrir-popup-compra-programada",function(){$(".overlay.compraProgramada").show(200)})}}),n.text("loaded")}})}function checkSkuInCart(e){return $('.cartDetail .item[data-id="'+e+'"]').length>0}function formatearPrecio(e){if(!e||"NaN"==e)return"-";if("Infinity"==e)return"∞";e=e.toString().replace(/\$|\,/g,""),isNaN(e)&&(e="0");var t=e==(e=Math.abs(e));e=Math.floor(100*e+.50000000001);var i=e%100;e=Math.floor(e/100).toString(),i<10&&(i="0"+i);for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n={};if(e.forEach(function(e){e.skuId&&(n[e.skuId]=e.cantidad)}),0===Object.keys(n).length)return $(".overlay.productAdded").hide(),t=!0,skuadd(),i&&i.removeClass("loading"),console.error("The skuId is undefined.");var o=/kiosko/gi.test(window.location.host),a=o?2:1;Fizzmod.Utils.addSKU(n,a,1,"").done(function(){$(PuppisMinicart.$SELF).vtexMinicart("fillCart"),vtexjs.checkout.getOrderForm().done(function(e){var n=App.createObject(e);App.updateComponents(n),t||($(".overlay.productAdded").show(100),$(".overlay.productAdded").addClass("keep-buying"),AlwaysAttachApp.appendButtonsToPopup(AlwaysAttachApp.layoutButtons()),AlwaysAttachApp.closeAlwaysAttach()),i&&i.removeClass("loading")})})}function btn_delete_item(){$("#header .checkout .delete.cartSkuRemove").on("click",function(){var e=$("#header .checkout");e.find('div[class*="DetailContainer"]').hide(),e.removeClass("visible"),$(".nav-mask").fadeTo(100,0,function(){setTimeout(function(){$(".nav-mask").hide()},50)})})}function selectedShippping(){vtexjs.checkout.getOrderForm().then(function(e){var t=e.shippingData.selectedAddresses.length>0?e.shippingData.selectedAddresses[0].state.toLowerCase():"";$.each(e.shippingData.logisticsInfo,function(i,n){var o=e.shippingData;return null==e.subscriptionData?"bogotá, d.c."==t?(console.log("És bogota, Entrega agendada"),o.logisticsInfo[i].selectedSla="Entrega agendada",console.log(o,"shippingData"),vtexjs.checkout.sendAttachment("shippingData",o)):(console.log("No és bogota, Nacional"),o.logisticsInfo[i].selectedSla="Nacional",console.log(o,"shippingData"),vtexjs.checkout.sendAttachment("shippingData",o)):null!=e.subscriptionData?e.subscriptionData.subscriptions.length>0?(console.log("AUTOCOMPRA"),o.logisticsInfo[i].selectedSla="Autocompra",console.log(o,"shippingData"),vtexjs.checkout.sendAttachment("shippingData",o)):"bogotá, d.c."==t?(console.log("És bogota, Entrega agendada"),o.logisticsInfo[i].selectedSla="Entrega agendada",console.log(o,"shippingData"),vtexjs.checkout.sendAttachment("shippingData",o)):(console.log("No és bogota, Nacional"),o.logisticsInfo[i].selectedSla="Nacional",console.log(o,"shippingData"),vtexjs.checkout.sendAttachment("shippingData",o)):void 0})})}function addBrandAndRefToCheckout(){vtexjs.checkout.getOrderForm().done(function(e){var t=0;$.each(e.items,function(i,n){t+=1,$('
Código:
'+e.items[i].refId+"
").insertBefore(".add-to-cart-container .cartDetail .items .item:nth-child("+t+") .price")})})}var FREE_SHIPPING_VALUE=2e5,lastData={cart:0},App={ID_DOCUMENT_MD:/kiosko/gi.test(window.location.host)?"7df6e5fc-2b15-11ed-835d-16b921a51a0d":"ef02732d-cac8-11ea-834f-0aa059a72445",config:{},init:function(){App.getFull(),App.getShippingValueFromMD(),App.loadData(),App.events(),App.appendStatic()},getFull:function(){return FREE_SHIPPING_VALUE},getShippingValueFromMD:function(){App.getFreeShippingValue().done(function(e){return App.config.freeShippingValue=e,e})},events:function(){$(window).on("orderFormUpdated.vtex",function(e,t){var i=App.createObject(t);App.updateComponents(i)})},appendLoadBar:function(e){var t=App.layout(e),i=setInterval(function(){$(".minicart-shipping-container").children().hasClass("wrapper-loader-bar")?clearInterval(i):$(".minicart-shipping-container").append(t)},1)},appendStatic:function(){vtexjs.checkout.getOrderForm().done(function(e){var t=App.createObject(e),i=App.layout(t);$(".productAdded .container-shipping-price").append(i),$(".produto .line.lineSubscription").before(i)})},loadData:function(){vtexjs.checkout.getOrderForm().done(function(e){var t=App.createObject(e);App.appendLoadBar(t)})},createObject:function(e){var t=App.totalCart(e.totalizers);return{rest:App.sms(t),porcent:App.calculatePorcent(t),full:"$"+App.formatPrice(App.config.freeShippingValue||App.getFull())}},formatPrice:function(e){if(!e||"NaN"==e)return"-";if("Infinity"==e)return"∞";e=e.toString().replace(/\$|\,/g,""),isNaN(e)&&(e="0");e=Math.abs(e);e=Math.floor(100*e+.50000000001);var t=e%100;e=Math.floor(e/100).toString(),t<10&&(t="0"+t);for(var i=0;i0?o.slice(0,-2):o;var a=i?i.toString().slice(0,-2):0;return parseFloat(a)-parseFloat(n)},updateComponents:function(e){lastData.cart=e.porcent,App.appendLoadBar(e),$(".msg-loader-bar").each(function(){$(this).html(e.rest)}),$(".item-loader-bar").each(function(){$(this).css({width:e.porcent+"%"})}),$(".total-amount").each(function(){$(this).html(e.full)})},sms:function(e){var t=App.config.freeShippingValue||App.getFull();if(e>=t)return"¡Felicidades! Tu envío es gratis";var i=parseFloat(t)-parseFloat(e);return'Te faltan $'+(i=App.formatPrice(i))+" para que tu envío sea gratis"},layout:function(e){return'

'+e.rest+'

$0 '+e.full+'
No aplica para destinos de envío nacional
'},getConfig:function(){if(App.configXHR)return App.configXHR;var e=App.configXHR=$.Deferred(),t="/api/dataentities/PU/documents/"+App.ID_DOCUMENT_MD+"?_fields=freeShippingAmount";return $.get(t).done(function(t){App.config=t,App.config=App.config.constructor!==Object?{}:App.config,App.config.freeShippingValue=parseInt(App.config.freeShippingAmount)||App.getFull(),$(window).trigger("puppisConfigured",App.config),e.resolve(App.config)}).fail(function(){var t;(t=console).warn.apply(t,["Failed to get %freeShippingAmount %cfrom MD"].concat(_toConsumableArray(["red",""].map(function(e){return e?"color: "+e+"; font-style: italic;":"color: black; font-style: none;"})))),App.config={freeShippingValue:App.getFull()},e.resolve(App.config)}),e.promise()},getFreeShippingValue:function(){var e=$.Deferred();return App.getConfig().done(function(t){App.freeShippingValue=t.freeShippingValue,e.resolve(t.freeShippingValue)}),e.promise()}};document.addEventListener("DOMContentLoaded",App.init());var AlwaysAttachApp={init:function(e,t){if(0==e.length||t){$(".keepBuying.alwaysAttach").addClass("buttons");var i=AlwaysAttachApp.layoutButtons();AlwaysAttachApp.adjustSize(!1),$(".overlay.productAdded").addClass("keep-buying"),AlwaysAttachApp.appendButtonsToPopup(AlwaysAttachApp.layoutButtons())}else{var i=AlwaysAttachApp.layoutAlwaysAttach(e);AlwaysAttachApp.adjustSize(!0),$(".keepBuying.alwaysAttach").addClass("active"),$(".productAdded .container-buttons").remove()}AlwaysAttachApp.appendAlwaysAttach(i),AlwaysAttachApp.closeAlwaysAttach();document.querySelector('div[class="overlay show productAdded dev keep-buying"]'),document.querySelector('div[class="productBottom"] div[class="left"]')},layoutButtons:function(){return'
\n
\n
Seguir Comprando
\n
\n \n
'},layoutAlwaysAttach:function(e){console.table(e);var t;t=e[0].items[0].sellers[0].commertialOffer.Price!=e[0].items[0].sellers[0].commertialOffer.ListPrice?'
\n
$ '+e[0].items[0].sellers[0].commertialOffer.ListPrice+',0
\n
\n
\n
$ '+e[0].items[0].sellers[0].commertialOffer.Price+",00
\n
":'
$ '+e[0].items[0].sellers[0].commertialOffer.Price+",00
";var i=e[0].items[0].sellers[0].commertialOffer.Teasers[0]?e[0].items[0].sellers[0].commertialOffer.Teasers[0]["k__BackingField"]:"",n=i.replace(/ /g,"-").toLowerCase();return'
\n
\n
Aprovecha también este producto
\n
\n \n
\n
\n \n '+e[0].items[0].images[0].imageText+'\n \n
\n \n

'+i+'

\n
\n
\n\n
\n
\n \n \n
\n
\n '+t+' \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
Comprar
\n
\n
\n
\n
\n
\n
\n
\n
No gracias
\n
\n \n
\n '},adjustSize:function(e){var t=e?"top: calc(50% - 240px) !important; height: auto;":"top: calc(50% - 150px) !important; height: 225px;";$(".overlay.productAdded .content").css("cssText",t)},addProduct:function(e){var t=$(".quantity-aa-"+e).val(),i=[];i.push({skuId:e,cantidad:t}),addProductsToCart(i),AlwaysAttachApp.init(data,!0)},appendAlwaysAttach:function(e){$(".keepBuying.alwaysAttach").is(":empty")||$(".keepBuying.alwaysAttach").empty(),$(".keepBuying.alwaysAttach").append(e)},appendButtonsToPopup:function(e){$(".productAdded .container-buttons").is(":empty")||$(".productAdded .container-buttons").empty(),$(".productAdded .container-buttons").append(e)},closeAlwaysAttach:function(){$(document).on("click",".overlay .close,.overlay .dontBuy",function(){$(".overlay").fadeOut()})}};$(document).ajaxStop(function(){rounded(),befaft()});var PuppisHeader={$HEADER:"#header",$CONTAINER_PETS_MENU:".navigation-pets-menu",$CONTAINER_BRANDS_MENU:".navigation-brands-menu",$LIST_MAIN_MENU:".navigation-main-menu ul.principal-menu-content li.item",$ACCOUNT_BTN:"#header .account",$MINICART_BTN:"#header .checkout",$SERVICES_BTN:".navigation-main-menu button.btn-navigation-services",nameCategory:{perros:"Perros",gatos:"Gatos",peces:"Peces",aves:"Aves","otras-especies":"Otras"},currentMenuActivated:null,init:function(){this.setTopBanner(),this.updateMiniCartQuantity(),this.initBrandsNav(),this.events(),this.hamburguesa()},events:function(){$(document).on("hover","li.item.container-mascotas",function(){$(".navigation-pets-menu").is(":visible")?$(".navigation-overlay").addClass("active"):$(".navigation-overlay").removeClass("active")}).on("hover","li.item.container-marcas",function(){$(".navigation-brands-menu").is(":visible")?$(".navigation-overlay").addClass("active"):$(".navigation-overlay").removeClass("active")}).on("click","li.item.container-mascotas",function(){PuppisHeader.showPetsMenu()}).on("mouseenter",this.$HEADER+", "+this.$LIST_MAIN_MENU+":not(.container-mascotas), "+this.$CONTAINER_PETS_MENU+" .navigation-pets-overlay",function(){PuppisHeader.hidePetsMenu()}).on("click","li.item.container-marcas",function(){PuppisHeader.showBrandsMenu()}).on("mouseenter",this.$HEADER+", "+this.$LIST_MAIN_MENU+", .navigation-overlay",function(){PuppisHeader.hideBrandsMenu()}).on("mouseenter",".navigation-pets-category",function(){var e=$(this).attr("id");$(".navigation-submenu-container").removeClass("active"),$("#"+e+"-content").addClass("active"),$(".navigation-pets-category").removeClass("active"),$(this).addClass("active")}).on("mouseenter",".navigation-pets-category-hamburguer",function(){var e=$(this).attr("id");$(".navigation-submenu-container-hamburguer").removeClass("active"),$("#"+e+"-content").addClass("active"),$(".navigation-pets-category-hamburguer").removeClass("active"),$(this).addClass("active")}),this.scrollHeaderEvents()},hamburguesa:function(){$(document).on("click","#menu-cats",function(){$(this).toggleClass("open"),$(".navigation-pets-menu").toggleClass("hamburguesa"),$(".navigation-pets-menu-body").toggleClass("hamburguesa"),$(".navigation-pets-overlay").toggleClass("hamburguesa"),$(".navigation-overlay").toggleClass("active")})},scrollHeaderEvents:function(){var e=$(this.$HEADER).height(),t=this;$(document).scroll(function(){$(this).scrollTop()>e?$(t.$HEADER).hasClass("fixedHeader")||($(t.$HEADER).addClass("fixedHeader"),$("body").addClass("scroll"),$(".navigation-pets-menu").addClass("fixed"),$(".navigation-brands-menu").addClass("fixed"),PuppisHeader.hideBrandsMenu()):($(t.$HEADER).removeClass("fixedHeader"),$("body").removeClass("scroll"),$(".navigation-pets-menu").removeClass("fixed"),$(".navigation-brands-menu").removeClass("fixed"))})},showPetsMenu:function(){this.hideBrandsMenu(),$(".navigation-pets-menu").hasClass("active")||(clearTimeout(PuppisHeader.currentMenuActivated),PuppisHeader.currentMenuActivated=setTimeout(function(){$(".navigation-pets-menu").addClass("active"),setTimeout(function(){$(".navigation-overlay").addClass("active"),$(".navigation-pets-menu-body").addClass("active")},200)},300))},showBrandsMenu:function(){this.hidePetsMenu(),$(".navigation-brands-menu").hasClass("active")||(clearTimeout(PuppisHeader.currentMenuActivated),PuppisHeader.currentMenuActivated=setTimeout(function(){$(".navigation-brands-menu").hasClass("active")||($(".navigation-brands-menu").addClass("active"),$(".navigation-overlay").addClass("active"),$(".navigation-brands-menu-body").addClass("active"))},300))},hidePetsMenu:function(){$(".navigation-pets-menu").hasClass("active")&&($(".navigation-pets-overlay").removeClass("active"),$(".navigation-pets-menu-body").removeClass("active"),$(".navigation-overlay").removeClass("active"),clearTimeout(PuppisHeader.currentMenuActivated),setTimeout(function(){$(".navigation-pets-menu").removeClass("active")},300))},hideBrandsMenu:function(){$(".navigation-brands-menu").hasClass("active")&&($(".navigation-overlay").removeClass("active"),$(".navigation-brands-menu-body").removeClass("active"),$(".navigation-brands-menu").removeClass("active"),clearTimeout(PuppisHeader.currentMenuActivated))},initBrandsNav:function(){var e=$(".navigation-main-menu .navigation-brands-letters li"),t=$(".navigation-main-menu .navigation-brands-list");e.first().addClass("is-selected"),e.on("click","a",function(i){if(i.preventDefault(),$(".navigation-main-menu .navigation-brands-menu-body").addClass("show-list"),$(".navigation-main-menu .navigation-brands-logos").removeClass("active"),$(".navigation-main-menu .navigation-brands-list").addClass("active"),!$(this).parent().hasClass("disabled")){var n=".navigation-main-menu #"+$(this).parent().first().attr("class"),o=$(n)[0],a=o?o.offsetTop:0;e.removeClass("is-selected"),$(this).parent().addClass("is-selected"),t.addClass("clicked"),"#brands-A"===n&&(a=0),t.stop(!0).animate({scrollTop:a},100,function(){setTimeout(function(){t.removeClass("clicked")},101)})}}),t.on("scroll",function(){t.find(".brand-list-item").each(function(){var e=$(this);if(e.position().top<40){var i=e.attr("id"),n=i.substring(0);t.hasClass("clicked")||($(".navigation-brands-letters li").removeClass("is-selected"),$("."+n).addClass("is-selected"))}})})},setTopBanner:function(){0==$("#SlideBannerUp .top-banners").children().length?($("#SlideBannerUp").addClass("empty-banner"),$(".navigation-pets-menu").removeClass("top-banner"),$(".navigation-brands-menu").removeClass("top-banner")):($("#SlideBannerUp").removeClass("empty-banner"),$(".navigation-pets-menu").addClass("top-banner"),$(".navigation-brands-menu").addClass("top-banner"),setTimeout(function(){try{new Swiper("#SlideBannerUp .top-banners",{loop:!0,longSwipes:!1,autoplay:{delay:5e3,disableOnInteraction:!1}})}catch(e){console.error("Swiper at top banner could not be initialized.",e)}},10))},getHeaderHeight:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;if(e){t=$("#header.fixedHeader").height()}else{var i=$("#SlideBannerUp"),n=$("#SlideBannerUp .top-banners").children(),o=$("#header"),a=$(".navigation-main-menu"),s=0,r=0,c=0;n.length>0&&(s=i.height()),r=o.height(),c=a.height(),t=r+c+s}return t},updateMiniCartQuantity:function(){$(document).on("click",".cartDetail .quantityMore, .cartDetail .quantityLess",function(){var e=this,t=$(this).parents(".item").data("id"),i=$(this).parents(".item");i.find(".quantity").text()>=1?(i.find(".back").show(),i.find(".loader").show(),vtexjs.checkout.getOrderForm().then(function(i){if(!i.items.some(function(e){return e.id==t}))return console.log("There is not item to update");var n=i.items.map(function(e){return e.id}).indexOf(String(t)),o=i.items[n],a=o.quantity;$(e).hasClass("quantityLess")?a-=1:a+=1,a<=1&&(a=1);var s={index:n,quantity:a};return vtexjs.checkout.updateItems([s])}).done(function(){$(PuppisMinicart.$SELF).vtexMinicart("fillCart"),delay(function(){i.find(".back").hide(),i.find(".loader").hide()},500)}).fail(function(e){console.log("There was an error",e),i.find(".loader").hide()})):console.log("There is not item to update")})}},PuppisSearch={init:function(){console.log("--PuppisSearch--"),this.events()},events:function(){$(document).on("keyup","#searchProducts",function(e){PuppisSearch.onSearchKeyPress(e.which),$(".browseContent .btn-buscar.browse").show().addClass("active"),$(".browseContent .btn-buscar.close-search").hide().removeClass("active"),0==$(this).val().length&&PuppisSearch.getProductsOnFocusSearch()}).on("change","#searchProducts",function(){setTimeout(function(){PuppisSearch.closeSearchPanel()},1e4)}).on("click",".browseContent .btn-buscar.browse",function(){0!=$("#searchProducts").val().length&&(window.location.href=PuppisSearch.searchProductResults())}).on("focus","#searchProducts",function(){/puppiscolombiaqa/gi.test(window.location.host)?PuppisSearch.getProductsOnFocusSearch(149):PuppisSearch.getProductsOnFocusSearch(),$(".browseContent .btn-buscar.browse").hide().removeClass("active"),$(".browseContent .btn-buscar.close-search").show().addClass("active")}).on("mouseenter","#searchProducts",function(){PuppisHeader.hideBrandsMenu(),PuppisHeader.hidePetsMenu()}).on("mouseenter",".navigation-overlay.active",function(){setTimeout(function(){PuppisHeader.hideBrandsMenu(),PuppisHeader.hidePetsMenu()},30)}).on("click",".browseContent .btn-buscar.close-search",function(){return PuppisSearch.closeSearchPanel()})},onSearchKeyPress:function(e){var t=$("#searchProducts"),i=t.val(),n=$("#categorySearch").is(":checked")?"?fq=C:"+IdCategoriaActual:"",o=$(window).height(),a=parseInt((o-206)/67),s=Math.min(a,7);""!=i&&i.length>2?(delay(function(){$.ajax({url:"/api/catalog_system/pub/products/search?ft="+encodeURI(i)+n+"&_from=0&_to="+(s-1)+"&O=OrderByTopSaleDESC",type:"GET",beforeSend:function(){$("#searchResult").show(),$("fieldset.main-container-search .input input").addClass("searching"),$("#searchResult .results").hasClass("active")||($("#searchResult .loader").show(),$("#searchResult .results").hide())},success:function(e){$("#searchResult .loader").hide(),$("#searchResult .results *").remove();var t="",n=0,o="",a="",s="",r=[],c="";if(e.length>0){for(p=0;p'+a+'
'+t+'
$'+Fizzmod.Utils.formatPrice(n,".",",",0)+'
'+Fizzmod.Utils.formatPrice(o,".",",",0)+'
Comprar
')}$("#searchResult .results").append('');for(var p=0;pBuscar '+i+' en '+r[p]+""):$("#searchResult .results").append('
Buscar '+i+' en '+r[p]+"
");$(".allResults a").hover(function(){$(this).parent().css("background","#0058a4")},function(){$(this).parent().css("background","#fff")})}else $(".browseContent .btn-buscar.browse").hide().removeClass("active"),$(".browseContent .btn-buscar.close-search").show().addClass("active"),$("#searchResult .results").append('
No se encontraron resultados
');$("#searchResult .results").show().addClass("active"),$(".navigation-overlay").addClass("active"),$(".navigation-main-menu").css("pointer-events","none"),PuppisHeader.hideBrandsMenu(),PuppisHeader.hidePetsMenu()},complete:function(){""==t.val()&&($("#searchResult .results *").remove(),$("#searchResult .results").hide(),$("fieldset.main-container-search .input input").removeClass("searching"))}})},750),13==e&&(window.location.href=PuppisSearch.searchProductResults())):($("#searchResult").hide(),$("#searchResult .loader").show(),$("#searchResult .results").hide(),$("#searchResult .results *").remove(),$("fieldset.main-container-search .input input").removeClass("searching"),$("#searchResult .results").removeClass("active"))},getProductsOnFocusSearch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1093,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7;$("#searchProducts").val().length>2||$.ajax({url:"/api/catalog_system/pub/products/search?fq=productClusterIds:"+e+"&_from=0&_to="+(t-1)+"&O=OrderByTopSaleDESC",type:"GET",beforeSend:function(){$("#searchResult").show(),$("fieldset.main-container-search .input input").addClass("searching"),$("#searchResult .results").hasClass("active")||($("#searchResult .loader").show(),$("#searchResult .results").hide())},success:function(e){if($("#searchResult .loader").hide(),$("#searchResult .results *").remove(),0==e.length)return $("#searchResult .results *").remove(),$("#searchResult .results").hide(),console.log("There is not items");var t="";e.map(function(e){var i=55;t=(t=(t=(t=(t=(t=(t=e.items[0].images[0].imageTag).replace("~/arquivos","/arquivos")).replace("-#width#-","-"+i+"-")).replace("#width#",i+"px")).replace("-#height#","-"+i)).replace("#height#",i+"px")).replace('id=""',"");var n=e.items.filter(function(e){return 0!=e.sellers[0].commertialOffer.Price}),o=parseFloat(n[0].sellers[0].commertialOffer.Price),a=parseFloat(n[0].sellers[0].commertialOffer.ListPrice),s='\n
\n '+t+'\n
\n '+e.productName+'\n
\n
$'+Fizzmod.Utils.formatPrice(o,".",",",0)+'
\n
$'+Fizzmod.Utils.formatPrice(a,".",",",0)+'
\n
\n
\n Comprar\n
\n
\n ';$("#searchResult .results").append(s)}),$("#searchResult .results").show().addClass("active"),$(".navigation-overlay").addClass("active"),$(".navigation-main-menu").css("pointer-events","none"),PuppisHeader.hideBrandsMenu(),PuppisHeader.hidePetsMenu()}})},searchProductResults:function(){var e=$("#searchProducts").val();return"/"+(e=encodeURI(e.replaceAll("'","")))+"?O=OrderByTopSaleDESC"},closeSearchPanel:function(){$("#searchProducts").blur(),$("fieldset.main-container-search .input input").removeClass("searching"),$("#searchResult").hide(),$(".navigation-overlay").removeClass("active"),$(".browseContent .btn-buscar.browse").show(),$(".browseContent .btn-buscar.close-search").hide(),$(".navigation-main-menu").css("pointer-events","initial")}},PuppisMinicart={$OVERLAY:".overlay.minicart-container",$SELF:".js--minicart",$OPEN:".add-to-cart-container",$CLOSE:".minicart-exit-button",seeAllProducts:!1,promotions:[],init:function(){var e=this;console.log("-- Puppis Minicart --"),this.initPlugin(),this.actions(),this.events(),this.addHighlightedProduct(),vtexjs.checkout.getOrderForm().done(function(t){return e.createInsiderBasketObject(t)}).fail(function(e){return console.error(e)})},initPlugin:function(){var e=new VTEX.VtexUtils,t=e.vtexHelpers;if("undefined"==typeof rivets)return console.error("RIVETS undefined - Check the libraries on the Vtex Subtemplates to import Rivets library.");rivets.formatters.formatPrice=function(e){return t.formatPrice(e,".",",",0,"$ ")},$(this.$SELF).vtexMinicart({vtexUtils:e,vtexCatalog:VTEX.VtexCatalog,debug:!1,bodyClass:"has--minicart-loader"})},actions:function(){$(document).on("click",".add-to-cart-container",function(){PuppisMinicart._openCart(),console.log("Abro el carrito")}).on("click","button#minicart-button-all-more",function(){$(".minicart__item-container").each(function(){$(this).removeClass("hidden")}),PuppisMinicart.seeAllProducts=!0,$(this).removeClass("active"),$("#minicart-button-all-less").addClass("active"),console.log("Veo todos los productos")}).on("click","button#minicart-button-all-less",function(){$(".minicart__item-container").each(function(e){e>=2&&$(this).addClass("hidden")}),PuppisMinicart.seeAllProducts=!1,$(this).removeClass("active"),$("#minicart-button-all-more").addClass("active"),console.log("Veo menos productos")}).on("click","button.minicart-highlight-button.buyButton",function(){setTimeout(function(){$(".minicart-highlight.producto-destacado").fadeOut(300)},300)}).on("click",this.$OVERLAY,function(e){$(e.target).is($(this).find("*"))||PuppisMinicart.closeCart()}).on("click",this.$CLOSE,function(){PuppisMinicart.closeCart()})},events:function(){$(document).on("requestEnd.vtexMinicart",function(e,t){var i=t.items,n=t.totalizers;if(void 0===i||!i)return console.log("There is not items in orderForm");if(0==i.length)$(".minicart__empty").addClass("active"),$(".add-to-cart-container .icon-quantity-container").hide(),$(".add-to-cart-container .amount").text("$ 0");else{if($(".minicart__empty").removeClass("active"),PuppisMinicart.updateSubstotal(n),$(".add-to-cart-container .icon-quantity-container").fadeIn(),$(".add-to-cart-container .icon-quantity-text").text(i.length),PuppisMinicart.setMinicartQuantities(i),i.length>2&&!PuppisMinicart.seeAllProducts){$(".container-minicart-all").addClass("active"),$("#minicart-button-all-more").addClass("active"),$("ul.minicart__items").addClass("min");for(var o=2;o0&&PuppisMinicart.updateSubstotal(a)}),$(document).on("vtexMinicart.delete",function(e,t){var i=t.totalizers;PuppisMinicart.updateSubstotal(i)}),$(document).on("click","button.set-empty-minicart",function(){console.log("Click en el primer vaciar carrito"),$(".set-empty-minicart-tooltip").not(".active").fadeIn().addClass("active")}).on("click","button.confirm-empty-cart",function(){console.log("Click en vaciar carrito en el modal"),vtexjs.checkout.removeAllItems().done(function(){PopupBienvenida.launchNotification("Los items han sido removidos exitosamente."),$(PuppisMinicart.$SELF).vtexMinicart("fillCart"),console.log("Productos quitados del carrito exitosamente")}).fail(function(e){console.log("Error al quitar los productos del carrito: ",e)}),$(".set-empty-minicart-tooltip.active").fadeOut().removeClass("active")}).on("click","button.cancel-empty-cart, button.close-tooltip",function(){$(".set-empty-minicart-tooltip.active").fadeOut().removeClass("active")})},_openCart:function(){$(this.$OVERLAY).fadeIn().addClass("active"),$(this.$OVERLAY+" .minicart").not("active").animate({"margin-right":"0px"},100),$(this.$OVERLAY+" .minicart").addClass("active")},closeCart:function(){$(this.$OVERLAY+" .minicart.active").animate({"margin-right":"-560px"},100),$(this.$OVERLAY).fadeOut().removeClass("active"),$(this.$OVERLAY+" .minicart").removeClass("active")},addHighlightedProduct:function(){var e=$(".minicart-highlight.producto-destacado").attr("data-sku");if(void 0===e)return void $(".minicart-highlight.producto-destacado").hide();var t=$.get("/api/catalog_system/pvt/sku/stockkeepingunitbyid/"+e),i=$.get("/api/rnb/pvt/benefits/calculatorconfiguration");Promise.all([t,i]).then(function(e){if(e.length<=1)return console.log("There is not data for product Minicart Highlight");var t=e[0],i=e[1],n='\n
\n \n '+t.ProductName+'\n \n
\n
\n

Producto destacado del mes

\n '+t.ProductName+'\n
    \n
    \n ';$(".minicart-highlight.producto-destacado").not(".added").append(n);var o=i.items;if(o&&0!=o.length){var a=o.filter(function(e){return e.isActive});a&&0!=a.length&&(PuppisMinicart.promotions=a,a.map(function(e){$.get("/api/rnb/pvt/calculatorconfiguration/"+e.idCalculatorConfiguration).done(function(e){if(e.products.some(function(e){return e.id==t.ProductId})){var i='
  • '+e.description+"
  • ";$(".minicart-highlight-discount").append(i)}}).fail(function(e){return console.log("There was an error fetchin the promotion",e)})}))}}).catch(function(e){return console.log("There was an error trying to get the promotion or sku data",e)})},updateSubstotal:function(e){if(e||0!=e.length){var t=e.map(function(e){return e.id}).indexOf("Items"),i=e.map(function(e){return e.id}).indexOf("Discounts"),n=0;if(-1!=t){n+=e[t].value/100;var o=Fizzmod.Utils.formatPrice(e[t].value/100,".",",",0);$(".price .minicart-subtotal-price").text("$ "+o)}else $(".price .minicart-subtotal-price").text("Por calcular");if(-1!=i){n+=e[i].value/100,$(".container-minicart-subtotal .discount").addClass("active");var a=Fizzmod.Utils.formatPrice(e[i].value/100,".",",",0);$(".discount .minicart-discount-price").text("$ "+a)}else $(".container-minicart-subtotal .discount").removeClass("active");var s="";s=isNaN(n)||n<=0?"Por calcular":"$ "+Fizzmod.Utils.formatPrice(n,".",",",0),$(".add-to-cart-container .amount").text(s),$(".footer-minicart .minicart-text-price").text(s)}},setMinicartQuantities:function(e){if(!e||0==e.length)return console.log("Items is undefined");var t=e.length,i=1==t?"producto":"productos",n=0;e.map(function(e){return e.quantity}).map(function(e){return n+=e});var o=1==n?"item":"items";$(".minicart-quantity-text .products-quantity").text(t+" "+i),$(".minicart-quantity-text .items-quantity").text(n+" "+o)},getDiscountDataName:function(e){return 0==e.priceTags.length?"":e.priceTags[0].name},createInsiderBasketObject:function(e){var t=this;if(window.insider_object&&e&&e.items&&0!=e.items.length&&!/kiosko/gi.test(location.host)){window.insider_object.basket={},window.insider_object.basket.currency="COP",window.insider_object.basket.total=e.value/100;if(e.totalizers.some(function(e){return"Discounts"===e.id})){var i=e.totalizers.map(function(e){return e.id}).indexOf("Discounts"),n=e.items.map(function(e){return e.listPrice!==e.sellingPrice?t.getDiscountDataName(e):""});window.insider_object.basket.promotions=n,window.insider_object.basket.promotion_discount=Math.abs(e.totalizers[i].value)/100,window.insider_object.basket.promotion_discount_ratio=1}if(e.totalizers.some(function(e){return"Shipping"===e.id})){var o=e.totalizers.map(function(e){return e.id}).indexOf("Shipping");window.insider_object.basket.shipping_cost=e.totalizers[o].value/100}if(e.items.length>0){window.insider_object.basket.vouchers=[],window.insider_object.basket.voucher_discount=0,window.insider_object.basket.voucher_discount_ratio=0;var a=e.items.map(function(e){var t={};return t.product=_defineProperty({id:e.productId,name:e.name,taxonomy:Object.values(e.productCategories),currency:"COP",unit_price:e.listPrice/100,unit_sale_price:e.sellingPrice/100,url:window.location.origin+e.detailUrl,size:e.additionalInfo.dimension||"",product_image_url:e.imageUrl,stock:e.quantity,color:""},"size",""),t.quantity=e.quantity,t.subtotal=e.sellingPrice/100*e.quantity,t});window.insider_object.basket.line_items=a}PuppisInsider.reInit()}}},PuppisSalesChannel={init:function(){var e=this;/puppiscolombiaqa/gi.test(window.location.host)&&/puppiscolombia/gi.test(window.location.host)&&(console.log("You are in Puppis Sales mode"),this.events(),setTimeout(function(){e.showButtonInMenu()},300))},events:function(){var e=this;$(document).on("click","button.select-sales-channel",function(){switch(e.getNumberSalesChannel()){case"1":e.updateSalesChannel("2");break;case"2":default:e.updateSalesChannel("1")}})},showButtonInMenu:function(){"2"==this.getNumberSalesChannel()?$(".container-sales-channel span").text("Ir a SC #1"):$(".container-sales-channel span").text("Ir a SC #2"),$(".container-sales-channel").addClass("active")},getSalesChannel:function(){var e=decodeURI(Fizzmod.Utils.getCookie("VTEXSC"));return e=""==e?"sc=1":e},getNumberSalesChannel:function(){var e=this.getSalesChannel();return"string"!=typeof e?1:e.split("sc=")[1]},updateSalesChannel:function(e){if(void 0===e)return console.log("saleChannel undefined");if(""==e)return console.log("saleChannel must not be empty");$("body").addClass("sc-"+e);var t=new RegExp("sc=","i"),i=decodeURIComponent(window.location.search),n=i.replace("?","").split("&");n=n.filter(function(e){return!t.test(e)}),n=n.concat(["sc="+e]).join("&"),"&"!==n[0]&&"?"!==n[0]||(n=n.substring(1)),Fizzmod.Utils.setCookie("VTEXSC","sc="+e,30),setTimeout(function(){window.location=window.location.origin+window.location.pathname+"?"+n},1e3)}},PuppisInsider={counterUpdates:0,init:function(){/kiosko/gi.test(location.host)||(console.log("-- Insider Object Init --"),this.createInsiderObject(),this.events())},events:function(){$(window).on("orderFormUpdated.vtex",function(e,t){PuppisInsider.updateInsiderObject(t)})},createInsiderObject:function(){var e=this;window.insider_object=window.insider_object||{},vtexjs.checkout.getOrderForm().done(function(t){var i=t.clientProfileData;i&&e.updateUserObject(i)}).fail(function(e){return console.error(e)})},updateInsiderObject:function(e){if(window.insider_object){var t=e.clientProfileData;t&&this.updateUserObject(t)}},checkUserLogin:function(){return fetch("/no-cache/profileSystem/getProfile").then(function(e){return e.json()})},updateUserObject:function(e){var t=this;window.insider_object.user={uuid:"",email:e.email,gender:"",name:e.firstName,surname:e.lastName,phone_number:e.phone,sms_optin:!0,gdpr_optin:!0,email_optin:!0,birthday:new Date("1990").toISOString(),language:"es-co",transaction_count:0,username:"",has_transacted:!1,whatsapp_optin:!1,list_id:[],returning:!0},setTimeout(function(){t.reInit()},300),this.checkUserLogin().then(function(e){e&&e.IsUserDefined&&(window.insider_object.user.uuid=e.UserId)}).catch(function(e){return console.error(e)})},reInit:function(){console.log("--Insider: "+window.Insider)}},OverlayBrands={$MAIN_VITRINE:".container-brands-all #SlideshowBrands",$MAIN_VITRINE_NEXT:".container-brands-all.row .next",$MAIN_VITRINE_PREV:".container-brands-all.row .prev",$BOX_VITRINE:".container-brands-all .box-banner",$BRANDS_LETTERS:".container-brands-all .navigation-brands-letters",$BRANDS_LIST:".container-brands-all .navigation-brands-list",init:function(){console.log("-- OverlayBrands initialized --"),this.events(),this.initializeSlideHowBrands(),this.initBrandsPopup()},events:function(){$(document).on("click","#brandsContainer .viewAll",function(){return $(".overlay.brands-popup").fadeIn()}).on("click",".container-brands-all .close",function(){return $(".overlay.brands-popup").fadeOut()})},initializeSlideHowBrands:function(){try{if($(this.$BOX_VITRINE).length>0?$(this.$BOX_VITRINE).each(function(){$(this).addClass("swiper-slide")}):console.error("There isn't BRANDS to render."),0==$(this.$MAIN_VITRINE).length)return;new Swiper(this.$MAIN_VITRINE,{slidesPerView:8,spaceBetween:10,loop:!0,loopFillGroupWithBlank:!0,navigation:{nextEl:this.$MAIN_VITRINE_NEXT,prevEl:this.$MAIN_VITRINE_PREV}})}catch(e){console.error("Error with Swiper at Brands Popup.")}},initBrandsPopup:function(){var e=$(this.$BRANDS_LETTERS+" li"),t=$(this.$BRANDS_LIST);e.first().addClass("is-selected"),e.on("click","a",function(i){if(i.preventDefault(),$(OverlayBrands.$BRANDS_LIST).addClass("active"),!$(this).parent().hasClass("disabled")){var n=OverlayBrands.$BRANDS_LIST+" #"+$(this).parent().first().attr("class"),o=$(n)[0],a=o?o.offsetTop:0;e.removeClass("is-selected"),$(this).parent().addClass("is-selected"),t.addClass("clicked"),"#brands-A"===n&&(a=0),t.stop(!0).animate({scrollTop:a},100,function(){setTimeout(function(){t.removeClass("clicked")},101)})}}),t.on("scroll",function(){t.find(".brand-list-item").each(function(){if($(this).position().top<40){var e=$(this).attr("id"),i=e.substring(0);t.hasClass("clicked")||($(OverlayBrands.$BRANDS_LETTERS+" li").removeClass("is-selected"),$("."+i).addClass("is-selected"))}})})}},BANKS=[{name:"Bancolombia",acronym:"bcol"},{name:"Scotiabank",acronym:"scbk"},{name:"Visa",acronym:"visa"},{name:"Itaú",acronym:"itau"},{name:"Occidente",acronym:"bocc"},{name:"AvVillas",acronym:"bavv"},{name:"Davivienda",acronym:"davv"},{name:"Falabella",acronym:"fbll"}],addHashToProductURL=function(e,t,i){if(!/produto/gi.test(document.body.className)){var n=$(e).find(t);if(void 0!==n&&n&&0!=n.length){var o=n.attr("href");void 0!==o&&e&&(-1==o.search("#")?n.attr("href",o+"#"+i):n.attr("href",o.split("#")[0]+"#"+i))}}},checkUTMsRoyalCanin=function(e,t){if(!/produto/gi.test(document.body.className)){$(e).find("a.brand").hasClass("royal-canin")&&(addUTMsRoyalCanin(e,".productName",t),addUTMsRoyalCanin(e,".productImage",t))}},addUTMsRoyalCanin=function(e,t,i){var n="?idsku="+i+"&utm_source=referal&utm_campaign=royal_site&utm_medium={CC_LINK}?br{CC_MANUFACTURER_ID}su{CC_SUBID_ID}cl{CC_UUID_HASHED}si1",o=$(e).find(t);if(void 0!==o&&o&&0!=o.length){var a=o.attr("href");void 0!==a&&e&&(-1==a.search("#")?o.attr("href",a+"#"+i+n):o.attr("href",a.split("#")[0]+"#"+i+n))}},isACustomTagProduct=function(e,t,i){if(!/produto/gi.test(document.body.className)&&void 0!==e.attachments&&e.attachments.length>0&&e.attachments.some(function(e){return/placa/gi.test(e.name)})&&!i){$(t).find(".priceAndBuyContainer").empty();var n='\n
    \n \n
    \n ';setTimeout(function(){$(t).find(".btn.go-product-cont").remove(),$(t).find(".priceAndBuyContainer").append(n),i=!0},!1)}},isACustomGiftCardProduct=function(e,t,i){if(!/produto/gi.test(document.body.className)&&void 0!==e.attachments&&/giftcard/gi.test(e.attachments[0].name)&&!i){$(t).find(".priceAndBuyContainer").empty();setTimeout(function(){$(t).find(".btn.buy-giftcard-product-cont").remove(),$(t).find(".priceAndBuyContainer").append('\n
    \n
    \n \n
    \n
    \n '),i=!0},!1)}},checkIfItemHasSubscriptionData=function(e){if(void 0===e||void 0===e.sellers||void 0===e.sellers[0])return!1;if(e.sellers[0].commertialOffer.ItemMetadataAttachment.length>0&&e.sellers[0].commertialOffer.ItemMetadataAttachment[0].assemblyOptions.length>0){var t=e.sellers[0].commertialOffer.ItemMetadataAttachment[0].assemblyOptions[0].id;if("vtex.subscription.assinatura"==t||"vtex.subscription.farmat"==t)return!0}return!1},addPUMToTheProductList=function(e,t,i){if(void 0!==t.variations&&void 0!==t.variations[0]&&void 0!==t[t.variations[1]]&&void 0!==t[t.variations[2]])try{var n=t.variations.indexOf(t.variations.filter(function(e){return/divisor/gi.test(e)})[0]),o=t.variations.indexOf(t.variations.filter(function(e){return new RegExp("Unidad de medida","ig").test(e)})[0]),a=t[t.variations[n]][0];a=a.replaceAll(",",".");var s=parseFloat(a);if(0==s||"0"==a)return;var r=i/s,c=void 0;if(isNaN(r))return console.log("The sku "+t.itemId+" has errors in PUM.");c=r<1e3?"("+t[t.variations[o]]+" $"+Fizzmod.Utils.formatPrice(r,".",",",2)+")":"("+t[t.variations[o]]+" $"+Fizzmod.Utils.formatPrice(r,".",",",0)+")",$(e).find(".price-pum-quantity").text(c)}catch(e){console.error("Error to assign the PUM value",e)}},checkDiscountsInSku=function(e,t){try{if(e.length>0){var i=e[0]["k__BackingField"]["k__BackingField"],n=BANKS.some(function(t){return new RegExp(t.acronym,"ig").test(e[0]["k__BackingField"].toLowerCase())});if(!n&&i.length>0&&"PercentualDiscount"==i[0]["k__BackingField"]){return{valor:parseFloat(i[0]["k__BackingField"]),tipo:1}}return console.log("highlight-1",void 0!=t?checkHighlight(t,n):0),void 0!=t?checkHighlight(t,n):0}return void 0!=t?checkHighlight(t):0}catch(e){return 0}},checkBankDiscountsInSku=function(e,t){try{if(e.length>0&&e[0]["k__BackingField"]["k__BackingField"].length>0&&"PercentualDiscount"==e[0]["k__BackingField"]["k__BackingField"][0]["k__BackingField"]){return{valor:parseFloat(e[0]["k__BackingField"]["k__BackingField"][0]["k__BackingField"]),tipo:1,name:e[0]["k__BackingField"]}}return void 0!=t?checkHighlight(t):0}catch(e){return 0}},checkHighlight=function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return 0;for(var t=["promo-7","promo-10","promo-12","promo-13","promo-20","promo-25","promo-30","promo-35","promo-40","promo-50","promo-70","4x3","3x2","2x1","6x5","15x10","15x12","6x4","6x3","7x5"],i={valor:0,tipo:0},n=0;0==i.valor&&n4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(n.valor>0){if($(e).find(".bestPrice").hasClass("big"))switch(console.log("SpecialDiscount: ",n),n.tipo){case 1:$(e).find(".prices.table-cell").eq(0).html('\n
    \n
    \n '+formatearPrecio(i)+'\n
    \n
    \n '+formatearPrecio(t)+"\n
    \n
    \n "),rounded();break;case 2:case 3:case 4:case 6:default:var s='\n
    \n
    PRECIO REGULAR
    \n
    \n '+formatearPrecio(i)+'\n
    \n
    \n
    \n
    \n LLEVANDO '+n.tipo+' C/U\n
    \n
    \n '+formatearPrecio(t)+"\n
    \n
    ";$(e).find(".prices.table-cell").eq(0).html(s),rounded()}}else $(e).find(".prices.table-cell").eq(0).html('
    '+formatearPrecio(i)+"
    ");a||addPUMToTheProductList(e,o,i)},generateBankDiscount=function(e,t,i){if(console.log("generateBankDiscount"),i&&i.valor>0){if(void 0===i.name)return console.log("There is not name for the BANK special discount");if(BANKS.some(function(e){return new RegExp(e.acronym).test(i.name.toLowerCase())})){var n=BANKS.filter(function(e){return new RegExp(e.acronym).test(i.name.toLowerCase())})[0];console.log("Bank discount: "+n.name);var o=i.valor,a=t.sellers[0].commertialOffer.ListPrice,s=a-a*(o/100);if(s<=0||isNaN(s))return console.log("The bank price has some errors for skuId:"+t.itemId);var r="$ "+Fizzmod.Utils.formatPrice(s,".",",",0);$(e).find(".credit-and-debit-cards-container").addClass(n.acronym),$(e).find(".credit-and-debit-cards-price").text(r),$(e).find(".credit-and-debit-cards-container .bank-text").text("Falabella"!==n.name?"Con tarjetas de crédito "+n.name:"Aprovecha 25% dtco con Alianza Falabella los domingos").show(),$(e).find(".credit-and-debit-cards-container").addClass("active")}}},changeVariant=function(e){var t=(e.data.itemId,e.data.thisProductBox),i=e.data.specialDiscount,n=e.data.specialBankDiscount,o=e.data.img,a=e.data.price,s=e.target,r=e.data.skuId,c=e.data.maxQuantity,l=$(t),d=e.data.currentSkuData,u=d.sellers[0].commertialOffer.ListPrice,p=d.sellers[0].commertialOffer.Price;generateDiscountDesignIfExist(t,a,u,i,d),generateBankDiscount(t,d,n),l.fadeTo(10,.25).delay(100).fadeTo(200,1),$(s).addClass("selected").siblings().removeClass("selected"),l.find(".productImage img")[0].src=o,l.find(".buyButton, .switch").attr("data-skuId",r),addHashToProductURL(t,".productName",r),addHashToProductURL(t,".productImage",r),checkUTMsRoyalCanin(t,r);var m=l.find(".switch");m.length>0&&(checkSkuInCart(r)?(m.attr("value","1"),m.prop("checked",!0)):(m.attr("value","0"),m.prop("checked",!1)));var f=l.find(".quantitySelector .btn.more"),h=l.find(".quantitySelector .btn.less"),g=f.prev();l.find(".quantitySelector .btn.more").attr("data-max",c),1==c?(g.val(c),f.addClass("disabled"),h.addClass("disabled")):g.val()>c?g.val(c):g.val()=4?window.location.href.split(/[#\/?]/g)[3]:"",IdCategoriaActual,isHomePage=window.location.pathname.length<2,urlPuppis="http://"+window.location.href.split("/")[2],goToTopPage=(function(e,t,i){var n,o=e.getElementsByTagName(t)[0];e.getElementById(i)||(n=e.createElement(t),n.id=i,n.src="//connect.facebook.net/es_LA/sdk.js#xfbml=1&version=v2.4",o.parentNode.insertBefore(n,o))}(document,"script","facebook-jssdk"),!1),icn="",subCategories={cat:[{name:"Collares",context:"fq=C:10/25/74"},{name:"Alimento",context:"fq=C:10/23"},{name:"Juguetes",context:"fq=C:10/28/80"},{name:"Accesorios",context:"fq=C:10/23"}],dog:[{name:"Correas",context:"fq=C:8/22/67"},{name:"Alimento",context:"fq=C:8/9"},{name:"Juguetes",context:"fq=C:8/21"},{name:"Accesorios",context:"fq=C:8/18"}],fish:[{name:"Peceras",context:"fq=C:12/35/98"},{name:"Alimento",context:"fq=C:12/36"},{name:"Filtros",context:"fq=C:12/36/102"},{name:"Limpieza",context:"fq=C:12/37/106"}],bird:[{name:"Jaulas",context:"fq=C:11/32/90"},{name:"Alimento",context:"fq=C:11/30"},{name:"Juguetes",context:"fq=C:11/32/94"},{name:"Limpieza",context:"fq=C:11/32/93"}]},myClass="",markers=[],mapClick=!1,max=0,destiny="",quantity=0,columns=0,page=0,contextSnack="",context="",random=!1,data="",bannerActual=0,interval="",clickActive=!1,bannerLoading=!1,nextBanner=0,productSnackPage=1,productPage=1,dataCat,flagSubCat=!1,categorySelectorActive=!1,styleTransform="",actualAmount="$ 0",branches=[],containerMap="map-canvas",loadingSection=!1,map,myLatlng,initilizedMap=!1,indexBranchSelected=0,isChrome=navigator.userAgent.toLowerCase().indexOf("chrome")>-1,resolutionArray={mobile:{min:0,max:640},desktop:{min:641,max:9999}},sliderProductsMobile={current:0,size:0};window.alert=function(){return!1},Fizzmod.Events.on(window,"load",function(){console.log("Se invoca a Fizzmod load"),window.goToTopPage=function(){return!1}}),$(document).on("click",".overlay",function(e){console.log("Se hizo click en el overlay"),$(e.target).is($(this).find("*"))||$(this).fadeOut(300)}),$(document).on("click","a",function(e){console.log("Link clicked:",$(this).attr("href")),("#"==$(this).attr("href")||"/#"==$(this).attr("href"))&&e.preventDefault()}),Fizzmod.Events.on(window,"resize",function(){if(console.log("Se invoca a Fizzmod resize"),$("#topContainerBrowser .back").length>0){var e=window.innerWidth-$("#topContainerBrowser .back").offset().left-20;e+="px",$("#topContainerBrowser .back").css("width",e)}$("body").hasClass("produto")&&(centerOverlays(),adjustHeightPuppisYa())});var delay=function(){var e=0;return function(t,i){clearTimeout(e),e=setTimeout(t,i)}}(),getResolutionKey=function(){var e=window.innerWidth;for(var t in resolutionArray)resolutionArray[t].mine&&(resolutionKey=t);return resolutionKey};$(document).on("hover","#brands .item img",function(){console.log("Brand image hovered"),$("#brands").find(".item img").not($(this)).css("opacity","0.6")}),$(document).on("mouseout","#brands .item img",function(){console.log("Brand image mouseout"),$("#brands").find(".item img").not($(this)).css("opacity","1")}),$(document).on("click","#mainMenu .brands .subMenu .viewMore",function(){console.log("View More clicked"),$(this).parent().hide(),viewMoreContent=$(this).parent().siblings(".viewMoreContent");var e=viewMoreContent.outerHeight();e+="px",viewMoreContent.show().css("height","136px").animate({height:e},500)}),document.addEventListener("DOMContentLoaded",function(){PuppisMinicart.init(),PuppisHeader.init(),PuppisInsider.init(),OverlayBrands.init(),PuppisSearch.init(),$("#product .descricao-preco").children().hasClass("valor-de")&&$("#product .valor-de").html().replace("De: ",'
    ANTES
    ');var e=$(".wrap-icon-descrption").clone();if($(".productOptions.first .content").after(e),befaft(),$("body").on("click",".cartSkuRemove",function(){$(document).trigger("vtex.minicart.updated"),setTimeout(function(){vtexjs.checkout.getOrderForm().done(function(e){var t=App.createObject(e);t.porcent;App.updateComponents(t)})},1e3)}),$(window).on("puppisConfigured",function(){vtexjs.checkout.getOrderForm().done(function(e){var t=App.createObject(e);App.updateComponents(t)})}),createCarrousels(),agregarVariantes(),$(".product .productName, .product .productNameContent").dotdotdot({truncate:"word",watch:"window",tolerance:0}),$("#topContainerBrowser .back").length>0){var t=window.innerWidth-$("#topContainerBrowser .back").offset().left-20;t+="px",$("#topContainerBrowser .back").css("width",t)}$("#topbar .item, #services .item").hover(function(){(parent=$(this).parent()).find(".item").not($(this)).css("opacity","0.6")},function(){(parent=$(this).parent()).find(".item").not($(this)).css("opacity","1")}),$("#brands .item img").hover(function(){$("#brands").find(".item img").not($(this)).css("opacity","0.6")},function(){$("#brands").find(".item img").not($(this)).css("opacity","1")}),$(document).on("click","#topbar .payment",function(e){e.preventDefault(),$(".overlay.payment").fadeIn(300),$("body, html").addClass("modal-open")}),$(document).on("click","#topbar .shipping",function(e){e.preventDefault(),$(".overlay.shipping").fadeIn(300),$("body, html").addClass("modal-open")}),$(document).on("click",".overlay .icn.close",function(){$(this).parents(".overlay").fadeOut(300),$("body, html").removeClass("modal-open")}),$(document).on("click",".overlay.payment .mercadoPagoPromoButton",function(){$(".overlay.payment").fadeOut(100,function(){$(".overlay.mercadoPago").fadeIn(300)})}),$(document).on("show",".overlay.payment",function(){$("body").addClass("modal-open")}).on("hidden",function(){$("body").removeClass("modal-open")}),$("#productsContainer").on("click",".arrowLeft, .arrowRight",function(){agregarVariantes()}),isResolutionDesktop()&&$(document).on("click","a[data-cat]",function(){agregarVariantes()}),$(document).on("click",".buyButton",function(){var e=$(this),t=e.attr("data-parentid");e.addClass("loading"),$.get("/api/catalog_system/pub/products/crossselling/accessories/"+t,function(t){var i=parseInt($(e).parents(".priceAndBuyContainerParent").find(".quantity").val())||1,n=$(e).attr("data-skuId");if(isResolutionMobile()){var o=parseInt($(e).parents(".priceAndBuyContainerParent").find(".btn.more").attr("data-max")),a=$(".overlay.addProduct").find(".btn.more");a.attr("data-max",o).attr("data-skuId",n),$(".overlay.addProduct").find(".quantity").val("1"),$(".overlay.addProduct").find(".btn.less").addClass("disabled"),1==o?a.addClass("disabled"):a.removeClass("disabled"),$(".overlay.addProduct").show(200),e.removeClass("loading")}else{var s=[];if($('.buyButton[data-skuId="'+n+'"]',".vitrine-accessories").length>0){var r=$('.vitrine-accessories[data-id="'+$(e).attr("data-parentid")+'"]').siblings(".product").find(".quantity").val(),c=$('.vitrine-accessories[data-id="'+$(e).attr("data-parentid")+'"]').siblings(".product").find(".buyButton").attr("data-skuid");s.push({skuId:c,cantidad:r})}t.length>0?t[0].items[0].sellers[0].commertialOffer.AvailableQuantity>0&&(AlwaysAttachApp.init(t,!1),skuadd()):$(".alwaysAttach").hasClass("active")&&AlwaysAttachApp.init({},!0),s.push({skuId:n,cantidad:i}),addProductsToCart(s,!1,e)}})}),$(document).on("click",".priceAndBuyContainer .quantitySelector .btn.more, .overlay.addProduct .btn.more",function(){try{if(!$(this).hasClass("disabled")){var e=$(this).prev(),t=parseInt(e.val()),i=parseInt($(this).attr("data-max"));t2?t--:2==t&&(t--,$(this).addClass("disabled")),e.val(t),e.next().removeClass("disabled")}}catch(e){}}),$(document).on("click",".keepBuyingButton",function(){$(this).parents(".overlay").fadeOut(200)}),$.each($(".overlay").not(".mercadoPago").not(".productAdded"),function(e,t){var i=$(t).children(".content").outerHeight(),n=$(window).height()/2-i/2;n>0?(n+="px",$(t).children(".content").css("top",n)):$(t).children(".content").css("top","0px")})});var map;$(function(){$('a[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=$(this.hash);if((e=e.length?e:$("[name="+this.hash.slice(1)+"]")).length)return $("html, body").animate({scrollTop:e.offset().top-70},1e3),!1}})}),$(document).on("click",".cartFooter .buyButtonMiniCart, .finishBuyButton",function(){console.log("Go to cart123"),selectedShippping()});var city_list=[],zipcode="";window.addEventListener("load",function(){cityModal(),null!==document.querySelector(".my-slider")&&tns({container:".my-slider ul",items:8,slideBy:"page",autoplay:!1,responsive:{640:{items:2,gutter:5},700:{items:4,gutter:5},900:{items:5,gutter:5},1440:{items:5,gutter:5},2e3:{items:8,gutter:5}}}),null!==document.querySelector(".my-slider2")&&tns({container:".my-slider2 ul",items:8,slideBy:"page",autoplay:!1,responsive:{640:{items:2,gutter:5},700:{items:4,gutter:5},900:{items:5,gutter:5},1440:{items:5,gutter:5},2e3:{items:8,gutter:5}}}),null!==document.querySelector(".my-slider3")&&tns({container:".my-slider3 ul",items:8,slideBy:"page",autoplay:!1,responsive:{640:{items:2,gutter:5},700:{items:4,gutter:5},900:{items:5,gutter:5},1440:{items:5,gutter:5},2e3:{items:8,gutter:5}}}),null!==document.querySelector(".my-slider-category")&&tns({container:".my-slider-category ul",items:3,slideBy:"page",autoplay:!1})});var cityModal=function(e,t){var i=JSON.parse(localStorage.getItem("location_whitelabel"));(document.querySelector(".text-up-to-header").insertAdjacentHTML("afterbegin",'\n
    \n
    \n
    \n \n

    Mi ubicación

    \n

    Debes escoger la ciudad para ver los productos disponibles, costos y tiempos de entrega de tu zona.

    \n
    \n \n
    \n\t \n

    Los productos y las opciones de entrega pueden variar según la ubicación que elijas.

    \n
    \n
    \n '),label_location_function(),null!==i)&&(document.querySelector("#select_city_modal").style.display="flex",document.getElementById("button_city_modal").disabled=!1,$(".city_modal").addClass("city_modal_hidden"),document.querySelector("#select_city_modal").value=i[2],zipcode=i[2],$("#close_modal_wl").removeClass("hide"),null===sessionStorage.getItem("locationready")&&setNewData(!1));document.querySelector("#button_city_modal").addEventListener("click",function(){if(null===i)setNewData(!0);else{var e=document.querySelector("#select_city_modal"),t=e.options[e.selectedIndex].text;document.querySelector("#select_city_modal").value===i[2]&&t===i[1]?$(".city_modal").addClass("city_modal_hidden"):setNewData(!0)}}),document.querySelector("#close_modal_wl").addEventListener("click",function(){$(".city_modal").addClass("city_modal_hidden")}),null!==sessionStorage.getItem("locationready")&&(label_location_function(),document.querySelector(".label_location").innerHTML=i[0]+", "+i[1])},label_location_function=function(){var e=document.querySelector(".list-extra-services");null===document.querySelector(".label_location")&&e.insertAdjacentHTML("beforeend",'\n
  • \n
    \n
    Mi Ubicación\n
    \n
    \n
    \n
    Escoger >
    \n
    \n
  • \n ')},showModalLocation=function(){$(".city_modal").removeClass("city_modal_hidden")},handleSelectCity=function(e,t){document.getElementById("button_city_modal").disabled=!1,document.querySelector("#select_city_modal").value=t,document.querySelector("#finder_city_modal").style.display="none",document.querySelector("#list_city_modal").style.display="none",zipcode=e},setNewData=function(e){$(".spinner_la_modal").removeClass("hide"),$(".spinner_la_modal_head").removeClass("hide");var t=document.querySelector("#select_city_modal").value;console.log("ZIP CODE",t),"0"===document.querySelector("#select_city_modal").value?document.querySelector("#select_city_modal").style.borderColor="red":vtexjs.checkout.getOrderForm().then(function(e){var i=t,n="COL",o={postalCode:i,country:n};return vtexjs.checkout.calculateShipping(o)}).done(function(t){console.log("Frete calculado."),$(".city_modal").addClass("city_modal_hidden");var i=document.querySelector("#select_city_modal"),n=i.options[i.selectedIndex].text,o=i.options[i.selectedIndex].getAttribute("data-depto"),a=document.querySelector("#select_city_modal").value;document.querySelector(".label_location").innerHTML=o+", "+n;var s=[o,n,a];console.log("ARRAY",s),localStorage.setItem("location_whitelabel",JSON.stringify(s)),update_session(e,a)})},update_session=function(e,t){var i={public:{country:{value:"COL"},postalCode:{value:t}}};fetch("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).then(function(t){if(sessionStorage.setItem("locationready",JSON.stringify(!0)),!0===e)location.reload();else{null===JSON.parse(sessionStorage.getItem("reloadId")||"null")&&(sessionStorage.setItem("reloadId",JSON.stringify(!0)),location.reload())}$(".spinner_la_modal").addClass("hide"),$(".spinner_la_modal_head").addClass("hide")}).catch(function(e){console.error(e)})},$WELCOME=".overlay.bienvenida",$WELCOME_CLOSE=$WELCOME+" .close",$WRAP_TITLE=$WELCOME+" .wrap-input-title",$WELCOME_MSG=$WRAP_TITLE+" #welcome-message",$ERROR_MSG=$WRAP_TITLE+" #error-message",$SUCCESS_MSG=$WRAP_TITLE+" #success-message",$WRAP_CONTENT=$WELCOME+" .wrap-input-content",$INPUT_CONTENT=$WRAP_CONTENT+" #input-content",$INPUT_ITEM=$INPUT_CONTENT+" .input-item",$INPUT_NAME=$INPUT_ITEM+" input#name",$INPUT_EMAIL=$INPUT_ITEM+" input#email",$INPUT_PHONE=$INPUT_ITEM+" input#phone",$SELECT_TYPEPET=$INPUT_ITEM+" select#type_pet",$INPUT_PETNAME=$INPUT_ITEM+" input#pet_name",$INPUT_PETBIRTH=$INPUT_ITEM+" input#pet_birthdate",$INPUT_MEMBERSHIP=$INPUT_CONTENT+" input#check-new",$BTN_SENDDATA=$INPUT_CONTENT+" .form-pet-confirm #send-data",$LOADING_DATA=$BTN_SENDDATA+" #loading-status",$TEXT_DATA=$BTN_SENDDATA+" #text-button",$SUCCESS_CONTENT=$WRAP_CONTENT+" #success-content",_self=void 0,PopupBienvenida={email:"",name:"",petbirthday:"",phone:"",petname:"",pettype:"",nameFill:!1,emailFill:!1,petbirthdayFill:!1,phoneFill:!1,petnameFill:!1,pettypeFill:!1,membership:!1,onRequest:!1,init:function(){console.log("Popup Bienvenida Started"),_self=this,1!=localStorage.getItem("suscrito")?$(".overlay.bienvenida").fadeIn():$(".overlay.bienvenida").fadeOut();var e=_self.currentDate.year()+"-"+_self.currentDate.month()+"-"+_self.currentDate.day();$("#pet_birthdate").attr("placeholder","dd-mm-aaaa"),$("#pet_birthdate").attr("max",e),_self.events()},events:function(){$(document).on("change",$INPUT_NAME,function(e){_self.nameFill=!0,_self.name=$(e.target).val()}).on("change",$INPUT_EMAIL,function(e){_self.emailFill=!0,_self.email=$(e.target).val()}).on("change",$INPUT_PHONE,function(e){_self.phoneFill=!0,_self.phone=$(e.target).val()}).on("change",$SELECT_TYPEPET,function(e){_self.pettypeFill=!0,_self.pettype=$(e.target).val()}).on("change",$INPUT_PETNAME,function(e){_self.petnameFill=!0,_self.petname=$(e.target).val()}).on("change",$INPUT_PETBIRTH,function(e){var t=$(e.target).val().split("-"),i=void 0,n=void 0,o=void 0;"iPhone"!=navigator.platform&&"Apple Computer, Inc."!=navigator.vendor||4!=t[2].length?(i=t[0],n=t[1],o=t[2]):(i=t[2],n=t[1],o=t[0]);var a=(new Date).getFullYear();i>1900&&i<=a&&n<=12&&n>0&&o>0&&o<=31?(_self.petbirthday=i+"-"+n+"-"+o+" 00:00:00",_self.petbirthdayFill=!0):_self.petbirthdayFill=!1}).on("change",$INPUT_MEMBERSHIP,function(e){_self.membership=$(e.target).prop("checked")}).on("click",$BTN_SENDDATA,function(){return _self.validateInputs()}).on("click",$WELCOME,function(e){$(e.target).is($(this).find("*"))||(localStorage.setItem("suscrito",1),$(".overlay.bienvenida").fadeOut())}).on("click",$WELCOME_CLOSE,function(){localStorage.setItem("suscrito",1),$(".overlay.bienvenida").fadeOut()}),$($BTN_SENDDATA).submit(function(){return!1})},onCustomSubmit:function(){return!1},validateInputs:function(){_self.emailFill&&_self.phoneFill&&_self.petnameFill&&_self.pettypeFill&&_self.membership?($($LOADING_DATA).css("display","block"),$($TEXT_DATA).css("display","none"),_self.validateMDEmail()):_self.launchNotification("Completa todos los campos para continuar.")},validateMDEmail:function(){if(!_self.onRequest){if(!_self.validateEmail(_self.email))return _self.launchNotification("Tu email no es válido."),$($LOADING_DATA).css("display","none"),void $($TEXT_DATA).css("display","block");_self.onRequest=!0,$.get("/api/dataentities/MA/search/?email="+_self.email+"&_fields=email").done(function(e){""==e||$.isEmptyObject(e)?_self.postUserToMD():e.forEach(function(e){e.email==_self.email?(_self.launchNotification("Este usuario ya fue registrado."),_self.updateRenderComponents($WELCOME_MSG,$ERROR_MSG),_self.updateRenderComponents($SUCCESS_MSG,$ERROR_MSG)):_self.postUserToMD()}),_self.onRequest=!1,$($LOADING_DATA).css("display","none"),$($TEXT_DATA).css("display","block")}).fail(function(e){console.warn("Error",e),_self.launchNotification("Ups! Hubo un error, intenta más tarde."),_self.onRequest=!1})}},postUserToMD:function(){var e='\n {\n "email": "'+_self.email+'",\n "phone": "'+_self.phone+'",\n "petname": "'+_self.petname+'",\n "pettype": "'+_self.pettype+'"\n }\n ',t=new XMLHttpRequest;t.onload=function(){var e=t.status;200==e||201==e?(_self.updateRenderComponents($WELCOME_MSG,$SUCCESS_MSG),_self.updateRenderComponents($ERROR_MSG,$SUCCESS_MSG),_self.updateRenderComponents($INPUT_CONTENT,$SUCCESS_CONTENT),$($WRAP_CONTENT).addClass("success"),_self.launchNotification("Información guardada existosamente.",3e3,!0),localStorage.setItem("suscrito",1),_self.resetInformationPopupBienvenida()):400!=e&&403!=e||_self.launchNotification("Hubo un error, intenta más tarde.")},t.open("POST","/api/dataentities/MA/documents",!0),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.send(e)},validateEmail:function(e){return!!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)},currentDate:{year:function(){return(new Date).getFullYear()},month:function(){var e=new Date,t=e.getMonth();return t+=parseFloat(1),t<10?"0"+t:t},day:function(){var e=new Date;return e.getDate()<10?"0"+e.getDate():e.getDate()}},launchNotification:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;arguments.length>2&&void 0!==arguments[2]&&arguments[2]?$(".notification-popupbienvenida").addClass("success"):$(".notification-popupbienvenida").removeClass("success"),$(".notification-popupbienvenida").html(e),$(".notification-popupbienvenida").slideDown(),setTimeout(function(){$(".notification-popupbienvenida").slideUp()},t)},resetInformationPopupBienvenida:function(){$(".hotsale-form input").val(""),_self.email="",_self.name="",_self.petbirthday="",_self.phone="",_self.petname="",_self.pettype="",_self.nameFill=!1,_self.emailFill=!1,_self.petbirthdayFill=!1,_self.phoneFill=!1,_self.petnameFill=!1,_self.pettypeFill=!1,_self.membership=!1,_self.onRequest=!1},updateRenderComponents:function(e,t){$(e).removeClass("active"),$(t).addClass("active")}};$(document).ready(function(){PopupBienvenida.init(),$(document).on("click",".quiero-cupon",function(){PopupBienvenida.init(),$(".overlay.bienvenida .content").show(),$(".overlay.bienvenida").fadeIn()})}),window.PopupBienvenida=PopupBienvenida;var $PRODUCT="#product",$PRODUCT_INFO=$PRODUCT+" .productInfo",$BUY_PRODUCT=$PRODUCT_INFO+" .productBuy",$CUSTOMIZE_PRODUCT=$PRODUCT_INFO+" .customize-product",GiftCards={isGiftCard:!1,hasAttachmentGiftCard:!1,initAttachementName:"Giftcard",orderFormApp:"giftcardrecipient",dataGiftCard:null,gitftcardConfigList:[],gitftcardConfig:{},recipientNameData:"",recipientEmailData:"",recipientCCData:"",initAtProdut:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.events(),this.gitftcardConfig=e,this.createObj(e)},initAtCategory:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.events(),this.gitftcardConfigList.push(t),this.gitftcardConfig=t,this.createListInfo(t.items.filter(function(t){return t.itemId==e})[0])},updateSkuCategory:function(e){this.createListInfo(this.gitftcardConfig.items.filter(function(t){return t.itemId==e})[0])},events:function(){var e=this;$(document).on("click",".productOptions.first .content .item",function(){return e.createObj()}).on("click","button.buy-giftcard-product,button.btn-customize-product",function(){GiftCards.triggerPopup(this)}).on("input",".content-input input",function(t){return e.updateInputLine(t)}).on("click","body.produto button.send-giftcard-benefit-info",function(){return e.addGiftCardToCart()}).on("click",".overlay .close",function(){return $(".overlay").fadeOut()})},isProductSku:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.gitftcardConfig;return!(void 0===t||void 0===t.items||!t||!e)&&(t.items.some(function(t){return t.itemId==e})&&this.hasAllAttachements(t))},hasAllAttachements:function(e){var t=this;if(e.items.every(function(e){return e.attachments})){var i=function(e){return e.attachments.some(function(e){return new RegExp(t.initAttachementName,"ig").test(e.name)})};if(this.hasAttachmentGiftCard=e.items.every(i),this.hasAttachmentGiftCard)return this.isGiftCard=!0,!0}return!1},createListInfo:function(e){this.skuId=e.itemId,$("button.send-giftcard-benefit-info").attr("data-parentid",this.skuId),$("button.send-giftcard-benefit-info").attr("data-skuid",this.skuId)},createObj:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.gitftcardConfig;void 0!==window.skuJson&&this.createInfo(e)},createInfo:function(e){this.hasAllAttachements(e)?(this.attachmentName=e.items[0].attachments[0].name,this.hideCurrentBuyButton(),$("button.send-giftcard-benefit-info").removeClass("buyButton"),$("button.send-giftcard-benefit-info").addClass("disabled"),this.skuId=window.product.sku,$("button.send-giftcard-benefit-info").attr("data-parentid",window.product.sku),$("button.send-giftcard-benefit-info").attr("data-skuid",window.product.sku)):console.log("This product has not a giftcard product")},disableControlsMinicart:function(e){if(void 0!==e||0!=e.length){var t=e.filter(function(e){if(/tarjeta/gi.test(e.name.toLowerCase())&&/regalo/gi.test(e.name.toLowerCase()))return e});t.length>0&&t.map(function(e){$("ul.minicart__items li.minicart__item-container").each(function(){e.id==$(this).find(".minicart__item").attr("data-id")&&$(this).find(".minicart__item-qty-wrapper").hide()})})}},doTheFieldsAreFilled:function(){return 0!=this.recipientNameData.length&&0!=this.recipientEmailData.length&&0!=this.recipientCCData.length},addGiftCardToCart:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.skuId;return t?this.doTheFieldsAreFilled()?($(".send-giftcard-benefit-info").addClass("loading-gift"),void vtexjs.checkout.getOrderForm().done(function(i){var n=i.items;if(void 0!==n||0!=n.length){var o=n.filter(function(e){if(/tarjeta/gi.test(e.name.toLowerCase())&&/regalo/gi.test(e.name.toLowerCase()))return e});if(o.length>0){console.log("Removing previous giftcards");var a=[];n.map(function(e,t){o.some(function(t){return t.id==e.id})&&a.push({index:t,quantity:0})}),vtexjs.checkout.removeItems(a).done(function(){return e.completeAddToCartGiftcard(t)}).fail(function(e){console.error(e),$(".send-giftcard-benefit-info").removeClass("loading-gift"),PopupBienvenida.launchNotification("Hubo un error, intenta más tarde.")})}else e.completeAddToCartGiftcard(t)}else e.completeAddToCartGiftcard(t)})):(PopupBienvenida.launchNotification("Te falta llenar los datos del beneficiario de la Giftcard."),console.log("The user has not filled the fields.")):console.log("skuId is undefined")},completeAddToCartGiftcard:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:self.skuId,i={};i[t]=1;var n="";n=/puppiscolombiaqa/gi.test(window.location.host)?"1":"puppiscolombiaqa",Fizzmod.Utils.addSKU(i,1,n).done(function(){e.setTagInformation(),$(PuppisMinicart.$SELF).vtexMinicart("fillCart"),vtexjs.checkout.getOrderForm().done(function(e){var t=App.createObject(e);App.updateComponents(t)})}).fail(function(t){console.error(t),$(".send-giftcard-benefit-info").removeClass("loading-gift"),e.launchNotification("Hubo un error, inténtalo más tarde.")})},hideCurrentBuyButton:function(){if("undefined"==typeof Fizzmod||!Fizzmod)return console.log("Fizzmod is undefined.");$($BUY_PRODUCT).hide(),$($CUSTOMIZE_PRODUCT).find("button").text("Agregar al carrito"),$($CUSTOMIZE_PRODUCT).show(),Fizzmod.Utils.addAnimation("buyButtonActivated",function(){$($BUY_PRODUCT).hide(),$($CUSTOMIZE_PRODUCT).find("button").text("Agregar al carrito"),$($CUSTOMIZE_PRODUCT).show()}),Fizzmod.Utils.addAnimation("productWithoutStock",function(){$($CUSTOMIZE_PRODUCT).hide()}),$(".notifyme.sku-notifyme").is(":visible")&&$($CUSTOMIZE_PRODUCT).hide()},triggerPopup:function(e){var t=this;if(0==$(".overlay.giftcard-popup").length)return console.log("Overlay Giftcard missing.");if(!$("body").hasClass("produto")){var i=$(e).closest(".product").attr("data-id");this.gitftcardConfigList.map(function(e){e.productId==i&&(t.gitftcardConfig=e,t.skuId=e.items[0].itemId,t.createListInfo(e.items[0]))})}$(".overlay.giftcard-popup").fadeIn(100),$(".giftcard-popup").submit(function(){return!1})},launchNotification:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;$(".custom-product-notification").html(e),$(".custom-product-notification").slideDown(),setTimeout(function(){$(".custom-product-notification").slideUp()},t)},updateInputLine:function(e){if($(e.target).val().length>0){var t=$(e.target).val();switch($(e.target).attr("id")){case"input-name":this.recipientNameData=t;break;case"input-email":this.recipientEmailData=t;break;case"input-cc":this.recipientCCData=t;break;default:console.log("This input uses an index out of range.")}}else{var i=$(e.target).val();switch($(e.target).attr("id")){case"input-name":this.recipientNameData=i;break;case"input-email":this.recipientEmailData=i;break;case"input-cc":this.recipientCCData=i;break;default:console.log("This input uses an index out of range.")}}this.recipientNameData.length>0&&this.recipientEmailData.length>0&&this.recipientCCData>0?$("button.send-giftcard-benefit-info").removeClass("disabled"):$("button.send-giftcard-benefit-info").addClass("disabled")},setTagInformation:function(){var e=this,t=[{value:this.recipientNameData,app:this.orderFormApp,field:"recipientName"},{value:this.recipientEmailData.toLowerCase(),app:this.orderFormApp,field:"recipientEmail"},{value:this.recipientCCData,app:this.orderFormApp,field:"recipientCC"}];Promise.all(t.map(function(t){vtexjs.checkout.setCustomData(t).done(function(){return console.log("Updated content for "+t.field)}).fail(function(t){console.warn("[ATTACHEMENT] Error in OrderForm",t),e.launchNotification("Hubo un error, inténtalo más tarde.")})})).then(function(){return $(".send-giftcard-benefit-info").removeClass("loading-gift")}).then(function(){return $(".overlay.giftcard-popup").fadeOut()}).then(function(){$(".overlay.productAdded").show(100),$(".overlay.productAdded").addClass("keep-buying"),AlwaysAttachApp.appendButtonsToPopup(AlwaysAttachApp.layoutButtons()),AlwaysAttachApp.closeAlwaysAttach()})}};window.GiftCards=GiftCards;var $STORE_MODAL="div.store-selection-container",$STORE_MODAL_CONTENT=$STORE_MODAL+" .store-selection-popup",$STORE_MAIN_MENU=$STORE_MODAL+" section.store-selection-main-menu",$STORE_PICKUPFORM=$STORE_MODAL+" section.store-selection-pickuppoint",$STORE_LOGINEMAIL=$STORE_MODAL+" section.store-selection-deliverylogin",$STORE_LIST=$STORE_MODAL+" section.store-selection-deliverylist",$STORE_NEWADDRESS=$STORE_MODAL+" section.store-selection-newaddress",$STORE_SUCCESS_CONFIG=$STORE_MODAL+" section.store-selection-success",StoreSelection={isALoggedUser:!1,popupActive:!1,selection:null,currentLocation:$STORE_MAIN_MENU,orderForm:vtexjs.checkout.orderForm,orderFormId:"",globalCity:"",globalStore:"",availablePickupPoints:[],globalEmail:"",globalAddress:"",globalComplementAddress:"",globalAddressList:[],cities:[],isNacionalCity:!1,init:function(){var e=this;console.log("-- store selection --"),this.events(),this.checkCookies(),vtexjs.checkout.getOrderForm().done(function(t){e.orderFormId=t.orderFormId,e.orderForm=t,Fizzmod.Utils.checkLogin().done(function(i){i&&i.IsUserDefined&&(e.globalEmail=i.Email,e.isALoggedUser=!0,e.globalAddressList=t.shippingData.availableAddresses)})}).fail(function(e){return console.error("[STORE] Something went wrong at setting the information of Store.",e)})},capitalize:function(e){return e.toLowerCase().replace(/\w/,function(e){return e.toUpperCase()})},events:function(){var e=this;$(document).on("change",".select-national-city select#select-state-national",function(){var e=$(this).val(),t=StoreSelection.cities.filter(function(t){return t.state==e}),i='';t.map(function(e){var t=StoreSelection.capitalize(e.city),n=4==e.postalCode.length?"0"+e.postalCode:e.postalCode;i+='"}),$(".select-national-city select#select-city-national").html(i)}).on("change",$STORE_NEWADDRESS+" select.select-city",function(){"Nacional"==$(this).val()?($($STORE_NEWADDRESS+" .pickup-select.select-city").slideUp(),$($STORE_NEWADDRESS+" .pickup-select.select-national-city").slideDown(),$($STORE_NEWADDRESS+" button.go-back").fadeIn(),StoreSelection.isNacionalCity=!0):StoreSelection.selectCityNewAddress(this)}).on("click",$STORE_NEWADDRESS+" button.go-back",function(){$($STORE_NEWADDRESS+" .pickup-select.select-city").slideDown(),$($STORE_NEWADDRESS+" .pickup-select.select-national-city").slideUp(),$($STORE_NEWADDRESS+" button.go-back").fadeOut(),$($STORE_NEWADDRESS+" .pickup-select select.select-city").val(1),StoreSelection.isNacionalCity=!1}).on("click",$STORE_NEWADDRESS+" button.set-new-address-delivery",function(){StoreSelection.setNewAddress(this)}).on("click","button.login-user-vtex",function(){return e.loginWithVtex()}).on("click","button.btn-navigation.select-store, .how-do-you-wish-your-delivery",function(){return $(".overlay.store-selection-container").fadeIn().addClass("active")}).on("click",$STORE_MODAL+" .close",function(){$("body").removeClass("lock-scroll"),$(".overlay").fadeOut(),StoreSelection.popupActive=!1})},popupIsActive:function(){return!!this.popupActive},openPopup:function(){$($STORE_MODAL).fadeIn(200),this.popupActive=!0},checkCookies:function(){Fizzmod.Utils.getCookie("openStoreSelection")&&!/login/.test(window.location.pathname)&&(console.log("Should open modal..."),this.openPopup(),Fizzmod.Utils.deleteCookie("openStoreSelection"),Fizzmod.Utils.deleteCookie("checkout-force-reload"))},updateSectionRender:function(e){$($STORE_MAIN_MENU).removeClass("active"),$($STORE_PICKUPFORM).removeClass("active"),$($STORE_LOGINEMAIL).removeClass("active"),$($STORE_NEWADDRESS).removeClass("active"),$($STORE_LIST).removeClass("active"),setTimeout(function(){$(e).addClass("active")},1),e==$STORE_LIST||e==$STORE_NEWADDRESS?$($STORE_MODAL_CONTENT).addClass("large"):$($STORE_MODAL_CONTENT).removeClass("large")},loginWithVtex:function(){window.location.href="/login?ReturnUrl="+window.location.pathname},loggoutWithVtex:function(){$.get("/checkout/changeToAnonymousUser/"+vtexjs.checkout.orderForm.orderFormId).done(function(){return window.location.href="/no-cache/user/logout"}).fail(function(e){return console.error("It cannot be possible to logout",e)})},startWithANewEmail:function(){Fizzmod.Utils.deleteCookie("hasConfiguredStore"),Fizzmod.Utils.deleteCookie("storeUserInfo"),Fizzmod.Utils.deleteCookie("addressUpdatedSS"),Fizzmod.Utils.deleteCookie("checkout-force-reload"),Fizzmod.Utils.setCookie("openStoreSelection",!0,1),setTimeout(function(){StoreSelection.loggoutWithVtex()},3)},selectCityNewAddress:function(e){var t=$(e).children("option:selected");this.globalCity=t.eq(0).val(),this.globalState=t.eq(0).attr("data-state"),this.globalPostalCode=t.eq(0).attr("data-postal")||"11001"},setNewAddress:function(e){var t=this;if(0==this.globalCity.length)return void PopupBienvenida.launchNotification("Por favor llena todos los campos.");$(e).addClass("loading");var i=this.setVtexSession(this.globalPostalCode),n=this.setShippingData(this.orderForm,this.globalCity,this.globalState,this.globalPostalCode);Promise.all([n,i]).then(function(){PopupBienvenida.launchNotification("Updated"),$(e).removeClass("loading"),t.updateSectionRender($STORE_SUCCESS_CONFIG),t.successSelection()}).catch(function(e){return console.log("ERR",e)})},setVtexSession:function(e){var t={country:{value:"COL"},postalCode:{value:e}};return vtexjs.session.setSessionParams(t)},setShippingData:function(e,t,i,n){var o=e.items;console.log("Updating address...\n");var a=this.getNewAddressObject(i,t,n),s=[];o.length>0&&(s=[{addressId:a.addressId,itemIndex:0,selectedDeliveryChannel:"delivery",selectedSla:this.isNacionalCity?"Nacional":"Entrega agendada"}]);var r="/api/checkout/pub/orderForm/"+e.orderFormId+"/attachments/shippingData",c={clearAddressIfPostalCodeNotFound:!1,logisticsInfo:s,selectedAddresses:[a],expectedOrderFormSections:["items","totalizers","clientProfileData","shippingData","paymentData","sellers","messages","marketingData","clientPreferencesData","storePreferencesData","giftRegistryData","ratesAndBenefitsData","openTextField","commercialConditionData","customData"]},l={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)};return Fizzmod.Utils.deleteCookie("setShippingInAddToCart"),Fizzmod.Utils.deleteCookie("setShippingData"),fetch(r,l)},getNewAddressObject:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"residential";return{addressId:Math.abs([-1,1][2*Math.random()|0]*Math.floor(1e5+9e12*Math.random())).toString(),addressType:n,city:t,complement:null,country:"COL",geoCoordinates:[],neighborhood:null,number:null,postalCode:i,receiverName:null,reference:null,state:e,street:null,isDisposable:null}},successSelection:function(){$($STORE_MODAL_CONTENT).removeClass("large").addClass("small");var e=3,t=setInterval(function(){$($STORE_SUCCESS_CONFIG+" span.countdown-popup").text(e.toString()),(e-=1)<=0&&(clearInterval(t),Fizzmod.Utils.setCookie("hasConfiguredStore",!0,1),$(".overlay").fadeOut(),$("body").removeClass("lock-scroll"),setTimeout(function(){window.location.reload()},10))},1e3)}};window.StoreSelection=StoreSelection,$(document).ready(function(){StoreSelection.init()});