($=>{"use strict";function i(){$(".spinner","#themify-widget-section").fadeOut((function(){$(this).remove()}))}$("#themify-widget-menu-submit").on("click",(function(){var e=$("#themify-menu-widgets :checked"),t=$(this);e.length>0&&($('<span class="spinner" style="visibility: visible; display: inline-block;"></span>').insertBefore(t),wpNavMenu.addLinkToMenu("#"+e.val(),e.text(),null,i))})),$("body").on("change",".themify_field_tf-mega",(function(){"drop"==$(this).val()?$(this).closest(".menu-item").find(".tf-dropdown-columns-field").show():$(this).closest(".menu-item").find(".tf-dropdown-columns-field").hide(),"columns"==$(this).val()?$(this).closest(".menu-item").find(".tf-mega-columns-layout").show():$(this).closest(".menu-item").find(".tf-mega-columns-layout").hide()})),$("#update-nav-menu").on("click",".item-edit",(function(){$(this).closest(".menu-item").find(".themify_field_tf-mega").trigger("change")})).on("click",".item-edit",(function(){var i=$(this).closest("li.menu-item-custom");if(!(i.length<1)&&i.find(".themify-widget-options").length>0){var e=i.find(".themify-widget-options");e.prevAll().hide(),i.hasClass("menu-item-depth-0")&&(i.find(".edit-menu-item-title").closest("p").show(),i.find(".field-icon").show()),e.hasClass("initialized")||($(document).trigger("widget-added",[i.find(".themify-widget-options").addClass("open")]),e.addClass("initialized"))}})).on("click",".tf-mega-columns-layout a",(function(i){i.preventDefault();var e=$(this);e.parent().find(".val").val(e.attr("data-value")),e.addClass("selected").siblings().removeClass("selected")}))})(jQuery);