var S=Object.defineProperty;var f=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var u=(s,t,e)=>t in s?S(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,h=(s,t)=>{for(var e in t||(t={}))C.call(t,e)&&u(s,e,t[e]);if(f)for(var e of f(t))D.call(t,e)&&u(s,e,t[e]);return s};import{j as a,_ as I}from"./main.2.8.10.js";import{u as _,e as k,b as c}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as y}from"./SnackMsg.7BjcJK1j.js";import{S as N}from"./Steps.B84Ui3GU.js";import{I as T,s as w}from"./Integrations.BFhED4ck.js";import L from"./DiscordAuthorization.Cwjv5Zj5.js";import{h as B}from"./DiscordCommonFunc.Dgxk7_Uh.js";import{D as E}from"./DiscordIntegLayout.DjGphvsD.js";import{B as A}from"./BackIcn.BFDZx8No.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";/* empty css                */function Z({formFields:s,setFlow:t,flow:e,allIntegURL:x}){const g=_(),{formID:v}=k(),[m,d]=c.useState(!1),[r,l]=c.useState(1),[b,i]=c.useState({show:!1}),[o,n]=c.useState({name:"Discord",type:"Discord",accessToken:"",parse_mode:"HTML",field_map:[{formField:"",discordFormField:""}],server_id:"",channel_id:"",body:"",actions:{}}),j=p=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),o.name!==""&&o.selectedChannel&&o.selectedServer&&l(p)};return a.jsxs("div",{children:[a.jsx(y,{snack:b,setSnackbar:i}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(N,{step:3,active:r})}),a.jsx(L,{formID:v,discordConf:o,setDiscordConf:n,step:r,setstep:l,isLoading:m,setIsLoading:d,setSnackbar:i}),a.jsxs("div",{className:"btcd-stp-page",style:h({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(E,{formFields:s,handleInput:p=>B(p,o,n),discordConf:o,setDiscordConf:n,isLoading:m,setIsLoading:d,setSnackbar:i}),a.jsxs("button",{onClick:()=>j(3),disabled:o.selectedChannel===""||o.selectedServer==="",className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[I("Next","bit-integrations"),a.jsx(A,{className:"ml-1 rev-icn"})]})]}),a.jsx(T,{step:r,saveConfig:()=>w({flow:e,setFlow:t,allIntegURL:x,conf:o,navigate:g,setIsLoading:d,setSnackbar:i}),isLoading:m,dataConf:o,setDataConf:n,formFields:s})]})}export{Z as default};
