https://icesports.at/cdn/shop/t/4/assets/pickup-availability.min.js?v=169151666184030599811779479475
1if (!customElements.get('pickup-availability')) { 2 customElements.define('pickup-availability', class PickupAvailability extends HTMLElement { 3 constructor() { 4 super(); 5 6 if (!this.hasAttribute('available')) return; 7 8 //this.errorHtml = this.querySelector('template').content.firstElementChild.cloneNode(true); 9 this.onClickRefreshList = this.onClickRefreshList.bind(this); 10 this.fetchAvailability(this.dataset.variantId); 11 12 } 13 14 fetchAvailability(variantId) { 15 let rootUrl = this.dataset.rootUrl; 16 if (!rootUrl.endsWith("/")) { 17 rootUrl = rootUrl + "/"; 18 } 19 const variantSectionUrl = `${rootUrl}variants/${variantId}/?section_id=pickup-availability`; 20 21 fetch(variantSectionUrl) 22 .then(response => response.text()) 23 .then(text => { 24 const sectionInnerHTML = new DOMParser() 25 .parseFromString(text, 'text/html') 26 .querySelector('.shopify-section'); 27 this.renderPreview(sectionInnerHTML); 28 29 }) 30 .catch(e => { 31 const button = this.querySelector('button'); 32 if (button) button.removeEventListener('click', this.onClickRefreshList); 33 this.renderError(); 34 }); 35 } 36 37 onClickRefreshList(evt) { 38 this.fetchAvailability(this.dataset.variantId); 39 } 40 41 renderError() { 42 this.innerHTML = ''; 43 //this.appendChild(this.errorHtml); 44 45 this.querySelector('button').addEventListener('click', this.onClickRefreshList); 46 } 47 48 renderPreview(sectionInnerHTML) { 49 const drawer = document.querySelector('.pickup-availability-drawer'); 50 if (drawer) drawer.remove(); 51 if (!sectionInnerHTML.querySelector('.pickup-availability-information')) { 52 this.innerHTML = ""; 53 this.removeAttribute('available'); 54 return; 55 } 56 57 this.innerHTML = sectionInnerHTML.querySelector('.pickup-availability-information').innerHTML; 58 this.setAttribute('available', ''); 59 60 document.getElementById('Pickup-Availability').innerHTML = sectionInnerHTML.querySelector('.side-availability').innerHTML; 61 62 const button = this.querySelector('button'); 63 if (button) button.addEventListener('click', (evt) => { 64 document.getElementById('Pickup-Availability').classList.toggle("active"); 65 document.getElementsByTagName("body")[0].classList.toggle('open-cc'); 66 67 evt.preventDefault(); 68 }); 69 } 70 }); 71}
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.