import{r as o,B as i,h as e}from"./p-03169580.js";import{s as n}from"./p-e1ee6da1.js";import{g as l}from"./p-e2c3460e.js";import{t as d}from"./p-5a032a89.js";import"./p-59c95c5f.js";import"./p-3775d1fc.js";import"./p-80de33dc.js";import"./p-c2fbed0d.js";import"./p-5717491f.js";import"./p-de14d315.js";import"./p-4cb16df5.js";import"./p-f44f0a67.js";const t="";let r=class{constructor(i){o(this,i);this.referring=false}async onSuccess(o){if(o.detail.name==="recommendation"){this.to=null;this.name=null;(await d.create({message:`Successfully sent recommendation(s).`,duration:3e3})).present()}}onBeforeSubmit(o){var i,e,l,d,t,r,a,s,u,m,v,p;return{templateId:"BaGYHYB6q7UBmgvoPATx",from:"info@thefloodteam.com",emails:((e=(i=o===null||o===void 0?void 0:o.to)===null||i===void 0?void 0:i.split)===null||e===void 0?void 0:e.call(i,","))||[],data:{firstName:(o===null||o===void 0?void 0:o.name)||"there",url:`${n.config.url}?referredBy=${(l=n.profile)===null||l===void 0?void 0:l.id}`,partner:{id:(d=n===null||n===void 0?void 0:n.session)===null||d===void 0?void 0:d.uid,name:`${((t=n===null||n===void 0?void 0:n.profile)===null||t===void 0?void 0:t.firstName)||""} ${((r=n===null||n===void 0?void 0:n.profile)===null||r===void 0?void 0:r.lastName)||""}`,company:((s=(a=n===null||n===void 0?void 0:n.profile)===null||a===void 0?void 0:a.company)===null||s===void 0?void 0:s.name)||"The Flood Team",title:((u=n===null||n===void 0?void 0:n.profile)===null||u===void 0?void 0:u.type)||"Mitigation Specialist",phone:(m=n===null||n===void 0?void 0:n.profile)===null||m===void 0?void 0:m.phone,location:(p=(v=n===null||n===void 0?void 0:n.profile)===null||v===void 0?void 0:v.location)===null||p===void 0?void 0:p.name}}}}componentDidLoad(){if(!(i===null||i===void 0?void 0:i.isBrowser))return}render(){var o;return[e("ion-content",{class:"ion-padding"},e("floodteam-title-bar",null,e("ion-router-link",{href:"/jobs"},"Jobs")),e("ion-grid",null,e("ion-row",null,e("ion-col",{size:"12",sizeMd:"6"},e("h1",{class:"title"},this.referring?"Refer A Flood":"Add Job"),e("floodteam-book-now",{referring:this.referring,referralId:(o=n===null||n===void 0?void 0:n.session)===null||o===void 0?void 0:o.uid,token:l("token"),locationId:this.locationId||l("location")})),e("ion-col",{size:"12",sizeMd:"6"},e("h1",{class:"title"},"Recommend Us"),e("ion-card",null,e("ion-card-content",{class:"ion-padding"},e("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."),e("br",null),e("fireenjin-form",{hideControls:true,name:"recommendation",endpoint:"sendTemplateEmail",disableEnterButton:true,beforeSubmit:this.onBeforeSubmit.bind(this)},e("ion-grid",null,e("ion-row",null,e("ion-col",null,e("fireenjin-input",{name:"name",placeholder:"Customer's Name",value:this.name}),e("fireenjin-input",{name:"to",placeholder:"Customer's Email",value:this.to}))),e("ion-row",null,e("ion-col",null,e("ion-button",{size:"default",expand:"block",type:"submit"},"Send",e("ion-icon",{name:"send",slot:"end"})))))))))))),e("floodteam-navigation-footer",null)]}};r.style=t;export{r as app_job_new};
//# sourceMappingURL=p-589216f3.entry.js.map