var clearpath=mh_customizer_settigs.clearpath;!function(a){function s(e,t){var n=e;n.addClass("mhc_popup_closing"),setTimeout(function(){"no_remove"!==t&&n.remove()},200)}function u(e){var t=0-e.outerHeight()/2;e.css({top:"50%",bottom:"auto",marginTop:t})}a(document).ready(function(){var n;function e(e,t){$range_input=e,$range=$range_input.parent().find('input[type="range"]'),value=parseFloat($range_input.val()),reset=parseFloat($range.attr("data-reset_value")),step=parseFloat($range_input.attr("step")),min=parseFloat($range_input.attr("min")),max=parseFloat($range_input.attr("max")),clearTimeout(n),n=setTimeout(function(){return isNaN(value)?($range_input.val(reset),void $range.val(reset).trigger("change")):(1<=step&&value%1!=0&&(value=Math.round(value),$range_input.val(value),$range.val(value)),value>max&&($range_input.val(max),$range.val(max).trigger("change")),void(value<min&&($range_input.val(min),$range.val(min).trigger("change"))))},t),$range.val(value).trigger("change")}a("div#customize-info").replaceWith('<div class="mh_customizer-customizer"></div>'),a(".mh_customizer_reset_slider").click(function(){var e=a(this).closest("label").find("input"),t=(e.data("customize-setting-link"),e.data("reset_value"));e.val(t),e.change()}),a("input[type=range]").on("mousedown",function(){var e=a(this).parent().children(".mh-customizer-range-input");e.val(a(this).val()),a(this).mousemove(function(){e.val(a(this).val())})}),a("input.mh-customizer-range-input").on("change keyup",function(){e(a(this),1e3)}).on("focusout",function(){e(a(this),0)}),wp.customize.bind("ready",function(){var o=this,e=a(".customize-switch-label").parent(),t=[];e.each(function(){var e=this.id.substring("customize-control-".length,this.id.length);t.push(e)}),a.each(t,function(e,i){o(i,function(t){var n=o.control(i).container.find(".customize-control-title");n.toggleClass("disabled-control-title",!t.get()),t.bind(function(e){n.toggleClass("disabled-control-title",!t.get())})})})}),a('.customize-control-multiple-checkbox input[type="checkbox"]').on("change",function(){checkbox_values=a(this).parents(".customize-control").find('input[type="checkbox"]:checked').map(function(){return this.value}).get().join(","),a(this).parents(".customize-control").find('input[type="hidden"]').val(checkbox_values).trigger("change")}),a('.customize-control-multiple-checkbox-image input[type="checkbox"]').on("change",function(){checkbox_values=a(this).parents(".customize-control").find('input[type="checkbox"]:checked').map(function(){return this.value}).get().join(","),a(this).parents(".customize-control").find('input[type="hidden"]').val(checkbox_values).trigger("change")}),a(".customize-control-multiple-checkbox-image input:checkbox:not([safari])").checkbox(),a(".customize-control-multiple-checkbox-image input[safari]:checkbox").checkbox({cls:"jquery-safari-checkbox"}),a(".customize-control-multiple-checkbox-image input:radio").checkbox(),a(".mh-setting-description-mark").click(function(){var e=a(this).siblings(".mh-setting-description-title").html(),t=a(this).siblings(".mh-setting-description").html();a("body").append("<div id='mh-popup-box'><div class='box-desc'><div class='box-desc-top'>"+e+"</div><div class='box-desc-content'>"+t+"<div class='lightboxclose'></div></div></div></div>"),u(a(".mh-setting-description")),a(".lightboxclose").click(function(){s(a("#mh-popup-box"))})}),a(".mh-menu-icon-button, .mh-menu-icon-show").each(function(e){var t=a(this),n=t.closest("label").find(".mh-menu-icon-field"),i=t.closest("label").find(".mh-menu-icon-show"),o=t.closest("label").find(".mh-menu-icon-button-reset"),c=a(".mh_menu_icons_list").html();a(this).parent("label");t.on("click",function(){a("body").append("<div id='mh_menu_icons_box'><div class='mh_menu_icons_box_inner'><div class='mh_menu_icons_box_content'>"+c+"<div class='mh_menu_icons_box_close'></div></div></div></div>"),u(a(".mh_menu_icons_box_inner")),a(".mh_menu_icons_box_close").click(function(){s(a("#mh_menu_icons_box"))}),a(".glyph").on("click",function(){var e=a(this).find("input.unit");n.val(e.val()),i.html("<em>&#x"+e.val()+";</em>"),n.change(),s(a("#mh_menu_icons_box")),t.removeClass("mh-menu-icon-button")})}),o.on("click",function(){n.val(""),i.html(""),n.change(),t.addClass("mh-menu-icon-button")})})});var e=a("#customize-header-actions"),t=a('<a id="mh-customizer-reset" class="mh-customizer-reset" href="#"></a>').attr("title",mh_customizer_settigs.reset);t.on("click",function(e){e.preventDefault();e={wp_customize:"on",action:"customizer_reset",nonce:mh_customizer_settigs.nonce.reset};confirm(mh_customizer_settigs.confirm)&&(t.attr("disabled","disabled"),a.post(ajaxurl,e,function(){wp.customize.state("saved").set(!0),location.reload()}))}),e.append(t)}(jQuery);