(()=>{var e,t;tribe.tickets=tribe.tickets||{},tribe.tickets.rsvp=tribe.tickets.rsvp||{},tribe.tickets.rsvp.manager={},e=jQuery,window.underscore||window._,(t=tribe.tickets.rsvp.manager).selectors={container:".tribe-tickets__rsvp-wrapper",loader:".tribe-common-c-loader",hiddenElement:".tribe-common-a11y-hidden",messageError:".tribe-tickets__rsvp-message--error"},t.currentAjaxRequest=null,t.$containers=e(),t.selectContainers=function(){t.$containers=e(t.selectors.container)},t.cleanup=function(t){const r=e(t);r.trigger("beforeCleanup.tribeTicketsRsvp",[r]),r.trigger("afterCleanup.tribeTicketsRsvp",[r])},t.setup=function(t,r){const s=e(r);s.trigger("beforeSetup.tribeTicketsRsvp",[t,s]),s.trigger("afterSetup.tribeTicketsRsvp",[t,s])},t.request=function(r,s){const i=t.getAjaxSettings(s);i.data=r,t.currentAjaxRequest=e.ajax(i)},t.getAjaxSettings=function(e){return{url:TribeRsvp.ajaxurl,method:"POST",beforeSend:t.ajaxBeforeSend,complete:t.ajaxComplete,success:t.ajaxSuccess,error:t.ajaxError,context:e}},t.ajaxBeforeSend=function(e,t){const r=this;r.trigger("beforeAjaxBeforeSend.tribeTicketsRsvp",[e,t]),tribe.tickets.loader.show(r),r.trigger("afterAjaxBeforeSend.tribeTicketsRsvp",[e,t])},t.ajaxComplete=function(e,r){const s=this;s.trigger("beforeAjaxComplete.tribeTicketsRsvp",[e,r]),tribe.tickets.loader.hide(s),s.trigger("afterAjaxComplete.tribeTicketsRsvp",[e,r]),t.currentAjaxRequest=null},t.ajaxSuccess=function(e,r,s){const i=this,c=e.data.html;e.success?(i.trigger("beforeAjaxSuccess.tribeTicketsRsvp",[e,r,s]),t.cleanup(i),i.html(c),t.setup(0,i),t.selectContainers(),i.trigger("afterAjaxSuccess.tribeTicketsRsvp",[e,r,s])):i.find(t.selectors.messageError).length||i.prepend(c)},t.ajaxError=function(e,t){this.trigger("beforeAjaxError.tribeTicketsRsvp",[e,t]),this.trigger("afterAjaxError.tribeTicketsRsvp",[e,t])},t.ready=function(){t.selectContainers(),t.$containers.each(t.setup)},e(t.ready),window.tec=window.tec||{},window.tec.tickets=window.tec.tickets||{},window.tec.tickets.v2=window.tec.tickets.v2||{},window.tec.tickets.v2.rsvpManager={}})();