!function(){"use strict";var e,r={n:function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(a,{a:a}),a},d:function(e,a){for(var n in a)r.o(a,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:function(e,r){return Object.prototype.hasOwnProperty.call(e,r)}},a=jQuery;(e=r.n(a)())((function(){({init:function(){this.wrap=e(".rank-math-seo-analysis-wrap"),this.results=this.wrap.find(".rank-math-results-wrapper"),this.progress=this.wrap.find(".progress"),this.counter=this.wrap.find(".progress-bar span"),this.events(),this.graphs(),this.single()},events:function(){var r=this;this.wrap.on("click",".rank-math-recheck",(function(a){var n=e(this);a.preventDefault(),r.wrap.addClass("is-loading").removeClass("is-loaded"),r.results.empty(),n.hide();var t=function(a){e(".notice-seo-analysis-error").remove(),0!==a.length&&(r.wrap.find(".rank-math-analyzer-result").first().prepend(a),a.slideDown())};e.ajax({url:ajaxurl,type:"POST",dataType:"html",data:{action:"rank_math_analyze",security:rankMath.security,u:r.wrap.find(".rank-math-analyze-url").val()},beforeSend:function(){r.renderProgressBar()},complete:function(){clearInterval(r.interval),r.progress.css("width","100%"),r.counter.html("100%")},error:function(){var a=e('<div class="notice notice-error is-dismissible notice-seo-analysis-error"><p>An error occured.</p></div>').hide();t(a),r.wrap.addClass("is-loaded").removeClass("is-loading")},success:function(a){r.results.html(a);var s=r.results.find(".notice");0!==e(a).find("#rank-math-circle-progress").length?(r.wrap.addClass("is-loaded").removeClass("is-loading"),r.graphs()):(r.wrap.removeClass("is-loaded is-loading"),r.progress.css("width","0%"),r.counter.html("0%")),n.show(),t(s)}})})),r.wrap.on("click",".result-action",(function(r){r.preventDefault(),e(this).parent("div").toggleClass("expanded")})),r.wrap.on("click",".enable-auto-update",(function(r){r.preventDefault(),e.ajax({url:ajaxurl,type:"POST",data:{action:"rank_math_enable_auto_update",security:rankMath.security}}),e(this).closest(".auto-update-disabled").addClass("hidden").siblings(".auto-update-enabled").removeClass("hidden").closest(".row-description").find(".status-icon").removeClass("status-warning dashicons-warning").addClass("status-ok dashicons-yes")}))},renderProgressBar:function(){var e=this,r=0;e.progress.css("width",r),e.interval=setInterval((function(){100==++r&&clearInterval(e.interval),e.counter.html(r+"%"),e.progress.css("width",r+"%")}),30)},graphs:function(){var r=e("#rank-math-circle-progress");if(!(0>r.length)){var a=r.data("result"),n=["#58bb58","#58bb58"];.5>a?n=["#ed6a5e","#ed6a5e"]:.7>a&&(n=["#f7ca63","#f7ca63"]),r.circleProgress({value:a,size:207,thickness:17,lineCap:"round",emptyFill:"#e9e9ea",fill:{gradient:n}})}},single:function(){var e=this,r=e.wrap.find(".rank-math-current-url"),a=e.wrap.find(".rank-math-analyze-url"),n=e.wrap.find(".rank-math-recheck"),t=e.wrap.find(".rank-math-changeurl"),s=e.wrap.find(".rank-math-changeurl-ok");if(!a.length)return e;t.on("click",(function(){return r.hide(),t.hide(),a.show(),s.show(),!1})),s.on("click",(function(){return a.hide(),s.hide(),r.show(),t.show(),r.html(a.val()),n.trigger("click"),!1})),a.on("keypress",(function(e){13===e.keyCode&&s.trigger("click")})),n.trigger("click")}}).init()}))}();