document.addEventListener("DOMContentLoaded",()=>{function e(e){"true"===e.getAttribute("aria-expanded")?t(e):function(e){e.setAttribute("aria-expanded","true"),e.closest("li").classList.add("is-open");const t=e.nextElementSibling;t&&t.removeAttribute("hidden")}(e)}function t(e){if(!e)return;e.setAttribute("aria-expanded","false"),e.closest("li").classList.remove("is-open");const t=e.nextElementSibling;t&&t.setAttribute("hidden","")}document.querySelectorAll(".category-link-panel .has-submenu .category-link-panel__submenu-trigger").forEach(t=>{t.addEventListener("click",()=>{e(t)}),t.addEventListener("keydown",n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),e(t))})}),document.addEventListener("keydown",e=>{"Escape"===e.key&&document.querySelectorAll('.category-link-panel .has-submenu .category-link-panel__submenu-trigger[aria-expanded="true"]').forEach(e=>{t(e),e.focus()})}),document.addEventListener("click",e=>{document.querySelectorAll(".category-link-panel .has-submenu.is-open").forEach(n=>{n.contains(e.target)||t(n.querySelector(".category-link-panel__submenu-trigger"))})})});