1import{Component}from"@theme/component";class CfNewsletterForm extends Component{async handleSubmit(event){event.preventDefault();const email=this.refs.emailInput?.value.trim();if(!email)return;const listId=this.dataset.listId||"MQLkqr",companyId=this.dataset.companyId||"JXsSet";this.refs.submitButton&&(this.refs.submitButton.disabled=!0),this.refs.errorMessage&&(this.refs.errorMessage.hidden=!0);const payload={data:{type:"subscription",attributes:{profile:{data:{type:"profile",attributes:{email}}}},relationships:{list:{data:{type:"list",id:listId}}}}};try{const response=await fetch(`https://a.klaviyo.com/client/subscriptions/?company_id=${companyId}`,{method:"POST",headers:{"Content-Type":"application/json",revision:"2025-04-15"},body:JSON.stringify(payload)});if(response.status!==202){const body=await response.text().catch(()=>"");throw new Error(`Klaviyo ${response.status}: ${body}`)}this.refs.emailInput&&(this.refs.emailInput.value=""),this.refs.successMessage&&(this.refs.successMessage.hidden=!1),this.refs.consentDefault&&(this.refs.consentDefault.hidden=!0)}catch(error){console.error("Newsletter subscription error:",error),this.refs.errorMessage&&(this.refs.errorMessage.hidden=!1)}finally{this.refs.submitButton&&(this.refs.submitButton.disabled=!1)}}}customElements.define("cf-newsletter-form",CfNewsletterForm); 2//# sourceMappingURL=/cdn/shop/t/253/assets/cf-newsletter.js.map?v=18408867485136991531790681804
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.