var C=Object.defineProperty;var f=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var b=(o,e,s)=>e in o?C(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s,g=(o,e)=>{for(var s in e||(e={}))M.call(e,s)&&b(o,s,e[s]);if(f)for(var s of f(e))A.call(e,s)&&b(o,s,e[s]);return o};import{_ as a,j as i}from"./main.2.8.1.js";import{u as w,h as N,d as l}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as _}from"./SnackMsg.S8DrwLlT.js";import{S as z}from"./Steps.1hz7v9Vj.js";import{I as D,s as E}from"./Integrations.D2bgBas2.js";import{M as T,h as F}from"./MasterStudyLmsIntegLayout.Dg2ZPa80.js";import P from"./MasterStudyLmsAuthorization.DLKEOHZ7.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./BackIcn._kGL_vVw.js";import"./TutorialLink.BAFX--T3.js";import"./tutorialLinks.kMkIDzcD.js";function U({formFields:o,setFlow:e,flow:s,allIntegURL:d,isInfo:h,edit:x}){const v=w(),{formID:S}=N(),[n,u]=l.useState(!1),[r,p]=l.useState(1),[y,c]=l.useState({show:!1}),j=[{key:"1",label:a("Course complete for the user","bit-integrations")},{key:"2",label:a("Lesson complete for the user","bit-integrations")},{key:"3",label:a("Quiz complete for the user","bit-integrations")},{key:"4",label:a("Reset user course","bit-integrations")},{key:"5",label:a("Reset user lesson","bit-integrations")}],[t,m]=l.useState({name:"MasterStudyLms",type:"MasterStudyLms",mainAction:"",field_map:[{formField:"",msLmsFormField:""}],allActions:j,actions:{}}),I=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),t.mainAction!==""&&p(3)};function L(){switch(t.mainAction){case"1":return t.courseId===void 0;case"4":return t.courseId===void 0;case"2":return t.lessonId===void 0;case"5":return t.lessonId===void 0;case"3":return t.quizId===void 0;default:return!1}}return i.jsxs("div",{children:[i.jsx(_,{snack:y,setSnackbar:c}),i.jsx("div",{className:"txt-center mt-2",children:i.jsx(z,{step:3,active:r})}),i.jsx(P,{formID:S,msLmsConf:t,setMsLmsConf:m,step:r,setStep:p,isLoading:n,setIsLoading:u,setSnackbar:c}),i.jsxs("div",{className:"btcd-stp-page",style:g({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[i.jsx(T,{formFields:o,handleInput:k=>F(k,t,m),msLmsConf:t,setMsLmsConf:m,isLoading:n,setIsLoading:u,setSnackbar:c,allIntegURL:d,isInfo:h,edit:x}),i.jsxs("button",{onClick:()=>I(),disabled:!t.mainAction||n||L(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[a("Next","bit-integrations")," ",i.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),i.jsx(D,{step:r,saveConfig:()=>E({flow:s,setFlow:e,allIntegURL:d,navigate:v,conf:t,setIsLoading:u,setSnackbar:c}),isLoading:n,dataConf:t,setDataConf:m,formFields:o})]})}export{U as default};
