PageSourceSearch

https://www.codingjr.online/_next/static/chunks/pages/course/lesson-88c4775468dea575.js

js codingjr.online collected 2026-09-24 12:25:01 UTC 23,971 bytes, 1 lines download raw bytes

1void 0===Promise.withResolvers&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4259],{88393:function(e,t,n){"use strict";n.d(t,{u:function(){return el}});var r=n(67294),s=n(24241),o=n(34731),l=n(3594),i=n(58495),a=n(94993);let c=(0,r.createContext)(!1),d=c.Provider,u=()=>(0,r.useContext)(c);function f({children:e,openDelay:t=0,closeDelay:n=0}){return r.createElement(d,{value:!0},r.createElement(a.e0,{delay:{open:t,close:n}},e))}f.displayName="@mantine/core/TooltipGroup";var p=n(56817),m=Object.defineProperty,h=Object.defineProperties,x=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,b=(e,t,n)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t)=>{for(var n in t||(t={}))v.call(t,n)&&b(e,n,t[n]);if(g)for(var n of g(t))y.call(t,n)&&b(e,n,t[n]);return e},j=(e,t)=>h(e,x(t)),N=(0,p.k)((e,{color:t,radius:n,width:r,multiline:s})=>({tooltip:j(w(w({},e.fn.fontStyles()),function(e,t){if(!t)return{backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[9],color:e.white};let n=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:n.background,color:n.color}}(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(n),padding:`calc(${e.spacing.xs}px / 2) ${e.spacing.xs}px`,position:"absolute",whiteSpace:s?"unset":"nowrap",pointerEvents:"none",width:r}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));let k={children:"Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"};var C=n(24750),_=n(37317),P=n(48269),E=n(7414),O=Object.defineProperty,S=Object.defineProperties,L=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,F=(e,t,n)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z=(e,t)=>{for(var n in t||(t={}))R.call(t,n)&&F(e,n,t[n]);if(Z)for(var n of Z(t))I.call(t,n)&&F(e,n,t[n]);return e},D=(e,t)=>S(e,L(t)),M=(e,t)=>{var n={};for(var r in e)R.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&Z)for(var r of Z(e))0>t.indexOf(r)&&I.call(e,r)&&(n[r]=e[r]);return n};let q={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:(0,l.w)("popover")};function T(e){var t;let n=(0,i.N4)("TooltipFloating",q,e),{children:l,refProp:c,withinPortal:d,style:u,className:f,classNames:p,styles:m,unstyled:h,radius:x,color:g,label:v,offset:y,position:b,multiline:w,width:j,zIndex:O,disabled:S}=n,L=M(n,["children","refProp","withinPortal","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled"]),{handleMouseMove:Z,x:R,y:I,opened:F,boundaryRef:T,floating:B,setOpened:A}=function({offset:e,position:t}){let[n,s]=(0,r.useState)(!1),o=(0,r.useRef)(),{x:l,y:i,reference:c,floating:d,refs:u,update:f,placement:p}=(0,a.YF)({placement:t,middleware:[(0,C.uY)({crossAxis:!0,padding:5,rootBoundary:"document"})]}),m=p.includes("right")?e:t.includes("left")?-1*e:0,h=p.includes("bottom")?e:t.includes("top")?-1*e:0,x=(0,r.useCallback)(({clientX:e,clientY:t})=>{c({getBoundingClientRect:()=>({width:0,height:0,x:e,y:t,left:e+m,top:t+h,right:e,bottom:t})})},[c]);return(0,r.useEffect)(()=>{if(u.floating.current){let e=o.current;e.addEventListener("mousemove",x);let t=(0,_.Kx)(u.floating.current);return t.forEach(e=>{e.addEventListener("scroll",f)}),()=>{e.removeEventListener("mousemove",x),t.forEach(e=>{e.removeEventListener("scroll",f)})}}},[c,u.floating.current,f,x,n]),{handleMouseMove:x,x:l,y:i,opened:n,setOpened:s,boundaryRef:o,floating:d}}({offset:y,position:b}),{classes:Y,cx:G}=N({radius:x,color:g,multiline:w,width:j},{name:"TooltipFloating",classNames:p,styles:m,unstyled:h});if(!(0,s.k)(l))throw Error(k.children);let H=(0,o.Y)(T,l.ref);return r.createElement(r.Fragment,null,r.createElement(P.q,{withinPortal:d},r.createElement(E.x,D(z({},L),{ref:B,className:G(Y.tooltip,f),style:D(z({},u),{zIndex:O,display:!S&&F?"block":"none",top:null!=I?I:"",left:null!=(t=Math.round(R)
1)?t:""})}),v)),(0,r.cloneElement)(l,D(z({},l.props),{[c]:H,onMouseEnter:e=>{var t,n;null==(n=(t=l.props).onMouseEnter)||n.call(t,e),Z(e),A(!0)},onMouseLeave:e=>{var t,n;null==(n=(t=l.props).onMouseLeave)||n.call(t,e),A(!1)}})))}T.displayName="@mantine/core/TooltipFloating";var B=n(58463),A=n(36289),Y=n(37048),G=n(30212),H=n(14870),X=n(58036),Q=n(63468),W=Object.defineProperty,K=Object.defineProperties,J=Object.getOwnPropertyDescriptors,$=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,ee=(e,t,n)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,et=(e,t)=>{for(var n in t||(t={}))U.call(t,n)&&ee(e,n,t[n]);if($)for(var n of $(t))V.call(t,n)&&ee(e,n,t[n]);return e},en=(e,t)=>K(e,J(t)),er=(e,t)=>{var n={};for(var r in e)U.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&$)for(var r of $(e))0>t.indexOf(r)&&V.call(e,r)&&(n[r]=e[r]);return n};let es={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transition:"fade",transitionDuration:100,width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:(0,l.w)("popover"),positionDependencies:[]},eo=(0,r.forwardRef)((e,t)=>{let n=(0,r.useRef)(null),l=(0,i.N4)("Tooltip",es,e),{children:c,position:d,refProp:f,label:p,openDelay:m,closeDelay:h,onPositionChange:x,opened:g,withinPortal:v,radius:y,color:b,classNames:w,styles:j,unstyled:_,style:O,className:S,withArrow:L,arrowSize:Z,arrowOffset:R,arrowRadius:I,arrowPosition:F,offset:z,transition:D,transitionDuration:M,multiline:q,width:T,events:W,zIndex:K,disabled:J,positionDependencies:$,onClick:U,onMouseEnter:V,onMouseLeave:ee,inline:eo}=l,el=er(l,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","offset","transition","transitionDuration","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline"]),{classes:ei,cx:ea,theme:ec}=N({radius:y,color:b,width:T,multiline:q},{name:"Tooltip",classNames:w,styles:j,unstyled:_}),ed=function(e){let[t,n]=(0,r.useState)(!1),s="boolean"==typeof e.opened?e.opened:t,o=u(),l=(0,A.M)(),{delay:i,currentId:c,setCurrentId:d}=(0,a.tj)(),f=(0,r.useCallback)(e=>{n(e),e&&d(l)},[d,l]),{x:p,y:m,reference:h,floating:x,context:g,refs:v,update:y,placement:b,middlewareData:{arrow:{x:w,y:j}={}}}=(0,a.YF)({placement:e.position,open:s,onOpenChange:f,middleware:[(0,C.cv)(e.offset),(0,C.uY)({padding:8}),(0,C.RR)(),(0,B.x7)({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[(0,C.Qo)()]:[]]}),{getReferenceProps:N,getFloatingProps:k}=(0,a.NI)([(0,a.XI)(g,{enabled:e.events.hover,delay:o?i:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),(0,a.KK)(g,{enabled:e.events.focus,keyboardOnly:!0}),(0,a.qs)(g,{role:"tooltip"}),(0,a.bQ)(g,{enabled:(e.opened,!1)}),(0,a.Qu)(g,{id:l})]);return(0,G.L)({opened:s,positionDependencies:e.positionDependencies,floating:{refs:v,update:y}}),(0,Y.l)(()=>{var t;null==(t=e.onPositionChange)||t.call(e,b)},[b]),{x:p,y:m,arrowX:w,arrowY:j,reference:h,floating:x,getFloatingProps:k,getReferenceProps:N,isGroupPhase:s&&c&&c!==l,opened:s,placement:b}}({position:(0,H._)(ec.dir,d),closeDelay:h,openDelay:m,onPositionChange:x,opened:g,events:W,arrowRef:n,arrowOffset:R,offset:z+(L?Z/2:0),positionDependencies:[...$,c],inline:eo});if(!(0,s.k)(c))throw Error(k.children);let eu=(0,o.Y)(ed.reference,c.ref,t);return r.createElement(r.Fragment,null,r.createElement(P.q,{withinPortal:v},r.createElement(X.u,{mounted:!J&&ed.opened,transition:D,duration:ed.isGroupPhase?10:M},e=>{var t,s;return r.createElement(E.x,et(et({},el),ed.getFloatingProps({ref:ed.floating,className:ei.tooltip,style:en(et(et({},O),e),{zIndex:K,top:null!=(t=ed.y)?t:0,left:null!=(s=ed.x)?s:0})})),p,r.createElement(Q.Y,{ref:n,arrowX:ed.arrowX,arrowY:ed.arrowY,visible:L,withBorder:!1,position:ed.placement,arrowSize:Z,arrowOffset:R,arrowRadius:I,arrowPosition:F,className:ei.arrow}))})),(0,r.cloneElement)(c,ed.getReferenceProps(et({onClick:U,onMouseEnter:V,onMouseLeave:ee,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[f]:eu,className:ea(S,c.props.className)},c.props))))});eo.Group=f,eo.Floating=T,eo.displayName="@mantine/core/Tooltip";let el=eo},42893:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/course/lesson",function(){return n(42071)}])},9462:function(e,t,n){"use strict";var r=n(85893),s=n(67294),o=n(95237);t.Z=(0,s.forwardRef)((e,t)=>
1{let[n,l]=(0,s.useState)(!1),i=(0,s.useRef)(),a=(0,s.useRef)(),{styles:c,attributes:d}=(0,o.D)(i.current,a.current,{placement:e.placement||"bottom-end",modifiers:[{name:"offset",options:{offset:e.offset||[0]}}]}),u=e=>{i.current.contains(e.target)||a.current.contains(e.target)||l(!1)};return(0,s.useEffect)(()=>(document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}),[]),(0,s.useImperativeHandle)(t,()=>({close(){l(!1)}})),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{ref:i,type:"button",className:e.btnClassName,onClick:()=>l(!n),children:e.button}),(0,r.jsx)("div",{ref:a,style:c.popper,...d.popper,className:"z-50",onClick:()=>l(!n),children:n&&e.children})]})})},68479:function(e,t,n){"use strict";var r=n(85893);t.Z=e=>{let{className:t,strokeWidth:n="1.5"}=e;return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,r.jsx)("path",{d:"M19 9L12 15L5 9",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"})})}},40628:function(e,t,n){"use strict";var r=n(85893);t.Z=e=>{let{className:t}=e;return(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,r.jsx)("path",{opacity:"0.5",d:"M17 9.00195C19.175 9.01406 20.3529 9.11051 21.1213 9.8789C22 10.7576 22 12.1718 22 15.0002V16.0002C22 18.8286 22 20.2429 21.1213 21.1215C20.2426 22.0002 18.8284 22.0002 16 22.0002H8C5.17157 22.0002 3.75736 22.0002 2.87868 21.1215C2 20.2429 2 18.8286 2 16.0002L2 15.0002C2 12.1718 2 10.7576 2.87868 9.87889C3.64706 9.11051 4.82497 9.01406 7 9.00195",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M12 15L12 2M12 2L15 5.5M12 2L9 5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},39877:function(e,t,n){"use strict";var r=n(85893);t.Z=e=>{let{className:t,fill:n="#1C274C"}=e;return(0,r.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 1.25C9.37665 1.25 7.25 3.37665 7.25 6C7.25 8.62335 9.37665 10.75 12 10.75C14.6234 10.75 16.75 8.62335 16.75 6C16.75 3.37665 14.6234 1.25 12 1.25ZM8.75 6C8.75 4.20507 10.2051 2.75 12 2.75C13.7949 2.75 15.25 4.20507 15.25 6C15.25 7.79493 13.7949 9.25 12 9.25C10.2051 9.25 8.75 7.79493 8.75 6Z",fill:n}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 12.25C9.96067 12.25 8.07752 12.7208 6.67815 13.5204C5.3 14.3079 4.25 15.5101 4.25 17C4.25 18.4899 5.3 19.6921 6.67815 20.4796C8.07752 21.2792 9.96067 21.75 12 21.75C14.0393 21.75 15.9225 21.2792 17.3219 20.4796C18.7 19.6921 19.75 18.4899 19.75 17C19.75 15.5101 18.7 14.3079 17.3219 13.5204C15.9225 12.7208 14.0393 12.25 12 12.25ZM5.75 17C5.75 16.2807 6.26701 15.483 7.42236 14.8228C8.55649 14.1747 10.1733 13.75 12 13.75C13.8267 13.75 15.4435 14.1747 16.5776 14.8228C17.733 15.483 18.25 16.2807 18.25 17C18.25 17.7193 17.733 18.517 16.5776 19.1772C15.4435 19.8253 13.8267 20.25 12 20.25C10.1733 20.25 8.55649 19.8253 7.42236 19.1772C6.26701 18.517 5.75 17.7193 5.75 17Z",fill:n})]})}},42071:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var r=n(85893),s=n(67294),o=n(29244),l=n(68479),i=n(201),a=n(33405),c=n(8765),d=n(21445),u=n(68089),f=n(96189),p=n(47041),m=n(87066),h=n(88057),x=e=>{let{item:t}=e,[n,x]=(0,s.useState)({}),g=(0,u.TL)(),v=(0,u.CG)(e=>e.coursesLesson),[y,b]=(0,s.useState)(!1);(0,s.useEffect)(()=>{b((0,p.hasCookie)("token"))},[]);let w=e=>t.section.findIndex(t=>t.lessons.some(t=>t.id===e));(0,s.useEffect)(()=>{let e=w(v.id);-1!==e&&x(t=>({["0-".concat(e)]:!0}))},[v.id,t.section]);let j=e=>{x(t=>({[e]:!t[e]}))};async function N(e,t){try{await m.Z.post("".concat(h._n,"/timeline/recent"),{lesson_id:e,section_id:t},{headers:{Authorization:"Bearer ".concat((0,p.getCookie)("token"))}})}catch(e){}}let k=(e,t)=>(0,r.jsx)("div",{onClick:()=>{let t;""===e.lesson_type||"quiz"===e.lesson_type||e.lesson_type,t={...e,attachment:e.attachment.toString()},g((0,f.ii)(t)),y&&N(t.id,t.section_id)},className:"".concat(v.id===e.id?"bg-slate-200":"bg-white","  select-non flex cursor-pointer flex-col border-t p-2 px-4"),children:"video"===e.lesson_type?(0,r.jsxs)("div",{className:" flex flex-col font-normal text-dark",children:[(0,r.jsxs)("span",{children:[t+1,". ",e.title]}),(0,r.jsxs)("div",{className:"flex flex-row items-center py-1 text-[16px] font-normal text-dark",children:[(0,r.jsx)(i.Z,{className:"mr-2 h-4 w-4"}),(0,r.jsx)("div",{className:" text-sm font-normal text-gray-400",children:function(e){let t=e.split(":").map(e=>parseInt(e,10)),n="";if(3===t.length){let[e,r,s]=t;e>0&&(n+="".concat(e,"h ")),r>0&&(n+="".concat(r,"m ")),s>0&&(n+="".concat(s,"s"))}else if(2===t.length){let[e,r]=t;e>0&&(n+="".concat(e,"m ")),r>0&&(n+="".concat(r,"s"))}else{let t=parseInt(e);if(isNaN(t))return"";n+="".concat(t,"m")}return n.trim()}(e.duration)})]})]}):"quiz"===e.lesson_type?(0,r.jsxs)("div",{className:" flex flex-col font-normal text-dark",children:[(0,r.jsxs)("span",{children:[t+1,". ",e.title]}),(0,r.jsxs)("div",{className:"flex flex-row items-center py-1 text-[16px] font-normal text-dark",children:[(0,r.jsx)(c.Z,{className:"mr-2 h-4 w-4"}),(0,r.jsx)("div",{className:" text-sm font-normal text-gray-400",children:"Qu
1iz"})]})]}):(0,r.jsxs)("div",{className:" flex flex-col font-normal text-dark",children:[(0,r.jsxs)("span",{children:[t+1,". ",e.title]}),(0,r.jsxs)("div",{className:"flex flex-row items-center py-1 text-[16px] font-normal text-dark",children:[e.title.toLowerCase().startsWith("ppt")?(0,r.jsx)(a.Z,{className:"mr-2 h-4 w-4"}):(0,r.jsx)(d.Z,{className:"mr-2 h-4 w-4"}),(0,r.jsx)("div",{className:" text-sm font-normal text-gray-400",children:"Attachment"})]})]})},e.id),C=(e,t)=>(0,r.jsxs)("div",{className:"w-full p-0",children:[(0,r.jsxs)("button",{type:"button",className:"font-base text-md relative flex w-full items-center justify-between border-l border-r border-t border-gray-200 bg-gray-100 py-2 pl-2 text-start text-black ".concat(n["".concat(0,"-").concat(t)]?"!text-primary":""),onClick:()=>j("".concat(0,"-").concat(t)),children:[(0,r.jsxs)("span",{className:" absolute left-0 top-1 pl-2 text-xs font-normal text-gray-500",children:["Section ",t+1]}),(0,r.jsx)("div",{className:" mt-3",children:e.title}),(0,r.jsx)("div",{className:"".concat(n["".concat(0,"-").concat(t)]?"rotate-180":""," mr-4 flex items-start"),children:(0,r.jsx)(l.Z,{})})]}),(0,r.jsx)(o.Z,{duration:300,className:"border",height:n["".concat(0,"-").concat(t)]?"auto":0,children:e.lessons.map((e,t)=>k(e,t))})]},t);return(0,r.jsx)("div",{className:"rounded font-semibold",children:t.section.map((e,t)=>C(e,t))})},g=n(72079),v=n(11163),y=n(11218),b=n(40628),w=n(9462),j=n(39877),N=n(30178),k=n(9473),C=()=>{let e=(0,u.CG)(e=>e.userData),t=(0,u.TL)(),n=(0,v.useRouter)(),s="rtl"===(0,k.v9)(e=>e.themeConfig.rtlClass);return(null==e?void 0:e.email)?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"dropdown mr-4 flex shrink-0",children:(0,r.jsx)(w.Z,{offset:[0,8],placement:"".concat(s?"bottom-start":"bottom-end"),btnClassName:"block p-2 rounded-full border border-black select-none bg-white-light/40 dark:bg-dark/40 hover:text-primary hover:bg-white-light/90 dark:hover:bg-dark/60",button:(0,r.jsx)(j.Z,{className:" h-5 w-5"}),children:(0,r.jsxs)("ul",{className:"w-[230px] !py-0 font-semibold text-dark dark:text-white-dark dark:text-white-light/90",children:[(0,r.jsx)("li",{children:(0,r.jsx)("div",{className:"flex items-center px-2 py-4",children:(0,r.jsxs)("div",{className:"truncate px-3 ltr:pl-6 rtl:pr-6",children:[(0,r.jsx)("h4",{className:"text-base",children:null==e?void 0:e.user_name}),(0,r.jsx)("button",{type:"button",className:"text-black/60 hover:text-primary dark:text-dark-light/60 dark:hover:text-white",children:null==e?void 0:e.email})]})})}),(0,r.jsx)("li",{onClick:()=>{(async function(){try{let e=await m.Z.post("".concat(h._n,"/auth/logout"),{},{headers:{Authorization:"Bearer ".concat((0,p.getCookie)("token"))}});200===e.status&&((0,p.deleteCookie)("token"),n.replace("/sign_in"),t((0,y.o0)()))}catch(e){(0,N.CF)("error","Please try again later")}})()},className:"border-t border-white-light dark:border-white-light/10",children:(0,r.jsxs)("button",{className:"!py-3 text-danger",children:[(0,r.jsx)(b.Z,{className:"mr-2 h-4.5 w-4.5 shrink-0 rotate-90 ltr:mr-2 rtl:ml-2"}),"Sign Out"]})})]})})})}):(0,r.jsx)(r.Fragment,{})},_=n(80201),P=n(23913),E=n(64958),O=e=>{let{url:t}=e;return(0,r.jsx)("div",{className:"flex h-full w-full select-none flex-col items-center justify-center outline-none",children:(0,r.jsx)("div",{className:"h-full w-full",children:(0,r.jsx)(E.Z,{url:t,light:""})})})},S=n(73237),L=n(41664),Z=n.n(L);let R=()=>{let[e,t]=(0,s.useState)(),[n,o]=(0,s.useState)(null),[l,i]=(0,s.useState)(void 0),[a,c]=(0,s.useState)(),[d,y]=(0,s.useState)(!1),b=(0,v.useRouter)(),w=(0,u.CG)(e=>e.coursesLesson),j=(0,u.TL)();function k(e){return{...e,attachment:e.attachment}}async function C(){try{let t=await m.Z.get("".concat(h._n,"/course/").concat(parseInt(n)),{headers:{Authorization:"Bearer ".concat((0,p.getCookie)("token"))}});if(200===t.status){var e;let n=t.data.data;n.section=n.section.filter(e=>e.lessons.length>0).map(e=>(e.lessons=e.lessons.filter(e=>1===e.show_lesson).sort((e,t)=>e.order-t.order),e)),i(n);let r=null===(e=n.section.find(e=>e.id===parseInt(b.query.section_id.toString())))||void 0===e?void 0:e.lessons.find(e=>e.id===parseInt(b.query.lesson_id.toString()));void 0!==r&&j((0,f.ii)(k(r)))}}catch(e){(0,N.CF)("error","An unexpected error occurred. Please reload the page.")}}async function E(){try{let t=await m.Z.get("".concat(h._n,"/course/limit?class=").concat(b.query.cat_id,"&subject=").concat(b.query.sub_cat_id));if(200===t.status){var e;let n=t.data.data.find(e=>e.id===parseInt(b.query.course_id.toString()));if(void 0===n)throw Error("Course data is undefined");n.section=n.section.filter(e=>e.lessons.length>0).map(e=>(e.lessons=e.lessons.filter(e=>1===e.show_lesson).sort((e,t)=>
1e.order-t.order),e)),i(n);let r=null===(e=n.section.find(e=>e.id===parseInt(b.query.section_id.toString())))||void 0===e?void 0:e.lessons.find(e=>e.id===parseInt(b.query.lesson_id.toString()));void 0!==r&&j((0,f.ii)(k(r)))}}catch(e){(0,N.CF)("error","An unexpected error occurred. Please reload the page.")}}async function L(){try{let t=await m.Z.get("".concat(h._n,"/course/lesson/").concat(e));if(200===t.status){let e=t.data.data,n=t.data.url;JSON.stringify(e[0])!==JSON.stringify(w)&&j((0,f.ii)(e[0])),c(n)}}catch(e){(0,N.CF)("error","An unexpected error occurred. Please reload the page.")}}return((0,s.useEffect)(()=>{if(j((0,S.Iw)("Courses")),b.isReady){var e,n,r,s;let l=null!==(r=null===(e=b.query.section_id)||void 0===e?void 0:e.toString())&&void 0!==r?r:null,i=null!==(s=null===(n=b.query.course_id)||void 0===n?void 0:n.toString())&&void 0!==s?s:null;o(i),t(l),(null===i||null===l)&&y(!0)}},[b.isReady,b.query.course_id]),(0,s.useEffect)(()=>{(0,p.hasCookie)("token")?e&&Promise.all([C(),L()]):n&&e&&Promise.all([E(),L()])},[e,n,(0,p.hasCookie)("token")]),d)?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:" flex flex-col",children:(0,r.jsx)("main",{className:"flex flex-grow items-center justify-center py-36",children:(0,r.jsxs)("div",{className:"flex  flex-col items-center justify-center text-center text-lg",children:[(0,r.jsx)("p",{className:"mb-2",children:"Unable to fetch available lessons"}),(0,r.jsx)("p",{className:"mb-4",children:"Please try again."}),(0,r.jsxs)("button",{onClick:()=>{b.replace("/")},className:"btn btn-primary flex items-center justify-center ",children:[(0,r.jsx)(g.Z,{stroke:"#fff",className:" mr-2 h-4 w-4"})," Home Page"]})]})})})}):void 0===l?(0,r.jsx)("div",{className:"fixed inset-0 flex items-center justify-center bg-gray-100 bg-opacity-50",children:(0,r.jsx)("span",{className:"inline-block h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent align-middle"})}):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"grid w-full grid-cols-1 gap-4 md:grid-cols-12",children:[(0,r.jsx)("div",{className:" md:col-span-9 ",children:(0,r.jsx)("div",{className:" flex w-full flex-col",children:(0,r.jsx)("div",{className:"video"===w.lesson_type?"h-[600px] bg-[#000000]":"h-[600px] bg-white",children:"other"===w.lesson_type||"pdf"===w.attachment_type?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(_.Z,{url:"".concat(a).concat(w.attachment),pdf_title:w.title})}):"video"===w.lesson_type?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(O,{url:w.video_url})}):(0,r.jsx)(r.Fragment,{children:void 0!==w&&(0,r.jsx)(P.Z,{quiz:k(w)})})})})}),(0,r.jsx)("div",{className:" mr-1 h-full w-full flex-col items-stretch justify-center md:col-span-3",children:(0,r.jsxs)("div",{className:" flex flex-col items-stretch",children:[(0,r.jsx)("h5",{className:"m-2 text-center text-lg font-semibold",children:"Course Content"}),(0,r.jsx)(x,{item:null!=l?l:{}}),(0,r.jsxs)("div",{className:" m-2 flex flex-row gap-2",children:[(0,r.jsx)("button",{onClick:e=>{e.preventDefault();for(let e=0;e<l.section.length;e++){let t=l.section[e];if(t.lessons.find(e=>e.id===w.id)){let n=e,r=t.lessons.findIndex(e=>w.id===e.id);if(r-1>=0){let e;let n=t.lessons[r-1];""===n.lesson_type||"quiz"===n.lesson_type||n.lesson_type,e={...n,attachment:n.attachment.toString()},j((0,f.ii)(e))}else if(n-1>=0){let t;let n=l.section[e-1].lessons.length-1,r=l.section[e-1].lessons[n];""===r.lesson_type||"quiz"===r.lesson_type||r.lesson_type,t={...r,attachment:r.attachment.toString()},j((0,f.ii)(t))}}}},type:"submit",id:"filter",className:"btn btn-primary  btn-block mt-4 w-full rounded-sm py-3",name:"button",children:"Back"}),(0,r.jsx)("button",{onClick:e=>{e.preventDefault();for(let e=0;e<l.section.length;e++){let t=l.section[e];if(t.lessons.find(e=>e.id===w.id)){let n=e,r=t.lessons.length,s=t.lessons.findIndex(e=>w.id===e.id);if(s+1<r){let e;let n=t.lessons[s+1];""===n.lesson_type||"quiz"===n.lesson_type||n.lesson_type,e={...n,attachment:n.attachment.toString()},j((0,f.ii)(e))}else if(n+1<l.section.length){let t;let n=l.section[e+1].lessons[0];""===n.lesson_type||"quiz"===n.lesson_type||n.lesson_type,t={...n,attachment:n.attachment.toString()},j((0,f.ii)(t))}}}},type:"submit",id:"filter",className:"btn btn-primary  btn-block mt-4 w-full rounded-sm py-3",name:"button",children:"Next"})]})]})})]})})};R.getLayout=e=>(0,r.jsxs)("div",{className:"",children:[(0,r.jsxs)("div",{className:" flex h-16 w-full items-center justify-between bg-white ",children:[(0,r.jsx)(Z(),{href:"/",className:" cursor-pointer",children:(0,r.jsx)("img",{src:"/assets/images/brand/logo-dark.png",alt:"",className:" h-12 w-48 pl-6"})}),(0,r.jsx)(C,{})]}),(0,r.jsx)("div",{className:"",children:e})]});var I=R}},function(e){e.O(0,[8166,4577,1623,3598,4750,6768,5652,3097,4661,2888,9774,179],function(){return e(e.s=42893)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.