1import{Component}from"@theme/component";import{ThemeEvents}from"@theme/events";class FindInStoreComponent extends Component{requiredRefs=["pureirlButton"];#pureirlPollId=null;connectedCallback(){super.connectedCallback();const target=this.closest('[id*="ProductInformation-"], [id*="QuickAdd-"]');target&&(target.addEventListener(ThemeEvents.variantUpdate,this.updateSku),this.#waitForPureIRLReady())}disconnectedCallback(){super.disconnectedCallback(),this.#clearPureirlPoll();const target=this.closest('[id*="ProductInformation-"], [id*="QuickAdd-"]');target&&target.removeEventListener(ThemeEvents.variantUpdate,this.updateSku)}updateSku=event=>{event.detail.data.newProduct&&(this.dataset.productId=event.detail.data.newProduct.id),!(event.target instanceof HTMLElement&&event.target.dataset.productId!==this.dataset.productId)&&event.detail.resource&&(this.refs.pureirlButton.dataset.pureirlSku=event.detail.resource.barcode||"",window.PureIRL&&window.PureIRL.STATUS===2&&(window.PureIRL._reset(),this.#waitForPureIRLReady()))};#clearPureirlPoll(){this.#pureirlPollId!=null&&(cancelAnimationFrame(this.#pureirlPollId),this.#pureirlPollId=null)}#waitForPureIRLReady(){this.#clearPureirlPoll(),this.#setLoading(!0);const startedAt=Date.now(),minDuration=200,deadline=startedAt+15e3,poll=()=>{const elapsed=Date.now()-startedAt;if(window.PureIRL?.STATUS===2&&elapsed>=minDuration||Date.now()>deadline){this.#setLoading(!1),this.#pureirlPollId=null;return}this.#pureirlPollId=requestAnimationFrame(poll)};this.#pureirlPollId=requestAnimationFrame(poll)}#setLoading(isLoading){const button=this.refs.pureirlButton;if(button){if(isLoading){this.dataset.state="loading",button.classList.add("is-loading"),button.setAttribute("aria-busy","true"),button.disabled=!0;return}this.dataset.state="ready",button.classList.remove("is-loading"),button.removeAttribute("aria-busy"),button.disabled=!1}}}customElements.get("find-in-store-component")||customElements.define("find-in-store-component",FindInStoreComponent); 2//# sourceMappingURL=/cdn/shop/t/196/assets/find-in-store.js.map?v=46461203737359181381784987630
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.