import{preloadImage}from"@theme/utilities";const cache={},shopName=window.Shopify.shop,shopPlaceholderSeed=shopName.split("-").reduce((acc,char)=>acc+char.charCodeAt(0),0),counters={product:0,general:shopPlaceholderSeed%Theme.placeholders.general.length};if(window.Shopify.visualPreviewMode||window.Shopify.designMode){const placeholderUrls=Object.values(Theme.placeholders).flat();for(const url of placeholderUrls)preloadImage(url)}class PlaceholderImage extends HTMLElement{connectedCallback(){if(this.hasChildNodes())return;const type=this.dataset.type,blockId=this.dataset.blockId;if(!type||!(type in counters)||!blockId)return;const cached=cache[blockId];if(cached!=null&&Theme.placeholders[type][cached]){const image2=Theme.placeholders[type][cached],imageElement2=document.createElement("img");imageElement2.src=image2,imageElement2.alt=Theme.translations.placeholder_image||"Placeholder Image",this.appendChild(imageElement2);return}const counter=counters[type]||0;counters[type]=(counter+1)%Theme.placeholders[type].length;const image=Theme.placeholders[type][counter];if(!image)return;const imageElement=document.createElement("img");imageElement.src=image,imageElement.alt=Theme.translations.placeholder_image||"Placeholder Image",this.appendChild(imageElement),cache[blockId]=counter}}customElements.get("placeholder-image")||customElements.define("placeholder-image",PlaceholderImage);
//# sourceMappingURL=/s/files/1/0677/1399/0759/t/1/assets/placeholder-image.js.map?v=1783128590
