import{r as i,d as o,B as l,h as d}from"./p-03169580.js";import{s as n}from"./p-46225039.js";import{g as a}from"./p-3af4387d.js";import"./p-59c95c5f.js";import"./p-c9699503.js";const t="app-dashboard floodteam-activity-feed .feed-header h3{color:#fff}app-dashboard fireenjin-map{background:var(--ion-color-light-shade);border-radius:15px;display:block;margin:20px auto 0;overflow:hidden;max-width:calc(100% - 30px)}app-dashboard h1 a{padding:0}app-dashboard ion-grid{margin-top:0;padding-top:0}app-dashboard .title-divider{display:flex;justify-content:space-between;align-items:baseline}app-dashboard .title-divider>span{display:flex;align-items:baseline;padding-inline-end:5px;margin-top:auto}app-dashboard .title-divider>span>ion-button{margin-right:5px}";let e=class{constructor(l){i(this,l);this.fireenjinTrigger=o(this,"fireenjinTrigger",7);this.unreadCount=0;this.selectedStatuses=["book","evaluate","claim","mitigate","monitor","review"]}async onTrigger(i){var o,l,d,n,a;if(((o=i===null||i===void 0?void 0:i.detail)===null||o===void 0?void 0:o.trigger)==="set"&&((d=(l=i===null||i===void 0?void 0:i.detail)===null||l===void 0?void 0:l.payload)===null||d===void 0?void 0:d.name)==="status"){await this.mapEl.clearMarkers();this.selectedStatuses=((a=(n=i===null||i===void 0?void 0:i.detail)===null||n===void 0?void 0:n.payload)===null||a===void 0?void 0:a.value)||[]}}filterJobsByStatus(i,o){return i.filter((i=>o.includes(i===null||i===void 0?void 0:i.status)))}componentDidLoad(){if(!(l===null||l===void 0?void 0:l.isBrowser))return}render(){var i,o,l;return[d("ion-content",{class:"truck-background ion-padding"},d("floodteam-title-bar",null,d("ion-router-link",{href:"/profile"},"Welcome Back"," ",((i=n===null||n===void 0?void 0:n.profile)===null||i===void 0?void 0:i.firstName)?`, ${n.profile.firstName}`:"","!")),d("article",{id:"myjobs"},d("fireenjin-map",{googleMapsKey:(l=(o=n===null||n===void 0?void 0:n.config)===null||o===void 0?void 0:o.firebase)===null||l===void 0?void 0:l.apiKey,ref:i=>this.mapEl=i,markers:this.filterJobsByStatus(n===null||n===void 0?void 0:n.myJobs,this.selectedStatuses).map((i=>{var o,l;return{payload:{job:i},name:i===null||i===void 0?void 0:i.title,icon:null,position:{lat:(o=i===null||i===void 0?void 0:i.address)===null||o===void 0?void 0:o.lat,lng:(l=i===null||i===void 0?void 0:i.address)===null||l===void 0?void 0:l.lng}}}))}),d("floodteam-title-bar",null,d("ion-router-link",{href:"/jobs"},"My Jobs"," ",d("ion-badge",{style:{borderRadius:"15px"}},d("small",null,this.filterJobsByStatus(n===null||n===void 0?void 0:n.myJobs,this.selectedStatuses).length||0))),d("ion-buttons",{slot:"end"},d("ion-button",{onClick:i=>this.fireenjinTrigger.emit({event:i,name:"filter",type:"status",payload:{control:{name:"status",label:"Status",icon:"help-circle",multiple:true,options:a(),value:this.selectedStatuses}}}),color:"medium",fill:"outline",size:"small"},"Filter",d("ion-icon",{slot:"end",name:"funnel"})))),d("ion-card",null,d("ion-list",null,this.filterJobsByStatus(n===null||n===void 0?void 0:n.myJobs,this.selectedStatuses).map((i=>d("floodteam-item-job",{job:i}))))))),d("floodteam-navigation-footer",null)]}};e.style=t;export{e as app_dashboard};
//# sourceMappingURL=p-5b79a7cd.entry.js.map