var I=Object.defineProperty;var b=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var f=(s,t,e)=>t in s?I(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,g=(s,t)=>{for(var e in t||(t={}))E.call(t,e)&&f(s,e,t[e]);if(b)for(var e of b(t))N.call(t,e)&&f(s,e,t[e]);return s};import{_ as o,j as a}from"./main.2.8.10.js";import{u as A,e as K,b as c}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as _}from"./SnackMsg.7BjcJK1j.js";import{S as C}from"./Steps.B84Ui3GU.js";import{I as F,s as w}from"./Integrations.BFhED4ck.js";import{h as T,c as q}from"./KirimEmailCommonFunc.Fh7ucDvf.js";import{B}from"./BackIcn.BFDZx8No.js";import L from"./KirimEmailAuthorization.D_IN4Duc.js";import{K as D}from"./KirimEmailIntegLayout.BHbCPtA0.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function it({formFields:s,setFlow:t,flow:e,allIntegURL:x}){const h=A(),{formID:v}=K(),[r,p]=c.useState(!1),[n,d]=c.useState(1),[k,m]=c.useState({show:!1}),j=[{key:"full_name",label:o("Full Name","bit-integrations"),required:!0},{key:"email",label:o("Email","bit-integrations"),required:!0},{key:"tags",label:o("Tags","bit-integrations"),required:!1}],S=[{key:"1",label:o("Add Subscriber","bit-integrations")},{key:"2",label:o("Remove Subscriber","bit-integrations")}],[i,l]=c.useState({name:"Kirim Email",type:"Kirim Email",mainAction:"",userName:"vaishak",api_key:"",field_map:[{formField:"",kirimEmailFormField:""}],subscriberFields:j,allActions:S,actions:{}}),y=u=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),d(3)};return a.jsxs("div",{children:[a.jsx(_,{snack:k,setSnackbar:m}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(C,{step:3,active:n})}),a.jsx(L,{formID:v,kirimEmailConf:i,setKirimEmailConf:l,step:n,setstep:d,isLoading:r,setIsLoading:p,setSnackbar:m}),a.jsxs("div",{className:"btcd-stp-page",style:g({},n===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(D,{formFields:s,handleInput:u=>T(u,i,l),kirimEmailConf:i,setKirimEmailConf:l,isLoading:r,setIsLoading:p,setSnackbar:m}),a.jsxs("button",{onClick:()=>y(),disabled:!q(i==null?void 0:i.field_map)||i.mainAction===""||r||i.mainAction==="1"&&(i.listId===""||i.listId===void 0),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[o("Next","bit-integrations"),a.jsx(B,{className:"ml-1 rev-icn"})]})]}),a.jsx(F,{step:n,saveConfig:()=>w({flow:e,setFlow:t,allIntegURL:x,conf:i,navigate:h,setIsLoading:p,setSnackbar:m}),isLoading:r,dataConf:i,setDataConf:l,formFields:s})]})}export{it as default};
