import{r as o,B as i,h as n}from"./p-f8363b1b.js";import{s as e}from"./p-c78d1e1b.js";import{g as l}from"./p-e2c3460e.js";import{t}from"./p-510e3bc9.js";import"./p-3775d1fc.js";import"./p-80de33dc.js";import"./p-c2fbed0d.js";import"./p-5717491f.js";import"./p-de14d315.js";import"./p-d2ac57a0.js";import"./p-f44f0a67.js";const d=class{constructor(i){o(this,i),this.referring=!1}async onSuccess(o){"recommendation"===o.detail.name&&(this.to=null,this.name=null,(await t.create({message:"Successfully sent recommendation(s).",duration:3e3})).present())}onBeforeSubmit(o){var i,n,l,t,d,a,r,s,m,u,c,p;return{templateId:"BaGYHYB6q7UBmgvoPATx",from:"info@thefloodteam.com",emails:(null===(n=null===(i=null==o?void 0:o.to)||void 0===i?void 0:i.split)||void 0===n?void 0:n.call(i,","))||[],data:{firstName:(null==o?void 0:o.name)||"there",url:`${e.config.url}?referredBy=${null===(l=e.profile)||void 0===l?void 0:l.id}`,partner:{id:null===(t=null==e?void 0:e.session)||void 0===t?void 0:t.uid,name:`${(null===(d=null==e?void 0:e.profile)||void 0===d?void 0:d.firstName)||""} ${(null===(a=null==e?void 0:e.profile)||void 0===a?void 0:a.lastName)||""}`,company:(null===(s=null===(r=null==e?void 0:e.profile)||void 0===r?void 0:r.company)||void 0===s?void 0:s.name)||"The Flood Team",title:(null===(m=null==e?void 0:e.profile)||void 0===m?void 0:m.type)||"Mitigation Specialist",phone:null===(u=null==e?void 0:e.profile)||void 0===u?void 0:u.phone,location:null===(p=null===(c=null==e?void 0:e.profile)||void 0===c?void 0:c.location)||void 0===p?void 0:p.name}}}}componentDidLoad(){}render(){var o;return[n("ion-content",{class:"ion-padding"},n("floodteam-title-bar",null,n("ion-router-link",{href:"/jobs"},"Jobs")),n("ion-grid",null,n("ion-row",null,n("ion-col",{size:"12",sizeMd:"6"},n("h1",{class:"title"},this.referring?"Refer A Flood":"Add Job"),n("floodteam-book-now",{referring:this.referring,referralId:null===(o=null==e?void 0:e.session)||void 0===o?void 0:o.uid,token:l("token"),locationId:this.locationId||l("location")})),n("ion-col",{size:"12",sizeMd:"6"},n("h1",{class:"title"},"Recommend Us"),n("ion-card",null,n("ion-card-content",{class:"ion-padding"},n("p",null,"Enter the email or phone of the person you would like to recommend The Flood Team water damage restoration services to and we will send them an email detailing how we can help."),n("br",null),n("fireenjin-form",{hideControls:!0,name:"recommendation",endpoint:"sendTemplateEmail",disableEnterButton:!0,beforeSubmit:this.onBeforeSubmit.bind(this)},n("ion-grid",null,n("ion-row",null,n("ion-col",null,n("fireenjin-input",{name:"name",placeholder:"Customer's Name",value:this.name}),n("fireenjin-input",{name:"to",placeholder:"Customer's Email",value:this.to}))),n("ion-row",null,n("ion-col",null,n("ion-button",{size:"default",expand:"block",type:"submit"},"Send",n("ion-icon",{name:"send",slot:"end"})))))))))))),n("floodteam-navigation-footer",null)]}};d.style="";export{d as app_job_new}