var C=Object.defineProperty;var p=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var f=(a,t,e)=>t in a?C(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,h=(a,t)=>{for(var e in t||(t={}))N.call(t,e)&&f(a,e,t[e]);if(p)for(var e of p(t))_.call(t,e)&&f(a,e,t[e]);return a};import{u as w,k as E,r as m,j as s}from"./main-333.js";import{_ as d,d as F,I as L,s as T,N as D}from"./bi.636.93.js";import{S as M}from"./bi.563.969.js";import P from"./bi.385.278.js";import{h as q,c as g}from"./bi.464.814.js";import{A as z}from"./bi.258.813.js";import"./bi.429.767.js";import"./bi.318.783.js";import"./bi.535.730.js";import"./bi.286.731.js";import"./bi.629.757.js";function X({formFields:a,setFlow:t,flow:e,allIntegURL:x}){const A=w(),{formID:u}=E(),[l,o]=m.useState(!1),[r,b]=m.useState(1),[j,n]=m.useState({show:!1}),v=[{key:"1",label:"Add/Update Subscriber"},{key:"2",label:"Delete Subscriber"}],I=[{key:"email",label:"Email",required:!0}],[i,c]=m.useState({name:"Acumbamail",type:"Acumbamail",mainAction:"",listId:"",auth_token:"",field_map:[{formField:"",acumbamailFormField:"EMAIL"}],addSubsCriberFields:I,allActions:v,address_field:[],actions:{}}),S=`
  <h4>${d("This integration can only be accessed by the payed users of Acumbamail","bit-integrations")}</h4>`,k=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!g(i)){n({show:!0,msg:d("Please map fields to continue.","bit-integrations")});return}i.listId!==""&&b(3)};return s.jsxs("div",{children:[s.jsx(F,{snack:j,setSnackbar:n}),s.jsx("div",{className:"txt-center mt-2",children:s.jsx(M,{step:3,active:r})}),s.jsx(P,{formID:u,acumbamailConf:i,setAcumbamailConf:c,step:r,setstep:b,isLoading:l,setIsLoading:o,setSnackbar:n}),s.jsxs("div",{className:"btcd-stp-page",style:h({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[s.jsx(z,{formFields:a,handleInput:y=>q(y,i,c,o,n,u),acumbamailConf:i,setAcumbamailConf:c,isLoading:l,setIsLoading:o,setSnackbar:n}),s.jsxs("button",{onClick:()=>k(),disabled:!i.mainAction||!g(i),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[d("Next","bit-integrations"),"  ",s.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.jsx(L,{step:r,saveConfig:()=>T({flow:e,setFlow:t,allIntegURL:x,navigate:A,conf:i,setIsLoading:o,setSnackbar:n}),isLoading:l,dataConf:i,setDataConf:c,formFields:a}),s.jsx(D,{note:S})]})}export{X as default};
