!function(e){woodmartThemeModule.menuOverlay=function(){var d=".wd-header-nav.wd-with-overlay .item-level-0.menu-item-has-children.wd-event-hover, .wd-header-cats.wd-with-overlay .item-level-0.menu-item-has-children.wd-event-hover, .wd-sticky-nav:not(.wd-opened), .wd-header-cats.wd-with-overlay.wd-event-hover, .wd-header-my-account.wd-with-overlay, .wd-header-cart.wd-with-overlay, .wd-header-search.wd-display-dropdown.wd-with-overlay",o="",t=e(".wd-close-side");woodmartThemeModule.$document.on("mouseleave",d,function(){e(this).parents(".wd-header-cats.wd-with-overlay.wd-event-click.wd-opened").length||t.trigger("wdCloseSideAction",["hide","hover","wd-location-header-sticky wd-location-header wd-location-header-cats wd-location-sticky-nav"])}),woodmartThemeModule.$document.on("mouseenter mousemove",d,function(){var d=e(this);if(!(t.hasClass("wd-close-side-opened")||woodmartThemeModule.$window.width()<768)){var o=d.parents(".whb-header").length,a=d.parents(".whb-clone").length,n=d.hasClass("wd-sticky-nav"),w=d.parents(".wd-header-cats").length,i="";o?(i=d.parents(".whb-sticked").length?"wd-location-header-sticky":"wd-location-header",w&&(i+=" wd-location-header-cats")):a?i="wd-location-header-sticky":n&&(i="wd-location-sticky-nav"),t.trigger("wdCloseSideAction",["show","hover",i])}}),woodmartThemeModule.$document.on("click",".wd-header-nav.wd-with-overlay .item-level-0.menu-item-has-children.wd-event-click, .wd-header-cats.wd-with-overlay .item-level-0.menu-item-has-children.wd-event-click, .wd-header-cats.wd-with-overlay.wd-event-click, .wd-search-form.wd-with-overlay .wd-search-cat",function(d){var o=e(this);o.parents(".wd-header-cats.wd-with-overlay.wd-event-click.wd-opened").length||o.parents(".wd-header-cats.wd-with-overlay.wd-event-hover").length||setTimeout(function(){var e=o.hasClass("wd-opened")?"show":"hide";t.trigger("wdCloseSideAction",[e,"click"])})}),woodmartThemeModule.$document.on("click touchstart",".wd-close-side.wd-location-header",function(){e(this).removeClass("wd-location-header wd-close-side-opened")}),t.on("wdCloseSideAction",function(e,d,a,n="wd-location-header"){"hover"===a&&"click"===o||(o="click"===a&&"hide"===d?"":a,"show"===d?t.addClass("wd-close-side-opened").addClass(n):t.removeClass("wd-close-side-opened").removeClass(n))})},["wdEventStarted","wdUpdatedHeader"].forEach(e=>{window.addEventListener(e,function(){woodmartThemeModule.menuOverlay()})})}(jQuery);