import{j as t,_ as l}from"./main.2.8.10.js";import{u as F,e as S,b as r}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as I}from"./BackIcn.BFDZx8No.js";import{S as k}from"./SnackMsg.7BjcJK1j.js";import{I as v,g as N}from"./Integrations.BFhED4ck.js";import y from"./AsgarosForumAuthorization.D49l3LUP.js";import{c as f}from"./AsgarosForumCommonFunc.B8Ec_x02.js";import{A as C}from"./AsgarosForumIntegLayout.Cogx2Y6s.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./ProUtilHelpers.CtRYkgop.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.Belqr4OT.js";function K({formFields:d,setFlow:x,flow:b,allIntegURL:h}){const j=F(),{formID:m}=S(),[a,i]=r.useState(!1),[e,c]=r.useState(1),[A,o]=r.useState({show:!1}),[s,p]=r.useState({name:"Asgaros Forum",type:"Asgaros Forum",field_map:[],asgarosForumFields:[],actions:{},mainAction:""}),u=n=>{if(setTimeout(()=>{const g=document.getElementById("btcd-settings-wrp");g&&(g.scrollTop=0)},300),n===3){if(!f(s)){o({show:!0,msg:l("Please complete all required fields to continue.","bit-integrations")});return}s.name!==""&&c(n);return}c(n)};return t.jsxs("div",{children:[t.jsx(k,{snack:A,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(y,{formID:m,asgarosForumConf:s,setAsgarosForumConf:p,step:e,nextPage:u,isLoading:a,setIsLoading:i,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(C,{formID:m,formFields:d,asgarosForumConf:s,setAsgarosForumConf:p,setSnackbar:o,setIsLoading:i,isLoading:a}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>u(3),disabled:!s.mainAction||!f(s),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[l("Next","bit-integrations"),t.jsx(I,{className:"ml-1 rev-icn"})]})]}),t.jsx(v,{step:e,saveConfig:()=>N(b,x,h,s,j,"","",i),isLoading:a})]})}export{K as default};
