import{j as t,_ as e,s as y,d as N}from"./main.2.8.1.js";import{d as n}from"./react-router-dom.9mCuUg3q.js";import{B as A}from"./BackIcn._kGL_vVw.js";import{z as L,y as k}from"./Note.BeM7sN-p.js";import{t as v}from"./tutorialLinks.kMkIDzcD.js";import{T as d}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function M({academyLmsConf:o,setAcademyLmsConf:u,step:r,setStep:h,setSnackbar:p}){const{academyLms:s}=v,[a,b]=n.useState(!1),[c,l]=n.useState(!1),[g,x]=n.useState(!1),f=()=>{l("auth"),N({},"academy_lms_authorize").then(i=>{i!=null&&i.success&&(b(!0),p({show:!0,msg:e("Connected with Academy Lms Successfully","bit-integrations")})),l(!1),x(!0)})},j=i=>{const m=k(o);m[i.target.name]=i.target.value,u(m)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:r===1&&900,height:r===1&&"auto"},children:[t.jsx(d,{title:"Academy LMS",youTubeLink:s==null?void 0:s.youTubeLink}),t.jsx(d,{title:"Academy LMS",docLink:s==null?void 0:s.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:j,name:"name",value:o.name,type:"text",placeholder:e("Integration Name...","bit-integrations")}),c==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(L,{size:25,clr:"#022217",className:"mr-2"}),e("Checking if Academy Lms is active!!!","bit-integrations")]}),g&&!a&&!c&&t.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[t.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),y(e("%s plugin must be activated to integrate with Bit Integrations","bit-integrations"),"Academy Lms")]}),!a&&t.jsx("button",{onClick:f,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:e("Connect","bit-integrations")}),a&&t.jsxs("button",{onClick:()=>h(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!a,children:[e("Next","bit-integrations"),t.jsx(A,{className:"ml-1 rev-icn"})]})]})}export{M as default};
