import{r as t,B as i,h as s,H as o}from"./p-846bd001.js";const e=class{constructor(i){t(this,i),this.paths={default:()=>[]},this.currentPath="default",this.currentStep="selectTemplate",this.locationId=void 0,this.endpoint="sendTemplateEmail",this.errors=[],this.steps=[],this.currentSlideIndex=0}async setPath(t){var i,s,o,e;return this.currentPath=t||this.currentPath,this.currentStep=(null===(e=null===(o=null===(s=null===(i=this.paths)||void 0===i?void 0:i[this.currentPath])||void 0===s?void 0:s.call(i))||void 0===o?void 0:o[this.currentSlideIndex])||void 0===e?void 0:e.name)||null,this.steps=this.paths[this.currentPath](),this.steps}onError(t){t.detail.endpoint===this.endpoint&&setTimeout((()=>{this.errors=t.detail.error.response.errors.map((t=>t.message))}),100)}onChange(t){console.log("change",t)}async onSuccess(t){console.log("success",t),this.errors=[]}async onSlideChange(t){this.currentSlideIndex=await t.target.getActiveIndex(),await this.setPath()}onBeforeSubmit(t){return{...t}}async componentDidLoad(){(null==i?void 0:i.isBrowser)&&await this.setPath()}render(){const t=1/this.steps.length*this.currentSlideIndex;return s(o,null,this.errors.map((t=>s("floodteam-error",{message:t}))),!(this.currentSlideIndex>=this.steps.length)&&s("ion-progress-bar",{style:{width:"80%",margin:"0 auto",transition:"opacity ease 500ms",opacity:"1"},value:t}),s("fireenjin-flow",{endpoint:this.endpoint,steps:this.steps,beforeSubmit:this.onBeforeSubmit.bind(this),prevButton:{color:"medium",fill:"outline",label:"Back"},nextButton:{color:"primary",fill:"solid",icon:null,label:"Next"}},s("div",{style:{color:"var(--ion-text-color)",padding:"2rem 3rem"}},s("h1",{class:"ion-padding-horizontal"},"Success! Emails have been sent. 📨"),s("p",{class:"ion-padding-horizontal",style:{color:"var(--ion-color-medium-shade)"}},"The company has been added to the database and will be synced with Notion."))))}};export{e as floodteam_eblast_flow}