if(typeof lazySizes!="function"&&typeof lazySizes!="object"){/*! lazysizes - v4.1.8 */(function(a,b){var c=b(a,a.document);a.lazySizes=c,typeof module=="object"&&module.exports&&(module.exports=c)})(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d,e=b.documentElement,f=a.Date,g=a.HTMLPictureElement,h="addEventListener",i="getAttribute",j=a[h],k=a.setTimeout,l=a.requestAnimationFrame||k,m=a.requestIdleCallback,n=/^picture$/i,o=["load","error","lazyincluded","_lazyloaded"],p={},q=Array.prototype.forEach,r=function(a2,b2){return p[b2]||(p[b2]=new RegExp("(\\s|^)"+b2+"(\\s|$)")),p[b2].test(a2[i]("class")||"")&&p[b2]},s=function(a2,b2){r(a2,b2)||a2.setAttribute("class",(a2[i]("class")||"").trim()+" "+b2)},t=function(a2,b2){var c2;(c2=r(a2,b2))&&a2.setAttribute("class",(a2[i]("class")||"").replace(c2," "))},u=function(a2,b2,c2){var d2=c2?h:"removeEventListener";c2&&u(a2,b2),o.forEach(function(c3){a2[d2](c3,b2)})},v=function(a2,d2,e2,f2,g2){var h2=b.createEvent("Event");return e2||(e2={}),e2.instance=c,h2.initEvent(d2,!f2,!g2),h2.detail=e2,a2.dispatchEvent(h2),h2},w=function(b2,c2){var e2;!g&&(e2=a.picturefill||d.pf)?(c2&&c2.src&&!b2[i]("srcset")&&b2.setAttribute("srcset",c2.src),e2({reevaluate:!0,elements:[b2]})):c2&&c2.src&&(b2.src=c2.src)},x=function(a2,b2){return(getComputedStyle(a2,null)||{})[b2]},y=function(a2,b2,c2){for(c2=c2||a2.offsetWidth;c249?function(){m(h2,{timeout:g2}),g2!==d.ricTimeout&&(g2=d.ricTimeout)}:A(function(){k(h2)},!0);return function(a3){var d2;(a3=a3===!0)&&(g2=33),b2||(b2=!0,d2=e2-(f.now()-c2),d2<0&&(d2=0),a3||d2<9?i2():k(i2,d2))}},C=function(a2){var b2,c2,d2=99,e2=function(){b2=null,a2()},g2=function(){var a3=f.now()-c2;a30)&&x(f2,"overflow")!="visible"&&(d2=f2.getBoundingClientRect(),g3=H>d2.left&&Gd2.top-1&&F2500&&e.clientWidth>500?500:370:d.expand,c._defEx=r2,s2=r2*d.expFactor,t2=d.hFac,J=null,O2&&o2>2&&!b.hidden?(O=s2,Q=0):O=o2>1&&Q>1&&P<6?r2:N),q2!==m3&&(y2=innerWidth+m3*t2,D2=innerHeight+m3,n2=-1*m3,q2=m3),h2=u2[f2].getBoundingClientRect(),(I=h2.bottom)>=n2&&(F2=h2.top)<=D2&&(H=h2.right)>=n2*t2&&(G=h2.left)<=y2&&(I||H||G||F2)&&(d.loadHidden||S(u2[f2]))&&(l2&&P<3&&!p3&&(o2<3||Q<4)||T(u2[f2],m3))){if(aa(u2[f2]),k2=!0,P>9)break}else!k2&&l2&&!j2&&P<4&&Q<4&&o2>2&&(g2[0]||d.preloadAfterLoad)&&(g2[0]||!p3&&(I||H||G||F2||u2[f2][i](d.sizesAttr)!="auto"))&&(j2=g2[0]||u2[f2]);j2&&!k2&&aa(j2)}},V=B(U),W=function(a2){var b2=a2.target;if(b2._lazyCache)return void delete b2._lazyCache;R(a2),s(b2,d.loadedClass),t(b2,d.loadingClass),u(b2,Y),v(b2,"lazyloaded")},X=A(W),Y=function(a2){X({target:a2.target})},Z=function(a2,b2){try{a2.contentWindow.location.replace(b2)}catch{a2.src=b2}},$2=function(a2){var b2,c2=a2[i](d.srcsetAttr);(b2=d.customMedia[a2[i]("data-media")||a2[i]("media")])&&a2.setAttribute("media",b2),c2&&a2.setAttribute("srcset",c2)},_=A(function(a2,b2,c2,e2,f2){var g3,h2,j2,l3,o3,p3;(o3=v(a2,"lazybeforeunveil",b2)).defaultPrevented||(e2&&(c2?s(a2,d.autosizesClass):a2.setAttribute("sizes",e2)),h2=a2[i](d.srcsetAttr),g3=a2[i](d.srcAttr),f2&&(j2=a2.parentNode,l3=j2&&n.test(j2.nodeName||"")),p3=b2.firesLoad||"src"in a2&&(h2||g3||l3),o3={target:a2},s(a2,d.loadingClass),p3&&(clearTimeout(m2),m2=k(R,2500),u(a2,Y,!0)),l3&&q.call(j2.getElementsByTagName("source"),$2),h2?a2.setAttribute("srcset",h2):g3&&!l3&&(L.test(a2.nodeName)?Z(a2,g3):a2.src=g3),f2&&(h2||l3)&&w(a2,{src:g3})),a2._lazyRace&&delete a2._lazyRace,t(a2,d.lazyClass),z(function(){var b3=a2.complete&&a2.naturalWidth>1;p3&&!b3||(b3&&s(a2,"ls-is-cached"),W(o3),a2._lazyCache=!0,k(function(){"_lazyCache"in a2&&delete a2._lazyCache},9)),a2.loading=="lazy"&&P--},!0)}),aa=function(a2){if(!a2._lazyRace){var b2,c2=K.test(a2.nodeName),e2=c2&&(a2[i](d.sizesAttr)||a2[i]("sizes")),f2=e2=="auto";(!f2&&l2||!c2||!a2[i]("src")&&!a2.srcset||a2.complete||r(a2,d.errorClass)||!r(a2,d.lazyClass))&&(b2=v(a2,"lazyunveilread").detail,f2&&E.updateElem(a2,!0,a2.offsetWidth),a2._lazyRace=!0,P++,_(a2,b2,f2,e2,c2))}},ba=C(function(){d.loadMode=3,V()}),ca=function(){d.loadMode==3&&(d.loadMode=2),ba()},da=function(){if(!l2){if(f.now()-p2<999)return void k(da,999);l2=!0,d.loadMode=3,V(),j("scroll",ca,!0)}};return{_:function(){p2=f.now(),c.elements=b.getElementsByClassName(d.lazyClass),g2=b.getElementsByClassName(d.lazyClass+" "+d.preloadClass),j("scroll",V,!0),j("resize",V,!0),a.MutationObserver?new MutationObserver(V).observe(e,{childList:!0,subtree:!0,attributes:!0}):(e[h]("DOMNodeInserted",V,!0),e[h]("DOMAttrModified",V,!0),setInterval(V,999)),j("hashchange",V,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(a2){b[h](a2,V,!0)}),/d$|^c/.test(b.readyState)?da():(j("load",da),b[h]("DOMContentLoaded",V),k(da,2e4)),c.elements.length?(U(),z._lsFlush()):V()},checkElems:V,unveil:aa,_aLSL:ca}})(),E=(function(){var a2,c2=A(function(a3,b2,c3,d2){var e3,f3,g3;if(a3._lazysizesWidth=d2,d2+="px",a3.setAttribute("sizes",d2),n.test(b2.nodeName||""))for(e3=b2.getElementsByTagName("source"),f3=0,g3=e3.length;f330&&(c2+=1),b3=36*c2,a2.push(b3)})(j.widths));for(b2 in e2)b2 in j||(j[b2]=e2[b2])})(),addEventListener("lazybeforesizes",function(a2){if(a2.detail.instance==c){var b2,d2,e2,k2,l2,m2,o2,p2,q2,s2,t2,u2,x;if(b2=a2.target,a2.detail.dataAttr&&!a2.defaultPrevented&&!j.disabled&&(q2=b2.getAttribute(i.sizesAttr)||b2.getAttribute("sizes"))&&r.test(q2)){if(d2=h(b2),e2=g(b2,d2),t2=n.test(e2.prefix)||n.test(e2.postfix),e2.isPicture&&(k2=b2.parentNode))for(l2=k2.getElementsByTagName("source"),m2=0,o2=l2.length;m2=a2.d){!e3.cached&&(b2=a2[f3-1])&&b2.d>a2.d-.13*Math.pow(a2.d,2.2)&&(c2=Math.pow(b2.d-.6,1.6),b2.cached&&(b2.d+=.15*c2),b2.d+(e3.d-a2.d)*c2>a2.d&&(e3=b2));break}return e3},f2=function(a2,b2){var d3;return!a2._lazyrias&&c.pWS&&(d3=c.pWS(a2.getAttribute(i.srcsetAttr||""))).length&&(Object.defineProperty(a2,"_lazyrias",{value:d3,writable:!0}),b2&&a2.parentNode&&(d3.isPicture=a2.parentNode.nodeName.toUpperCase()=="PICTURE")),a2._lazyrias},g2=function(b2){var d3=a.devicePixelRatio||1,e3=c.getX&&c.getX(b2);return Math.min(e3||d3,2.4,d3)},h2=function(b2,c2){var h3,i2,j3,k2,l2,m2;if(l2=b2._lazyrias,l2.isPicture&&a.matchMedia){for(i2=0,h3=b2.parentNode.getElementsByTagName("source"),j3=h3.length;i2data.price_min,priceVaries=data.price_min!=data.price_max,images=data.images_info,firstVariant=data.variants[0],Utils.getParam("variant")!==null&&Utils.getParam("variant")!=""){var paramVariant=data.variants.filter(function(e){return e.id==Utils.getParam("variant")});typeof paramVariant[0]<"u"&&(firstVariant=paramVariant[0])}else for(var i=0;i{{itemColorSwatches}}
{{itemTitle}}{{itemReviews}}{{itemPrice}}{{itemIcon}}{{itemColorCount}}{{itemSizeSwatches}}
'),itemHtml=itemHtml.replace(/{{itemProductInfo}}/g,itemProductInfoHtml);var soldOutClass=soldOut?boostPFSTemplate.soldOutClass:"",saleClass=onSale?boostPFSTemplate.saleClass:"",NonProduct="";data.tags.includes("NonProductCard")&&(NonProduct="NonProduct"),itemHtml=itemHtml.replace(/{{NonProduct}}/g,NonProduct),itemHtml=itemHtml.replace(/{{soldOutClass}}/g,soldOutClass),itemHtml=itemHtml.replace(/{{saleClass}}/g,saleClass);var customTagHtml="";itemHtml=itemHtml.replace(/{{customTagLabel}}/g,customTagHtml),itemHtml=itemHtml.replace(/{{gridWidthClass}}/g,buildGridWidthClass(data)),itemHtml=itemHtml.replace(/{{itemLabels}}/g,tags.indexOf("NonProductCard")!=-1?"":buildLabels(data,data.variants[0].id)),itemHtml=itemHtml.replace(/{{itemTagLabels}}/g,tags.indexOf("NonProductCard")!=-1?"":buildTagLabels(data,!1)),itemHtml=itemHtml.replace(/{{itemImages}}/g,buildImages(data)),itemHtml=itemHtml.replace(/{{itemPrice}}/g,buildPrice(data)),(typeof Integration>"u"||typeof Integration<"u"&&typeof Integration.hascompileTemplate=="function"&&!Integration.hascompileTemplate("reviews"))&&(itemHtml=itemHtml.replace(/{{itemReviews}}/g,buildReview(data)));var itemIconOne="",itemIconTwo="",itemIconThree="",itemIconFour="",itemIconFive="",itemIconSix="",itemIcon="";data.tags.indexOf("iconfairtrade")!==-1&&(itemIconOne='
Fair Trade
'),data.tags.indexOf("iconrecycled")!==-1&&(itemIconTwo='
Recycled
'),data.tags.indexOf("iconorganic")!==-1&&(itemIconThree='
Organic
'),data.tags.indexOf("iconhemp")!==-1&&(itemIconFour='
'),data.tags.indexOf("iconresponsiblewool")!==-1&&(itemIconFive='
Responsible Wool
'),data.tags.indexOf("icontraceabledown")!==-1&&(itemIconSix='
');var icons=[itemIconOne,itemIconTwo,itemIconThree,itemIconFour,itemIconFive,itemIconSix];itemHtml=itemHtml.replace(/{{itemIcon}}/g,icons.join("")),itemHtml=itemHtml.replace(/{{itemVendor}}/g,buildVendor(data)),itemHtml=itemHtml.replace(/{{itemActiveSwapClass}}/g,buildActiveSwapClass(data)),itemHtml=itemHtml.replace(/{{itemColorSwatches}}/g,buildProductOptionSwatches(data,boostPFSFilterConfig.boostProductOptionSwatch.color.swatchName,boostPFSFilterConfig.boostProductOptionSwatch.color.optionName,boostPFSFilterConfig.boostProductOptionSwatch.color.swatchDisplay,boostPFSFilterConfig.boostProductOptionSwatch.color.swatchType)),itemHtml=itemHtml.replace(/{{itemSizeSwatches}}/g,buildProductOptionSwatches(data,boostPFSFilterConfig.boostProductOptionSwatch.size.swatchName,boostPFSFilterConfig.boostProductOptionSwatch.size.optionName,boostPFSFilterConfig.boostProductOptionSwatch.size.swatchDisplay,boostPFSFilterConfig.boostProductOptionSwatch.size.swatchType));var itemColorLabel=colorCount==1?"color":"colores",itemColorCount='

'+colorCount+" "+itemColorLabel+"

";itemHtml=itemHtml.replace(/{{itemColorCount}}/g,itemColorCount),itemHtml=itemHtml.replace(/{{itemId}}/g,data.id),itemHtml=itemHtml.replace(/{{itemTitle}}/g,data.title),itemHtml=itemHtml.replace(/{{itemHandle}}/g,data.handle),itemHtml=itemHtml.replace(/{{itemVendorLabel}}/g,data.vendor);var productUrl=Utils.buildProductItemUrl(data);if(data.handle=="card-collection-gift-card"&&(productUrl="/products/gift-card"),data.handle=="card-collection-canamo"&&(productUrl="/pages/ca\xF1amo-industrial"),data.handle=="card-collection-fairtrade"&&(productUrl="/pages/comercio-justo"),data.handle=="card-collection-netplus"&&(productUrl="/collections/netplus"),data.handle=="card-collections-webspecials"&&(productUrl="/collections/web-specials"),data.handle=="card-test"&&(productUrl="/pages/centro-de-ayuda"),data.handle=="card-collection-garantia-de-hierro"&&(productUrl="/pages/garantia-de-hierro"),data.handle=="card-collection-snow"&&(productUrl="/pages/snow"),data.handle=="card-collection-better-than-new"&&(productUrl="/products/better-than-new"),data.handle=="card-collection-better-than-new"&&(productUrl="/products/better-than-new"),data.handle=="card-collection-netplus-dos"&&(productUrl="https://youtu.be/4LHMZmtpZdg",jQ(document).ready(function(){jQ('[href="https://youtu.be/4LHMZmtpZdg"]').attr("target","_blank")})),data.handle=="card-collection-yulex"&&(productUrl="https://youtu.be/_6WVtLdXqDk",jQ(document).ready(function(){jQ('[href="https://youtu.be/_6WVtLdXqDk"]').attr("target","_blank")})),data.handle=="card-collections-sale"&&(productUrl="/collections/sale"),data.handle=="card-collections-ddp"&&(productUrl="/collections/dia-del-padre"),data.handle=="card-collections-ddp20off"&&(productUrl="/collections/regalos-con-descuentos"),data.handle=="card-collections-ddp-cuotas"&&(productUrl="/collections/dia-del-padre"),data.handle=="card-collection-pfas"&&(productUrl="/pages/libre-de-pfc"),data.handle=="card-collection-h2no"&&(productUrl="/pages/norma-de-desempeno-h2no"),data.handle=="card-collection-snow-mujer"&&(productUrl="/collections/ski-snow-mujer"),data.handle=="card-collection-snow-hombre"&&(productUrl="/collections/ski-snow-hombre"),data.handle=="card-collection-equipamento-snow"&&(productUrl="/collections/equipamiento-ski-y-snow"),data.handle=="card-sale-0326"&&(productUrl="/collections/sale"),data.handle=="card-nt0925-equipamiento"&&(productUrl="/collections/nueva-temporada-mochilas-y-equipamiento"),data.handle=="card-nt0925-kids"&&(productUrl="/collections/nueva-temporada-ninos-y-bebes"),data.handle=="card-nt0925-hombre"&&(productUrl="/collections/nueva-temporada-hombre"),data.handle=="card-nt0925-mujer"&&(productUrl="/collections/nueva-temporada-mujer"),data.handle=="card-collection-gg25-el"&&(productUrl="/collections/regalos-para-el"),data.handle=="card-collection-gg25-ella"&&(productUrl="/collections/regalos-para-ella"),data.handle=="card-collection-gg25-kids"&&(productUrl="/collections/regalos-para-ninos-y-bebes"),data.handle=="card-collection-gg25-todos"&&(productUrl="/collections/regalos-para-todos"),data.handle=="card-collection-gg25-menos-de"&&(productUrl="/collections/a-menos-de-99500"),itemHtml=itemHtml.replace(/{{itemUrl}}/g,productUrl),itemHtml=itemHtml.replace(/{{firstVariant}}/g,data.variants[0].id),tags.indexOf("NonProductCard")==-1){let atcBlock=`
Agregar ahora
`;const activeSwatch=$(itemHtml).find("[js-swatch-img].active").data("value");data.options.length>1?(atcBlock+="
    ",data.options_with_values.forEach(option=>{option.name.includes("color")||option.values.forEach(value=>{const variantTitle=`${activeSwatch} / ${value.title}`,currentVariant=data.variants.find(item=>item.title.includes(variantTitle));atcBlock+=`
  • ${value.title}
  • `})}),atcBlock+="
",itemHtml=itemHtml.replace(/{{itemAtcBlock}}/g,atcBlock)):(atcBlock+="",itemHtml=itemHtml.replace(/{{itemAtcBlock}}/g,atcBlock))}else itemHtml=itemHtml.replace(/{{itemAtcBlock}}/g,"");return itemHtml},ProductListItem.prototype.compileTemplate=function(data){data||(data=this.data),data=prepareShopifyData(data);var itemHtml=boostPFSTemplate.productListItemHtml,soldOutClass=soldOut?boostPFSTemplate.soldOutClass:"",saleClass=onSale?boostPFSTemplate.saleClass:"";itemHtml=itemHtml.replace(/{{soldOutClass}}/g,soldOutClass),itemHtml=itemHtml.replace(/{{saleClass}}/g,saleClass),itemHtml=itemHtml.replace(/{{itemLabels}}/g,buildLabels(data,data.variants[0].id)),itemHtml=itemHtml.replace(/{{itemTagLabels}}/g,buildTagLabels(data,!1)),itemHtml=itemHtml.replace(/{{itemImages}}/g,buildImages(data)),(typeof Integration>"u"||typeof Integration<"u"&&typeof Integration.hascompileTemplate=="function"&&!Integration.hascompileTemplate("reviews"))&&(itemHtml=itemHtml.replace(/{{itemReviews}}/g,buildReview(data))),itemHtml=itemHtml.replace(/{{itemVendor}}/g,buildVendor(data));var itemPriceHtml=buildPrice(data,onSale,priceVaries);itemHtml=itemHtml.replace(/{{itemPrice}}/g,itemPriceHtml);var itemDescription=jQ("

"+data.body_html+"

").text();return itemDescription=itemDescription.split(" ").length>35?itemDescription.split(" ").splice(0,35).join(" ")+"...":itemDescription.split(" ").splice(0,35).join(" "),itemHtml=itemHtml.replace(/{{itemDescription}}/g,itemDescription),itemHtml=itemHtml.replace(/{{itemActiveSwapClass}}/g,buildActiveSwapClass(data)),itemHtml=itemHtml.replace(/{{itemColorSwatches}}/g,buildProductOptionSwatches(data,boostPFSFilterConfig.boostProductOptionSwatch.color.swatchName,boostPFSFilterConfig.boostProductOptionSwatch.color.optionName,boostPFSFilterConfig.boostProductOptionSwatch.color.swatchDisplay,boostPFSFilterConfig.boostProductOptionSwatch.color.swatchType)),itemHtml=itemHtml.replace(/{{itemSizeSwatches}}/g,buildProductOptionSwatches(data,boostPFSFilterConfig.boostProductOptionSwatch.size.swatchName,boostPFSFilterConfig.boostProductOptionSwatch.size.optionName,boostPFSFilterConfig.boostProductOptionSwatch.size.swatchDisplay,boostPFSFilterConfig.boostProductOptionSwatch.size.swatchType)),itemHtml=itemHtml.replace(/{{itemTitle}}/g,data.title),itemHtml=itemHtml.replace(/{{itemVendorLabel}}/g,data.vendor),itemHtml=itemHtml.replace(/{{itemUrl}}/g,Utils.buildProductItemUrl(data)),itemHtml=itemHtml.replace(/{{itemId}}/g,data.id),itemHtml};function buildGridWidthClass(){var gridWidthClass="";switch(boostPFSThemeConfig.custom.products_per_row){case 2:gridWidthClass="boost-pfs-filter-grid-width-2";break;case 3:gridWidthClass="boost-pfs-filter-grid-width-3";break;case 5:gridWidthClass="boost-pfs-filter-grid-width-5";break;case 6:gridWidthClass="boost-pfs-filter-grid-width-6";break;default:gridWidthClass="boost-pfs-filter-grid-width-4";break}switch(boostPFSThemeConfig.custom.products_per_row_mobile){case 1:gridWidthClass+=" boost-pfs-filter-grid-width-mb-1";break;case 3:gridWidthClass+=" boost-pfs-filter-grid-width-mb-3";break;default:gridWidthClass+=" boost-pfs-filter-grid-width-mb-2";break}return gridWidthClass}function buildImages(data){var html="",aspectRatio="",rangeWidths=boostPFSRangeWidths,paddingTop=100,dataSrcSet="",dataWidths="",dataSizes="auto",imgAlt=data.title,flipImageSrcSet="",imgVariant=firstVariant,productImage=images.length>0?images[0]:{id:0,src:boostPFSConfig.general.no_image_url};if(boostPFSConfig.general.collection_handle==="web-specials"){for(var i=0;iimage.src===productImage);currentImage&&(productImage=currentImage)}var activeSwapImage=!Utils.isMobile()&&boostPFSThemeConfig.custom.hasOwnProperty("active_image_swap")&&boostPFSThemeConfig.custom.active_image_swap==!0,secondImage="";if(images.length>1){secondImage=images[0].src;var imageBack=images.find(image=>image.alt&&image.alt.toLowerCase().includes("back")&&image.alt.toLowerCase().includes(imgVariant.option_color.toLowerCase()));if(!imageBack&&productImage.alt){var secondAlt=productImage.alt.toLowerCase().replace("front","back");imageBack=images.find(image=>image.alt&&image.alt.toLowerCase()===secondAlt)}imageBack?secondImage=imageBack.src:secondImage=images[0].src}for(var i=0;i0?(aspectRatio=productImage.width/productImage.height,paddingTop=1/aspectRatio*100,productImage.alt&&(imgAlt=escape(productImage.alt))):paddingTop=100;var tags=data.tags.join(",");return html+='':html+='">',html+=`'+imgAlt+''+data.body_html+"":"",html+="",html}function buildVendor(data){var html="";return boostPFSThemeConfig.custom.hasOwnProperty("show_vendor")&&boostPFSThemeConfig.custom.show_vendor==!0&&(html=boostPFSTemplate.vendorHtml),html}function buildPrice(data){var html="";if(boostPFSThemeConfig.custom.hasOwnProperty("show_price")&&boostPFSThemeConfig.custom.show_price){html='

';var priceMin=firstVariant.price,comparePriceMin=firstVariant.compare_at_price,onSale2=comparePriceMin>priceMin,isWebSpecial=data.tags.some(t=>t.toLowerCase()==="web-specials"),variants=data.variants.filter(v=>v.available),saleVariant=variants.find(v=>parseFloat(v.compare_at_price)>parseFloat(v.price));if(boostPFSConfig.general.collection_handle==="web-specials"&&saleVariant)html+='salews '+Utils.formatMoney(parseFloat(saleVariant.price))+"",html+=""+Utils.formatMoney(parseFloat(saleVariant.compare_at_price))+" ";else if(onSale2)html+='saleinicial '+Utils.formatMoney(priceMin)+"",html+=""+Utils.formatMoney(comparePriceMin)+"";else if(priceVaries){var variantData=data.variants.filter(function(e){return e.compare_at_price==null}).sort(function(a,b){return a.price-b.price}),price=variantData[0]?variantData[0].price:variantData.price;price==data.price_max?html+='zzz '+Utils.formatMoney(price)+"":price==0?html+='vvv '+Utils.formatMoney(data.price_max)+"":html+='yyy '+Utils.formatMoney(data.price_max)+""}else html+='uuu '+Utils.formatMoney(priceMin)+"";html+="

"}return html}function buildLabels(data,selectedVariantId){let onlyWebLabel="",newColorLabel="",redesignedLabel="";data.metafields.map(metafield=>{metafield.namespace=="custom"&&metafield.value.replace(/\s+/g,"").toLowerCase()==="onlyweb"&&selectedVariantId==metafield.id&&(onlyWebLabel='Only Web')}),data.metafields.map(metafield=>{metafield.namespace=="custom"&&metafield.value=="Redesigned"&&selectedVariantId==metafield.id&&(redesignedLabel='Redesigned')});var soldOutLabel="";boostPFSThemeConfig.custom.hasOwnProperty("show_sold_out_label")&&boostPFSThemeConfig.custom.show_sold_out_label&&soldOut&&(soldOutLabel=boostPFSTemplate.soldOutLabelHtml.replace(/{{style}}/g,""));var webSpecialTag=!1;data.tags.forEach(tag=>{tag.toLowerCase()==="web-specials"&&(webSpecialTag=!0)});var firstVariantOnSale=firstVariant.compare_at_price>firstVariant.price;if(boostPFSConfig.general.collection_handle==="web-specials")for(var variants=data.variants,i=0;ivariant.price){firstVariantOnSale=!0;break}}var saleLabel="",salePercent="";!webSpecialTag&&firstVariantOnSale?boostPFSThemeConfig.custom.show_sale_label&&firstVariantOnSale&&!soldOut&&(boostPFSThemeConfig.custom.show_sale_percent&&(salePercent=Math.round((firstVariant.compare_at_price-firstVariant.price)*100/firstVariant.compare_at_price)),saleLabel=boostPFSTemplate.saleLabelHtml.replace(/{{style}}/g,""),saleLabel=boostPFSTemplate.saleLabelHtml.replace(/{{salePercent}}/g,salePercent+"% OFF")):webSpecialTag&&firstVariantOnSale&&(salePercent=Math.round((firstVariant.compare_at_price-firstVariant.price)*100/firstVariant.compare_at_price),saleLabel=''+salePercent+"% OFF");var NuevosTag=!1;data.tags.forEach(tag=>{tag==="Nuevos"&&(NuevosTag=!0)});var newLabel="",date1=new Date(data.published_at),date2=new Date,diffDataTime=date2.getTime()-date1.getTime(),diffDataDays=diffDataTime/(1e3*3600*24);diffDataDays=Math.round(diffDataDays);const isWithinDays=(metafields,daysLimit=60)=>{const startDateMeta=metafields.find(m=>m.key==="start_date_badge"&&m.id==selectedVariantId);if(!startDateMeta?.value?.trim())return!1;const startDate=new Date(startDateMeta.value);if(isNaN(startDate))return!1;const diffMs=new Date().getTime()-startDate.getTime(),diffDays=Math.round(diffMs/(1e3*60*60*24));return diffDays>=0&&diffDays<=daysLimit};return data.metafields.find(m=>m.namespace==="custom"&&m.key==="new_color"&&m.value?.trim().toLowerCase()==="new color"&&m.id==selectedVariantId)&&isWithinDays(data.metafields)?newColorLabel='New Color':newLabel=boostPFSTemplate.tagLabelHtml.replace(/{{labelTag}}/g,isWithinDays(data.metafields)&&!firstVariantOnSale?"Nuevo":"wsnew"),soldOutLabel+saleLabel+newLabel+onlyWebLabel+newColorLabel+redesignedLabel}function buildTagLabels(data,showall){if(boostPFSThemeConfig.custom.show_label_by_tag){if(showall){var tagLabel="";if(data.tags)for(var i=0;i=0;i--)if(tag=data.tags[i],tag.indexOf("pfs:label")!==-1){var preTagLabel=boostPFSTemplate.tagLabelHtml.replace(/{{labelTag}}/g,tag.split("pfs:label-")[1]);tagLabel+=preTagLabel;break}}}return tagLabel}else return""}function buildProductOptionSwatches(data,swatchName,optionName,swatchDisplay,swatchType){var swatchesProductOptionHtml="",filterSwatchTitle=swatchName,optionName=optionName,swatchArr=[],countSwatch=0,swatchValues=[],swatchLimit=9999999999,dataImgSize="360",bgSize="50x",dataImgSrc=Utils.getFeaturedImage(data.images_info,dataImgSize+"x"),swatchName="#ffffff",bgImageSrc="",viewMoreLabel="More "+filterSwatchTitle,swatchSettings=Settings.getSettingValue("swatch_settings"),newProduct=!1,newLabel="",date1=new Date(data.published_at),date2=new Date,diffDataTime=date2.getTime()-date1.getTime(),diffDataDays=diffDataTime/(1e3*3600*24);diffDataDays=Math.round(diffDataDays);function productIsWithinDays(dateValue,days=60){if(!dateValue)return!1;const startDate=new Date(dateValue),diffMs=new Date().getTime()-startDate.getTime(),diffDays=Math.floor(diffMs/(1e3*60*60*24));return diffDays>=0&&diffDays<=days}if(data.metafields&&data.metafields.length)for(var i=0;i=768,DESKTOP_SWATCH_LIMIT=5,MOBILE_SWATCH_LIMIT=4,CURRENT_SWATCH_LIMIT=isDesktop?DESKTOP_SWATCH_LIMIT:MOBILE_SWATCH_LIMIT,hiddenSwatchCount=0,variantData=data.variants.filter(function(e){return e.compare_at_price==null});if(variantData=variantData.sort(function(a,b){return a.price-b.price}),swatchDisplay&&typeof data.options_with_values<"u"&&data.options_with_values.length>0&&(swatchArr=data.options_with_values.filter(function(option){return option.name==optionName}),swatchArr.length>0)){countSwatch=swatchArr[0].values.length,swatchLimit>countSwatch&&(swatchLimit=countSwatch),swatchValues=swatchArr[0].values,swatchesProductOptionHtml+='
    ';for(var sIndex=0;sIndex=CURRENT_SWATCH_LIMIT,swatchVariant=data.variants[sIndex],sImageIndex=swatchValues[sIndex].image||"";if(sImageIndex!=""&&(dataImgSrc=Utils.optimizeImage(data.images[sImageIndex],dataImgSize+"x")+" "+dataImgSize+"w"),swatchType)switch(swatchType){case"swatch_color_display_type_image_color":bgImageSrc=boostPFSAppConfig.general.file_url.replace(/\?/,Utils.slugify(filterSwatchTitle).replace(/\-/g,"_")+"-"+Utils.slugify(swatchName)+".png?v="),bgImageSrc="";break;case"swatch_color_display_type_image_product":bgImageSrc=Utils.getFeaturedImage(data.images_info,bgSize),sImageIndex!=""&&(bgImageSrc=Utils.optimizeImage(data.images[sImageIndex],bgSize));break;default:bgImageSrc=""}var priceMin="",comparedPriceMin="",webSpecialTag=!1,onSale2=!1;data.tags.forEach(tag=>{tag.toLowerCase()==="web-specials"&&(webSpecialTag=!0)});var activeClass=count==0?"active":"",is_available=!1;let variant2=data.variants.find(variant3=>variant3.available&&variant3.title.toLowerCase().includes(swatchName.toLowerCase())),availVrs=data.variants.find(variant3=>variant3.available);var onlyWebLabel="",newColorLabel="",redesignedLabel="",variantIDMetaOnlyWeb=0,variantIDMetaNewColor=0;data.metafields.map(metafield=>{metafield.namespace=="custom"&&metafield.value=="'Redesigned'"&&(redesignedLabel='Only Web')}),variant2&&(data.metafields.map(metafield=>{metafield.namespace=="custom"&&metafield.value.replace(/\s+/g,"").toLowerCase()==="onlyweb"&&variant2.id==metafield.id&&(variantIDMetaOnlyWeb=metafield.id,onlyWebLabel='Only Web')}),data.metafields.map(metafield=>{metafield.namespace=="custom"&&metafield.value=="New Color"&&variant2.id==metafield.id&&(variantIDMetaNewColor=metafield.id,newColorLabel='New Color')})),variant2&&(priceMin=variant2.price,comparedPriceMin=variant2.compare_at_price,onSale2=comparedPriceMin>priceMin,is_available=variant2.available);var imageFront=images.find(image=>image.alt&&image.alt.toLowerCase().includes("front")&&image.alt.toLowerCase().includes(swatchName.toLowerCase()));imageFront&&(dataImgSrc=Utils.optimizeImage(imageFront.src,dataImgSize+"x")+" "+dataImgSize+"w");var dataBackImgSrc="",imageBack=images.find(image=>image?.alt&&image?.alt.toLowerCase().includes("back")&&image?.alt.toLowerCase().includes(swatchName.toLowerCase()));if(imageBack&&(dataBackImgSrc=Utils.optimizeImage(imageBack.src,dataImgSize+"x")+" "+dataImgSize+"w"),swatchSettings){var swatchKeys=Object.keys(swatchSettings),swatchSetting="";if(Array.isArray(swatchKeys)&&swatchKeys.length>0){var swatchSettingKey=swatchKeys.find(key=>swatchName.toLowerCase()===key.toLowerCase());swatchSetting=swatchSettings[swatchSettingKey]}}if(swatchSetting)switch(swatchSetting.type){case FilterOptionItemSwatch.SwatchType.ONE_COLOR:swatchSetting.colorCodes.length>0&&swatchSetting.colorCodes[0]&&(swatchName=swatchSetting.colorCodes[0],bgImageSrc="");break;case FilterOptionItemSwatch.SwatchType.IMAGE:swatchSetting.imageUrl&&(bgImageSrc=swatchSetting.imageUrl);break}var nosalePrice=variantData[0]?variantData[0].price:firstVariant.price;if(webSpecialTag&&boostPFSConfig.general.collection_handle==="web-specials"||boostPFSConfig.general.collection_handle==="mujeres-web-specials"||boostPFSConfig.general.collection_handle==="hombres-web-specials"||boostPFSConfig.general.collection_handle==="ninos-bebes-web-specials"||boostPFSConfig.general.collection_handle==="regalos-con-descuentos"||boostPFSConfig.general.collection_handle==="sale"||boostPFSConfig.general.collection_handle==="sale-mujeres"||boostPFSConfig.general.collection_handle==="sale-hombres"||boostPFSConfig.general.collection_handle==="sale-ninos-bebes"||boostPFSConfig.general.collection_handle==="sale-bolsos-accesorios"||boostPFSConfig.general.collection_handle==="sale-50off"||boostPFSConfig.general.collection_handle==="sale-40off"||boostPFSConfig.general.collection_handle==="sale-35off"||boostPFSConfig.general.collection_handle==="sale-30off"||boostPFSConfig.general.collection_handle==="sale-25off"||boostPFSConfig.general.collection_handle==="sale-mujer-25off"||boostPFSConfig.general.collection_handle==="sale-mujer-30off"||boostPFSConfig.general.collection_handle==="sale-mujer-35off"||boostPFSConfig.general.collection_handle==="sale-mujer-40off"||boostPFSConfig.general.collection_handle==="sale-mujer-50off"||boostPFSConfig.general.collection_handle==="sale-hombre-25off"||boostPFSConfig.general.collection_handle==="sale-hombre-30off"||boostPFSConfig.general.collection_handle==="sale-hombre-35off"||boostPFSConfig.general.collection_handle==="sale-hombre-40off"||boostPFSConfig.general.collection_handle==="sale-hombre-50off"||boostPFSConfig.general.collection_handle==="sale-ninos-bebes-25off"||boostPFSConfig.general.collection_handle==="sale-ninos-bebes-30off"||boostPFSConfig.general.collection_handle==="sale-ninos-bebes-35off"||boostPFSConfig.general.collection_handle==="sale-ninos-bebes-40off"||boostPFSConfig.general.collection_handle==="sale-ninos-bebes-50off"||boostPFSConfig.general.collection_handle==="mas-elegidos")is_available&&(swatchesProductOptionHtml+=`
  • `,optionName=="color"||optionName=="colour"?(swatchesProductOptionHtml+='
    '+swatchName+"
    ",swatchesProductOptionHtml+=''+swatchName+"",swatchesProductOptionHtml+="
  • ",hideSwatch&&hiddenSwatchCount++,count++);else if(boostPFSConfig.general.collection_handle!=="web-specials"&&is_available){let available_onlyweb=!1,available_newcolor=!1,is_redesigned=!1;onlyWebLabel!=""||variantIDMetaOnlyWeb==variant2.id?available_onlyweb=!0:available_onlyweb=!1,(newColorLabel!=""||variantIDMetaNewColor==variant2.id)&&(available_newcolor=!0),redesignedLabel!=""&&(is_redesigned=!0),swatchesProductOptionHtml+=`
  • `,optionName=="color"||optionName=="colour"?(swatchesProductOptionHtml+='
    '+swatchName+"
    ",swatchesProductOptionHtml+=`'+swatchName+"",swatchesProductOptionHtml+="
  • ",hideSwatch&&hiddenSwatchCount++,count++}}colorCount=count,hiddenSwatchCount>0&&(swatchesProductOptionHtml+=`
  • +${hiddenSwatchCount}

  • `),swatchesProductOptionHtml+="
"}return swatchesProductOptionHtml}jQ(document).on("click",".swatch-more-trigger",function(){const $swatchList=jQ(this).closest(".boost-pfs-filter-item-swatch");if(!$swatchList.length)return;const $product=$swatchList.closest(".boost-pfs-filter-product-item");if(!$product.length)return;const $firstSwatch=$swatchList.find("li span[js-swatch-img]").first();if(!$firstSwatch.length)return;const variantId=$firstSwatch.data("variant-id");let href=$product.find(".boost-pfs-filter-product-item-image-link").attr("href");href&&(href=href.split("?")[0],window.location.href=`${href}?variant=${variantId}`)});function eventColorSwatches(event,data){jQ(".boost-pfs-filter-item-swatch li span").each(function(){var img=jQ(this).parents(".boost-pfs-filter-product-item-inner").find(".boost-pfs-filter-product-item-main-image"),imgSec=jQ(this).parents(".boost-pfs-filter-product-item-inner").find(".boost-pfs-filter-product-item-flip-image"),labels=jQ(this).parents(".boost-pfs-filter-product-item-inner").find(".boost-pfs-filter-product-item-label"),link=jQ(this).parents(".boost-pfs-filter-product-item-inner").find(".boost-pfs-filter-product-item-image-link"),currentHref=link.attr("href"),labelsInit=labels.html();event=="hover"&&jQ(this).on("hover",function(){jQ(this).closest(".boost-pfs-filter-item-swatch ").find("li span").removeClass("active"),jQ(this).addClass("active");var newImage=jQ(this).data("img");img.attr("srcset",newImage)}),event=="click"&&jQ(this).on("click",function(){jQ(this).closest(".boost-pfs-filter-item-swatch ").find("li span").removeClass("active");var variantId=jQ(this).data("variant-id");link.attr("href",currentHref+"?variant="+variantId);var newImage=jQ(this).data("img"),newBackImage=jQ(this).data("back-img");img.attr("srcset",newImage);const variantId1=jQ(this).data("variant-id"),selectedProduct1=data.products.find(item=>item.id===jQ(this).data("product-id"));if(!selectedProduct1)return;let newColorBadge=!1,newBadge=!1;const variantMetafields=selectedProduct1.metafields.filter(m=>Number(m.id)===Number(variantId1)),newColorField=variantMetafields.find(m=>m.key==="new_color"&&m.value?.trim().toLowerCase()==="new color"),startDateField=variantMetafields.find(m=>m.key==="start_date_badge"&&m.value?.trim()!=="");startDateField&&((metafieldval,daysLimit=60)=>{const startDate=new Date(metafieldval),diffMs=new Date().getTime()-startDate.getTime(),diffDays=Math.round(diffMs/(1e3*60*60*24));return diffDays>=0&&diffDays<=daysLimit})(startDateField.value)&&(newBadge=!0,newColorField&&(newColorBadge=!0)),newBackImage?imgSec.attr("srcset",newBackImage):imgSec.attr("srcset",newImage),jQ(this).addClass("active");var onSale2=jQ(this).data("on-sale"),prodPriceVaries=jQ(this).data("price-varies"),webBadge=jQ(this).data("web"),newProduct=jQ(this).data("new"),priceMin=parseFloat(jQ(this).data("price")),onlyweb=jQ(this).data("only-web"),newColor=jQ(this).data("new-color"),redesignedLabel=jQ(this).data("redesigned"),comparedPriceMin=parseFloat(jQ(this).data("compared-price"));if(webBadge&&onSale2){var discount=Math.round((comparedPriceMin-priceMin)*100/comparedPriceMin),badgeHtml=''+discount+"% OFF";labels.html(badgeHtml)}else if(onSale2&&onlyweb){var discount=Math.round((comparedPriceMin-priceMin)*100/comparedPriceMin),badgeHtml=''+discount+"% OFF";badgeHtml+='Only Web',labels.html(badgeHtml)}else if(onSale2){var discount=Math.round((comparedPriceMin-priceMin)*100/comparedPriceMin),badgeHtml=''+discount+"% OFF";labels.html(badgeHtml)}else if(!onSale2&&newProduct&&newBadge&&!newColorBadge){var newLabel=boostPFSTemplate.tagLabelHtml.replace(/{{labelTag}}/g,"Nuevo");labels.html(newLabel)}else if(webBadge&&newProduct){var newLabel=boostPFSTemplate.tagLabelHtml.replace(/{{labelTag}}/g,"");labels.html(newLabel)}else if(onlyweb){var newLabel='Only Web';labels.html(newLabel)}else if(redesignedLabel){var newLabel='Redesigned';labels.html(newLabel)}else labels.html("");if(newColorBadge){let currentHtml=labels.html()||"";if(!currentHtml.includes("New Color")){const onlywebClass=boostPFSConfig?.general?.collection_handle==="web-specials"?" onlyweb":"";labels.html(currentHtml+'New Color')}}if(onSale2){var html="",comparePrice=parseFloat(jQ(this).data("compared-price"));typeof comparePrice=="number"&&(html+='saleckick '+Utils.formatMoney(priceMin)+"",html+=""+Utils.formatMoney(comparePrice)+"",jQ(this).parents(".boost-pfs-filter-product-item-image").find(".boost-pfs-filter-product-item-price").html(html))}else if(prodPriceVaries){var rawPriceMax=parseFloat(jQ(this).data("price-max")),rawPriceMin=parseFloat(jQ(this).data("price-min-nosale")),html="";rawPriceMin<=rawPriceMax?html='aaa '+Utils.formatMoney(priceMin)+"":(html='bbb '+Utils.formatMoney(rawPriceMin)+"",html+=' - ccc '+Utils.formatMoney(rawPriceMax)+""),jQ(this).parents(".boost-pfs-filter-product-item-image").find(".boost-pfs-filter-product-item-price").html(html)}else{var html="";html+=''+Utils.formatMoney(priceMin)+"",jQ(this).parents(".boost-pfs-filter-product-item-image").find(".boost-pfs-filter-product-item-price").html(html)}const activeValue=$(this).data("value"),productId=$(this).data("product-id"),variantItems=$(this).parents(".boost-pfs-filter-product-item").find("[js-variant-item]"),selectedProduct=data.products.find(item=>item.id===productId),outOfStockVariant=selectedProduct.variants.filter(item=>!item.available&&item.title.includes(activeValue)),selectedVariantList=selectedProduct.variants.filter(item=>item.title.includes(activeValue));variantItems.removeClass("disabled"),variantItems.removeClass("hide"),outOfStockVariant.length&&variantItems.each((index,item)=>{const value=$(item).data("value"),variantTitle=`${activeValue} / ${value}`;outOfStockVariant.forEach(variant=>{variant.title.includes(variantTitle)&&$(item).addClass("disabled")}),selectedProduct.variants.find(item2=>item2.title.includes(variantTitle)&&item2.title.includes(activeValue))||$(item).addClass("hide")}),selectedVariantList.length!==variantItems.length&&variantItems.each((index,item)=>{const value=$(item).data("value"),variantTitle=`${activeValue} / ${value}`;selectedProduct.variants.find(item2=>item2.title.includes(variantTitle)&&item2.title.includes(activeValue))||$(item).addClass("hide")})}),jQ(this).focus(function(){if(jQ("body").hasClass("boost-pfs-ada")){var newImage=jQ(this).data("img");img.attr("srcset",newImage)}})})}function buildReview(data){var html="";return boostPFSThemeConfig.custom.hasOwnProperty("show_product_review")&&boostPFSThemeConfig.custom.show_product_review==!0&&(html=''),html}function buildActiveSwapClass(data){return!Utils.isMobile()&&boostPFSThemeConfig.custom.hasOwnProperty("active_image_swap")&&boostPFSThemeConfig.custom.active_image_swap==!0?"has-bc-swap-image":""}ProductPaginationDefault.prototype.compileTemplate=function(totalProduct){totalProduct||(totalProduct=this.totalProduct);var currentPage=parseInt(Globals.queryParams.page),totalPage=Math.ceil(totalProduct/Globals.queryParams.limit);if(totalPage<=1)return"";var paginationHtml=boostPFSTemplate.paginateHtml,previousHtml=currentPage>1?boostPFSTemplate.previousActiveHtml:boostPFSTemplate.previousDisabledHtml;previousHtml=previousHtml.replace(/{{itemUrl}}/g,Utils.buildToolbarLink("page",currentPage,currentPage-1)),paginationHtml=paginationHtml.replace(/{{previous}}/g,previousHtml);var nextHtml=currentPagecurrentPage-3&&iBefore>0;iBefore--)beforeCurrentPageArr.unshift(iBefore);currentPage-4>0&&beforeCurrentPageArr.unshift("..."),currentPage-4>=0&&beforeCurrentPageArr.unshift(1),beforeCurrentPageArr.push(currentPage);for(var afterCurrentPageArr=[],iAfter=currentPage+1;iAfter'+sortingArr2[k]+""}html=boostPFSTemplate.sortingHtml.replace(/{{sortingItems}}/g,sortingItemsHtml)}}return html},ProductSorting.prototype.render=function(){jQ(Selector.topSorting).html(this.compileTemplate()),jQ(".boost-pfs-filter-custom-sorting").hasClass("boost-pfs-filter-sort-active")&&jQ(".boost-pfs-filter-custom-sorting").toggleClass("boost-pfs-filter-sort-active");var labelSort="",paramSort=Globals.queryParams.sort||"",sortingList=Utils.getSortingList();paramSort.length>0&&sortingList&&sortingList[paramSort]?labelSort=sortingList[paramSort]:labelSort=Labels.sorting_heading,jQ(".boost-pfs-filter-custom-sorting button span span").text(labelSort)},ProductSorting.prototype.bindEvents=function(){var _this=this;jQ(".boost-pfs-filter-filter-dropdown a").click(function(e){e.preventDefault(),FilterApi.setParam("sort",jQ(this).data("sort")),FilterApi.setParam("page",1),FilterApi.applyFilter("sort")}),jQ(".boost-pfs-filter-custom-sorting > button").click(function(){jQ(".boost-pfs-filter-filter-dropdown").toggle().parent().toggleClass("boost-pfs-filter-sort-active")}),jQ(Selector.filterTreeMobileButton).click(function(){jQ(".boost-pfs-filter-top-sorting-mobile .boost-pfs-filter-filter-dropdown").hide()}),jQ(document).on("click",function(e){jQ(e.target).parents(".boost-pfs-filter-top-sorting").find(".boost-pfs-filter-filter-dropdown").length===0&&jQ(".boost-pfs-filter-filter-dropdown").hide().parent().removeClass("boost-pfs-filter-sort-active")})},ProductDisplayType.prototype.compileTemplate=function(){var itemHtml=""+boostPFSThemeConfig.label.toolbar_viewas+"";return boostPFSThemeConfig.custom.product_item_type=="grid"?boostPFSThemeConfig.custom.view_as_type=="view_as_type_list_grid_multi_col"&&!Utils.isMobile()?(itemHtml+='',itemHtml+='',itemHtml+='',itemHtml+='',itemHtml+='',itemHtml+=''):(itemHtml+='',itemHtml+=''):boostPFSThemeConfig.custom.view_as_type=="view_as_type_list_grid_multi_col"&&!Utils.isMobile()?(itemHtml+='',itemHtml+='',itemHtml+='',itemHtml+='',itemHtml+='',itemHtml+=''):(itemHtml+='',itemHtml+=''),itemHtml=itemHtml.replace(/{{class.productDisplayType}}/g,Class.productDisplayType),itemHtml};var originalRenderProductDisplayType=ProductDisplayType.prototype.render;ProductDisplayType.prototype.render=function(){if(originalRenderProductDisplayType.call(this),this.$element.length){if(this.$element.find(this.selector.productDisplayTypeList).removeClass("active"),this.$element.find(this.selector.productDisplayTypeGrid).removeClass("active"),Globals.queryParams.display=="list")this.$element.find(this.selector.productDisplayTypeList).addClass("active");else if(Globals.queryParams.display=="grid")if(boostPFSThemeConfig.custom.view_as_type=="view_as_type_list_grid_multi_col"&&!Utils.isMobile()){var curentGridColumn=boostPFSThemeConfig.custom.products_per_row;this.$element.find(this.selector.productDisplayTypeGrid).each(function(){var $parent=jQ(this).parent(),$cssNames=jQ(".boost-pfs-filter-top-display-type").attr("class").split(" "),$activeClass=$cssNames[$cssNames.length-1],indexCurrentColumn=$activeClass.split("-")[$activeClass.split("-").length-1];$parent.hasClass("boost-pfs-filter-view-as-click")&&jQ(this).data("view")==$activeClass?(jQ(this).addClass("active"),jQ(".boost-pfs-filter-product-item").removeClass(function(index,css){return(css.match(/(^|\s)boost-pfs-filter-grid-width-\S+/g)||[]).join(" ")}).addClass("boost-pfs-filter-grid-width-"+indexCurrentColumn)):!$parent.hasClass("boost-pfs-filter-view-as-click")&&jQ(this).data("view").split("-")[1]==curentGridColumn&&jQ(this).addClass("active")})}else this.$element.find(this.selector.productDisplayTypeGrid).addClass("active")}},ProductLimit.prototype.compileTemplate=function(){var html="";if(boostPFSThemeConfig.custom.show_limit&&boostPFSTemplate.hasOwnProperty("showLimitHtml")){var numberList=Settings.getSettingValue("general.showLimitList");if(numberList!=""){var showLimitItemsHtml="",arr=numberList.split(",");for(var k in sortingArr)showLimitItemsHtml+='";html=boostPFSTemplate.showLimitHtml.replace(/{{showLimitItems}}/g,showLimitItemsHtml)}}return html},Breadcrumb.prototype.compileTemplate=function(colData){colData||(colData=this.collectionData);var breadcrumbItemsHtml="";if(boostPFSTemplate.hasOwnProperty("breadcrumbHtml"))if(typeof colData<"u"&&colData.hasOwnProperty("collection")){var colInfo=colData.collection;typeof this.collectionTags<"u"&&this.collectionTags!==null?(breadcrumbItemsHtml+=boostPFSTemplate.breadcrumbItemLink.replace(/{{itemLink}}/g,"/collections/"+colInfo.handle).replace(/{{itemTitle}}/g,colInfo.title),breadcrumbItemsHtml+=" {{breadcrumbDivider}} ",breadcrumbItemsHtml+=boostPFSTemplate.breadcrumbItemSelected.replace(/{{itemTitle}}/g,this.collectionTags[0])):breadcrumbItemsHtml+=boostPFSTemplate.breadcrumbItemSelected.replace(/{{itemTitle}}/g,colInfo.title)}else breadcrumbItemsHtml+=boostPFSTemplate.breadcrumbItemSelected.replace(/{{itemTitle}}/g,Settings.getSettingValue("label.defaultCollectionHeader"));return breadcrumbItemsHtml};function customBuildProductImages(){$("[js-swatch-img].active").each((index,swatch)=>{const frontImage=$(swatch).data("img"),backImage=$(swatch).data("back-img"),parent=$(swatch).parents(".boost-pfs-filter-product-item-inner"),frontImageTag=parent.find(".boost-pfs-filter-product-item-main-image"),backImageTag=parent.find(".boost-pfs-filter-product-item-flip-image");frontImageTag.attr("src",frontImage),frontImageTag.attr("data-src",frontImage),frontImageTag.attr("data-srcset",frontImage),backImage?(backImageTag.attr("src",backImage),backImageTag.attr("data-src",backImage),backImageTag.attr("data-srcset",backImage)):(backImageTag.attr("src",frontImage),backImageTag.attr("data-src",frontImage),backImageTag.attr("data-srcset",frontImage))})}customBuildProductImages(),ProductList.prototype.afterRender=function(data){data||(data=this.data),this.buildExtrasProductListByAjax(data,"boost-product-description",function(results){results.forEach(function(result){var element=jQ('.boost-pfs-filter-product-item[data-id="'+result.id+'"]');element.find(".pfs-des-custom").html(result.product_description)})}),customBuildProductImages(),setTimeout(()=>{customBuildProductImages()},500),window.SPR&&typeof window.SPR.initDomEls=="function"&&typeof window.SPR.loadBadges=="function"&&boostPFSThemeConfig.custom.show_product_review&&(window.SPR.initDomEls(),window.SPR.loadBadges())},Filter.prototype.afterRender=function(data){data||(data=this.data);var totalProduct=data.total_product+" "+boostPFSThemeConfig.label.items_with_count_other+"";data.total_product==1&&(totalProduct=data.total_product+" "+boostPFSThemeConfig.label.items_with_count_one+""),jQ(".boost-pfs-filter-total-product").html(totalProduct),jQ("body").find(".boost-pfs-filter-skeleton-button").remove();var isiOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;if(isiOS&&Utils.isMobile()&&jQ(".boost-pfs-filter-product-item").find("a").on("touchstart",function(){isScrolling=!1}).on("touchmove",function(){isScrolling=!0}).on("touchend",function(){isScrolling||(window.location=jQ(this).attr("href"))}),swapImage(data),Globals.queryParams.display!=="list"&&equalHeight(data),jQ(window).resize(function(){Globals.queryParams.display!=="list"&&equalHeight(data)}),boostPFSThemeConfig.custom.swatch_color_event_change_image!="none"&&eventColorSwatches(boostPFSThemeConfig.custom.swatch_color_event_change_image,data),typeof boostRemoveImageLoadingAnimation=="function"&&boostRemoveImageLoadingAnimation(jQ(Selector.products).find("[data-boost-image-loading-animation]")),boostPFSThemeConfig.custom.hasOwnProperty("enable_filter_sticky")&&boostPFSThemeConfig.custom.enable_filter_sticky&&!Utils.isMobile()&&jQ(".boost-pfs-filter-left-col-inner").length>0){var stickyElemet=".boost-pfs-filter-left-col-inner",stickyElementParent=".boost-pfs-filter-left-col",startElement=".boost-pfs-filter-products";jQ(stickyElemet).stickTo(startElement,stickyElementParent)}stickyFilterMobile(),jQ(window).scroll(stickyFilterMobile),stickyFilterHorizontal(),jQ(window).scroll(stickyFilterHorizontal),boostPFSThemeConfig.custom.hasOwnProperty("layout_type")&&boostPFSThemeConfig.custom.layout_type=="fullwidth"&&!Utils.isMobile()&&jQ("body").addClass("boost-pfs-filter-fullwidth-page");const quickAtcBlock=$("[js-atc-block]"),variantItem=$("[js-variant-item]");$("[js-atc-btn]").click(function(){$(this).hasClass("has-multiple-variant")&&(quickAtcBlock.removeClass("active"),$(this).parent("[js-atc-block]").addClass("active"))}),variantItem.click(function(){const targetProduct=$(this).parents(".boost-pfs-filter-product-item"),productId=$(this).data("product-id"),value=$(this).data("value"),selectedProduct=data.products.find(item=>item.id===productId),selectedValue=targetProduct.find("[js-swatch-img].active").data("value"),selectedVariant=selectedProduct.variants.find(item=>item.title===`${selectedValue} / ${value}`);$.ajax({type:"POST",url:"/cart/add.js",data:{quantity:1,id:selectedVariant.id},dataType:"json",success:function(data2){jQuery.getJSON("/cart.js").done(function(items){$(".site-header__cart .counter").html(items.item_count)}),initProductModal(selectedProduct,selectedVariant,data2.price)}})});function initProductModal(product,variant,variantPrice){renderPopup(product,variant,variantPrice),$("[js-close-btn]").click(function(){$("[js-pdp-popup]").remove()});const loader=document.querySelector(".loader"),mainpdp=document.querySelector(".main-pdp-popup .popup");setTimeout(()=>{loader.style.display="none",mainpdp.style.opacity=1},2e3)}function renderPopup(product,variant,variantPrice){$("body").append(`
Loading ... Patagonia Loading Icon
`)}function renderOptions(product,variantTitle){let optionsEl="";const values=variantTitle.split("/");return product.options_with_values.forEach((option,index)=>{let rawValue=values[index],displayValue=rawValue;option.name?.toLowerCase()==="color"&&(displayValue=window.translateColor(rawValue)),optionsEl+=`

${option.name}: ${displayValue} |

`}),optionsEl}document.querySelectorAll(".boost-pfs-filter-product-item-grid").forEach(item=>{const saleEl=item.querySelector(".on-sale"),colorOption=item.querySelector("[js-upper]");colorOption&&(saleEl?saleEl.querySelector("span").click():colorOption.querySelector("span").click())})},jQ.fn.stickTo=function(startElement,stickyElementParent){var showingHeader=!1,headerHeight=0,headerSelector="",$window=jQ(window),$startElement=jQ(startElement),_this=this,lastScrollTop=window.pageYOffset||document.body.scrollTop,setPosition=function(){var width=jQ(stickyElementParent).outerWidth(),$windowHeight=$window.height(),$contentHeight=$startElement.outerHeight(!0),$contentTop=$startElement.offset().top,sidebarHeight=_this.outerHeight(),sidebarTop=_this.offset().top,sidebarBottom=sidebarTop+sidebarHeight,scrollTop=window.pageYOffset||document.body.scrollTop,scrollBottom=scrollTop+$windowHeight,isScrollingDown=scrollTop>lastScrollTop,endPos=$contentTop+$contentHeight;if(jQ(".site-header-wrapper .action-area").length>0?headerSelector=".site-header-wrapper .action-area":jQ(".site-header .nav-bar").length>0?headerSelector=".site-header .nav-bar":jQ(".site-header--fixed").length>0?headerSelector=".site-header--fixed":jQ(".header-wrapper--fixed").length>0&&(headerSelector=".header-wrapper--fixed"),headerSelector!=""&&(headerHeight=jQ(headerSelector).outerHeight()),document.addEventListener("scroll",function(){showingHeader=!1,(jQ(".js-sticky-action-bar").length>0||jQ(".site-header .sticky--open").length>0||jQ(".site-header--fixed"))&&(showingHeader=!0)}),sidebarHeight>$contentHeight){_this.removeClass("boost-pfs-filter-stick"),jQ("body").removeClass("boost-pfs-filter-stick-vertical-body"),_this.css({position:"initial"});return}if(scrollTop<=$contentTop){_this.removeClass("boost-pfs-filter-stick"),jQ("body").removeClass("boost-pfs-filter-stick-vertical-body"),_this.css({position:"initial",width:"100%"});return}if(scrollBottom>=endPos){var absolutePos=endPos-sidebarHeight-$contentTop;absolutePos>0&&(_this.removeClass("boost-pfs-filter-stick"),jQ("body").removeClass("boost-pfs-filter-stick-vertical-body"),_this.css({position:"absolute",top:absolutePos,bottom:"unset",width}));return}isScrollingDown?scrollBottom=sidebarBottom&&scrollTop>$contentTop&&(_this.addClass("boost-pfs-filter-stick"),jQ("body").addClass("boost-pfs-filter-stick-vertical-body"),_this.css({position:"fixed",top:showingHeader?headerHeight+"px":"20px",bottom:$windowHeight>sidebarHeight+headerHeight?"unset":0,width,left:"auto"})):scrollTop-headerHeight>sidebarTop?_this.css("position")!=="relative"&&(_this.removeClass("boost-pfs-filter-stick"),jQ("body").removeClass("boost-pfs-filter-stick-vertical-body"),_this.css({position:"relative",top:sidebarTop-$contentTop,bottom:"unset",width:"100%"})):scrollTop<=endPos-sidebarHeight&&(_this.addClass("boost-pfs-filter-stick"),jQ("body").addClass("boost-pfs-filter-stick-vertical-body"),_this.css({position:"fixed",top:showingHeader?headerHeight+"px":"20px",bottom:"unset",width,left:"auto"})),lastScrollTop=window.pageYOffset||document.body.scrollTop};jQ(window).resize(function(){setPosition()}),document.addEventListener("scroll",function(){setPosition()}),setPosition(),jQ(document).on("click",".boost-pfs-filter-button.boost-pfs-filter-option-title-heading",function(){setTimeout(setPosition,400)})};var original_onClickEventProductDisplayType=ProductDisplayType.prototype._onClickEvent;ProductDisplayType.prototype._onClickEvent=function(event){original_onClickEventProductDisplayType.call(this,event),boostPFSThemeConfig.custom.view_as_type=="view_as_type_list_grid_multi_col"&&!Utils.isMobile()&&(jQ(".boost-pfs-filter-top-display-type").addClass("boost-pfs-filter-view-as-click"),jQ(".boost-pfs-filter-top-display-type").removeClass(function(index,css){return(css.match(/(^|\s)grid-\S+/g)||[]).join(" ")}).addClass(jQ(event.target).data("view")))},ProductListPlaceholder.prototype.render=function(){var placeholderLimit=this.settings.productsPerRow||this.settings.placeholderProductPerRow,placeholderItem=this.compileTemplate();this.$element=[];for(var i=0;i0?imgRatioSetting:1.4;return template.replace(/{{class.filterProductSkeleton}}/g,Class.filterProductSkeleton).replace(/{{class.filterSkeleton}}/g,Class.filterSkeleton).replace(/{{class.filterSkeletonText}}/g,Class.filterSkeletonText).replace(/{{paddingTop}}/g,imgRatio*100)},Array.prototype.insert=function(a,b){};function equalHeight(data){var equal_i=-1,equal_els=[],equal_element=null;jQ(".boost-pfs-filter-product-item").each(function(i2,element){var offsetTop=jQ(element).offset().top;(!equal_element||equal_element.offset().top!==offsetTop)&&(equal_element=jQ(element),equal_i++),equal_els[equal_i]||(equal_els[equal_i]=[]),equal_els[equal_i].push(element)});for(var i=0;i',productItemSelector.find(".boost-pfs-filter-product-item-image-link").append(html))})}}function boostRemoveImageLoadingAnimation($selector){$selector.length&&$selector.removeAttr("data-boost-image-loading-animation")}jQ(document).ready(function(){jQ(".boost-pfs-filter-custom-filter-button").on("click",function(){jQ("body").toggleClass("boost-pfs-filter-custom-drawer-open")}),jQ(".boost-pfs-filter-custom-drawer-close").on("click",function(){jQ("body").removeClass("boost-pfs-filter-custom-drawer-open")}),jQ(".boost-pfs-filter-custom-drawer-overlay").on("click",function(){jQ("body").removeClass("boost-pfs-filter-custom-drawer-open")})});function stickyFilterMobile(){var windowTop=window.pageYOffset||document.body.scrollTop,heightFooter=0,divTop=0,divHeight=0;jQ("#shopify-section-footer").length>0&&(heightFooter=jQ("#shopify-section-footer").height()),jQ(".boost-pfs-filter-wrapper").length>0&&(divTop=jQ(".boost-pfs-filter-wrapper").offset().top),jQ(".boost-pfs-filter-wrapper").length>0&&(divHeight=jQ(".boost-pfs-filter-wrapper").height()),windowTop>divTop+divHeight-heightFooter?jQ("body").removeClass("boost-pfs-mobile-stick"):windowTop>divTop?jQ("body").addClass("boost-pfs-mobile-stick"):jQ("body").removeClass("boost-pfs-mobile-stick")}function stickyFilterHorizontal(){if(jQ(".boost-pfs-filter-tree-h-sticky-filter").length>0&&!Utils.isMobile()){var windowTop=window.pageYOffset||document.body.scrollTop,divTop=0;jQ(".boost-pfs-filter-wrapper").length>0&&(divTop=jQ(".boost-pfs-filter-wrapper").offset().top),windowTop>divTop?jQ("body").addClass("boost-pfs-filter-horizontal-sticky-body"):jQ("body").removeClass("boost-pfs-filter-horizontal-sticky-body")}}FilterApi.beforeCall=function(eventType,eventInfo){Utils.isSearchPage()&&(Globals.queryParams.q=(Globals.queryParams.q||"").replace(/'/g,"'").replace(/&/g,"").replace(/*/gi,"").replace(/-/g," "))}})(),window.onload=function(){document.querySelectorAll(".boost-pfs-filter-product-item-inner").forEach(ele=>{let swatchElement=ele.querySelectorAll("[js-lower]");swatchElement&&swatchElement.length&&swatchElement.forEach((el,index)=>{index==0&&el.querySelector("span").click()});let swatchElementUpper=ele.querySelectorAll("[js-upper]");if(swatchElementUpper&&swatchElementUpper.length){const saleEl=ele.querySelector(".on-sale");swatchElementUpper.forEach((el,index)=>{index==0&&(saleEl?saleEl.querySelector("span").click():el.querySelector("span").click())})}})}; //# sourceMappingURL=/cdn/shop/t/90/assets/boost-pfs-filter.js.map?v=23741653749602116051775057682