import{j as t,_ as f}from"./main.2.9.0.js";import{u as C,e as j,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as v}from"./BackIcn._8Wofmn2.js";import{S as M}from"./SnackMsg.DYSD96P4.js";import{I as S,g as I}from"./Integrations.DL8wqGct.js";import W from"./MoreConvertWishlistAuthorization.BYpuA9Tq.js";import{M as k,c as N}from"./MoreConvertWishlistIntegLayout.Br1grDZf.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:a,setFlow:d,flow:g,allIntegURL:h}){const u=C(),{formID:x}=j(),[m,l]=i.useState(!1),[s,p]=i.useState(1),[b,o]=i.useState({show:!1}),[e,r]=i.useState({name:"MoreConvert Wishlist",type:"MoreConvert Wishlist",field_map:[{formField:"",moreConvertWishlistField:""}],actions:{},mainAction:""}),c=n=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),n===3){if(!N(e)){o({show:!0,msg:f("Please map all required fields to continue.","bit-integrations")});return}e.name!==""&&e.field_map.length>0&&p(n)}else p(n)};return t.jsxs("div",{children:[t.jsx(M,{snack:b,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(W,{formID:x,moreConvertWishlistConf:e,setMoreConvertWishlistConf:r,step:s,nextPage:c,isLoading:m,setIsLoading:l,setSnackbar:o}),t.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto",minHeight:s===2&&"500px"},children:[t.jsx(k,{formFields:a,moreConvertWishlistConf:e,setMoreConvertWishlistConf:r}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>c(3),disabled:e.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[f("Next","bit-integrations"),t.jsx(v,{className:"ml-1 rev-icn"})]})]}),t.jsx(S,{step:s,saveConfig:()=>I(g,d,h,e,u,"","",l),isLoading:m,dataConf:e,setDataConf:r,formFields:a})]})}export{K as default};
