PageSourceSearch

https://tobermorydistillery.com/cdn/shop/t/55/assets/back-in-stock.js?v=147046150397459351771758798171

js tobermorydistillery.com collected 2026-10-02 11:08:22 UTC 2,113 bytes, 2 lines download raw bytes

1class BackInStock extends HTMLElement{constructor(){super(),this.form=this.querySelector("form"),this.addSubmitListener()}addSubmitListener(){this.form.addEventListener("submit",event=>{event.preventDefault(),this.input=this.querySelector(".js-input-email"),this.email=this.input.value,this.variant=this.input.dataset.variant,this.email?this.submit():this.displayErrorMessage("email")})}submit(){const payload={data:{type:"back-in-stock-subscription",attributes:{profile:{data:{type:"profile",attributes:{email:this.email}}},channels:["EMAIL"]},relationships:{variant:{data:{type:"catalog-variant",id:"$shopify:::$default:::"+this.variant}}}}};this.postRequest("back-in-stock-subscriptions",payload).then(()=>this.submitSubscription()).then(()=>this.displayMessage()).catch(error=>this.handleError(error))}postRequest(type,payload){const url=`https://a.klaviyo.com/client/${type}/?company_id=${window.apps.klaviyo_id}`,requestOptions={method:"POST",headers:{"Content-Type":"application/json",revision:"2024-07-15"},body:JSON.str
1ingify(payload)};return fetch(url,requestOptions)}submitSubscription(){const input=this.querySelector(".js-input-consent"),payload={data:{type:"subscription",attributes:{profile:{data:{type:"profile",attributes:{email:this.email}}}},relationships:{list:{data:{type:"list",id:`${window.apps.klaviyo_list_id}`}}}}};input.checked?this.postRequest("subscriptions",payload):Promise.resolve()}displayMessage(){const element=this.querySelector(".back-in-stock__success");element&&element.classList.add("back-in-stock__success--active"),this.removeErrorMessages()}displayErrorMessage(type){const modifier=type==="email"?"--email":"",element=this.querySelector(".back-in-stock__error"+modifier);element&&element.classList.add("back-in-stock__error--active")}handleError(error){this.displayErrorMessage()}removeErrorMessages(){this.querySelectorAll(".back-in-stock__error").forEach(error=>error.classList.remove("back-in-stock__error--active"))}}customElements.define("back-in-stock",BackInStock);
2//# sourceMappingURL=/cdn/shop/t/55/assets/back-in-stock.js.map?v=147046150397459351771758798171

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.