function xs_show_hide_login_multiple(e,s){var t=document.querySelectorAll(e);if(t)for(var o=0;o<t.length;o++)t[o].classList.remove("xs-donate-visible");var n=document.querySelectorAll(s);if(n)for(var i=0;i<n.length;i++)n[i].classList.add("xs-donate-visible")}function toggle_class_in_target(e,s,t,o){t=t||"xs-donate-hidden",o=o||"xs-donate-visible";var n=document.querySelectorAll(s+" ."+o);if(n)for(var i=0;i<n.length;i++)n[i].classList.remove(o),n[i].classList.add(t);var r=document.querySelector(e);r&&(r.classList.remove(t),r.classList.add(o))}function ajax_xs_login_submit(e,s){e.preventDefault();var t=jQuery(s).closest("form#wfp_auth_form_login").serialize();document.getElementsByTagName("body")[0].classList.add("wfp-disabled"),console.log("Sending request..",window.wfp_xs_url.xs_rest_login),jQuery.ajax({data:t,type:"post",url:window.wfp_xs_url.xs_rest_login,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wfp_xs_url.nonce)},success:function(e){document.getElementsByTagName("body")[0].classList.remove("wfp-disabled"),e.error?jQuery(".wfp-login-message").html('<div class="xs-alert xs-alert-danger error">'+e.error+"</div>"):e.success&&setTimeout((function(){window.location.reload()}),100)}})}function ajax_xs_register_submit(e,s){e.preventDefault();var t=jQuery(s).closest("form#wfp_auth_form_register").serialize();document.getElementsByTagName("body")[0].classList.add("wfp-disabled"),jQuery.ajax({data:t,type:"post",url:window.wfp_xs_url.xs_rest_register,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wfp_xs_url.nonce)},success:function(e){document.getElementsByTagName("body")[0].classList.remove("wfp-disabled"),e.error?jQuery(".wfp-login-message").html('<div class="xs-alert xs-alert-danger error">'+e.error+"</div>"):e.success&&setTimeout((function(){window.location.reload()}),100)}})}!function(e){e((function(){e(document).on("click",".wfp-form-login__submit",(function(e){e.preventDefault(),ajax_xs_login_submit(e,this)})),e(document).on("click",".wfp-form-register__submit",(function(e){e.preventDefault(),ajax_xs_register_submit(e,this)})),e("i.wfp-from-group--password__icon").on("click",(function(){var s=e(this).closest("div").find(".wfp-password");"password"===s.attr("type")?s.attr("type","text").end().end().addClass("viewed"):s.attr("type","password").end().end().removeClass("viewed")})),e(".wfp-reg-login-navs").on("click",".wfp-button",(function(){e(this).addClass("wfp-button-active").siblings().removeClass("wfp-button-active")})),e('a[data-target=".bd-login-modal"]').length>0&&e('a[data-target=".bd-login-modal"]').on("click",(function(s){return e('.xs-header-login-shortcode .wfp-auth-btn[data-type="modal-trigger"]').trigger("click"),!1})),e(document).on("click",".xs-auth-modal--close",(function(s){s.preventDefault(),e(this).closest("div.xs-modal-popup").removeClass("xs-show").removeClass("is-open")})),e(".login-register-pup-up-wrapper").on("click",(function(s){s.target==this&&e(".login-register-pup-up-wrapper").removeClass("xs-show")})),e(document).on("click",".xs_reset_switch",(function(){e("#wp_fundraising_reset_form").fadeIn(),e("#wp_fundraising_login_form").hide(),e(".xs_login_switch").fadeIn(),e(this).hide()})),e(document).on("click",".xs_login_switch",(function(){e("#wp_fundraising_reset_form").hide(),e("#wp_fundraising_login_form").fadeIn(),e(".xs_reset_switch").fadeIn(),e(this).hide()}))}))}(jQuery);