1import{a as E,E as C}from"./api-fetcher-D7q-2H74.js";import{s as r}from"./set-aria-prop-BL99Jnpu.js";const I=d=>{const o={trigger:"js-expandable-side-menu-button",listElement:"side-menu__nested-link",activeIndicatorClass:d.dataset.activeIndicatorClass??""},p=d.querySelectorAll(`.${o.trigger}`);if(p.length===0)return;const u=async e=>{try{return await E(`${C.navigationMenu}?nodeid=${e}`)}catch(s){return console.error("Failed to get menuitems",s),[]}},h=e=>{const s=d.dataset.dropdownLabelSuffix??"",a=document.createElement("li"),t=document.createElement("a");if(t.setAttribute("href",e.link),t.className=`${o.listElement} ${o.activeIndicatorClass}`,t.textContent=e.title,a.appendChild(t),e.hasChildren){const n=document.createElement("button"),c=document.createElement("ul");let i=!1,l=!1;r(n,"expanded",l),n.innerHTML=`<span class="sr-only">${e.title} - ${s}</span>`,n.onclick=async()=>{if(l=!l,r(n,"expanded",l),!i){i=!0,a.appendChild(c);const f=await u(e.nodeId);f.length>0&&f.forEach(m=>{c.appendChild(h(m))})}},a.appendChild(n)}return a};p.forEach(e=>{const s=parseInt(e.dataset.nodeId??"");let a=e.classList.contains("open-on-load"),t=e.getAttribute("aria-expanded")==="true";e.onclick=async()=>{if(t=!t,r(e,"expanded",t),!a){a=!0;const n=await u(s);if(n.length>0){const c=document.createElement("ul");n.forEach(i=>{c.appendChild(h(i))}),e.insertAdjacentElement("afterend",c)}}}})};export{I as ExpandableSideMenu};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.