"use strict";let topLayerButtons=document.querySelectorAll(".dropdown-button.top-layer");topLayerButtons.forEach((t,e)=>{let l=t.nextElementSibling;if(null!==l){let i=l.scrollHeight,s=l.firstElementChild,n=[];t.classList.contains("show")&&(l.style.maxHeight=i+"px"),t.addEventListener("click",function(){i=this.nextElementSibling.scrollHeight,"sm"!=document.documentElement.getAttribute("data-sidebar-size")&&(l&&(t.classList.toggle("show"),l.style.maxHeight?l.style.maxHeight=null:l.style.maxHeight=i+"px"),topLayerButtons.forEach((t,l)=>{e!=l&&t.nextElementSibling&&(t.classList.remove("show"),t.nextElementSibling.style.maxHeight=null)}))});for(let a=0;a<s.children.length;a++){let o=s.children[a];o.firstElementChild?.classList.contains("second-layer")&&n.push(o.firstElementChild)}n.length>0&&n.forEach((e,s)=>{let a=e.nextElementSibling;e.addEventListener("click",function(){let o=this.nextElementSibling.scrollHeight;"sm"!=document.documentElement.getAttribute("data-sidebar-size")&&(a&&(e.classList.toggle("show"),a.style.maxHeight?a.style.maxHeight=null:(l.style.maxHeight=i+o+"px",a.style.maxHeight=o+"px")),n.forEach((e,l)=>{s!=l&&e.nextElementSibling&&t.classList.contains("show")&&(e.classList.remove("show"),e.nextElementSibling.style.maxHeight=null)}))})})}});