PageSourceSearch

https://nobullproject.com/cdn/shop/t/1087/assets/quick-add.js?v=167493836933754669491788294735

js nobullproject.com collected 2026-09-24 17:19:36 UTC 6,564 bytes, 2 lines download raw bytes

1customElements.get("quick-add-modal")||customElements.define("quick-add-modal",class extends ModalDialog{constructor(){super(),this.modalContent=this.querySelector('[id^="QuickAddInfo-"]'),this.productCache=new Map,this.cart=document.querySelector("cart-notification")||document.querySelector("cart-drawer"),this.addEventListener("product-info:loaded",({target})=>{target.addPreProcessCallback(this.preprocessHTML.bind(this))}),this.elementSection=this.getAttribute("data-element"),this.productTitle=this.getAttribute("data-product-title"),this.productTitleVariant=this.getAttribute("data-label"),this.buttonATC=this.modalContent.querySelector(".product-main-atc.product-form__submit")}hide(preventFocus=!1){const cartNotification=document.querySelector("cart-notification")||document.querySelector("cart-drawer");cartNotification&&cartNotification.setActiveElement(this.openedBy),this.modalContent.innerHTML="",preventFocus&&(this.openedBy=null),super.hide()}show(opener){opener.setAttribute("aria-disabled",!0),opener.classList.add("loading"),opener.querySelector(".loading__spinner").classList.remove("hidden");const productUrl=opener.getAttribute("data-product-url"),fetchUrl=productUrl.includes("?")?`${productUrl}&view=basic`:`${productUrl}?view=basic`;this.fetchAndRenderProduct(fetchUrl).then(()=>{super.show(opener),window.requestIdleCallback?requestIdleCallback(()=>this.prefetchColorVariants()):setTimeout(()=>this.prefetchColorVariants(),100)}).finally(()=>{opener.removeAttribute("aria-disabled"),opener.classList.remove("loading"),opener.querySelector(".loading__spinner").classList.add("hidden")})}prefetchColorVariants(){this.modalContent.querySelectorAll(".product-variant-picker-color a[href]").forEach(link=>{const baseUrl=link.getAttribute("href");if(!baseUrl)return;const url=baseUrl.includes("?")?`${baseUrl}&view=basic`:`${baseUrl}?view=basic`;this.productCache.has(url)||fetch(url).then(response=>response.text()).then(html=>{this.productCache.set(url,html)}).catch(error=>{console.error(`Error prefetching ${url}:`,error)})})}fetchAndRenderProduct(productUrl){if(this.productCache.has(productUrl)){const cachedHTML=this.productCache.get(productUrl);return this.renderProduct(cachedHTML),Promise.resolve()}return fetch(productUrl).then(response=>response.text()).then(html=>{this.productCache.set(productUrl,html),this.renderProduct(html)})}renderProduct(html){const productElement=new DOMParser().parseFromString(html,"text/html").querySelector("product-info");this.preprocessHTML(productElement),this.removeScripts(productElement),HTMLUpdateUtility.setInnerHTML(this.modalContent,productElement.outerHTML),this.initColorVariantHandler(),this.buttonATC=this.modalContent.querySelector(".product-main-atc.product-form__submit"),this.buttonATC&&(this.buttonATC.setAttribute("data-category","pdp-module"),this.buttonATC.setAttribute("data-product-title",this.productTitle),this.buttonATC.setAttribute("data-label",this.productTitleVariant),this.buttonATC.setAttribute("data-element",this.elementSection)),window.Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),window.ProductModel&&window.ProductModel.loadShopifyXR()}initColorVariantHandler(){const colorPicker=this.modalContent.querySelector(".product-variant-picker-color");colorPicker&&colorPicker.addEventListener("click",event=>{const anchor=event.target.closest("a[href]");if(!anchor)return;event.preventDefault(),event.stopPropagation();const baseUrl=anchor.getAttribute("href");if(!baseUrl)return;const newProductUrl=baseUrl.includes("?")?`${baseUrl}&view=basic`:`${baseUrl}?view=basic`;colorPicker.querySelectorAll("a").forEach(a=>a.classList.remove("active")),anchor.classList.add("active"),this.productCache.has(newProductUrl)?this.renderProduct(this.productCache.get(newProductUrl)):(this.modalContent.style.opacity="0.5",this.modalContent.style.pointerEvents="none",this.fetchAndRenderProduct(newProductUrl).finally(()=>{this.modalContent.style.opacity="1",this.modalContent.style.pointerEvents="auto"}))})}removeScripts(productElement){productElement.querySelectorAll("script").forEach(script=>{const content=script.textContent?.trim()||"";script.type==="application/json"||content.startsWith("{")||content.startsWith("[")||script.remove()})}preprocessHTML(productElement){productElement.classList.forEach(classApplied=>{(classApplied.startsWith("color-")||classApplied==="gradient")&&this.modalContent.classList.add(classApplied)}),this.preventDuplicatedIDs(productElement),this.removeDOMElements(productElement),this.removeGalleryListSemantic(productElement),this.updateImageSizes(productElement),this.preventVariantURLSwitching(productElement)}preventVariantURLSwitching(productElement){productElement.setAttribute("data-update-url","false")}removeDOMElements(productElement){const pickupAvailability=productElement.querySelector("pickup-availability");pickupAvailability&&pickupAvailability.remove();const productModal=productElement.querySelector("product-modal");productModal&&productModal.remove();const modalDialog=productElement.querySelectorAll("modal-dialog");modalDialog&&modalDialog.forEach(modal=>modal.remove())}preventDuplicatedIDs(productElement){const sectionId=productElement.dataset.section,oldId=sectionId,newId=`quickadd-${sectionId}`;productElement.innerHTML=productElement.innerHTML.replaceAll(oldId,newId),Array.from(productElement.attributes).forEac
1h(attribute=>{attribute.value.includes(oldId)&&productElement.setAttribute(attribute.name,attribute.value.replace(oldId,newId))}),productElement.dataset.originalSection=sectionId}removeGalleryListSemantic(productElement){const galleryList=productElement.querySelector('[id^="Slider-Gallery"]');galleryList&&(galleryList.setAttribute("role","presentation"),galleryList.querySelectorAll('[id^="Slide-"]').forEach(li=>li.setAttribute("role","presentation")))}updateImageSizes(productElement){const product=productElement.querySelector(".product");if(!product?.classList.contains("product--columns"))return;const mediaImages=product.querySelectorAll(".product__media img");if(!mediaImages.length)return;let mediaImageSizes="(min-width: 1000px) 715px, (min-width: 750px) calc((100vw - 11.5rem) / 2), calc(100vw - 4rem)";product.classList.contains("product--medium")?mediaImageSizes=mediaImageSizes.replace("715px","605px"):product.classList.contains("product--small")&&(mediaImageSizes=mediaImageSizes.replace("715px","495px")),mediaImages.forEach(img=>img.setAttribute("sizes",mediaImageSizes))}});
2//# sourceMappingURL=/cdn/shop/t/1087/assets/quick-add.js.map?v=167493836933754669491788294735

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.