1class BundleCartItem extends HTMLElement{constructor(){super();try{this.components=JSON.parse(this.dataset.componentData),this.componentData=[],this.spinner=this.querySelector(".spinner")}catch(error){console.error("Error parsing component data",error)}}cacheExpirationTime=1e3*60*2;compressString(input){const dictionary={},data=(input+"").split(""),out=[];let currChar,phrase=data[0],code=256;for(let i=1;i<data.length;i++)currChar=data[i],dictionary[phrase+currChar]!=null?phrase+=currChar:(out.push(phrase.length>1?dictionary[phrase]:phrase.charCodeAt(0)),dictionary[phrase+currChar]=code,code++,phrase=currChar);out.push(phrase.length>1?dictionary[phrase]:phrase.charCodeAt(0));for(let i=0;i<out.length;i++)out[i]=String.fromCharCode(out[i]);return out.join("")}async fetchComponentData(){const variantIds=this.compressString(Object.keys(this.components).join(",")),country=window.Shopify.country,cacheKey=`wmxb_bcd_${encodeURIComponent(variantIds)}_${country}`,inProgressKey=`${cacheKey}_in_progress`,cachedData=sessionStorage.getItem(cacheKey),inProgress=window[inProgressKey];if(cachedData){this.componentData=JSON.parse(cachedData),this.renderComponentData();return}if(inProgress){await this.waitForCachedData(cacheKey,inProgressKey);return}window[inProgressKey]=!0;try{const data=await(await fetch(`/a/wmxb/bcd?c=${variantIds}&country=${country}`)).json();sessionStorage.setItem(cacheKey,JSON.stringify(data));const expiration=Date.now()+this.cacheExpirationTime;sessionStorage.setItem(`${cacheKey}_expiration`,expiration.toString()),this.componentData=data,this.renderComponentData()}catch(error){console.error("Error fetching bundle component data:",error)}finally{window[inProgressKey]=!1}}async waitForCachedData(cacheKey,inProgressKey,maxWaitTime=5e3,checkInterval=100){const startTime=Date.now();for(;Date.now()-startTime<maxWaitTime;){const cachedData=sessionStorage.getItem(cacheKey),stillInProgress=window[inProgressKey];if(cachedData){this.componentData=JSON.parse(cachedData),this.renderComponentData();return}if(!stillInProgress)break;await new Promise(resolve=>setTimeout(resolve,checkInterval))}try{const variantIds=this.compressString(Object.keys(this.components).join(",")),country=window.Shopify.country;window[inProgressKey]=!0;const data=await(await fetch(`/a/wmxb/bcd?c=${variantIds}&country=${country}`)).json();sessionStorage.setItem(cacheKey,JSON.stringify(data));const expiration=Date.now()+this.cacheExpirationTime;sessionStorage.setItem(`${cacheKey}_expiration`,expiration.toString()),this.componentData=data,this.renderComponentData()}catch(error){console.error("Error fetching bundle component data after waiting:",error)}finally{window[inProgressKey]=!1}}renderComponentData(){const container=document.createElement("div");container.classList.add("bundle-cart-item"),this.componentData.forEach(product=>{const productContainer=document.createElement("div");productContainer.classList.add("product-container");const componentTitle=document.createElement("span");componentTitle.style.fontSize="1.4rem",componentTitle.style.fontWeight="normal",componentTitle.classList.add("component-title");const optionsText=product.variants[0].selectedOptions.filter(option=>option.value!=="Default Title").map(option=>option.value).join(" / "),componentTitleText=`${product.title}${optionsText?` - ${optionsText}`:""}`;componentTitle.textContent=componentTitleText,productContainer.appendChild(componentTitle),container.appendChild(productContainer)}),this.appendChild(container),this.spinner.classList.add("hidden")}connectedCallback(){this.fetchComponentData()}}customElements.define("bundle-cart-item",BundleCartItem); 2//# sourceMappingURL=/cdn/shop/t/79/assets/bundle-cart-item.js.map?v=178527118337444827761790276138
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.