1if(typeof CartCompatibility!="function"){class CartCompatibility2 extends HTMLElement{constructor(){super(),this.init()}init(){const cartItems=document.querySelectorAll("[data-js-cart-item]"),incompatableNoteWrapper=document.querySelector("[data-checkout-compatability]"),incompatableNote=document.querySelector("[data-checkout-compatability] [data-cart-note]"),items={},pickup_array=[];for(let i=0;i<cartItems.length;i++){const item=cartItems[i],variantId=item.dataset.productId;items[variantId]={product:item.dataset.title,shippable:!1,pickup:[]},item.dataset.shippable&&(items[variantId].shippable=!0),item.dataset.shippable&&pickup_array.push(item.dataset.productId);const pickup_items=item.dataset.storeAvailability.split(",");for(let i2=0;i2<pickup_items.length;i2++){const element=pickup_items[i2];items[variantId].pickup.push(element)}}function findCommonPickupValues(objects,propertyName){const objectKeys=Object.keys(objects),firstObjectKey=objectKeys[0];if(!firstObjectKey||!propertyName)return;const firstArray=objects[firstObjectKey][propertyName],locationValues2=[];for(let i=0;i<firstArray.length;i++){const currentValue=firstArray[i];let isCommonValue=!0;for(let j=1;j<objectKeys.length;j++){const currentObjectKey=objectKeys[j];if(!objects[currentObjectKey][propertyName].includes(currentValue)){isCommonValue=!1;break}}isCommonValue&&locationValues2.push(currentValue)}return locationValues2}const locationValues=findCommonPickupValues(items,"pickup");if(!locationValues)return;let shippingNote="";if(pickup_array.length==cartItems.length&&(shippingNote=' <span class="font-bold">shipping</span> or'),incompatableNoteWrapper.classList.remove("hidden"),console.log(incompatableNoteWrapper),locationValues.length>0)incompatableNote.innerHTML=` 2 The items in your cart are${shippingNote?"":" only"} available for${shippingNote} <span class="font-bold">pick up</span> at the following location${locationValues.length>1?"s":""}: 3 <ul class="list-disc ml-4 mt-2"> 4 ${locationValues.map(location=>`<li>${location}</li>`).join("")} 5 </ul> 6 `,this.toggleCheckoutButtons(!1);else{let products=[];Object.keys(items).forEach(key=>{products.push(items[key])}),this.querySelector("svg path").style.fill="red",this.querySelector(".cart-compatibility-inner").style.borderColor="red",incompatableNote.innerHTML=` 7 Unable to checkout. The items in your cart are not compatible with each other. 8 <br><br> 9 Make sure all items in your cart are available for pickup at the same location and/or shippable. 10 <br><br> 11 Pickup locations by product: 12 <ul class="list-disc ml-4 mt-2"> 13 ${products.map(item=>`<li class="mb-2"> 14 <b>${item.product.slice(0,15)}...</b> - ${item.pickup.map(pickup=>`${pickup}`).join(", ")} 15 </li>`).join("")} 16 </ul> 17 `,this.toggleCheckoutButtons()}}toggleCheckoutButtons(hidden=!0){const AjaxCartSubtotal=this.closest("#AjaxCartSubtotal");console.log(AjaxCartSubtotal,AjaxCartSubtotal.querySelector(".cart__details")),hidden?AjaxCartSubtotal.querySelector(".cart__details").classList.add("hidden"):AjaxCartSubtotal.querySelector(".cart__details").classList.remove("hidden")}}typeof customElements.get("cart-compatibility")>"u"&&customElements.define("cart-compatibility",CartCompatibility2)} 18//# sourceMappingURL=/cdn/shop/t/7/assets/cart-compatibility-checker.js.map?v=130980850632029235451699550164
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.