1var L=r=>{throw TypeError(r)};var b=(r,s,e)=>s.has(r)||L("Cannot "+e);var i=(r,s,e)=>(b(r,s,"read from private field"),e?e.call(r):s.get(r)),d=(r,s,e)=>s.has(r)?L("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,e);import{E as M,V as k}from"./index-20260917T125828-sh.js";import{FormController as v}from"./islands-form-controller-20260917T125828-sh.js";var a,c;class w extends M{constructor(){super(...arguments);d(this,a,this.closest("product-manager")??this._throwError("Missing product manager"));d(this,c,this.closest("form")??this._throwError("Missing form"))}onStart(){i(this,c).addEventListener("submit",async e=>{var f,g,u,h;e.preventDefault(),this.classList.add("is-adding"),i(this,a).setLoading(!0);const m=(f=i(this,a).formData.get("id"))==null?void 0:f.toString(),E=(g=i(this,a).formData.get("product-id"))==null?void 0:g.toString();if(!m){console.error("Missing variant id");return}const t=i(this,c).querySelector("[data-input]"),l=t==null?void 0:t.value;if(!t||!l){console.error("Missing email"),this.classList.remove("is-adding"),i(this,a).setLoa
1ding(!1);return}const o=await await k({email:l,variant_id:Number(m),product_id:Number(E)});if(o.status==="Error"&&o.errors){const n=typeof o.errors=="string"?o.errors:o.errors.message??((u=o.errors.base)==null?void 0:u.at(0))??((h=o.errors.email)==null?void 0:h.at(0))??"404";if(n){const p=t==null?void 0:t.closest(".form-control");p&&v.createErrorLabel(p,n)}}else if(o.status==="OK"&&o.message){const n=t==null?void 0:t.closest(".form-control");n&&v.createErrorLabel(n,o.message,"success")}this.classList.remove("is-adding"),i(this,a).setLoading(!1)},{signal:this.signal})}}a=new WeakMap,c=new WeakMap;customElements.define("backinstock-form-app",w);export{w as BackinstockForm};
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.