const elSearch=document.getElementById("comSchedulerSelectSearch"),elSearchContainer=document.getElementById("comSchedulerSelectSearchContainer"),elSearchHeader=document.getElementById("comSchedulerSelectTypeHeader"),elSearchResults=document.getElementById("comSchedulerSelectResultsContainer"),alertElement=document.querySelector(".tasks-alert"),elCards=[].slice.call(document.querySelectorAll(".comSchedulerSelectCard"));if(elSearch&&elSearchContainer){elSearch.addEventListener("keyup",(({target:e})=>{const t=e.value;let r=!1;"undefined"!=typeof sessionStorage&&sessionStorage.setItem("Joomla.com_scheduler.new.search",t),elCards.forEach((e=>{if(e.classList.remove("d-none"),!t)return;const a=e.querySelector(".new-task-title"),c=e.querySelector(".card-body"),l=a?a.textContent:"",s=c?c.textContent:"";l&&!l.toLowerCase().includes(t.toLowerCase())&&s&&!s.toLowerCase().includes(t.toLowerCase())?e.classList.add("d-none"):r=!0})),r||!t?(alertElement.classList.add("d-none"),elSearchHeader.classList.remove("d-none"),elSearchResults.classList.remove("d-none")):(alertElement.classList.remove("d-none"),elSearchHeader.classList.add("d-none"),elSearchResults.classList.add("d-none"))})),elSearchContainer.classList.remove("d-none"),elSearch.focus();try{"undefined"!=typeof sessionStorage&&(elSearch.value=sessionStorage.getItem("Joomla.com_scheduler.new.search")||"",elSearch.dispatchEvent(new KeyboardEvent("keyup")))}catch(e){}}