const c=document.getElementById("website-overlay"),d=document.getElementById("transparent-overlay"),y=document.getElementById("trigger-search-component");window.addEventListener("onCartItemsUpdate",e=>{document.querySelectorAll("[data-cart-product-count]").forEach(t=>{t.innerHTML=e.detail.totalItems>0?e.detail.totalItems:""})});window.addEventListener("onRequestOverlay",e=>{const n=document.body,t=document.getElementById("website-overlay"),l=document.activeElement;if(e.detail.active){if(t.classList.add("website-overlay--open"),e.detail.type&&n.classList.add(`body--overlay-type-${e.detail.type}`),e.detail.type&&e.detail.type==="search"){const s=document.getElementById("transparent-overlay");s&&(s.style.display="block")}e.detail.fullscreen&&t.classList.add("website-overlay--fullscreen")}else{e.detail.escapeKey&&l&&typeof l.blur=="function"&&l.blur(),i.forEach(a=>{a.classList.remove("hovering-this-element")}),t.classList.remove("website-overlay--open"),t.classList.remove("website-overlay--fullscreen"),n.classList.forEach(a=>{a.indexOf("body--overlay-type")!==-1&&n.classList.remove(a)});const s=document.querySelector(".navigation__area--search");s.style.display="";const r=document.getElementById("transparent-overlay");r&&(r.style.display="")}});document.addEventListener("keydown",e=>{e.key==="Escape"&&(window.dispatchEvent(new CustomEvent("onRequestOverlay",{detail:{active:!1,escapeKey:!0}})),window.dispatchEvent(new CustomEvent("onEscapeKey",{detail:{escapeKey:!0}})))});c&&c.addEventListener("click",()=>{window.dispatchEvent(new CustomEvent("onRequestOverlay",{detail:{active:!1}}))});d&&d.addEventListener("click",()=>{window.dispatchEvent(new CustomEvent("onRequestOverlay",{detail:{active:!1}}))});window.addEventListener("scroll",()=>{if(!(document.body.scrollHeight<600)){if(Math.round(window.scrollY)>300)document.body.classList.add("is-scrolling");else if(Math.round(window.scrollY)<=0){const e=document.getElementById("search-component");e&&(e.style.display="",document.body.classList.remove("is-scrolling"))}}},{passive:!0});const i=document.querySelectorAll("[data-menu-item-with-children]");let u=null,o=200,v=null;i.forEach(e=>{e.addEventListener("mouseenter",n=>{u=setTimeout(function(){i.forEach(t=>{t.id!==e.id&&t.classList.remove("hovering-this-element")}),e.classList.add("hovering-this-element"),window.dispatchEvent(new CustomEvent("onRequestOverlay",{detail:{active:!0,type:"menu"}}))},o),clearTimeout(v)}),e.addEventListener("mouseleave",n=>{clearTimeout(u),n.relatedTarget.parentNode.hasAttribute("data-menu-item-with-children")?o=0:o=200,v=setTimeout(function(){e.classList.remove("hovering-this-element"),window.dispatchEvent(new CustomEvent("onRequestOverlay",{detail:{active:!1,type:"menu"}}))},100)})});y&&y.addEventListener("click",()=>{const e=document.querySelector(".navigation__area--search");e.style.display=e.style.display!=="block"?"block":"none",e.style.display==="block"&&document.querySelector("#search-component input[type=search]").focus()}); //# sourceMappingURL=production-navigation.js.map