import{u as x,r as i,j as t}from"./main-406.js";import{d as j,_ as b,I,s as S}from"./bi.394.85.js";import{B as v}from"./bi.46.744.js";import{S as M}from"./bi.68.941.js";import k from"./bi.59.258.js";import{s as C,h as w,c as N}from"./bi.36.768.js";import{M as y}from"./bi.940.769.js";import"./bi.150.760.js";import"./bi.704.707.js";import"./bi.701.708.js";function D({formFields:r,setFlow:p,flow:l,allIntegURL:u}){const d=x(),[c,n]=i.useState(!1),[a,m]=i.useState(1),[f,s]=i.useState({show:!1}),[e,o]=i.useState({name:"Mautic",type:"Mautic",clientId:"",clientSecret:"",baseUrl:"",field_map:[{formField:"",mauticField:""}],actions:{}});i.useEffect(()=>{window.opener&&C("mautic")},[]);const g=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!N(e)){s({show:!0,msg:"Please map fields to continue."});return}e.listId!==""&&m(3)};return t.jsxs("div",{children:[t.jsx(j,{snack:f,setSnackbar:s}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(M,{step:3,active:a})}),t.jsx(k,{mauticConf:e,setMauticConf:o,step:a,setstep:m,isLoading:c,setIsLoading:n,setSnackbar:s}),t.jsxs("div",{className:"btcd-stp-page",style:{width:a===2&&900,height:a===2&&"auto"},children:[t.jsx(y,{formFields:r,handleInput:h=>w(h,e,o,n,s),mauticConf:e,setMauticConf:o,isLoading:c,setIsLoading:n,setSnackbar:s}),t.jsxs("button",{onClick:()=>g(),disabled:e.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[b("Next","bit-integrations"),t.jsx(v,{className:"ml-1 rev-icn"})]})]}),t.jsx(I,{step:a,saveConfig:()=>S({flow:l,setFlow:p,allIntegURL:u,navigate:d,conf:e,setIsLoading:n,setSnackbar:s}),isLoading:c,dataConf:e,setDataConf:o,formFields:r})]})}export{D as default};
