import{Component}from"@theme/component";import{debounce}from"@theme/utilities";class SearchPageInputComponent extends Component{requiredRefs=["searchPageInput"];handleClearClick(){this.#submitEmptySearch()}handleKeyDown=debounce(event=>{const value=this.refs.searchPageInput.value.trim();event.key==="Escape"&&value===""&&this.#submitEmptySearch()},100);#submitEmptySearch(){const searchInput=this.refs.searchPageInput;searchInput.focus(),searchInput.value="",!this.#isEmptyState()&&searchInput.form?.submit()}#isEmptyState=()=>(new URL(window.location.href).searchParams.get("q")??"").trim()===""}customElements.get("search-page-input-component")||customElements.define("search-page-input-component",SearchPageInputComponent);
//# sourceMappingURL=/s/files/1/0677/1399/0759/t/1/assets/search-page-input.js.map?v=1783128772
