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.1.js";import{u as _,h as k,d as c}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as y}from"./SnackMsg.S8DrwLlT.js";import{S as N}from"./Steps.1hz7v9Vj.js";import{I as T,s as w}from"./Integrations.D2bgBas2.js";import L from"./DiscordAuthorization.Dm7Pi3wS.js";import{h as B}from"./DiscordCommonFunc.CxpQNkyY.js";import{D as E}from"./DiscordIntegLayout.DbQP6kDW.js";import{B as A}from"./BackIcn._kGL_vVw.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.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};
