| Current Path : /home/users/unlimited/www/learnoid.codeskitter.site/public/build/assets/ |
| Current File : /home/users/unlimited/www/learnoid.codeskitter.site/public/build/assets/CourseLessons-Drv-K6WB.js |
import{c as r,o as s,C as z,n as p,a as o,_ as ie,E as re,r as B,I as ae,G as l,e as _,t as a,F as x,A as b,B as m,x as ne,d as c,s as E,w as R,y as le,S as $,f as de}from"./app-DM0q11P6.js";import{u as ce}from"./exam-Di7EiBTP.js";import{u as ue}from"./quiz-nKz7ReqH.js";import{b as me,F as j,c as pe,d as he}from"./index-XZxFLTeX.js";const V={__name:"video",props:{colorClass:{type:String,default:"#24262D"}},setup(i){return(C,u)=>(s(),r("div",{class:p(i.colorClass)},u[0]||(u[0]=[z('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22.0001 15V9.00001C22.0001 4 20 2 15 2H9.00001C4 2 2 4 2 9.00001V15C2 20 4 22 9.00001 22H15C20 22 22.0001 20 22.0001 15Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M2.51953 7.10938H21.4795" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.51953 2.10938V6.96937" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.4805 2.10938V6.51938" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path opacity="0.4" d="M9.75 14.4501V13.2501C9.75 11.7101 10.84 11.0801 12.17 11.8501L13.21 12.4501L14.25 13.0501C15.58 13.8201 15.58 15.0801 14.25 15.8502L13.21 16.4502L12.17 17.0502C10.84 17.8201 9.75 17.1901 9.75 15.6501V14.4501Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path></svg>',1)]),2))}},Y={__name:"image",props:{colorClass:{type:String,default:"#24262D"}},setup(i){return(C,u)=>(s(),r("div",{class:p(i.colorClass)},u[0]||(u[0]=[o("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M9 22H15C20 22 22 20 22 15V9C22 4 20 2 15 2H9C4 2 2 4 2 9V15C2 20 4 22 9 22Z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o("path",{opacity:"0.4",d:"M9 10C10.1046 10 11 9.10457 11 8C11 6.89543 10.1046 6 9 6C7.89543 6 7 6.89543 7 8C7 9.10457 7.89543 10 9 10Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),o("path",{opacity:"0.4",d:"M2.66992 18.9505L7.59992 15.6405C8.38992 15.1105 9.52992 15.1705 10.2399 15.7805L10.5699 16.0705C11.3499 16.7405 12.6099 16.7405 13.3899 16.0705L17.5499 12.5005C18.3299 11.8305 19.5899 11.8305 20.3699 12.5005L21.9999 13.9005",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]),2))}},F={__name:"document",props:{colorClass:{type:String,default:"#24262D"}},setup(i){return(C,u)=>(s(),r("div",{class:p(i.colorClass)},u[0]||(u[0]=[z('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity="0.4" d="M8 12.1992H15" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path opacity="0.4" d="M8 16.1992H12.38" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M10 6.00001H14C16.0001 6.00001 16.0001 5 16.0001 4C16.0001 2 15 2 14 2H10C9.00001 2 8 2 8 4C8 6.00001 9.00001 6.00001 10 6.00001Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M16 4.01953C19.33 4.19953 21 5.42953 21 9.99953V15.9995C21 19.9996 20 21.9995 15 21.9995H9C4 21.9995 3 19.9996 3 15.9995V9.99953C3 5.43953 4.67 4.19953 8 4.01953" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path></svg>',1)]),2))}},M={__name:"audio",props:{colorClass:{type:String,default:"#24262D"}},setup(i){return(C,u)=>(s(),r("div",{class:p(i.colorClass)},u[0]||(u[0]=[z('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22 15V9C22 4 20 2 15 2H9C4 2 2 4 2 9V15C2 20 4 22 9 22H15C20 22 22 20 22 15Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><g opacity="0.4"><path d="M9.62 17.3005C10.7908 17.3005 11.74 16.3513 11.74 15.1805C11.74 14.0096 10.7908 13.0605 9.62 13.0605C8.44915 13.0605 7.5 14.0096 7.5 15.1805C7.5 16.3513 8.44915 17.3005 9.62 17.3005Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.7402 15.1795V7.76953" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M13.1302 6.7701L15.4702 7.55006C16.0402 7.74006 16.5002 8.38006 16.5002 8.98006V9.60005C16.5002 10.4101 15.8702 10.8601 15.1102 10.6001L12.7703 9.82008C12.2003 9.63008 11.7402 8.99009 11.7402 8.39009V7.7701C11.7402 6.9701 12.3602 6.5101 13.1302 6.7701Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>',1)]),2))}},ke={class:"mb-5 p-3 rounded",style:{background:"#e2e8f0"}},ye={class:"text-center mt-3",style:{cursor:"pointer"}},Ce={class:"text-decoration-none text-primary"},ge={class:"accordion",id:"contentAccordion"},ve={key:0},fe={class:"m-0"},we=["data-bs-target","onClick"],_e={class:"accordion-content w-100"},xe={class:"d-flex justify-content-between align-items-center mb-3"},be={class:"me-2 text-muted"},$e={key:0,class:"me-2 text-muted chapter-duration"},Ve={class:"chapter-title"},Se=["id"],Ae={class:"accordion-body border-start border-end border-light p-0 mx-1"},Be=["onClick"],Ee={class:"ms-auto d-flex justify-content-between align-items-center gap-3"},je={key:0,class:"text-muted",style:{"font-size":"0.625em"}},Me={class:"text-muted",style:{"font-size":"0.625em"}},ze={class:"d-flex align-items-center"},Le={class:"text-muted title-font"},qe={class:"text-center mt-3",style:{cursor:"pointer"}},He={key:0},Pe={class:"text-center mt-3",style:{cursor:"pointer"}},De={class:"text-decoration-none text-primary"},Ne={class:"accordion",id:"accordionPanelsStayOpenExample"},Oe={class:"accordion-item"},Te={class:"accordion-header"},Ze={class:"accordion-button",type:"button","data-bs-toggle":"collapse","data-bs-target":"#panelsStayOpen-collapseOne","aria-expanded":"true","aria-controls":"panelsStayOpen-collapseOne"},Ie={id:"panelsStayOpen-collapseOne",class:"accordion-collapse collapse show"},Qe={class:"accordion-body"},Re={class:"row"},Ye={class:"col-6"},Fe={key:0},We=["onClick"],Ge={key:1,class:"text-muted"},Ke={class:"col-6"},Je={key:0},Ue=["onClick"],Xe={key:1,class:"text-muted"},et={__name:"CourseLessons",props:{chapters:{type:Array,default:()=>[]},courseId:Number,isPlayingVideo:Boolean,isPlayingAudio:Boolean,course:Object,contentData:Object,exams:Array,quizes:Array},emits:["playVideo","pauseVideo","pauseAudio","playAudio"],setup(i,{emit:C}){const u=re(),W=ce(),G=ue(),v=ae(),L=de(),f=B(0);let y=B(v.params.content_id),q=B(5),S=i;const K=t=>{const n=J(t);n&&(n.is_viewed=!0)};function J(t){for(const n of S.chapters)for(const k of n.contents)if(k.id===t)return k;return null}const U=()=>{q.value+=1},w=C,H=t=>{y.value=t,S.isPlayingVideo?w("pauseVideo",t):w("playVideo",t)},P=t=>{y.value=t,S.isPlayingAudio?w("pauseAudio",t):w("playAudio",t)};function D(t){if(t>=60){const n=Math.floor(t/60),k=t%60;return`${n} hour${n>1?"s":""}${k>0?` ${k} min`:""}`}return`${t} min`}const X=()=>{u.userData||$.fire({icon:"error",title:"Sorry...",text:"You need to log in to access this page.",confirmButtonText:"Go to Login"}).then(t=>{t.isConfirmed&&(window.location.href="/login")})};function ee(){$.fire({icon:"warning",title:"Enroll Required",text:"You need to enroll the course to view the content",showConfirmButton:!0})}const te=t=>{f.value=f.value===t?-1:t},oe=t=>{$.fire({title:"Are you sure?",text:"Warning! If you start the exam and submit it, you won't be able to re-take the exam later. Are you sure you want to proceed?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, Start the Exam!"}).then(n=>{n.isConfirmed&&(W.isResetTimer=!0,L.push(`/exam/${t}`))})},se=t=>{$.fire({title:"Are you sure?",text:"Warning! If you start the quiz and submit it, you won't be able to re-take the quiz later. Are you sure you want to proceed?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, Start the quiz!"}).then(n=>{n.isConfirmed&&(G.isResetTimer=!0,L.push(`/quiz/${t}`))})};return(t,n)=>{var N,O,T,Z,I;const k=le("router-link");return s(),r("section",ke,[o("div",ye,[o("p",Ce,[n[0]||(n[0]=o("i",{class:"bi bi-highlighter fs-5"},null,-1)),_(" "+a(t.$t("Learn with Ease: Step-by-Step Lessons")),1)])]),o("div",ge,[Array.isArray(i.chapters)?(s(),r("div",ve,[(s(!0),r(x,null,b((i.chapters||[]).slice(0,c(q)),(h,d)=>(s(),r("div",{key:d,class:p(["border border-2 bg-white rounded mb-2",{"border-primary":f.value===d,collapsed:f.value!==d}])},[o("h2",fe,[o("button",{class:p(["accordion-button bg-white border rounded",{collapsed:d!==0}]),type:"button","data-bs-toggle":"collapse","data-bs-target":"#chapter"+d,"aria-expanded":"index === 0","aria-controls":"'chapter' + index",onClick:e=>te(d)},[o("div",_e,[o("div",xe,[o("small",be,"Class "+a(d+1),1),h.duration>0?(s(),r("small",$e,a(D((h==null?void 0:h.duration)??0)),1)):l("",!0)]),o("span",Ve,a(h.title),1)])],10,we)]),o("div",{id:"chapter"+d,class:p(["accordion-collapse collapse my-1",{show:d===0}]),"data-bs-parent":"#contentAccordion"},[o("div",Ae,[(s(!0),r(x,null,b(h.contents,(e,A)=>{var Q;return s(),r("div",{key:e.id},[(Q=i.course)!=null&&Q.is_enrolled||e.is_free?(s(),m(k,{key:0,to:c(u).userData?`/play/${i.courseId}?content_id=${e.id}`:"",onClick:[R(X,["prevent"]),g=>K(e.id)],class:p({"d-block px-3 py-2 rounded-3 border-light text-decoration-none text-dark content-link":!0,active:e.id==c(v).query.content_id||c(v).path!=="/details/[course_id]"&&!c(v).query.content_id&&A===0,completed:e.completed,view:e.is_viewed})},{default:ne(()=>[o("div",{class:"d-flex align-items-center",onClick:g=>t.handleView(e.id)},[e.type==="video"&&e.media_id&&i.isPlayingVideo&&c(y)==e.id?(s(),m(V,{key:0,onClick:g=>H(e.id),colorClass:e.is_viewed?"text-primary":"text-muted",class:"mg-fluid me-3 svgEdit"},null,8,["onClick","colorClass"])):l("",!0),e.type==="video"&&e.media_id&&(!i.isPlayingVideo||c(y)!=e.id)?(s(),m(V,{key:1,onClick:g=>H(e.id),colorClass:e.is_viewed?"text-primary":"text-muted",class:"mg-fluid me-3 svgEdit"},null,8,["onClick","colorClass"])):l("",!0),e.type==="video"&&!e.media_id?(s(),m(V,{key:2,colorClass:e.is_viewed?"text-primary":"text-muted",class:"mg-fluid me-3 svgEdit"},null,8,["colorClass"])):l("",!0),e.type==="audio"&&i.isPlayingAudio&&c(y)==e.id?(s(),m(M,{key:3,onClick:g=>P(e.id),class:"img-fluid me-3 svgEdit"},null,8,["onClick"])):l("",!0),e.type==="audio"&&(!i.isPlayingAudio||c(y)!=e.id)?(s(),m(M,{key:4,onClick:g=>P(e.id),class:"img-fluid me-3 svgEdit"},null,8,["onClick"])):l("",!0),e.type==="document"?(s(),m(F,{key:5,colorClass:e.is_viewed?"text-primary":"text-muted",class:"img-fluid me-3 svgEdit"},null,8,["colorClass"])):l("",!0),e.type==="image"?(s(),m(Y,{key:6,colorClass:e.is_viewed?"text-primary":"text-muted",class:"img-fluid me-3 svgEdit"},null,8,["colorClass"])):l("",!0),o("span",{class:p(e.is_viewed?"text-primary title-font":"text-muted title-font")},a(e.title),3),o("div",Ee,[e.duration>0?(s(),r("small",je,a(D(e.duration??0)),1)):l("",!0),o("small",Me,[E(c(j),{icon:e.is_viewed?"":c(me),class:p(e.is_viewed?"":"text-primary")},null,8,["icon","class"])])])],8,Be)]),_:2},1032,["to","onClick","class"])):(s(),r("div",{key:1,onClick:ee,class:"content d-block px-3 py-2 border-bottom border-light text-decoration-none text-dark"},[o("div",ze,[e.type==="video"?(s(),m(V,{key:0,class:"img-fluid me-3 svgEdit"})):l("",!0),e.type==="audio"?(s(),m(M,{key:1,class:"img-fluid me-3 svgEdit"})):l("",!0),e.type==="document"?(s(),m(F,{key:2,class:"img-fluid me-3 svgEdit"})):l("",!0),e.type==="image"?(s(),m(Y,{key:3,class:"img-fluid me-3 svgEdit"})):l("",!0),o("span",Le,a(e.title),1),n[1]||(n[1]=o("small",{class:"text-muted ms-auto"},[o("i",{class:"bi bi-lock-fill"})],-1))])]))])}),128))])],10,Se)],2))),128))])):l("",!0)]),o("div",qe,[o("a",{onClick:R(U,["prevent"]),class:p(((N=i.chapters)==null?void 0:N.length)===0?"text-danger text-decoration-none":"text-decoration-none")},a(((O=i.chapters)==null?void 0:O.length)===0?t.$t("No Content Available"):((T=i.chapters)==null?void 0:T.length)>4?t.$t("See More"):""),3)]),t.$route.path.includes("/play")?(s(),r("div",He,[o("div",Pe,[o("p",De,[n[2]||(n[2]=o("i",{class:"bi bi-patch-question-fill fs-5"},null,-1)),_(" "+a(t.$t("Exam & Quiz")),1)])]),o("div",Ne,[o("div",Oe,[o("h2",Te,[o("button",Ze,a(t.$t("Test Your Knowladge")),1)]),o("div",Ie,[o("div",Qe,[o("div",Re,[o("div",Ye,[o("p",null,[_(a(t.$t("Exams"))+" ",1),E(c(j),{class:"text-primary",icon:c(pe)},null,8,["icon"])]),((Z=i.exams)==null?void 0:Z.length)>0?(s(),r("div",Fe,[(s(!0),r(x,null,b(i.exams,(h,d)=>{var e;return s(),r("div",{key:d},[(e=i.course)!=null&&e.is_enrolled?(s(),r("button",{key:0,class:"btn btn-primary w-100 text-white my-2",onClick:A=>oe(h.id)},a(t.$t("Start"))+" "+a(t.$t("Exam"))+" #"+a(d+1),9,We)):l("",!0)])}),128))])):(s(),r("p",Ge,a(t.$t("No exams available at the moment"))+".",1))]),o("div",Ke,[o("p",null,[_(a(t.$t("Quizzes"))+" ",1),E(c(j),{class:"text-warning",icon:c(he)},null,8,["icon"])]),((I=i.quizes)==null?void 0:I.length)>0?(s(),r("div",Je,[(s(!0),r(x,null,b(i.quizes,(h,d)=>{var e;return s(),r("div",{key:d},[(e=i.course)!=null&&e.is_enrolled?(s(),r("button",{key:0,onClick:A=>se(h.id),class:"btn btn-warning w-100 text-white my-2"},a(t.$t("Start"))+" "+a(t.$t("Quiz"))+" #"+a(d+1),9,Ue)):l("",!0)])}),128))])):(s(),r("p",Xe,a(t.$t("No quizzes available at the moment"))+".",1))])])])])])])])):l("",!0)])}}},rt=ie(et,[["__scopeId","data-v-1ee90fc2"]]);export{rt as C,V as _,M as a,F as b,Y as c};