"use strict";function GSPB_Accordion_Toggle(target){let item=target.closest(".gs-accordion-item"),wrapper=target.closest(".gs-accordion"),enableScroll=wrapper.getAttribute("data-scroll"),contentWrap=item.querySelector(".gs-accordion-item__content");if(item.classList.contains("gsopen"))if(wrapper.classList.contains("togglelogic")){const items=wrapper.getElementsByClassName("gs-accordion-item");for(let i=0;i<items.length;i++){let titlearea;items[i].classList.replace("gsopen","gsclose"),items[i].querySelector(".gs-accordion-item__title").setAttribute("aria-expanded","false");let contentarea=items[i].querySelector(".gs-accordion-item__content");contentarea.style.maxHeight=null}}else item.classList.replace("gsopen","gsclose"),item.querySelector(".gs-accordion-item__title").setAttribute("aria-expanded","false"),contentWrap.style.maxHeight=null;else{if(wrapper.classList.contains("togglelogic")){const items=wrapper.getElementsByClassName("gs-accordion-item");for(let i=0;i<items.length;i++){let titlearea;items[i].classList.replace("gsopen","gsclose"),items[i].querySelector(".gs-accordion-item__title").setAttribute("aria-expanded","false");let contentarea=items[i].querySelector(".gs-accordion-item__content");contentarea.style.maxHeight=null}}item.classList.replace("gsclose","gsopen"),contentWrap.style.maxHeight=contentWrap.scrollHeight+"px",item.querySelector(".gs-accordion-item__title").setAttribute("aria-expanded","true"),enableScroll&&item.scrollIntoView({behavior:"smooth"})}}document.addEventListener("click",(function(ev){let target=ev.target;(target.classList.contains("gs-accordion-item__title")||target.closest(".gs-accordion-item__title"))&&GSPB_Accordion_Toggle(ev.target)}),!1);let accordionItems=document.querySelectorAll(".gs-accordion-item__title");const GSPB_Accordion_MaxHeight=()=>{for(let i=0;i<accordionItems.length;i++){let item=accordionItems[i].closest(".gs-accordion-item");if(item.classList.contains("gsopen")){let contentWrap=item.querySelector(".gs-accordion-item__content");contentWrap.style.maxHeight=contentWrap.scrollHeight+"px"}}};GSPB_Accordion_MaxHeight(),window.addEventListener("resize",GSPB_Accordion_MaxHeight);for(let i=0;i<accordionItems.length;i++)accordionItems[i].addEventListener("keydown",(function(e){const keyDown=void 0!==e.key?e.key:e.keyCode;("Enter"===keyDown||13===keyDown||["Spacebar"," "].indexOf(keyDown)>=0||32===keyDown)&&(e.preventDefault(),GSPB_Accordion_Toggle(accordionItems[i]))}));