var S=Object.defineProperty;var f=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var u=(s,e,t)=>e in s?S(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,x=(s,e)=>{for(var t in e||(e={}))v.call(e,t)&&u(s,t,e[t]);if(f)for(var t of f(e))k.call(e,t)&&u(s,t,e[t]);return s};import{D as I,r,j as o,S as b,V as F}from"./main-634.js";import"./bf-25-81.js";import{S as C}from"./bf-54-258.js";import{a7 as N}from"./bf-746-82.js";import{I as B}from"./bf-942-184.js";import{N as q}from"./bf-123-109.js";import L from"./bf-235-127.js";import{a as M,c as P}from"./bf-12-183.js";import{T as _}from"./bf-837-226.js";import"./bf-275-83.js";import"./bf-822-108.js";import"./bf-438-114.js";function W({formFields:s,setIntegration:e,integrations:t,allIntegURL:g}){const w=I(),[p,n]=r.useState(!1),[a,c]=r.useState(1),[h,l]=r.useState({show:!1}),T=[{key:"To",label:"To",required:!0},{key:"Body",label:"Message Body",required:!0}],[i,d]=r.useState({name:"Twilio",type:"Twilio",sid:"",token:"",from_num:"",field_map:[{formField:"",twilioField:"To"},{formField:"",twilioField:"Body"}],twilioFields:T}),j=()=>{n(!0),N(t,e,g,i,w)},y=m=>{if(!P(i)){F.error("Please map mandatory fields");return}i.field_map.length>0&&c(m)};return document.querySelector(".btcd-s-wrp").scrollTop=0,o.jsxs("div",{children:[o.jsx(b,{snack:h,setSnackbar:l}),o.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:o.jsx(C,{step:3,active:a})}),o.jsx(L,{twilioConf:i,setTwilioConf:d,step:a,setstep:c,isLoading:p,setIsLoading:n,setSnackbar:l}),o.jsxs("div",{className:"btcd-stp-page",style:x({},a===2&&{width:900,height:"auto",overflow:"visible"}),children:[o.jsx(_,{formFields:s,handleInput:m=>M(m,i,d),twilioConf:i,setTwilioConf:d,isLoading:p,setIsLoading:n,setSnackbar:l}),o.jsx(q,{nextPageHandler:()=>y(3)})]}),o.jsx(B,{step:a,saveConfig:()=>j()})]})}export{W as default};
