https://www.ghostlifestyle.com/cdn/shop/t/1423/assets/sms-footer.js?v=162339187575870403231790020572
1if(!customElements.get("sms-footer")){class SmsFooter extends HTMLElement{constructor(){super()}connectedCallback(){this.formatNumber(),this.querySelector("form").addEventListener("submit",e=>{if(e.preventDefault(),this.terms=this.querySelector("[name=accept_terms]").checked,this.phone=this.querySelector("[name=phone_number]")?.value,this.customer=this.querySelector("[name=customer_id]")?.value,this.email=this.querySelector("[name=customer_email]")?.value,!this.phone)return;const termsCheckbox=this.querySelector("[name=accept_terms]");if(!this.terms){const error="You must agree to the above terms";this.querySelector("[data-errors]").textContent=error,termsCheckbox.setAttribute("aria-invalid","true"),termsCheckbox.focus();return}termsCheckbox.removeAttribute("aria-invalid"),this.querySelector("[data-errors]").textContent="",this.postForm()})}formatNumber(){const phoneInput=this.querySelector("[name=phone_number]");phoneInput.addEventListener("keyup",function(){let phoneNumber=phoneInput.value,val=phoneNumber.split("-").join("");if(val.length<9){let finalVal=val.match(/.{1,3}/g).join("-");phoneInput.value=finalVal}var cleaned=(""+phoneNumber).replace(/\D/g,""),match=cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);if(match){var intlCode=match[1]?"+1 ":"";phoneInput.value=[intlCode,"(",match[2],") ",match[3],"-",match[4]].join("")}return null})}postForm=async()=>{const data={phone_number:this.phone,keyword:"WEBFOOTER",shopify_customer_id:this.customer,email:this.email};await fetch("https://ghost.sparkyapps.dev/postscript/subscribe",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(data)}).then(res=>{if(res.ok)this.innerHTML='<div class="block text-lg text-accent1 mt-6" role="status">Success, Legend! Check your messages for a confirmation text from us.</div>';else if(res.status=="409")this.querySelector("[data-errors]").textContent="Subscriber already exists with this phone number";else return})}}customElements.define("sms-footer",SmsFooter)} 2//# sourceMappingURL=/cdn/shop/t/1423/assets/sms-footer.js.map?v=162339187575870403231790020572
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.