import{j as t,_ as d}from"./main.2.9.0.js";import{u as b,e as j,b as a}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as P}from"./BackIcn._8Wofmn2.js";import{S as I}from"./SnackMsg.DYSD96P4.js";import{I as C,g as k}from"./Integrations.DL8wqGct.js";import v from"./SeoPressAuthorization.BVVtdArC.js";import{S as N,c as y}from"./SeoPressIntegLayout.CJXBp5Lh.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";import"./ProUtilHelpers.CHf_DzPf.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.B6YI8w_n.js";function K({formFields:p,setFlow:g,flow:u,allIntegURL:x}){const S=b(),{formID:c}=j(),[i,r]=a.useState(!1),[e,f]=a.useState(1),[h,o]=a.useState({show:!1}),[s,n]=a.useState({name:"SEOPress",type:"SeoPress",field_map:[{formField:"",seoPressField:""}],actions:{},mainAction:""}),l=m=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),m!==3&&f(m),!y(s)){o({show:!0,msg:d("Please map all required fields to continue.","bit-integrations")});return}s.name!==""&&s.field_map.length>0&&f(m)};return t.jsxs("div",{children:[t.jsx(I,{snack:h,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(v,{formID:c,seoPressConf:s,setSeoPressConf:n,step:e,nextPage:l,isLoading:i,setIsLoading:r,setSnackbar:o}),t.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:[t.jsx(N,{formID:c,formFields:p,seoPressConf:s,setSeoPressConf:n,setSnackbar:o,setIsLoading:r,isLoading:i}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>l(3),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[d("Next","bit-integrations"),t.jsx(P,{className:"ml-1 rev-icn"})]})]}),t.jsx(C,{step:e,saveConfig:()=>k(u,g,x,s,S,"","",r),isLoading:i,dataConf:s,setDataConf:n,formFields:p})]})}export{K as default};
