import{r as o,d as i,h as s}from"./p-03169580.js";import{t as e}from"./p-5a032a89.js";import"./p-4cb16df5.js";import"./p-f44f0a67.js";const t="app-user ion-card,app-user ion-card ion-list{overflow:visible !important;contain:none !important}";let n=class{constructor(s){o(this,s);this.floodteamOpenModal=i(this,"floodteamOpenModal",7);this.floodteamCloseModal=i(this,"floodteamCloseModal",7);this.fireenjinFetch=i(this,"fireenjinFetch",7);this.user={};this.jobs=[]}async onSuccess(o){var i,s,e,t,n,r;if(o.detail.endpoint==="addUser"){const t=document.querySelector("ion-router");if(!t||!((e=(s=(i=o===null||o===void 0?void 0:o.detail)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.addUser)===null||e===void 0?void 0:e.id))return;t.push(`/users/${o.detail.data.addUser.id}`)}else if(o.detail.endpoint==="editUser"){this.presentToast()}else if(((t=o===null||o===void 0?void 0:o.detail)===null||t===void 0?void 0:t.endpoint)==="findUser"){this.user=(r=(n=o===null||o===void 0?void 0:o.detail)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.user}}async presentToast(){const o=await e.create({message:"The user has been updated.",duration:2e3});o.present()}render(){return[s("ion-content",{scrollEvents:true,class:"ion-padding"},s("floodteam-title-bar",{pin:{icon:"person",href:`/users/${this.userId}`,name:this.user.firstName||"User"}},s("ion-router-link",{href:"/users"},"Users")),s("ion-grid",null,s("ion-row",null,s("ion-col",null,s("ion-card",{class:"ion-padding"},s("floodteam-form-user",{userId:this.userId,showPhoto:true}))),s("ion-col",null,s("fireenjin-pagination",{ref:o=>this.paginationEl=o,disableVirtualScroll:true,listEl:({result:o})=>s("floodteam-item-job",{job:o}),endpoint:"listJobs",limit:4,fetchParams:{withPayables:true},fetchData:{userId:this.userId},resultsKey:"jobs",query:this.query,removeDuplicates:true}))))),s("floodteam-navigation-footer",null)]}};n.style=t;export{n as app_user};
//# sourceMappingURL=p-0b01c644.entry.js.map