var W=Object.defineProperty;var f=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var b=(i,e,t)=>e in i?W(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,g=(i,e)=>{for(var t in e||(e={}))_.call(e,t)&&b(i,t,e[t]);if(f)for(var t of f(e))G.call(e,t)&&b(i,t,e[t]);return i};import{_ as s,j as a}from"./main.2.8.1.js";import{u as I,h as q,d as c}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as w}from"./SnackMsg.S8DrwLlT.js";import{S as A}from"./Steps.1hz7v9Vj.js";import{I as F,s as P}from"./Integrations.D2bgBas2.js";import{G as E,h as L,c as T}from"./GiveWpIntegLayout.DGzm4OPj.js";import D from"./GiveWpAuthorization.eD4CIMWG.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";import"./BackIcn._kGL_vVw.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";function ie({formFields:i,setFlow:e,flow:t,allIntegURL:d,isInfo:h,edit:v}){const x=I(),{formID:k}=q(),[r,p]=c.useState(!1),[l,u]=c.useState(1),[y,o]=c.useState({show:!1}),j=[{key:"1",label:s("Create a donar","bit-integrations")}],S=[{key:"email",label:s("Email","bit-integrations"),required:!0},{key:"name",label:s("Name","bit-integrations"),required:!1},{key:"first_name",label:s("First Name","bit-integrations"),required:!1},{key:"last_name",label:s("Last Name","bit-integrations"),required:!1},{key:"purchase_value",label:s("Purchase Value","bit-integrations"),required:!1},{key:"purchase_count",label:s("Purchase Count","bit-integrations"),required:!1}],[n,m]=c.useState({name:"GiveWp",type:"GiveWp",mainAction:"",field_map:[{formField:"",giveWpFormField:""}],allActions:j,giveWpFields:S,actions:{}}),C=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!T(n)){o({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}n.mainAction!==""&&u(3)};return a.jsxs("div",{children:[a.jsx(w,{snack:y,setSnackbar:o}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(A,{step:3,active:l})}),a.jsx(D,{formID:k,giveWpConf:n,setGiveWpConf:m,step:l,setStep:u,isLoading:r,setIsLoading:p,setSnackbar:o}),a.jsxs("div",{className:"btcd-stp-page",style:g({},l===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(E,{formFields:i,handleInput:N=>L(N,n,m),giveWpConf:n,setGiveWpConf:m,isLoading:r,setIsLoading:p,setSnackbar:o,allIntegURL:d,isInfo:h,edit:v}),a.jsxs("button",{onClick:()=>C(),disabled:!n.mainAction||r,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[s("Next","bit-integrations")," ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(F,{step:l,saveConfig:()=>P({flow:t,setFlow:e,allIntegURL:d,navigate:x,conf:n,setIsLoading:p,setSnackbar:o}),isLoading:r,dataConf:n,setDataConf:m,formFields:i})]})}export{ie as default};
