!function(){const e=document.querySelector("#searchform-dropdown");if(!e)return;let t=!1,s=!1,n=!1,o=!1,i=!1,r=null;const a=e.parentElement,c=e.querySelector('input[type="search"]'),l=e.closest(".menu-item"),d=()=>t?m():u(),u=()=>{if(t||i)return;t=!0,n=!1,i=!0;if(l&&a&&!e.offsetParent&&s&&s.closest("#mobile-menu, #mobile-icons-menu")){const t=document.querySelector("#site-header-inner");r||(r=document.createElement("div"),r.style.display="none",t.classList.contains("header-six-inner")&&(e.style.insetBlockStart="100%",e.style.insetInlineStart="auto",e.style.insetInlineEnd="0"),a.insertBefore(r,e)),t&&t.appendChild(e),requestAnimationFrame((()=>{document.body.classList.add("header-search-is-open"),e.classList.add("show"),e.classList.remove("wpex-invisible","wpex-opacity-0")}))}else document.body.classList.add("header-search-is-open"),e.classList.add("show"),e.classList.remove("wpex-invisible","wpex-opacity-0");s&&(s.setAttribute("aria-expanded","true"),s.closest("li")?.classList.add("active")),"function"==typeof jQuery&&jQuery(document).trigger("show.wpex.menuSearch"),e.addEventListener("transitionend",(function(){o=wpex.focusOnElement(e,c),i=!1}),{once:!0}),document.addEventListener("click",p),e.addEventListener("keydown",h)},m=()=>{t&&!i&&(t=!1,i=!0,document.body.classList.remove("header-search-is-open"),e.classList.remove("show"),e.classList.add("wpex-invisible","wpex-opacity-0"),s&&(s.setAttribute("aria-expanded","false"),s.closest("li")?.classList.remove("active"),n&&s.focus({preventScroll:!0,focusVisible:!1})),document.removeEventListener("click",p),e.removeEventListener("keydown",h),o&&(o(),o=null),r&&a&&(a.insertBefore(e,r),r.remove(),r=null,e.removeAttribute("style")),i=!1)},p=e=>{e.target.closest('#searchform-dropdown,[data-wpex-toggle="theme"],a.search-dropdown-toggle,a.mobile-menu-search,.wpex-header-search-icon button')||m()},h=e=>{t&&"Escape"===e.key&&(n=!0,m())};document.querySelectorAll("a.search-dropdown-toggle,a.mobile-menu-search,.wpex-header-search-icon button").forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault(),s=e,d()})),e.addEventListener("keydown",(t=>{" "===t.key&&(t.preventDefault(),s=e,d())}))}));const f=function(e,t=100){let s;return function(...n){clearTimeout(s),s=setTimeout((()=>e.apply(this,n)),t)}}((()=>{t&&(!e.offsetParent||s&&!s.offsetParent)&&m()}),150);window.addEventListener("resize",f)}();