document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".wp-block-ntvb-accordion").forEach((t,e)=>{const i=t.querySelectorAll(".accordion-head");t.querySelectorAll(".accordion-body").forEach(t=>{const e=t.querySelector(".body-inner");if(e){const i={maxHeight:t.style.maxHeight,visibility:t.style.visibility,position:t.style.position};t.style.maxHeight="none",t.style.visibility="hidden",t.style.position="absolute",e.offsetHeight,t.style.maxHeight=i.maxHeight,t.style.visibility=i.visibility,t.style.position=i.position,t.style.setProperty("--content-height","auto")}}),i.forEach((t,s)=>{const a=t.parentElement,n=t.querySelector(".icon"),o=t.nextElementSibling,c=o.classList.contains("active"),r=`accordion-heading-${e}-${s}`,l=`accordion-panel-${e}-${s}`;t.setAttribute("id",r),t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-expanded",c?"true":"false"),t.setAttribute("aria-controls",l),o.setAttribute("id",l),o.setAttribute("role","region"),o.setAttribute("aria-labelledby",r);const d=function(){o.classList.contains("active")?(a.classList.remove("active"),o.classList.remove("active"),n.classList.remove("active"),t.setAttribute("aria-expanded","false")):(i.forEach(e=>{if(e!==t){const t=e.parentElement,i=e.querySelector(".icon"),s=e.nextElementSibling;t.classList.remove("active"),s.classList.remove("active"),i.classList.remove("active"),e.setAttribute("aria-expanded","false")}}),a.classList.add("active"),o.classList.add("active"),n.classList.add("active"),t.setAttribute("aria-expanded","true"))};t.addEventListener("click",d),t.addEventListener("keydown",function(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),d())})})})});