PageSourceSearch

https://polkapop.in/cdn/shop/t/9/compiled_assets/scripts.js?v=24803178623290755181791191573

js polkapop.in collected 2026-10-07 23:00:00 UTC 20,688 bytes, 2 lines download raw bytes

1(function(){var __sections__={};(function(){for(var i=0,s=document.getElementById("sections-script").getAttribute("data-sections").split(",");i<s.length;i++)__sections__[s[i]]=!0})(),(function(){if(__sections__["main-collection"])try{const url=new URL(window.location.href);url.hash&&document.addEventListener("DOMContentLoaded",()=>{const card=document.getElementById(url.hash.slice(1));card&&card.scrollIntoView({behavior:"instant"})},{once:!0})}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["polkapop-collection-page"]&&!Shopify.designMode))try{const cards=document.querySelectorAll(".ppcv2-product-card");cards.forEach(card=>{card.addEventListener("click",()=>{const wasActive=card.classList.contains("is-active");cards.forEach(c=>c.classList.remove("is-active")),wasActive||card.classList.add("is-active")}),card.addEventListener("keydown",event=>{event.key==="Escape"&&card.classList.remove("is-active")})}),document.addEventListener("click",event=>{event.target.closest(".ppcv2-product-card")||cards.forEach(c=>c.classList.remove("is-active"))}),document.querySelectorAll(".ppcv2-faq-question").forEach(button=>{button.addEventListener("click",()=>{const open=button.closest(".ppcv2-faq-item").classList.toggle("open");button.setAttribute("aria-expanded",String(open))})}
1),document.querySelectorAll(".ppcv2-slider").forEach(slider=>{const track=slider.querySelector(".ppcv2-slider-track"),slides=slider.querySelectorAll(".ppcv2-slide"),dots=slider.querySelectorAll(".ppcv2-slider-dot"),prevBtn=slider.querySelector(".ppcv2-slider-prev"),nextBtn=slider.querySelector(".ppcv2-slider-next"),total=slides.length;if(total<2)return;let current=0,autoplayTimer=null,paused=!1;const autoplay=slider.dataset.autoplay==="true",interval=parseInt(slider.dataset.interval,10)||5e3;function goTo(index,announce){current=(index%total+total)%total,track.style.transform="translateX(-"+current*100+"%)",slides.forEach((s,i)=>{s.classList.toggle("is-active",i===current);const link=s.querySelector(".ppcv2-slide-link");link&&(link.tabIndex=i===current?0:-1)}),dots.forEach((d,i)=>{d.classList.toggle("is-active",i===current),d.setAttribute("aria-selected",String(i===current))}),announce!==!1&&slider.setAttribute("aria-live",paused?"polite":"off")}function startAutoplay(){autoplay&&(stopAutoplay(),autoplayTimer=setInterval(()=>goTo(current+1),interval),slider.setAttribute("aria-live","off"))}function stopAutoplay(){autoplayTimer&&(clearInterval(autoplayTimer),autoplayTimer=null),slider.setAttribute("aria-live","polite")}prevBtn&&prevBtn.addEventListener("click",()=>{goTo(current-1),resetAutoplay()}),nextBtn&&nextBtn.addEventListener("click",()=>{goTo(current+1),resetAutoplay()}),dots.forEach(dot=>{dot.addEventListener("click",()=>{goTo(parseInt(dot.dataset.index,10)),resetAutoplay()})});function resetAutoplay(){autoplay&&!paused&&startAutoplay()}slider.addEventListener("mouseenter",()=>{paused=!0,stopAutoplay()}),slider.addEventListener("mouseleave",()=>{paused=!1,autoplay&&startAutoplay()}),slider.addEventListener("focusin",()=>{paused=!0,stopAutoplay()}),slider.addEventListener("focusout",e=>{slider.contains(e.relatedTarget)||(paused=!1,autoplay&&startAutoplay())}),slider.addEventListener("keydown",e=>{e.key==="ArrowLeft"?(goTo(current-1),resetAutoplay(),e.preventDefault()):e.key==="ArrowRight"&&(goTo(current+1),resetAutoplay(),e.preventDefault())});let touchStartX=0,touchStartY=0,touchDiffX=0,swiping=!1;slider.addEventListener("touchstart",e=>{touchStartX=e.touches[0].clientX,touchStartY=e.touches[0].clientY,swiping=!0},{passive:!0}),slider.addEventListener("touchmove",e=>{if(!swiping)return;if(touchDiffX=e.touches[0].clientX-touchStartX,Math.abs(e.touches[0].clientY-touchStartY)>Math.abs(touchDiffX)){swiping=!1;return}},{passive:!0}),slider.addEventListener("touchend",()=>{swiping&&(swiping=!1,Math.abs(touchDiffX)>40&&(goTo(current+(touchDiffX<0?1:-1)),resetAutoplay()),touchDiffX=0)}),autoplay&&startAutoplay(),slider.setAttribute("aria-live",autoplay?"off":"polite")})}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["polkapop-hero-slider"]&&!Shopify.designMode))try{document.querySelectorAll(".pp-hero-video").forEach(video=>{video.muted=!0,video.loop=!0,video.autoplay=!0,video.playsInline=!0,video.load();const play=()=>video.play().catch(()=>{});video.addEventListener("canplay",play,{once:!0}),play()})}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["polkapop-homepage"]&&!Shopify.designMode))try{(()=>{const heroVideo=document.querySelector(".pp-split-video-hero video");heroVideo&&(heroVideo.muted=!0,heroVideo.loop=!0,heroVideo.autoplay=!0,heroVideo.playsInline=!0,heroVideo.play().catch(()=>{}));const whyCards=Array.from(document.querySelectorAll(".why-card")),whyExperience=document.querySelector(".why-experience"),whyTag=document.querySelector("#whyTag"),whyTitle=document.querySelector("#whyTitle"),whyText=document.querySelector("#whyText"),whyBottle=document.querySelector("#whyBottle"),setWhyCard=card=>{whyCards.forEach(item=>item.classList.remove("is-active")),card.classList.add("is-active"),whyExperience?.style.setProperty("--why-soft",card.dataset.soft||"#efffd4"),whyExperience?.style.setProperty("--why-accent",card.dataset.accent||"#7dbf1d"),whyTag&&(whyTag.textContent=card.dataset.tag||""),whyTitle&&(whyTitle.textContent=card.dataset.title||""),whyText&&(whyText.textContent=card.dataset.text||"")};whyCards.forEach(card=>{card.addEventListener("click",()=>setWhyCard(card)),card.addEventListener("mouseenter",()=>setWhyCard(card))});const momentTabs=Array.from(document.querySelectorAll(".moment-tab")),momentCards=Array.from(document.querySelectorAll(".moment-card[data-moment]"));
1momentTabs.forEach(tab=>{tab.addEventListener("click",()=>{const filter=tab.dataset.momentFilter||"all";momentTabs.forEach(item=>item.classList.remove("is-active")),tab.classList.add("is-active"),momentCards.forEach(card=>{const isMatch=filter==="all"||card.dataset.moment===filter;card.classList.toggle("is-featured",filter!=="all"&&isMatch),card.classList.toggle("is-muted",!isMatch)})})});const whySimpleText=document.querySelector("#whySimpleText"),whySimpleButtons=Array.from(document.querySelectorAll(".why-simple button"));whySimpleButtons.forEach(button=>{button.addEventListener("click",()=>{whySimpleButtons.forEach(item=>item.classList.remove("is-active")),button.classList.add("is-active"),whySimpleText&&(whySimpleText.textContent=button.dataset.whySimple||"")})});const recipeLab=document.querySelector(".recipe-lab"),recipeOptions=Array.from(document.querySelectorAll("[data-recipe-option]")),recipeImage=document.querySelector("#recipeLabImage"),recipeTag=document.querySelector("#recipeLabTag"),recipeTitle=document.querySelector("#recipeLabTitle"),recipeDesc=document.querySelector("#recipeLabDesc"),recipeIngredients=document.querySelector("#recipeIngredients"),recipeSteps=document.querySelector("#recipeSteps"),recipeMore=document.querySelector("#recipeMore"),recipeRead=document.querySelector("[data-recipe-more]"),activateIngredientButtons=()=>{Array.from(recipeIngredients?.querySelectorAll("button")||[]).forEach(button=>{button.addEventListener("click",()=>{button.classList.toggle("is-active")})})},renderRecipeList=(target,items,itemTag)=>{target&&(target.innerHTML="",items.forEach(item=>{const element=document.createElement(itemTag);itemTag==="button"&&(element.type="button"),element.textContent=item,target.appendChild(element)}))},setRecipe=option=>{!recipeLab||!option||(recipeOptions.forEach(item=>{const isActive=item===option;item.classList.toggle("is-active",isActive),item.setAttribute("aria-selected",String(isActive))}),recipeLab.classList.add("is-changing"),recipeLab.style.setProperty("--recipe-soft",option.dataset.soft||"#efffd4"),recipeLab.style.setProperty("--recipe-accent",option.dataset.accent||"#7dbf1d"),window.setTimeout(()=>recipeLab.classList.remove("is-changing"),220),recipeImage&&(recipeImage.src=option.dataset.img||recipeImage.src,recipeImage.alt=option.dataset.alt||option.dataset.title||"Polka Pop recipe"),recipeTag&&(recipeTag.textContent=option.dataset.tag||""),recipeTitle&&(recipeTitle.textContent=option.dataset.title||""),recipeDesc&&(recipeDesc.textContent=option.dataset.desc||""),renderRecipeList(recipeIngredients,(option.dataset.ingredients||"").split("|").filter(Boolean),"button"),recipeIngredients?.querySelector("button")?.classList.add("is-active"),activateIngredientButtons(),renderRecipeList(recipeSteps,(option.dataset.steps||"").split("|").filter(Boolean),"li"),recipeMore&&(recipeMore.hidden=!0,recipeMore.textContent=option.dataset.detail||""),recipeRead&&(recipeRead.textContent="Read More",recipeRead.setAttribute("aria-expanded","false")))};let recipeIndex=Math.max(0,recipeOptions.findIndex(option=>option.classList.contains("is-active"))),recipeTimer=window.setInterval(()=>{recipeOptions.length&&(recipeIndex=(recipeIndex+1)%recipeOptions.length,setRecipe(recipeOptions[recipeIndex]))},2e3);recipeOptions.forEach((option,optionIndex)=>{option.addEventListener("click",()=>{recipeIndex=optionIndex,setRecipe(option),window.clearInterval(recipeTimer),recipeTimer=window.setInterval(()=>{recipeOptions.length&&(recipeIndex=(recipeIndex+1)%recipeOptions.length,setRecipe(recipeOptions[recipeIndex]))},2e3)})}),recipeRead?.addEventListener("click",()=>{if(!recipeMore)return;const shouldOpen=recipeMore.hidden;recipeMore.hidden=!shouldOpen,recipeRead.textContent=shouldOpen?"Show Less":"Read More",recipeRead.setAttribute("aria-expanded",String(shouldOpen))}),activateIngredientButtons()})()}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["polkapop-mobile-fix"]&&!Shopify.designMode))try{(()=>{const setup=()=>{if(!window.matchMedia("(max-width: 620px)").matches)return;
1Array.from(document.querySelectorAll(".product-grid")).forEach(grid=>{if(grid.dataset.manualSliderReady==="true")return;grid.dataset.manualSliderReady="true";const controls=document.createElement("div");controls.className="pp-slider-controls",controls.innerHTML='<button type="button" aria-label="Previous product">\u2039</button><span class="pp-slider-count">1 / '+grid.children.length+'</span><button type="button" aria-label="Next product">\u203A</button>',grid.parentElement.appendChild(controls);const count=controls.querySelector(".pp-slider-count"),cards=Array.from(grid.children),update=()=>{const index=Math.max(0,Math.min(cards.length-1,Math.round(grid.scrollLeft/Math.max(1,cards[0].offsetWidth+14))));count.textContent=index+1+" / "+cards.length};controls.querySelector("button").addEventListener("click",()=>grid.scrollBy({left:-(cards[0]?.offsetWidth||280)-14,behavior:"smooth"})),controls.querySelectorAll("button")[1].addEventListener("click",()=>grid.scrollBy({left:(cards[0]?.offsetWidth||280)+14,behavior:"smooth"})),grid.addEventListener("scroll",update,{passive:!0}),update()})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",setup):setup()})()}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["polkapop-prototype-base"]&&!Shopify.designMode))try{(()=>{const heroVideo=document.querySelector(".pp-split-video-hero video");heroVideo&&(heroVideo.muted=!0,heroVideo.loop=!0,heroVideo.autoplay=!0,heroVideo.playsInline=!0,heroVideo.play().catch(()=>{}));const whyCards=Array.from(document.querySelectorAll(".why-card")),whyExperience=document.querySelector(".why-experience"),setWhyCard=card=>{whyCards.forEach(item=>item.classList.remove("is-active")),card.classList.add("is-active"),whyExperience?.style.setProperty("--why-soft",card.dataset.soft||"#efffd4"),whyExperience?.style.setProperty("--why-accent",card.dataset.accent||"#7dbf1d")};whyCards.forEach(card=>{card.addEventListener("click",()=>setWhyCard(card)),card.addEventListener("mouseenter",()=>setWhyCard(card))});const momentTabs=Array.from(document.querySelectorAll(".moment-tab")),momentCards=Array.from(document.querySelectorAll(".moment-card[data-moment]"));momentTabs.forEach(tab=>{tab.addEventListener("click",()=>{const filter=tab.dataset.momentFilter||"all";momentTabs.forEach(item=>item.classList.remove("is-active")),tab.classList.add("is-active"),momentCards.forEach(card=>{const isMatch=filter==="all"||card.dataset.moment===filter;card.classList.toggle("is-featured",filter!=="all"&&isMatch),card.classList.toggle("is-muted",!isMatch)})})});const whySimpleText=document.querySelector("#whySimpleText"),whySimpleButtons=Array.from(document.querySelectorAll(".why-simple button"));whySimpleButtons.forEach(button=>{button.addEventListener("click",()=>{whySimpleButtons.forEach(item=>item.classList.remove("is-active")),button.classList.add("is-active"),whySimpleText&&(whySimpleText.textContent=button.dataset.whySimple||"")})});const recipeLab=document.querySelector(".recipe-lab"),recipeOptions=Array.from(document.querySelectorAll("[data-recipe-option]")),recipeImage=document.querySelector("#recipeLabImage"),recipeTag=document.querySelector("#recipeLabTag"),recipeTitle=document.querySelector("#recipeLabTitle"),recipeDesc=document.querySelector("#recipeLabDesc"),recipeIngredients=document.querySelector("#recipeIngredients"),recipeSteps=document.querySelector("#recipeSteps"),recipeMore=document.querySelector("#recipeMore"),recipeRead=document.querySelector("[data-recipe-more]"),activateIngredientButtons=()=>{Array.from(recipeIngredients?.querySelectorAll("button")||[]).forEach(button=>{button.addEventListener("click",()=>{button.classList.toggle("is-active")})})},renderRecipeList=(target,items,itemTag)=>{target&&(target.innerHTML="",items.forEach(item=>{const element=document.createElement(itemTag);itemTag==="button"&&(element.type="button"),element.textContent=item,target.appendChild(element)}))},setRecipe=option=>{!recipeLab||!option||(recipeOptions.forEach(item=>{const isActive=item===option;item.classList.toggle("is-active",isActive),item.setAttribute("aria-selected",String(isActive))}),recipeLab.classList.add("is-changing"),recipeLab.style.setProperty("--recipe
1-soft",option.dataset.soft||"#efffd4"),recipeLab.style.setProperty("--recipe-accent",option.dataset.accent||"#7dbf1d"),window.setTimeout(()=>recipeLab.classList.remove("is-changing"),220),recipeImage&&(recipeImage.src=option.dataset.img||recipeImage.src,recipeImage.alt=option.dataset.alt||option.dataset.title||"Polka Pop recipe"),recipeTag&&(recipeTag.textContent=option.dataset.tag||""),recipeTitle&&(recipeTitle.textContent=option.dataset.title||""),recipeDesc&&(recipeDesc.textContent=option.dataset.desc||""),renderRecipeList(recipeIngredients,(option.dataset.ingredients||"").split("|").filter(Boolean),"button"),recipeIngredients?.querySelector("button")?.classList.add("is-active"),activateIngredientButtons(),renderRecipeList(recipeSteps,(option.dataset.steps||"").split("|").filter(Boolean),"li"),recipeMore&&(recipeMore.hidden=!0,recipeMore.textContent=option.dataset.detail||""),recipeRead&&(recipeRead.textContent="Read More",recipeRead.setAttribute("aria-expanded","false")))};let recipeIndex=Math.max(0,recipeOptions.findIndex(option=>option.classList.contains("is-active")));const recipePrev=document.querySelector("[data-recipe-prev]"),recipeNext=document.querySelector("[data-recipe-next]");recipePrev&&recipePrev.addEventListener("click",()=>{recipeOptions.length&&(recipeIndex=(recipeIndex-1+recipeOptions.length)%recipeOptions.length,setRecipe(recipeOptions[recipeIndex]))}),recipeNext&&recipeNext.addEventListener("click",()=>{recipeOptions.length&&(recipeIndex=(recipeIndex+1)%recipeOptions.length,setRecipe(recipeOptions[recipeIndex]))}),recipeOptions.forEach((option,optionIndex)=>{option.addEventListener("click",()=>{recipeIndex=optionIndex,setRecipe(option)})}),recipeRead?.addEventListener("click",()=>{if(!recipeMore)return;const shouldOpen=recipeMore.hidden;recipeMore.hidden=!shouldOpen,recipeRead.textContent=shouldOpen?"Show Less":"Read More",recipeRead.setAttribute("aria-expanded",String(shouldOpen))}),activateIngredientButtons()})()}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["polkapop-prototype-shop"]&&!Shopify.designMode))try{(function(){function init(root){var viewport=root.querySelector(".pp-shop-viewport"),track=root.querySelector(".pp-shop-track"),prev=root.querySelector(".pp-shop-arrow.prev"),next=root.querySelector(".pp-shop-arrow.next"),dotsWrap=root.querySelector(".pp-shop-dots");if(!viewport||!track)return;var originals=Array.prototype.slice.call(track.children),total=originals.length;if(!total)return;var reduce=window.matchMedia("(prefers-reduced-motion: reduce)").matches,cloneCount=Math.min(3,total);originals.slice(0,cloneCount).forEach(function(card){var clone=card.cloneNode(!0);clone.setAttribute("aria-hidden","true"),clone.querySelectorAll("a, button").forEach(function(el){el.tabIndex=-1}),track.appendChild(clone)});var dots=originals.map(function(_,i){var b=document.createElement("button");return b.type="button",b.className="pp-shop-dot"+(i===0?" is-active":""),b.setAttribute("role","tab"),b.setAttribute("aria-label","Go to slide "+(i+1)),b.addEventListener("click",function(){stop(),index=i,render(!0),start()}),dotsWrap.appendChild(b),b}),index=0,timer=null,pointerStart=null;function stepSize(){var first=track.querySelector(".product-card");if(!first)return 0;var gap=parseFloat(getComputedStyle(track).gap)||0;return first.getBoundingClientRect().width+gap}function setDots(){var a=(index%total+total)%total;dots.forEach(function(d,i){d.classList.toggle("is-active",i===a)})}function render(animate){track.style.transition=animate&&!reduce?"transform .6s cubic-bezier(.22,.74,.25,1)":"none",track.style.transform="translate3d("+-index*stepSize()+"px,0,0)",setDots()}function move(dir){if(index+=dir,index<0){index=total-1,render(!1),requestAnimationFrame(function(){render(!0)});return}render(!0),index>=total&&window.setTimeout(function(){index=0,render(!1)},640)}function start(){reduce||document.hidden||(stop(),timer=window.setInterval(function(){move(1)},4500))}function stop(){window.clearInterval(timer),timer=null}prev&&prev.addEventListener("click",function(){stop(),move(-1),start()}),next&&next.addEventListener("click",function(){stop(),move(1),start()}),root.addEventListener("mouseenter",stop),root.addEventListener("mouseleave",start),viewport.addEventListener("pointerdown",function(e){pointerStart=e.clientX,stop()}),viewport.addEventListener("pointerup",function(e){if(pointerStart!==null){var d=e.clientX-pointerStart;Math.abs(d)>45&&move(d<0?1:-1)}pointerStart=null,start()}),viewport.addEventListener("pointercancel",function(){pointerStart=null,start()}),viewport.addEventListener("click",function(e){pointerStart!==null&&e.preventDefault()},!0),document.addEventListener("visibilitychange",function(){document.hidden?stop():start()}),window.addEventListener("resize",function(){render(!1)}),render(!1),start()}function boot(){document.querySelectorAll("[data-pp-shop-carousel]").forEach(init)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",boot):boot()})()}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["polkapop-recipes"]&&!Shopify.designMode))try{(()=>{const activateRecipe=choice=>{const sectionId=choice.dataset.section;
1choice.closest(".pp-recipe-menu")?.querySelectorAll(".pp-recipe-choice").forEach(item=>item.classList.remove("is-selected")),choice.classList.add("is-selected");const flavor=document.getElementById(`recipeFlavor-${sectionId}`),title=document.getElementById(`recipeTitle-${sectionId}`),desc=document.getElementById(`recipeDesc-${sectionId}`),img=document.getElementById(`recipeImg-${sectionId}`),steps=document.getElementById(`recipeSteps-${sectionId}`);flavor&&(flavor.textContent=choice.dataset.flavor||""),title&&(title.textContent=choice.dataset.title||""),desc&&(desc.textContent=choice.dataset.desc||""),img&&(img.src=choice.dataset.img||img.src,img.alt=choice.dataset.alt||""),steps&&(steps.innerHTML=(choice.dataset.steps||"").split("|").map(step=>`<span>${step}</span>`).join(""))};document.querySelectorAll(".pp-recipe-menu").forEach(group=>{const choices=[...group.querySelectorAll(".pp-recipe-choice")];if(!choices.length)return;let index=Math.max(0,choices.findIndex(choice=>choice.classList.contains("is-selected"))),timer=window.setInterval(()=>{index=(index+1)%choices.length,activateRecipe(choices[index])},2e3);choices.forEach((choice,choiceIndex)=>{choice.addEventListener("click",()=>{index=choiceIndex,activateRecipe(choice),window.clearInterval(timer),timer=window.setInterval(()=>{index=(index+1)%choices.length,activateRecipe(choices[index])},2e3)})})})})()}catch(e){console.error(e)}})()})();
2//# sourceMappingURL=/cdn/shop/t/9/compiled_assets/scripts.js.map?v=24803178623290755181791191573

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.