PageSourceSearch

https://www.skinnydiplondon.com/cdn/shop/t/914/assets/quick-buy-async.js?v=147688638623345597681787651064

js skinnydiplondon.com collected 2026-09-24 08:44:03 UTC 4,512 bytes, 2 lines download raw bytes

1const{getElements,parseInteger}=window.BAO.Utils;class QuickBuyAsync extends window.BAO.CustomElement(){static get observedAttributes(){return["section-id","url","loading","cache-key","cache-expiry"]}static get requiredAttributes(){return["section-id"]}setupListeners(){super.setupListeners(),this.listeners.add(document.documentElement,"click",this.handleClick.bind(this))}handleClick(event){if(this.triggerEl=event.target.closest('[data-quick-buy-async-external-el="button"]'),!this.triggerEl)return;this.triggerEl.closest(".kuQuickSearchResultsContainer")&&event.stopPropagation(),this.triggerEl.classList.add("btn-Button-loading");const buttonUrl=this.triggerEl.dataset.productUrl;this.setAttribute("url",buttonUrl),!this.useCache&&this.isLazy&&this.isIntersectionObserverSupported?(this.intersectionObserverCallback=this.intersectionObserverCallback.bind(this),this.observer.observe(this)):this.renderSection(),this.triggerEl.closest("section-async")?.url?.includes("nosto=")&&(document.body.dataset.nostoProductId=this.triggerEl.closest("section-async").dataset.productId,document.body.dataset.nostoElementId=this.triggerEl.closest(".nosto_element").id)}async renderSection(){this.isBusy=!0;const cachedHtml=this.cachedHtml,html=cachedHtml||await this.sectionRenderer.fetchSingle(this.sectionId,this.sectionUrl);this.sectionHTML=this.sectionRenderer.getInnerHtml(html),this.isBusy=!1,this.useCache&&!cachedHtml&&this.storeHtmlInCache(html);const variantDrawerSelector=document.querySelector(".qb-QuickBuy_FormButton"),drawerCloseIcon=document.querySelector(".qb-QuickBuy_Close"),drawerCloseOverlay=document.querySelector('[data-site-drawers-el="backdrop"]');variantDrawerSelector!==null&&(variantDrawerSelector.addEventListener("click",this.nostoTracking),drawerCloseIcon.addEventListener("click",()=>{variantDrawerSelector.removeEventListener("click",this.nostoTracking)}),drawerCloseOverlay.addEventListener("click",()=>{variantDrawerSelector.removeEventListener("click",this.nostoTracking)}));const modal=this.closest("quick-buy-modal");modal?.show&&modal.show(),window.BAO.dispatchEvent(window.BAO.EVENTS.OPEN_DRAWER,{key:"productQuickBuy"}),this.triggerEl.classList.remove("btn-Button-loading")}nostoTracking(){const nostoProductId=document.body.dataset.nostoProductId,nostoElementId=document.body.dataset.nostoElementId;nostoProductId&&(nostojs(api=>{api.recommendedProductAddedToCart(nostoProductId,nostoElementId)}),document.body.dataset.nostoProductId="",document.body.dataset.nostoElementId="")}removeParentElement(){(this.parentIdentifier?this.closest(this.parentIdentifier):this).remove()}intersectionObserverCallback(entries){entries?.[0]?.isIntersecting&&(this.renderSection(),this.observer.disconnect())}get observer(){return new IntersectionObserver(this.intersectionObserverCallback)}get sectionId(){return this.getAttribute("section-id")}set sectionHTML(html){if(!html){this.removeParentElement();return}this.innerHTML=html,this.enableDependantElements()}enableDependantElements(){getElements(`[data-await='${this.sectionId}']`).forEach(el=>el.disabled=!1)}storeHtmlInCache(html){const item={value:html,expiry:new Date().getTime()+this.cacheExpiryInMilliseconds};localStorage.setItem(this.cacheKey,JSON.stringify(item))}get sectionHTML(){return this.innerHTML}set isBusy(isBusy){this.setAttribute("aria-busy",String(isBusy))}get isBusy(){return this.getAttribute("aria-busy")==="true"}get sectionRenderer(){return window.BAO.sectionRenderer}get url(){return this.getAttribute("url")?.replace("[[query_parameters]]",window.location.search)}get parentIdentifier(){return this?.dataset?.parentIdentifier}get sectionUrl(){return this.url||`${window.location.pathname}${window.location.search}`}get isLazy(){return this.getAttribute("loading")==="lazy"}get useCache(){return this.hasAttribute("cache-key")}get cacheKey(){return this.getAttribute("cache-key")}get cacheExpiry(){return parseInteger(this.getAttribute("cache-expiry"))}get cacheExpiryInMilliseconds(){return this.cacheExpiry*36e5}get cachedHtml(){const itemString=localStorage.getItem(this.cacheKey);if(!itemString)return null;const item=JSON.parse(itemString);return new Date().getTime()>item.expiry?(localStorage.removeItem(this.cacheKey),null):item.value}get isIntersectionObserverSupported(){return"IntersectionObserver"in window}}customElements.get("quick-buy-async")||customElements.define("quick-buy-async",QuickBuyAsync);
2//# sourceMappingURL=/cdn/shop/t/914/assets/quick-buy-async.js.map?v=147688638623345597681787651064

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.