var clearpath=mhPanel.clearpath;(h=>{function c(t){var e=t.outerHeight();t.css({top:"50%",bottom:"auto",marginTop:0-e/2})}h(document).ready(function(){var t=h(".mh_color_scheme_main_input"),e=h(".mh-panel-section-title-span");e.length&&e.each(function(){h(this).closest("tr").addClass("mh-panel-section-title")}),h("#mh-panel-content .tab-content > table > tbody tr th").click(function(){var t=h(this).html(),e=h(this).siblings("td").find(".mh-panel-option-desc").html();h("body").append("<div id='mh-popup-box'><div class='box-desc'><div class='box-desc-top'>"+t+"</div><div class='box-desc-content'>"+e+"<div class='lightboxclose'></div></div></div></div>"),c(h(".box-desc")),h(".lightboxclose").click(function(){var t,e=h("#mh-popup-box");(t=e).addClass("mh_popup_closing"),setTimeout(function(){t.remove()},200)})}),h("#mh-panel-content .tab-content input:checkbox:not([safari]):not(.switch_button)").checkbox(),h("#mh-panel-content .tab-content input[safari]:checkbox:not(.switch_button)").checkbox({cls:"jquery-safari-checkbox"}),h("#mh-panel input:radio:not(.switch_button)").checkbox(),h(".switch_button").each(function(){var t=h(this),e=t.is(":checked"),c=t.attr("data-affects"),o=e?"mh-panel-switch-is-on":"mh-panel-switch-is-off",n=e?"mh-panel-switch-checked":"mh-panel-switch-not-checked",e=e?"affected":"not-affected";$template=h(h("#mh-panel-switch-template").html()).find(".mh-panel-switch").addClass(o),t.addClass(n),t.hide().after($template),h(c).parents("tr").addClass(e),h(c).parents("tr.not-affected").hide()}),h("#mh-panel-content .tab-content > table > tbody tr").on("click",".mh-panel-switch",function(t){t.preventDefault();var e=(t=h(this).parents("tr")).find('input[type="checkbox"]'),t=t.find(".mh-panel-switch"),c=e.attr("data-affects");t.toggleClass("mh-panel-switch-is-on mh-panel-switch-is-off"),e.toggleClass("mh-panel-switch-checked mh-panel-switch-not-checked"),h(c).parents("tr").toggleClass("affected not-affected"),h(c).parents("tr").toggle(),e.is(":checked")?e.prop("checked",!1):e.prop("checked",!0)}),t.length&&(t.each(function(){var i=h(this),a=i.closest("tr"),t=a.find(".input-colorscheme-colorpicker"),c=0,s=i.val().split("|");t.each(function(){var t=h(this),e=s[c];t.val(e).wpColorPicker({hide:!1,default:h(this).data("default-color"),width:313,palettes:!1,change:function(t,e){var c=h(this),o=c.attr("data-index"),n=a.find(".colorscheme-item-"+o),e=e.color.toString();c.val(e),n.css({backgroundColor:e}),s[o-1]=e,i.val(s.join("|"))}}),t.trigger("change"),c++}),a.on("click",".colorscheme-item",function(t){t.preventDefault(),t=h(this).attr("data-index"),a.find(".colorscheme-colorpicker").removeClass("active"),a.find('.colorscheme-colorpicker[data-index="'+t+'"]').addClass("active"),event.stopPropagation()}),h("body").on("click",function(t){a.find(".colorscheme-colorpicker").removeClass("active")})}),h(".mh_color_schemes_list li").click(function(){var t=h(this).find(".color_palette_code").html(),e=(e=h("input:hidden.mh_color_scheme_main_input").val().split("|"))[0]+"|"+e[1]+"|"+e[2]+"|"+t;h("input:hidden.mh_color_scheme_main_input").val(e),c(h(".mh_color_schemes_confirm_box")),h(".mh_color_schemes_confirm").show(),h(".mh_color_schemes_confirm_cancel").click(function(){h(".mh_color_schemes_confirm").hide()})}),h(".mh_color_schemes_confirm_button").click(function(){setTimeout(function(){h("#mh-panel .save-button").click()},1)})),h("#mh-site-status-copy").on("click",function(){var t;h("#mh-site-status-report-textarea").select(),document.execCommand("copy"),(t=h("#mh-site-status-copied")).fadeIn("fast"),t.fadeOut(2e3)})})})(jQuery);