(function(){"use strict";window.KBTabs={setupTabs:function(){var a=document.querySelectorAll(".kt-tabs-wrap");a.forEach(a=>{a.querySelectorAll(":scope > .kt-tabs-title-list").forEach(a=>{a.setAttribute("role","tablist")}),a.querySelectorAll(":scope > .kt-tabs-content-wrap > .kt-tab-inner-content").forEach(a=>{a.setAttribute("role","tabpanel"),a.setAttribute("aria-hidden","true")}),a.querySelectorAll(":scope > .kt-tabs-title-list li a").forEach(b=>{var c=b.parentElement,d=c.getAttribute("id"),e=c.classList.contains("kt-tab-title-active");c.setAttribute("role","presentation"),b.setAttribute("role","tab"),b.setAttribute("aria-selected",e?"true":"false"),b.setAttribute("tabindex",e?"0":"-1");var f=b.getAttribute("data-tab"),g=a.querySelector(":scope > .kt-tabs-content-wrap > .kt-inner-tab-"+f);g.setAttribute("aria-labelledby",d),g.setAttribute("aria-hidden",e?"false":"true"),e&&(g.style.display="block")}),a.querySelectorAll(":scope > .kt-tabs-title-list li").forEach(a=>{a.addEventListener("keydown",function(b){switch(b.which){case 37:a.previousElementSibling?a.previousElementSibling.querySelector("a").click():a.parentElement.querySelector("li:last-of-type > a").click();break;case 39:a.nextElementSibling?a.nextElementSibling.querySelector("a").click():a.parentElement.querySelector("li:first-of-type > a").click();}})});var b=new Event("resize");window.dispatchEvent(b)});var b=document.querySelectorAll(".kt-tabs-title-list li a");b.forEach(a=>{a.addEventListener("click",function(b){b.preventDefault();const c=a.getAttribute("data-tab"),d=a.closest(".kt-tabs-wrap");window.KBTabs.setActiveTab(d,c)})});var c=document.querySelectorAll(".kt-create-accordion");c.forEach(a=>{a.querySelectorAll(":scope > .kt-tabs-title-list .kt-title-item").forEach(a=>{var b=a.querySelector("a").getAttribute("data-tab"),c=a.classList;const d=a.closest(".kt-tabs-wrap"),e=d.querySelector(":scope > .kt-tabs-content-wrap"),f=window.document.createElement("div");f.className=[...c].concat(["kt-tabs-accordion-title","kt-tabs-accordion-title-"+b]).join(" "),f.innerHTML=a.innerHTML,e.insertBefore(f,e.querySelector(":scope > .kt-inner-tab-"+b)),e.querySelector(":scope > .kt-tabs-accordion-title-"+b+"  a").removeAttribute("role"),e.querySelector(":scope > .kt-tabs-accordion-title-"+b+"  a").removeAttribute("tabindex")})});var d=document.querySelectorAll(".kt-tabs-accordion-title a");d.forEach(a=>{a.addEventListener("click",function(b){b.preventDefault();var c=a.getAttribute("data-tab"),d=a.parentElement,e=a.closest(".kt-tabs-wrap"),f=e.querySelector(":scope > .kt-tabs-content-wrap > .kt-inner-tab-"+c);d.classList.contains("kt-tab-title-active")?(e.classList.remove("kt-active-tab-"+c),d.classList.replace("kt-tab-title-active","kt-tab-title-inactive"),f.style.display="none"):(e.classList.add("kt-active-tab-"+c),d.classList.replace("kt-tab-title-inactive","kt-tab-title-active"),f.style.display="block");var g=new Event("resize");window.dispatchEvent(g);var h=new Event("kadence-tabs-open");window.dispatchEvent(h)})}),window.KBTabs.setActiveWithHash()},setActiveWithHash:function(){if(""!=window.location.hash){var a=window.document.querySelector(window.location.hash+".kt-title-item");if(a){var b=window.document.querySelector("#"+window.location.hash.substring(1)),c=b.querySelector("a").getAttribute("data-tab"),d=b.closest(".kt-tabs-wrap");window.KBTabs.setActiveTab(d,c),(window.KBTabs.isMobileSize()&&d.classList.contains("kt-tabs-mobile-layout-accordion")||window.KBTabs.isTabletSize()&&d.classList.contains("kt-tabs-tablet-layout-accordion"))&&d.querySelector(".kt-tabs-content-wrap > .kt-tabs-accordion-title.kt-tabs-accordion-title-"+c).scrollIntoView({behavior:"smooth"})}}},isMobileSize:function(){return 767>=window.innerWidth},isTabletSize:function(){return 767<window.innerWidth&&1024>=window.innerWidth},setActiveTab:function(a,b,c=!0){const d=a.querySelector(":scope > .kt-tabs-title-list > li.kt-tab-title-active a"),e=a.querySelector(":scope > .kt-tabs-title-list > li.kt-tab-title-active");e.classList.replace("kt-tab-title-active","kt-tab-title-inactive"),d.setAttribute("tabindex","-1"),d.setAttribute("aria-selected","false"),a.className=a.className.replace(/\bkt-active-tab-\S+/g,"kt-active-tab-"+b);const f=a.querySelector(":scope > .kt-tabs-title-list > li.kt-title-item-"+b+" a"),g=a.querySelector(":scope > .kt-tabs-title-list > li.kt-title-item-"+b);g.classList.replace("kt-tab-title-inactive","kt-tab-title-active"),f.setAttribute("tabindex","0"),f.setAttribute("aria-selected","true"),a.querySelectorAll(":scope > .kt-tabs-content-wrap > .kt-tab-inner-content").forEach(a=>{a.style.display="none"});const h=a.querySelector(":scope > .kt-tabs-content-wrap > .kt-inner-tab-"+b);h.style.display="block",c&&f.focus(),window.KBTabs.setAriaAttributesForTabs(a,b);var i=new Event("resize");window.dispatchEvent(i);var j=new Event("kadence-tabs-open");window.dispatchEvent(j)},setAriaAttributesForTabs:function(a,b){a.querySelectorAll(":scope > .kt-tabs-content-wrap > .kt-tab-inner-content:not(.kt-inner-tab-"+b+")").forEach(a=>a.setAttribute("aria-hidden","true")),a.querySelector(":scope > .kt-tabs-content-wrap > .kt-inner-tab-"+b).setAttribute("aria-hidden","false"),a.querySelectorAll(":scope > .kt-tabs-content-wrap > .kt-tabs-accordion-title:not(.kt-tabs-accordion-title-"+b+")").forEach(a=>{a.classList.replace("kt-tab-title-active","kt-tab-title-inactive"),a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")});const c=a.querySelector(":scope >.kt-tabs-content-wrap > .kt-tabs-accordion-title.kt-tabs-accordion-title-"+b);c&&(c.classList.replace("kt-tab-title-inactive","kt-tab-title-active"),c.setAttribute("tabindex","0"),c.setAttribute("aria-selected","true"))},init:function(){window.KBTabs.setupTabs(),window.addEventListener("hashchange",window.KBTabs.setActiveWithHash,!1)}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.KBTabs.init):window.KBTabs.init()})();