import{r as i,d as t,h as s}from"./p-846bd001.js";const e=class{constructor(s){i(this,s),this.ionInput=t(this,"ionInput",7),this.fireenjinSelectUser=t(this,"fireenjinSelectUser",7),this.name=void 0,this.label=void 0,this.placeholder="Search Users",this.value=void 0,this.required=!1,this.autofocus=void 0,this.disableSearch=!1,this.disabled=void 0,this.endpoint=void 0,this.dataPropsMap=void 0,this.mode="inline",this.iconEnd=void 0,this.iconStart=void 0,this.limit=5,this.template=void 0,this.results=[],this.lines=void 0,this.labelPosition=void 0,this.selectKey="id",this.pattern=void 0}async selectUser(i,t){this.value=t[this.selectKey],this.fireenjinSelectUser.emit({event:i,user:t}),setTimeout((async()=>{await this.inputSearchEl.checkValidity({setValidationClass:!0})}),200),"popover"===this.mode?await this.inputSearchEl.closePopover():"inline"===this.mode&&await this.inputSearchEl.clearResults()}render(){return s("fireenjin-input-search",{labelPosition:this.labelPosition,lines:this.lines,iconEnd:this.iconEnd,iconStart:this.iconStart,mode:this.mode,label:this.label,ref:i=>this.inputSearchEl=i,endpoint:"searchUsers",resultsKey:"searchUsers.results",name:this.name,searchParams:{limit:this.limit?this.limit:null},results:this.results,placeholder:this.placeholder,value:this.value,template:i=>s("ion-item",{onClick:t=>this.selectUser(t,i),style:{cursor:"pointer"}},s("ion-label",null,s("h2",null,i.firstName?i.firstName:""," ",i.lastName?i.lastName:""),s("p",null,i.email?i.email:"No email on file")),s("ion-icon",{name:"checkmark-circle"}))},s("slot",{name:"start"}),s("slot",{name:"end"}),s("input",{style:{opacity:"0",height:"0",width:"0",float:"left",margin:"0",padding:"0"},type:"text",pattern:this.pattern,value:this.value,required:this.required}))}};e.style="";export{e as fireenjin_input_search_user}