!function(u){"use strict";u(document).ready(function(){u(".youzify-membership-login-form").on("submit",function(i){u(this).addClass("youzify-authenticating");var t,e,n,a=u(this);n=u(this).find('button[type="submit"]'),t=n.find(".youzify-membership-button-title").text(),e=n.find(".youzify-membership-button-icon i").attr("class"),n.find(".youzify-membership-button-title").text(Youzify.authenticating),n.find(".youzify-membership-button-icon i").attr("class","fas fa-spinner fa-spin");var o={action:"youzify_ajax_login",username:u(this).find('input[name="log"]').val(),password:u(this).find('input[name="pwd"]').val(),remember:u(this).find('input[name="rememberme"]').val(),redirect_to:u(this).find('input[name="youzify_redirect_to"]').val(),security:u(this).find('input[name="youzify_ajax_login_nonce"]').val()};u.ajax({type:"POST",dataType:"json",url:ajaxurl,data:o,success:function(i){1==i.loggedin?(n.find(".youzify-membership-button-title").text(i.message),n.find(".youzify-membership-button-icon i").attr("class","fas fa-check"),document.location.href=i.redirect_url):(a.removeClass("youzify-authenticating"),i.error_code&&"incorrect_password"==i.error_code?a.find('input[name="pwd"]').val(""):a.find('input[name="log"],input[name="pwd"]').val(""),n.find(".youzify-membership-button-title").text(t),n.find(".youzify-membership-button-icon i").attr("class",e),u.youzify_DialogMsg("error",i.message))}}),i.preventDefault()})})}(jQuery);