jQuery(function(o){vara,l=wp.i18n.__,n=wp.i18n._n,r=wp.i18n.sprintf,e=newClipboardJS(".site-health-copy-buttons .copy-button"),c=o(".health-check-body.health-check-status-tab").length,t=o(".health-check-body.health-check-debug-tab").length,i=o("#health-check-accordion-block-wp-paths-sizes"),h=o("#adminmenu .site-health-counter"),u=o("#adminmenu .site-health-counter .count");functiond(e){vart,s,a=wp.template("health-check-issue"),i=o("#health-check-issues-"+e.status);(e=>{vart,s,a,i,n={test:"string",label:"string",description:"string"},o=!0;if("object"==typeofe){for(tinn)if("object"==typeof(s=n[t]))for(ains)i=s[a],void0!==e[t]&&void0!==e[t][a]&&i===typeofe[t][a]||(o=!1);elsevoid0!==e[t]&&s===typeofe[t]||(o=!1);returno}})(e)&&(SiteHealth.site_status.issues[e.status]++,s=SiteHealth.site_status.issues[e.status],void0===e.test&&(e.test=e.status+s),"critical"===e.status?t=r(n("%s critical issue","%s critical issues",s),'<span class="issue-count">'+s+"</span>"):"recommended"===e.status?t=r(n("%s recommended improvement","%s recommended improvements",s),'<span class="issue-count">'+s+"</span>"):"good"===e.status&&(t=r(n("%s item with no issues detected","%s items with no issues detected",s),'<span class="issue-count">'+s+"</span>")),t&&o(".site-health-issue-count-title",i).html(t),u.text(SiteHealth.site_status.issues.critical),0<parseInt(SiteHealth.site_status.issues.critical,0)?(o("#health-check-issues-critical").removeClass("hidden"),h.removeClass("count-0")):h.addClass("count-0"),0<parseInt(SiteHealth.site_status.issues.recommended,0)&&o("#health-check-issues-recommended").removeClass("hidden"),o(".issues","#health-check-issues-"+e.status).append(a(e)))}functionp(){vare=o(".site-health-progress"),t=e.closest(".site-health-progress-wrapper"),s=o(".site-health-progress-label",t),a=o(".site-health-progress svg #bar"),i=parseInt(SiteHealth.site_status.issues.good,0)+parseInt(SiteHealth.site_status.issues.recommended,0)+1.5*parseInt(SiteHealth.site_status.issues.critical,0),n=.5*parseInt(SiteHealth.site_status.issues.recommended,0)+1.5*parseInt(SiteHealth.site_status.issues.critical,0),n=100-Math.ceil(n/i*100);0===i?e.addClass("hidden"):(t.removeClass("loading"),i=a.attr("r"),e=Math.PI*(2*i),a.css({strokeDashoffset:(100-(n=100<(n=n<0?0:n)?100:n))/100*e+"px"}),80<=n&&0===parseInt(SiteHealth.site_status.issues.critical,0)?(t.addClass("green").removeClass("orange"),s.text(l("Good")),g("good")):(t.addClass("orange").removeClass("green"),s.text(l("Should be improved")),g("improvable")),c&&(o.post(ajaxurl,{action:"health-check-site-status-result",_wpnonce:SiteHealth.nonce.site_status_result,counts:SiteHealth.site_status.issues}),100===n)&&(o(".site-status-all-clear").removeClass("hide"),o(".site-status-has-issues").addClass("hide")))}functionm(e,t){e={status:"recommended",label:l("A test is unavailable"),badge:{color:"red",label:l("Unavailable")},description:"<p>"+e+"</p><p>"+t+"</p>",actions:""};d(wp.hooks.applyFilters("site_status_test_result",e))}functions(){vart=(newDate).getTime(),s=window.setTimeout(function(){g("waiting-for-directory-sizes")},3e3);wp.apiRequest({path:"/wp-site-health/v1/directory-sizes"}).done(function(e){vara,s;a=e||{},e=o("button.button.copy-button"),s=e.attr("data-clipboard-text"),o.each(a,function(e,t){t=t.debug||t.size;void0!==t&&(s=s.replace(e+": loading...",e+": "+t))}),e.attr("data-clipboard-text",s),i.find("td[class]").each(function(e,t){vart=o(t),s=t.attr("class");a.hasOwnProperty(s)&&a[s].size&&t.text(a[s].size)})}).always(function(){vare=(newDate).getTime()-t;o(".health-check-wp-paths-sizes.spinner").css("visibility","hidden"),3e3<e?(e=6e3<e?0:6500-e,window.setTimeout(function(){p()},e)):window.clearTimeout(s),o(document).trigger("site-health-info-dirsizes-done")})}functiong(e){if("site-health"===SiteHealth.screen)switch(e){case"good":wp.a11y.speak(l("All site health tests have finished running. Your site is looking good."));break;case"improvable":wp.a11y.speak(l("All site health tests have finished running. There are items that should be addressed."));break;case"waiting