!function(e){"use strict";ElementsKit_Helper.registerWidget("ekit-nav-menu.default",(function(n){if(n.find(".elementskit-megamenu-has").length>0){let t=n.find(".ekit-wid-con").data("responsive-breakpoint"),i=n.find(".elementskit-megamenu-has"),o=n.find(".elementskit-menu-container").outerHeight();function s(n,t,i){n.css({width:t}),e(document).width()<Number(i)&&n.removeAttr("style")}e(window).on("resize",(function(){n.find(".elementskit-megamenu-panel").css({top:o})})).trigger("resize"),i.on("mouseenter",(function(){let n=e(this).data("vertical-menu"),i=e(this).children(".elementskit-megamenu-panel");if(e(this).hasClass("elementskit-dropdown-menu-full_width")&&e(this).hasClass("top_position")){let n=Math.floor(e(this).position().left-e(this).offset().left),t=e(this);t.find(".elementskit-megamenu-panel").css("max-width",e(window).width()),e(window).on("resize",(function(){t.find(".elementskit-megamenu-panel").css({left:n+"px"})})).trigger("resize")}!e(this).hasClass("elementskit-dropdown-menu-full_width")&&e(this).hasClass("top_position")&&e(this).on({mouseenter:function(){0===e(".default_menu_position").length&&e(this).parents(".elementor-section-wrap").addClass("default_menu_position")},mouseleave:function(){0!==e(".default_menu_position").length&&e(this).parents(".elementor-section-wrap").removeClass("default_menu_position")}}),n&&n!==undefined?"string"==typeof n?(/^[0-9]/.test(n),s(i,n,t)):i.css({width:n+"px"}):s(i,n,t)})),i.trigger("mouseenter")}if(n.find(".ekit-nav-dropdown-click").length>0){let d=n.find(".ekit-wid-con").data("responsive-breakpoint");n.on("click",".elementskit-dropdown-has > a",(function(t){if(t.preventDefault(),e(document).width()<Number(d))return;let i=e(this).parent(),o=e(this).parents(".elementskit-dropdown-has"),s=i.find(">.elementskit-dropdown, >.elementskit-megamenu-panel");n.find(".elementskit-dropdown-has").not(o).find(">.elementskit-dropdown, >.elementskit-megamenu-panel").removeClass("ekit-dropdown-open-onclick"),s.toggleClass("ekit-dropdown-open-onclick")})),e(window).on("resize",(function(){e(document).width()<Number(d)&&n.find(".ekit-dropdown-open-onclick").removeClass("ekit-dropdown-open-onclick")})),e(document).on("click",(function(t){e(t.target).closest(".elementskit-dropdown-has").length||n.find(".ekit-dropdown-open-onclick").removeClass("ekit-dropdown-open-onclick")})),e(window).on("sticky:stick sticky:unstick",(n=>{e(n.target).find(".ekit-dropdown-open-onclick").removeClass("ekit-dropdown-open-onclick"),e(n.target).next().find(".ekit-dropdown-open-onclick").removeClass("ekit-dropdown-open-onclick")}))}n.find(".megamenu-ajax-load").length>0&&(n.find(".ekit-nav-dropdown-hover").on("mouseenter",".elementskit-megamenu-has",(function(){ElementsKit_Helper.megaMenuAjaxLoad(e(this))})),n.find(".ekit-nav-dropdown-click").on("click",".elementskit-megamenu-has",(function(){ElementsKit_Helper.megaMenuAjaxLoad(e(this))}))),"yes"===n.find(".ekit-wid-con").data("close-on-anchor")&&n.on("click",'.elementskit-navbar-nav a[href^="#"]:not(.ekit-menu-dropdown-toggle)',(function(){setTimeout((function(){n.find(".elementskit-menu-close.elementskit-menu-toggler").trigger("click")}),300)}))}))}(jQuery);