import{r as i,d as o,h as e,H as t,e as l}from"./p-846bd001.js";const n=class{constructor(e){i(this,e),this.fireenjinSubmit=o(this,"fireenjinSubmit",7),this.user=void 0,this.jobId=void 0,this.role=void 0,this.disabled=!1}removeUserFromJob(i){confirm(`Are you sure you want to remove ${(null==i?void 0:i.firstName)?i.firstName:"this user"} from the job?`)&&(this.fireenjinSubmit.emit({endpoint:"removeUserFromJob",data:{jobId:this.jobId,userId:i.id}}),this.slidingEl&&this.slidingEl.close())}render(){var i,o,l,n,s,a;return e(t,null,e("ion-item-sliding",{ref:i=>this.slidingEl=i,disabled:this.disabled},e("ion-item",{href:this.disabled?null:`/users/${this.user.id}`,detail:!0},e("fireenjin-avatar",{style:{marginInlineEnd:"8px"},src:this.user.photo,initials:`${(null===(i=this.user)||void 0===i?void 0:i.firstName)?this.user.firstName.charAt(0):""}${(null===(o=this.user)||void 0===o?void 0:o.lastName)?this.user.lastName.charAt(0):""}`,slot:"start"}),e("ion-label",null,e("h2",null,(null===(l=this.user)||void 0===l?void 0:l.firstName)||""," ",(null===(n=this.user)||void 0===n?void 0:n.lastName)||""),e("p",null,(null===(s=this.user)||void 0===s?void 0:s.email)||"")),e("floodteam-select-role",{jobId:this.jobId,userId:null===(a=this.user)||void 0===a?void 0:a.id,value:this.role,slot:"end"})),e("ion-item-options",null,e("ion-item-option",{color:"danger",onClick:()=>this.removeUserFromJob(this.user)},e("ion-icon",{slot:"end",name:"close-circle"}),"Remove"))))}};n.style="floodteam-item-user h3,floodteam-item-user ion-text{display:block;text-indent:10px}floodteam-item-user ion-label{margin-top:5px;margin-bottom:0px;text-transform:capitalize}floodteam-item-user ion-grid ion-chip{padding:0px 15px;--background:transparent;--color:var(--ion-text-color);opacity:0.5}floodteam-item-user ion-chip ion-icon{height:15px;width:15px;color:var(--ion-text-color)}floodteam-item-user ion-grid,floodteam-item-user ion-grid ion-row,floodteam-item-user ion-grid ion-row ion-col{padding:0;margin:0}";const s=class{constructor(e){i(this,e),this.fireenjinTrigger=o(this,"fireenjinTrigger",7),this.fireenjinSubmit=o(this,"fireenjinSubmit",7),this.name="lostReason",this.value=void 0,this.jobId=void 0,this.disabled=!1}onTrigger(i){var o,e,t,l,n;(null===(t=null===(e=null===(o=null==i?void 0:i.detail)||void 0===o?void 0:o.event)||void 0===e?void 0:e.detail)||void 0===t?void 0:t.type)===this.name&&(this.value=(null===(n=null===(l=null==i?void 0:i.detail)||void 0===l?void 0:l.payload)||void 0===n?void 0:n.value)||null,this.fireenjinSubmit.emit({endpoint:"editJob",id:this.jobId,data:{lostReason:this.value}}))}render(){var i;const o=[{label:"No Availability",value:"no-availability"},{label:"Wrong Type of Job",value:"wrong-type"},{label:"Insurance Recommendation",value:"insurance-recommendation"},{label:"Chose Competitor",value:"competitor"},{label:"No Coverage / Can't Afford",value:"no-coverage"},{label:"Too Expensive",value:"too-expensive"},{label:"Bad Lead",value:"bad-lead"}];return e("ion-chip",{onClick:i=>{this.disabled||(i.preventDefault(),i.stopPropagation(),this.fireenjinTrigger.emit({event:i,name:"filter",type:this.name,el:this.selectLocationEl,payload:{control:{name:this.name,label:"Lost Reason",icon:"info",options:o,value:this.value}}}))}},e("ion-icon",{name:"help",class:"ft-icon-style"}),e("ion-label",{class:"ion-text-capitalize"},(null===(i=(o||[]).find((i=>(null==i?void 0:i.value)===this.value)))||void 0===i?void 0:i.label)||"No Reason Set"))}get selectLocationEl(){return l(this)}};export{n as floodteam_item_user,s as floodteam_select_lost_reason}