document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".wp-block-zolo-navigation").forEach(e=>{const o=e.querySelector(".zolo-navigation-hamburger"),t=e.querySelector(".zolo-navigation-wrapper"),n=e.querySelector(".zolo-navigation-overlay"),a=e.querySelector(".zolo-navigation-sidebar-close"),i=e.querySelectorAll(".zolo-submenu-arrow");let s;o.addEventListener("click",e=>{e.preventDefault(),s&&clearTimeout(s),s=setTimeout(()=>{t.classList.add("zolo-navigation-open"),n.classList.add("zolo-navigation-overlay-open"),t.classList.add("is-menu-active")},500)});const l=e.querySelectorAll(".zolo-navigation-link"),c=e.querySelectorAll(".zolo-navigation-item");n.addEventListener("click",()=>{t.classList.remove("zolo-navigation-open"),n.classList.remove("zolo-navigation-overlay-open"),c.forEach(e=>{e.classList.remove("zolo-navigation-submenu-open")}),setTimeout(()=>{t.classList.remove("is-menu-active")},700)}),l.forEach(e=>{e.addEventListener("click",function(e){const o=this.closest(".zolo-navigation-item");(o.classList.contains("has-submenu")||o.classList.contains("has-megamenu"))&&o.classList.contains("triggerby-click")&&(e.preventDefault(),o.classList.toggle("zolo-navigation-submenu-open"),o.classList.toggle("submenu-open"))})}),i.forEach(e=>{e.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();const o=this.closest(".zolo-navigation-item");o.classList.toggle("zolo-navigation-submenu-open"),o.classList.toggle("submenu-open")})}),a.addEventListener("click",()=>{t.classList.remove("zolo-navigation-open"),n.classList.remove("zolo-navigation-overlay-open"),setTimeout(()=>{t.classList.remove("is-menu-active")},700)})})});