import{j as t,_ as w}from"./main.2.8.10.js";import{u as C,e as j,b as r}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as b}from"./BackIcn.BFDZx8No.js";import{S}from"./SnackMsg.7BjcJK1j.js";import{S as v}from"./Steps.B84Ui3GU.js";import{I as P,s as I}from"./Integrations.BFhED4ck.js";import N from"./WPCoursewareAuthorization.BN5Zq5Du.js";import{W}from"./WPCoursewareIntegLayout.DwWzFJGU.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";function q({formFields:c,setFlow:f,flow:d,allIntegURL:g}){const x=C(),{formID:m}=j(),[p,i]=r.useState(!1),[e,u]=r.useState(1),[h,o]=r.useState({show:!1}),[s,n]=r.useState({name:"WP Courseware",type:"WP Courseware",field_map:[{formField:"",wpCoursewareField:""}],default:{},action:"",course:[],actions:{}}),l=a=>{(a===2&&s.name!==""||a===3&&s.action!==""&&s.course.length>0)&&u(a),document.getElementById("btcd-settings-wrp").scrollTop=0};return t.jsxs("div",{children:[t.jsx(S,{snack:h,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(v,{step:3,active:e})}),t.jsx(N,{formID:m,wpCoursewareConf:s,setWPCoursewareConf:n,step:e,nextPage:l,isLoading:p,setIsLoading:i,setSnackbar:o}),t.jsx("div",{className:"btcd-stp-page",style:{overflow:e===2&&"initial",width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:t.jsx(W,{formID:m,formFields:c,wpCoursewareConf:s,setWPCoursewareConf:n,setIsLoading:i,setSnackbar:o})}),t.jsx(P,{step:e,saveConfig:()=>I({flow:d,setFlow:f,allIntegURL:g,conf:s,navigate:x,setIsLoading:i,setSnackbar:o}),isLoading:p,dataConf:s,setDataConf:n,formFields:c}),t.jsx("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:t.jsxs("button",{onClick:()=>l(3),disabled:s.action===""||s.course.length===0,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[w("Next","bit-integrations"),t.jsx(b,{className:"ml-1 rev-icn"})]})})]})}export{q as default};
