import*as t from"@wordpress/interactivity";var e={d:(t,a)=>{for(var s in a)e.o(a,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:a[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const a=(s={getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store},i={},e.d(i,s),i);var s,i;(0,a.store)("spectra/tabs",{actions:{updateActiveTab:()=>{const t=(0,a.getContext)("spectra/tabs"),{currentTab:e}=t;t.activeTab=e},switchTabs:t=>{if(![37,39].includes(t.keyCode))return;const e=(0,a.getContext)("spectra/tabs"),{blockId:s,currentTab:i,firstTab:r,lastTab:o}=e,{ref:c}=(0,a.getElement)();let n;switch(t.keyCode){case 37:n=i-1,n<r&&(n=o);break;case 39:n=i+1,n>o&&(n=r)}c.parentNode.querySelector(`#${s}-tab-${n}`).focus(),e.activeTab=n}},callbacks:{initializeTabs:()=>{const t=(0,a.getContext)("spectra/tabs"),{blockId:e,currentTab:s}=t;t.tabId=`${e}-tab-${s}`,t.tabPanelId=`${e}-tabpanel-${s}`},isActiveTab:()=>{const t=(0,a.getContext)("spectra/tabs"),{activeTab:e,currentTab:s}=t,i=t.isActive;if(t.isActive=e===s,window.AOS.refresh(),t.isActive&&!i){const{ref:t}=(0,a.getElement)();if(t){const e=t.querySelectorAll("[data-aos]");e.forEach((t=>{t.style.visibility="hidden",t.classList.remove("aos-init","aos-animate")})),setTimeout((()=>{e.forEach((t=>{t.style.visibility="visible"})),void 0!==window.AOS&&window.AOS.init()}),100)}}},updateTabAttributes:()=>{const t=(0,a.getContext)("spectra/tabs"),{isActive:e}=t;t.ariaSelected=e?"true":"false",t.tabIndex=e?"0":"-1"}}});