({92:function(){tec.ticketsPlus=tec.ticketsPlus||{},tec.ticketsPlus.waitlist=tec.ticketsPlus.waitlist||{},((t,e)=>{e.selectors={waitlists:".tec-tickets-plus-waitlist-container",submitBtn:".tec-tickets-plus-waitlist-submit",nameField:'[name="tec-tickets-plus-waitlist[name]"',emailField:'[name="tec-tickets-plus-waitlist[email]"',innerWrap:".tec-tickets-plus-waitlist-container__inner-wrap",successWrap:".tec-tickets-plus-waitlist-container__success",whenEmpty:'[data-show-when="empty"]',whenInvalid:'[data-show-when="invalid"]',when:"[data-show-when]",waitlistId:'[name="tec-tickets-plus-waitlist[waitlist_id]"',nonce:'[name="tec-tickets-plus-waitlist[nonce]"',action:'[name="tec-tickets-plus-waitlist[action]"',hasError:"tec-tickets-plus-waitlist-container--input--has-error"},e.waitlistObjects=t(e.selectors.waitlists),e.waitlistObjects.length&&(e.clearUrl=()=>{const t=new URL(window.location);t.searchParams.delete("unsubscribed"),history.replaceState({},"",t)},e.clearUrl(),e.waitlistObjects.each((s=>{const i=t(e.waitlistObjects[s]),l=i.find(e.selectors.submitBtn),n=i.closest("form");n.length&&n.on("submit",(t=>{t.preventDefault()}));const a=i.find(e.selectors.nameField),r=i.find(e.selectors.emailField),c=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,o=()=>{let t=!1;a.val()||(a.nextAll(e.selectors.whenEmpty).show(),a.addClass(e.selectors.hasError),t=!0);const s=r.val();return s?c.test(s)||(r.nextAll(e.selectors.whenInvalid).show(),r.addClass(e.selectors.hasError),t=!0):(r.nextAll(e.selectors.whenEmpty).show(),r.addClass(e.selectors.hasError),t=!0),l.prop("disabled",t),t},w=(t,e)=>{let s;return(...i)=>{clearTimeout(s),s=setTimeout((()=>t.apply(this,i)),e)}};l.on("click",w((async t=>{t.preventDefault();const s=i.find(e.selectors.waitlistId).val(),n=i.find(e.selectors.nonce).val(),c=i.find(e.selectors.action).val();if(!(s&&n&&c))throw new Error("Missing required fields for waitlist submission.");if(a.length&&o())return;l.prop("disabled",!0);const w=new FormData;w.append("action",c),w.append("waitlistId",s),w.append("nonce",n),w.append("name",a.length?a.val():""),w.append("email",r.length?r.val():"");try{const t=await tribe.ky.post(TribeTicketsPlus.ajaxurl,{body:w}).json();if(!t?.success)return console.error("Failed to submit waitlist form.",t),!1;i.find(e.selectors.innerWrap).hide(),i.find(e.selectors.successWrap).show()}catch(t){return l.prop("disabled",!1),console.error("Failed to submit waitlist form.",t),!1}}),500)),a.length&&(a.on("input",(()=>{a.nextAll(e.selectors.when).hide(),a.removeClass(e.selectors.hasError)})),a.on("input",w(o,500)),a.on("blur",o),r.on("input",(()=>{r.nextAll(e.selectors.when).hide(),r.removeClass(e.selectors.hasError)})),r.on("input",w(o,500)),r.on("blur",o))})))})(jQuery,tec.ticketsPlus.waitlist)}})[92](),window.ticketsPlus=window.ticketsPlus||{},window.ticketsPlus.waitlist=window.ticketsPlus.waitlist||{},window.ticketsPlus.waitlist.form={};