1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1068],{7833:(e,r,a)=>{a.d(r,{F:()=>d});var t=a(95155);a(12115);var s=a(6439),l=a(18955),i=a(6613);let d=()=>{let e=(0,l.c)("dashboard.learning"),{questions:r,currentIndex:a,correctCount:d,answers:n}=(0,s.G)(e=>e.mistakesQuiz),o=r.length;Object.keys(n).length;let c=o>0?d/o*100:0;return(0,t.jsxs)("div",{className:"w-full bg-[#FFF5F2] dark:bg-white/5 rounded-4xl p-4 md:p-8 space-y-6 mb-8",children:[(0,t.jsx)("div",{className:"flex items-center justify-between flex-col-reverse md:flex-row gap-4 md:gap-0",children:(0,t.jsx)("div",{className:"text-center w-full",children:(0,t.jsx)("h2",{className:"text-xl md:text-2xl font-black text-dynamic-secondary-500 leading-tight",children:e("testYourMistakes")})})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-emerald-500 font-bold",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center",children:(0,t.jsx)(i.A,{className:"w-4 h-4"})}),(0,t.jsx)("span",{className:"text-xs uppercase tracking-widest",children:e("correctRate")})]}),(0,t.jsx)("div",{className:"text-sm font-black text-dynamic-secondary-500 opacity-80 italic",children:e("questionsProgress",{current:d,total:o,of:e("of")||"/",label:e("correct")||"Correct"})})]}),(0,t.jsx)("div",{className:"w-full h-3.5 bg-gray-200 dark:bg-white/10 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-gradient-to-r from-emerald-400 to-emerald-700 transition-all duration-700 ease-out rounded-full shadow-[0_0_10px_rgba(16,185,129,0.3)]",style:{width:"".concat(c,"%")}})})]})]})}},12793:(e,r,a)=>{a.d(r,{$:()=>l,T:()=>i});var t=a(21858),s=a(37547);async function l(e,r){try{let a=await t.A.get("/test-wrongs/get",{params:{course_id:e,questions_count:r}}),l=(0,s.Mw)(a.data);return{success:!0,data:l}}catch(e){var a,l,i;return console.error("Error fetching wrong questions:",(null==e||null==(a=e.response)?void 0:a.data)||e),{success:!1,error:(null==(i=e.response)||null==(l=i.data)?void 0:l.message)||"Failed to fetch wrong questions"}}}async function i(e){try{let r=await t.A.post("/test-wrongs/mark-question",e);return{success:!0,data:r.data}}catch(e){var r,a,s;return console.error("Error marking correct questions:",(null==e||null==(r=e.response)?void 0:r.data)||e),{success:!1,error:(null==(s=e.response)||null==(a=s.data)?void 0:a.message)||"Failed to mark questions"}}}},71068:(e,r,a)=>{a.r(r),a.d(r,{MistakesQuizPlayer:()=>Q});var t=a(95155),s=a(12115),l=a(6439),i=a(74155),d=a(12793),n=a(82377),o=a(346),c=a(18085),m=a(5917),x=a(65229),u=a(18955),g=a(36386),h=a(26405),b=a(47065);let y=e=>{let{question:r}=e,a=(0,l.j)(),d=(0,u.c)("dashboard.learning"),n=(0,l.G)(e=>e.mistakesQuiz.answers[r.id]),y=!!n,{user:p}=(0,h.x)(),{webSettings:f}=(0,g.A)(),w=null==f?void 0:f.settings_watermark,j=(0,s.useMemo)(()=>w&&p?w.selected_user_info_multiple.map(e=>(e=>{if(!p)return"";switch(e){case"full_name":return[p.fname,p.lname].filter(Boolean).join(" ");case"email":return p.email||"";case"id":return p.id?String(p.id):"";case"mobile":return p.mobile||"";default:return p[e]||""}})(e)).filter(Boolean).join(w.selected_user_delimiter||" / "):"",[w,p]),v=(null==w?void 0:w.watermark_size)||18,N=(0,s.useMemo)(()=>{if(!j)return null;let e='<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">\n <text x="50%" y="50%" transform="rotate(-20 150 100)" fill="#ffffff" opacity="0.08" font-size="'.concat(v,'" font-family="sans-serif" font-weight="bold" text-anchor="middle" stroke="#000000" stroke-width="0.5">').concat(j,"</text>\n </svg>");return(0,t.jsx)("div",{className:"absolute inset-0 pointer-events-none z-10 select-none",style:{backgroundImage:'url("data:image/svg+xml;utf8,'.concat(encodeURIComponent(e),'")'),backgroundRepeat:"repeat"}})},[j,v]),[k,C]=(0,s.useState)(!1),A=(r.question||"").split(/(\.{2,}|_{2,}|\[\.\.\.+\])/g),_=A.filter(e=>/^(\.{2,}|_{2,}
1|\[\.\.\.+\])$/.test(e)).length,q=0===_,[z,Q]=(0,s.useState)(Array(q?1:_).fill(""));(0,s.useEffect)(()=>{Q(Array(q?1:_).fill(""))},[r.id,_,q]);let S=(e,r)=>{if(y)return;let a=[...z];a[e]=r,Q(a)},F=z.some(e=>e.trim().length>0),U=r.image?(e=>{var r;if(!e)return null;let a=null==(r=e.split(".").pop())?void 0:r.toLowerCase();return["jpg","jpeg","png","gif","webp","svg"].includes(a||"")?"image":["mp3","wav","ogg","m4a"].includes(a||"")?"audio":["mp4","webm","mov","avi"].includes(a||"")?"video":null})(r.image):null,E=0;return(0,t.jsxs)("div",{className:"space-y-6",children:[r.image&&(0,t.jsxs)(t.Fragment,{children:["image"===U&&(0,t.jsxs)("div",{className:"w-full relative",children:[(0,t.jsxs)("button",{onClick:()=>C(!0),className:"mt-4 rounded-xl overflow-hidden shadow-2xl ring-1 border-dynamic-secondary-500/20 mx-auto block w-full cursor-zoom-in hover:opacity-90 transition-opacity focus:outline-none focus:ring-2 focus:ring-dynamic-primary-500 relative",children:[(0,t.jsx)("img",{src:r.image,alt:"Question",className:"w-full h-auto object-contain max-h-[400px]"}),N]}),(0,t.jsx)(b.r,{open:k,onClose:()=>C(!1),maxWidth:"7xl",children:(0,t.jsxs)("div",{className:"flex justify-center items-center bg-black/5 dark:bg-white/5 rounded-2xl p-2 md:p-4 relative overflow-hidden",children:[(0,t.jsx)("img",{src:r.image,alt:"Question Enlarged",className:"w-full h-auto max-h-[85vh] object-contain rounded-lg shadow-2xl relative z-10"}),N]})})]}),"audio"===U&&(0,t.jsx)("div",{className:"rounded-2xl overflow-hidden shadow-xl border-2 border-gray-200 dark:border-white/10 max-w-sm mx-auto bg-white dark:bg-dashboard-card p-6",children:(0,t.jsx)("audio",{src:r.image,controls:!0,className:"w-full"})}),"video"===U&&(0,t.jsx)("div",{className:"rounded-2xl overflow-hidden shadow-xl border-2 border-gray-200 dark:border-white/10 max-w-sm mx-auto",children:(0,t.jsx)("video",{src:r.image,controls:!0,className:"w-full h-auto max-h-96"})})]}),(e=>{if(!e)return!1;let r=String(e).trim().toLowerCase();if(""===r||"null"===r||"undefined"===r)return!1;let a=e.replace(/<[^>]*>/g,""),t=(a=(a=a.replace(/&[a-zA-Z0-9#]+;/g,"")).replace(/[\s\u00A0\u2007\u202F\u200B\uFEFF._\-\[\]\\:;,?Ø!]/g,"")).trim().toLowerCase();return""!==t&&"null"!==t&&"undefined"!==t&&a.length>0})(r.question)&&(0,t.jsx)("div",{className:"bg-dynamic-primary-500/5 dark:bg-orange-950/20 rounded-2xl p-6 md:p-10 border border-orange-200/60 dark:border-orange-500/10",children:(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-x-3 md:gap-x-4 gap-y-6 text-lg md:text-xl font-bold text-dynamic-secondary-500 leading-loose justify-start",children:A.map((e,r)=>{if(/^(\.{2,}|_{2,}|\[\.\.\.+\])$/.test(e)){let e=E++;return(0,t.jsx)("div",{className:"inline-grid grid-cols-1 items-center mx-1 min-w-[80px] md:min-w-[120px] max-w-xs md:max-w-lg",children:(0,t.jsx)("input",{type:"text",value:z[e]||"",onChange:r=>S(e,r.target.value),disabled:y,className:(0,o.cn)("w-full border rounded-lg px-3 py-1.5 text-center font-bold text-lg shadow-sm transition-all",y?n.isCorrect?"bg-emerald-50 dark:bg-emerald-900/20 border-emerald-500 text-emerald-700":"bg-red-50 dark:bg-red-900/20 border-red-500 text-red-700":"bg-white dark:bg-dashboard-card border-gray-300 dark:border-white/10 text-dynamic-secondary-500 focus:outline-none focus:border-dynamic-primary-500"),placeholder:"..."})},r)}return(0,t.jsx)("span",{className:"whitespace-pre-wrap",children:e},r)})})}),q&&(0,t.jsxs)("div",{className:"flex flex-col gap-3 mt-4",children:[(0,t.jsx)("label",{className:"text-sm font-bold text-gray-500 dark:text-gray-400",children:d("typeYourAnswer")||"Type your answer"}),(0,t.jsx)("input",{type:"text",value:z[0]||"",onChange:e=>S(0,e.target.value),disabled:y,className:(0,o.cn)("w-full border rounded-xl px-4 py-3 text-lg font-bold shadow-sm transition-all",y?n.isCorrect?"bg-emerald-50 dark:bg-emerald-900/20 border-emerald-500 text-emerald-700":"bg-red-50 dark:bg-red-900/20 border-red-500 text-red-700":"bg-white dark:bg-dashboard-card border-gray-300 dark:border-white/10 text-dynamic-secondary-500 focus:outline-none focus:border-dynamic-primary-500"),placeholder:d("answerPlaceholder")||"Write your answer here..."})]}),!y&&(0,t.jsxs)("button",{onClick:()=>{y||a((0,i.y8)({questionId:r.id.toString(),userAnswers:z,correctAnswer:r.answer}))},disabled:!F,className:(0,o.cn)("w-full py-4 rounded-2xl font-bold text-lg flex items-center justify-center gap-2 transition-all",F?"bg-dynamic-primary-500 text-white hover:bg-dynamic-primary-600 active:scale-[0.98]":"bg-gray-200 dark:bg-white/5 text-gray-400 dark:text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(c.A,{className:"w-5 h-5"}),d("checkAnswer")||"Check Answer"]}),y&&(0,t.jsx)("div",{className:(0,o.cn)("p-4 rounded-2xl text-center font-bold animate-in slide-in-from-bottom-2 duration-300 flex items-center justify-center gap-2",n.isCorrect?"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400":"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400"),children:n.isCorrect?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.A,{className:"w-5 h-5"}),d("correctAnswer")||"â Correct!"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.A,{className:"w-5 h-5"}),d("incorrectAnswer")||"â Incorrect",(0,t.jsxs)("span",{className:"ml-2 opacity-70",children:["(",d("correctAnswerIs")||"Correct answer",": ",r.answer,")"]})]})})]})},p=e=>{let{question:r}=e,a=(0,l.j)(),d=(0,u.c)("dashboard.learning"),n=!!(0,l.G)(e=>e.mistakesQuiz.answers[r.id]),g=(0,s.useMemo)(()=>
1r.data||[],[r.data]),[h,b]=(0,s.useState)({});(0,s.useEffect)(()=>{b({})},[r.id]);let y=(0,s.useMemo)(()=>{let e={};return g.forEach((r,a)=>{e[a]=r.answer||""}),e},[g]),p=Object.keys(h).length===g.length;return(0,t.jsxs)("div",{className:"space-y-10",children:[(0,t.jsx)("div",{className:"space-y-12",children:g.map((e,r)=>(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("h3",{className:"text-xl font-bold text-gray-800 dark:text-gray-100 flex items-center gap-2 text-right justify-start",children:[(0,t.jsxs)("span",{className:"text-dynamic-primary-500",children:[r+1,"-"]}),(0,t.jsx)("span",{children:e.question})]}),(0,t.jsx)("div",{className:"pr-0 border-r-0",children:((e,r)=>{let a=h[r],s=[{key:"A",text:e.a,image:e.image_a},{key:"B",text:e.b,image:e.image_b},{key:"C",text:e.c,image:e.image_c},{key:"D",text:e.d,image:e.image_d},{key:"E",text:e.e,image:e.image_e}].filter(e=>e.text||e.image);return(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:s.map(e=>{var s;let l=a===e.key,i=n&&e.key.toUpperCase()===(null==(s=y[r])?void 0:s.toUpperCase()),d=n&&l&&!(e=>{var r,a;return n?(null==(r=h[e])?void 0:r.toUpperCase())===(null==(a=y[e])?void 0:a.toUpperCase()):null})(r);return(0,t.jsxs)("button",{onClick:()=>{var a;return a=e.key,void(!n&&b(e=>({...e,[r]:a})))},disabled:n,className:(0,o.cn)("flex items-center gap-4 p-4 rounded-2xl border-2 transition-all group/option relative",n?i?"bg-emerald-50 dark:bg-emerald-900/20 border-emerald-500 shadow-md ring-1 ring-emerald-500/20":d?"bg-red-50 dark:bg-red-900/20 border-red-500 shadow-md ring-1 ring-red-500/20":"bg-gray-50 dark:bg-dashboard-card border-gray-200 dark:border-dynamic-secondary-500/10 opacity-60 cursor-not-allowed":l?"bg-dynamic-primary-500/5 border-dynamic-primary-500 shadow-sm":"bg-white dark:bg-dashboard-card border-dynamic-secondary-500/20 hover:border-dynamic-primary-500/50"),children:[(0,t.jsxs)("div",{className:(0,o.cn)("w-6 h-6 rounded-full border-2 flex items-center justify-center transition-all shrink-0 ltr:order-1 rtl:order-3",n?i?"border-emerald-500 bg-emerald-500":d?"border-red-500 bg-red-500":"border-gray-300 dark:border-gray-600":l?"border-dynamic-primary-500":"border-dynamic-secondary-500/20"),children:[i&&(0,t.jsx)(m.A,{className:"w-4 h-4 text-white animate-in zoom-in-50 duration-200"}),d&&(0,t.jsx)(x.A,{className:"w-4 h-4 text-white animate-in zoom-in-50 duration-200"}),!n&&l&&(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-dynamic-primary-500"})]}),(0,t.jsxs)("div",{className:"flex-1 space-y-2 text-start order-2 px-2",children:[e.text&&(0,t.jsx)("p",{className:(0,o.cn)("text-base md:text-lg font-bold transition-colors",i?"text-emerald-700 dark:text-emerald-300":d?"text-red-700 dark:text-red-300":n?"text-gray-400":l?"text-dynamic-secondary-500":"text-gray-500"),children:e.text}),e.image&&(0,t.jsx)("div",{className:"rounded-xl overflow-hidden ring-1 border-dynamic-secondary-500/20 max-w-xs ml-auto",children:(0,t.jsx)("img",{src:e.image,alt:"Option ".concat(e.key),className:"w-full h-auto"})})]}),(0,t.jsx)("div",{className:(0,o.cn)("w-8 h-8 rounded-lg flex items-center justify-center font-black text-xs transition-colors shrink-0 ltr:order-3 rtl:order-1",i?"bg-emerald-100 text-emerald-600":d?"bg-red-100 text-red-600":n?"bg-gray-100 text-gray-400":l?"bg-dynamic-primary-500/10 text-dynamic-primary-500":"bg-gray-50 dark:bg-white/5 text-gray-400"),children:e.key})]},e.key)})})})(e,r)})]},r))}),!n&&(0,t.jsxs)("button",{onClick:()=>{n||a((0,i.jw)({questionId:r.id.toString(),subAnswers:h,correctSubAnswers:y}))},disabled:!p,className:(0,o.cn)("w-full py-4 rounded-2xl font-bold text-lg flex items-center justify-center gap-2 transition-all",p?"bg-dynamic-primary-500 text-white hover:bg-dynamic-primary-600 active:scale-[0.98]":"bg-gray-200 dark:bg-white/5 text-gray-400 dark:text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(c.A,{className:"w-5 h-5"}),d("checkAnswer")||"Check Answer"]})]})};var f=a(7833),w=a(87940),j=a(6132),v=a(70667);let N=e=>{let{open:r,onClose:a,onConfirm:s}=e,l=(0,u.c)("dashboard.learning");return(0,t.jsx)(b.r,{open:r,onClose:a,title:"",maxWidth:"sm",children:(0,t.jsxs)("div",{className:"text-center space-y-6 py-4",children:[(0,t.jsx)("div",{className:"w-20 h-20 rounded-full bg-amber-50 dark:bg-amber-900/20 flex items-center justify-center mx-auto",children:(0,t.jsx)(j.A,{className:"w-10 h-10 text-amber-500"})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-2xl font-black text-dynamic-secondary-500",children:l("finishQuizConfirmationTitle")||"Finish Quiz?"}),(0,t.jsx)("p",{className:"text-gray-500 dark:text-gray-400 font-medium px-4",children:l("finishQuizConfirmationMessage")||"Are you sure you want to finish the quiz? You can always come back and practice more later."})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,t.jsx)(v.$,{onClick:s,className:(0,o.cn)("flex-1 h-12 shadow-lg","bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-600 shadow-dynamic-primary-500/20","hover:scale-[1.01] active:scale-95 transition-all"),children:l("confirmFinish")||"Yes, Finish"}),(0,t.jsx)(v.$,{variant:"outline",onClick:a,className:"h-12",children:l("cancel")||"Cancel"})]})]})})};var k=a(902),C=a(35299),A=a(52987),_=a(35626),q=a(44517),z=a(99776);let Q=e=>{let{courseId:r,onClose:a}=e,m=(0,l.j)(),g=(0,z.jE)(),h=(0,u.c)("dashboard.learning"),b="ar"===(0,k.Ym)(),{questions:j,currentIndex:Q,answers:S,correctCount:F,status:U}=(0,l.G)(e=>
1e.mistakesQuiz),[E,P]=(0,s.useState)(!1),[M,L]=(0,s.useState)(!1);(0,s.useEffect)(()=>()=>{m((0,i.a8)())},[m]);let R=j[Q],G=0===Q,I=Q===j.length-1,O=R?S[R.id]:null,Y=!!O,B=Object.keys(S).length===j.length,T=()=>{L(!0)},$=(0,s.useCallback)(async()=>{L(!1),m((0,i.l5)());let e=q.default.loading(h("submittingQuiz")||"Submitting...");try{let a=j.filter(e=>{var r;let a=S[e.id];if(!a)return!1;if("PARAGRAPH"!==e.question_type||!(null==(r=e.data)?void 0:r.length))return a.isCorrect;try{let r=JSON.parse(a.selected);return e.data.some((e,a)=>{var t,s;return(null==(t=r[a])?void 0:t.toUpperCase())===(null==(s=e.answer)?void 0:s.toUpperCase())})}catch(e){return a.isCorrect}}).map(e=>{var r;let a={id:e.id,type:e.question_type};if("PARAGRAPH"!==e.question_type||!(null==(r=e.data)?void 0:r.length))return a;try{let r=JSON.parse(S[e.id].selected),t=e.data.map((e,a)=>{var t,s;return(null==(t=r[a])?void 0:t.toUpperCase())===(null==(s=e.answer)?void 0:s.toUpperCase())?e.order:-1}).filter(e=>-1!==e);return{...a,sub_questions_ids:t}}catch(e){return a}});if(0===a.length){q.default.success(h("submissionSuccessful")||"Submission successful!",{id:e}),m((0,i.Il)()),P(!0);return}let t=await (0,d.T)({course_id:r,questions:a});if(t.success){let t=a.filter(e=>{var r,a;let t=j.find(r=>r.id===e.id);if(!t||"PARAGRAPH"!==t.question_type||!(null==(r=t.data)?void 0:r.length))return!0;let s=t.data.length;return((null==(a=e.sub_questions_ids)?void 0:a.length)||0)===s}).length;(e=>{g.setQueryData(["course-details",r],r=>r?{...r,wrong_questions_count:Math.max(0,(r.wrong_questions_count||0)-e)}:r),g.setQueryData(["student-courses-infinite"],a=>(null==a?void 0:a.pages)?{...a,pages:a.pages.map(a=>{var t,s;let l=[];Array.isArray(null==a||null==(t=a.courses)?void 0:t.data)?l=a.courses.data:Array.isArray(null==a?void 0:a.courses)?l=a.courses:Array.isArray(null==a?void 0:a.data)&&(l=a.data);let i=l.map(a=>{var t;return(null==a||null==(t=a.id)?void 0:t.toString())===(null==r?void 0:r.toString())?{...a,wrong_questions_count:Math.max(0,(a.wrong_questions_count||0)-e)}:a});return Array.isArray(null==a||null==(s=a.courses)?void 0:s.data)?{...a,courses:{...a.courses,data:i}}:Array.isArray(null==a?void 0:a.courses)?{...a,courses:i}:Array.isArray(null==a?void 0:a.data)?{...a,data:i}:a})}:a)})(t),q.default.success(h("submissionSuccessful")||"Submission successful!",{id:e}),m((0,i.Il)()),P(!0)}else q.default.error(t.error||"Failed to submit",{id:e}),m((0,i.Nh)())}catch(r){q.default.error(h("submissionError")||"Submission failed",{id:e}),m((0,i.Nh)())}},[j,S,r,m,h,g]),D=(0,s.useCallback)(()=>{P(!1),a()},[a]),H=(0,s.useCallback)(()=>{I&&B?$():I||m((0,i.Yx)())},[I,B,$,m]);return"loading"===U?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[50vh] space-y-4",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"w-16 h-16 border-4 border-dynamic-primary-500/20 rounded-full"}),(0,t.jsx)("div",{className:"w-16 h-16 border-4 border-dynamic-primary-500 border-t-transparent rounded-full animate-spin absolute top-0 left-0"})]}),(0,t.jsx)("p",{className:"text-dynamic-secondary-500 font-bold animate-pulse",children:h("loadingQuiz")||"Loading..."})]}):"error"===U?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[50vh] space-y-6 text-center px-4",children:[(0,t.jsx)("div",{className:"w-20 h-20 rounded-full bg-red-100 dark:bg-red-900/20 flex items-center justify-center",children:(0,t.jsx)(x.A,{className:"w-10 h-10 text-red-500"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-2xl font-black text-dynamic-secondary-500",children:h("errorLoadingQuiz")||"Error Loading Quiz"}),(0,t.jsx)("p",{className:"text-gray-500 mt-2",children:h("tryAgainLater")||"Please try again later"})]}),(0,t.jsx)(v.$,{onClick:a,variant:"outline",className:"px-10 rounded-xl border-red-500 text-red-500 hover:bg-red-50",children:h("goBack")||"Go Back"})]}):R?(0,t.jsx)("div",{className:"flex flex-col h-full w-full bg-[#fcfaf9] dark:bg-dashboard-bg",children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 relative",children:[(0,t.jsx)("main",{className:"flex-1 overflow-y-auto no-scrollbar lg:p-8 pb-8",children:(0,t.jsxs)("div",{className:"w-full max-w-4xl mx-auto
1space-y-6",children:[(0,t.jsx)(f.F,{}),(0,t.jsxs)("div",{className:"bg-white dark:bg-dashboard-card rounded-[32px] p-6 md:p-8 shadow-2xl shadow-black/5 border border-dynamic-secondary-500/20",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,t.jsxs)("span",{className:"text-sm bg-dynamic-primary-500 text-white px-3 py-1 rounded-lg font-bold",children:[h("questionLabel")||"Question"," ",Q+1]}),(0,t.jsx)("span",{className:"text-sm bg-dynamic-primary-500/10 text-dynamic-primary-500 px-3 py-1 rounded-lg font-bold",children:R.question_type})]}),"COMPLETE"!==R.question_type&&(0,t.jsxs)("div",{className:"bg-dynamic-primary-500/5 dark:bg-dashboard-card rounded-3xl p-4 md:p-8 border border-dynamic-primary-500/10 dark:border-white/5 mb-6",children:[(0,t.jsx)("h2",{className:"text-xl md:text-2xl font-bold text-dynamic-secondary-500 leading-relaxed",children:R.question}),R.image&&(0,t.jsx)("div",{className:"mt-4 rounded-xl overflow-hidden shadow-2xl max-w-2xl mx-auto",children:(0,t.jsx)("img",{src:R.image,alt:"Question",className:"w-full h-auto object-contain"})})]}),"MCQ"===R.question_type&&(0,t.jsx)(n.b,{question:R}),"COMPLETE"===R.question_type&&(0,t.jsx)(y,{question:R}),"PARAGRAPH"===R.question_type&&(0,t.jsx)(p,{question:R}),Y&&"MCQ"===R.question_type&&(0,t.jsx)("div",{className:(0,o.cn)("mt-6 p-4 rounded-2xl text-center font-bold animate-in slide-in-from-bottom-2 duration-300",O.isCorrect?"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400":"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400"),children:O.isCorrect?h("correctAnswer")||"â Correct!":h("incorrectAnswer")||"â Incorrect"}),(0,t.jsxs)("div",{className:"hidden lg:flex items-center justify-between gap-4 pt-10 mt-10 border-t border-dynamic-secondary-500/10",children:[(0,t.jsx)("button",{onClick:T,disabled:"submitting"===U,className:(0,o.cn)("group relative h-14 p-[1.5px] rounded-full bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700","hover:scale-[1.02] active:scale-95 transition-all","disabled:opacity-50 disabled:cursor-not-allowed disabled:grayscale"),children:(0,t.jsxs)("div",{className:"h-full px-10 rounded-full bg-[#fcfaf9] dark:bg-dashboard-card flex items-center gap-2 transition-all",children:["submitting"===U?(0,t.jsx)(C.A,{className:"w-5 h-5 animate-spin text-dynamic-primary-500"}):(0,t.jsx)(c.A,{className:"w-5 h-5 text-dynamic-primary-500"}),(0,t.jsx)("span",{className:"font-bold bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700 bg-clip-text text-transparent",children:h("finishQuiz")||"Finish"})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("button",{onClick:()=>m((0,i.Ce)()),disabled:G,className:(0,o.cn)("group relative h-14 p-[1.5px] rounded-full bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700 hover:scale-[1.02] active:scale-95 transition-all disabled:opacity-30 disabled:cursor-not-allowed disabled:grayscale"),children:(0,t.jsxs)("div",{className:"h-full px-10 rounded-full bg-[#fcfaf9] dark:bg-dashboard-card flex items-center gap-2 transition-all",children:[b?(0,t.jsx)(A.A,{className:"w-5 h-5 text-dynamic-primary-500"}):(0,t.jsx)(_.A,{className:"w-5 h-5 text-dynamic-primary-500"}),(0,t.jsx)("span",{className:"hidden sm:inline font-bold bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700 bg-clip-text text-transparent",children:h("previous")||"Previous"})]})}),(0,t.jsx)("button",{onClick:H,disabled:I&&!B||"submitting"===U,className:(0,o.cn)("h-14 px-10 rounded-full bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700","text-white font-black shadow-lg shadow-dynamic-primary-500/20","hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2","disabled:opacity-50 disabled:cursor-not-allowed"),children:I&&B?(0,t.jsxs)(t.Fragment,{children:["submitting"===U?(0,t.jsx)(C.A,{className:"w-5 h-5 animate-spin"}):(0,t.jsx)(c.A,{className:"w-5 h-5"}),(0,t.jsx)("span",{children:h("submitQuiz")||"Submit"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:h("next")||"Next"}),b?(0,t.jsx)(_.A,{className:"w-5 h-5"}):(0,t.jsx)(A.A,{className:"w-5 h-5"})]})})]})]})]})]})}),(0,t.jsx)("div",{className:"lg:hidden sticky bottom-0 bg-[#fcfaf9]/95 dark:bg-dashboard-bg/95 backdrop-blur-sm border-t border-dynamic-secondary-500/10 p-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 max-w-4xl mx-auto",children:[(0,t.jsx)("button",{onClick:T,disabled:"submitting"===U,className:(0,o.cn)("group relative h-12 p-[1.5px] rounded-full bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700","hover:scale-[1.02] active:scale-95 transition-all","disabled:opacity-50 disabled:cursor-not-allowed disabled:grayscale"),children:(0,t.jsxs)("div",{className:"h-full px-6 rounded-full bg-[#fcfaf9] dark:bg-dashboard-bg flex items-center gap-2",children:["submitting"===U?(0,t.jsx)(C.A,{className:"w-4 h-4 animate-spin text-dynamic-primary-500"}):(0,t.jsx)(c.A,{className:"w-4 h-4 text-dynamic-primary-500"}),(0,t.jsx)("span",{className:"font-bold bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700 bg-clip-text text-transparent",children:h("finishQuiz")||"Finish"})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("button",{onClick:()=>m((0,i.Ce)()),disabled:G,className:(0,o.cn)("h-12 px-6 rounded-full border-2 border-dynamic-primary-500/30 text-dynamic-primary-500 font-bold","hover:bg-dynamic-primary-500/10 transition-all flex items-center gap-2","disabled:opacity-30 disabled:cursor-not-allowed"),children:[b?(0,t.jsx)(A.A,{className:"w-4 h-4"}):(0,t.jsx)(_.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:h("previous")||"Previous"})]}),(0,t.jsx)("button",{onClick:H,disabled:I&&!B||"submitting"===U,className:(0,o.cn)("h-12 px-6 rounded-full bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700","text-white font-bold shadow-lg shadow-dynamic-primary-500/20","hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2","disabled:opacity-50 disabled:cursor-not-allowed"),children:I&&B?(0,t.jsxs)(t.Fragment,{children:["submitting"===U?(0,t.jsx)(C.A,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(c.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:h("submitQuiz")||"Submit"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:h("next")||"Next"}),b?(0,t.jsx)(_.A,{className:"w-4 h-4"}):(0,t.jsx)(A.A,{className:"w-4 h-4"})]})})]})]})}),(0,t.jsx)(w.y,{open:E,onClose:D,correctCount:F,totalQuestions:j.length}),(0,t.jsx)(N,{open:M,onClose:()=>L(!1),onConfirm:$})]})}):null}},82377:(e,r,a)=>{a.d(r,{b:()=>o});var t=a(95155);a(12115);var s=a(6439),l=a(74155),i=a(346),d=a(5917),n=a(65229);let o=e=>{let{question:r}=e,a=(0,s.j)(),o=(0,s.G)(e=>e.mistakesQuiz.answers[r.id]),c=!!o,m=[{key:"A",text:r.a,image:r.image_a},{key:"B",text:r.b,image:r.image_b},{key:"C",text:r.c,image:r.image_c},{key:"D",text:r.d,image:r.image_d},{key:"E",text:r.e,image:r.image_e}].filter(e=>e.text||e.image);return(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4",children:m.map(e=>{let s=c&&e.key.toUpperCase()===r.answer.toUpperCase(),m=c&&o.selected.toUpperCase()===e.key.toUpperCase()&&!o.isCorrect;return(0,t.jsxs)("button",{onClick:()=>{var t;return t=e.key,void(!c&&a((0,l.pt)({questionId:r.id.toString(),selected:t,correctAnswer:r.answer})))}
1,disabled:c,className:(0,i.cn)("flex items-center gap-4 p-4 rounded-2xl border-2 transition-all group/option relative",(e=>{if(!c)return"bg-white dark:bg-dashboard-card border-dynamic-secondary-500/20 hover:border-dynamic-primary-500/50 cursor-pointer";let a=e.toUpperCase()===r.answer.toUpperCase(),t=o.selected.toUpperCase()===e.toUpperCase();return a?"bg-emerald-50 dark:bg-emerald-900/20 border-emerald-500 shadow-md ring-1 ring-emerald-500/20":t&&!o.isCorrect?"bg-red-50 dark:bg-red-900/20 border-red-500 shadow-md ring-1 ring-red-500/20":"bg-gray-50 dark:bg-dashboard-card border-gray-200 dark:border-dynamic-secondary-500/10 opacity-60 cursor-not-allowed"})(e.key)),children:[(0,t.jsxs)("div",{className:(0,i.cn)("w-6 h-6 rounded-full border-2 flex items-center justify-center transition-all shrink-0 ltr:order-1 rtl:order-3",(e=>{if(!c)return"border-dynamic-secondary-500/20";let a=e.toUpperCase()===r.answer.toUpperCase(),t=o.selected.toUpperCase()===e.toUpperCase();return a?"border-emerald-500 bg-emerald-500":t&&!o.isCorrect?"border-red-500 bg-red-500":"border-gray-300 dark:border-gray-600"})(e.key)),children:[s&&(0,t.jsx)(d.A,{className:"w-4 h-4 text-white animate-in zoom-in-50 duration-200"}),m&&(0,t.jsx)(n.A,{className:"w-4 h-4 text-white animate-in zoom-in-50 duration-200"})]}),(0,t.jsxs)("div",{className:"flex-1 space-y-2 text-start order-2 px-2",children:[e.text&&(0,t.jsx)("p",{className:(0,i.cn)("text-base md:text-lg font-bold transition-colors",s?"text-emerald-700 dark:text-emerald-300":m?"text-red-700 dark:text-red-300":c?"text-gray-400":"text-gray-600 dark:text-gray-300"),children:e.text}),e.image&&(0,t.jsx)("div",{className:"rounded-xl overflow-hidden ring-1 border-dynamic-secondary-500/20 max-w-xs ml-auto",children:(0,t.jsx)("img",{src:e.image,alt:"Option ".concat(e.key),className:"w-full h-auto"})})]}),(0,t.jsx)("div",{className:(0,i.cn)("w-8 h-8 rounded-lg flex items-center justify-center font-black text-xs transition-colors shrink-0 ltr:order-3 rtl:order-1",s?"bg-emerald-100 text-emerald-600":m?"bg-red-100 text-red-600":c?"bg-gray-100 text-gray-400":"bg-gray-50 dark:bg-white/5 text-gray-400"),children:e.key})]},e.key)})})}},87940:(e,r,a)=>{a.d(r,{y:()=>c});var t=a(95155);a(12115);var s=a(47065),l=a(18955),i=a(6613),d=a(61362),n=a(95740),o=a(346);let c=e=>{let{open:r,onClose:a,correctCount:c,totalQuestions:m}=e,x=(0,l.c)("dashboard.learning"),u=m>0?Math.round(c/m*100):0,g=c===m;return(0,t.jsx)(s.r,{open:r,onClose:a,title:"",maxWidth:"sm",children:(0,t.jsxs)("div",{className:"text-center space-y-6 py-4",children:[(0,t.jsxs)("div",{className:"relative inline-flex",children:[(0,t.jsx)("div",{className:(0,o.cn)("w-24 h-24 rounded-full flex items-center justify-center",g?"bg-linear-to-br from-yellow-400 to-amber-500":"bg-linear-to-br from-emerald-400 to-emerald-600"),children:g?(0,t.jsx)(i.A,{className:"w-12 h-12 text-white drop-shadow-lg"}):(0,t.jsx)(d.A,{className:"w-12 h-12 text-white drop-shadow-lg"})}),g&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.A,{className:"w-6 h-6 text-yellow-400 absolute -top-2 -right-2 animate-pulse"}),(0,t.jsx)(n.A,{className:"w-4 h-4 text-yellow-400 absolute -bottom-1 -left-2 animate-pulse delay-300"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-2xl md:text-3xl font-black text-dynamic-secondary-500",children:g?x("perfectScore")||"Perfect Score!":x("quizComplete")||"Quiz Complete!"}),(0,t.jsx)("p",{className:"text-gray-500 dark:text-gray-400 font-medium",children:x("submissionSuccessful")||"Your submission was successful"})]}),(0,t.jsxs)("div",{className:"bg-gray-50 dark:bg-dashboard-card rounded-2xl p-6 space-y-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 font-medium",children:x("yourScore")||"Your Score"}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,t.jsx)("span",{className:(0,o.cn)("text-4xl font-black",g?"text-amber-500":"text-emerald-500"),children:c}),(0,t.jsx)("span",{className:"text-2xl font-bold text-gray-400",children:"/"}),(0,t.jsx)("span",{className:"text-2xl font-bold text-muted",children:m})]}),(0,t.jsxs)("p",{className:(0,o.cn)("text-lg font-bold",g?"text-amber-500":"text-emerald-500"),children:[u,"%"]})]}),(0,t.jsx)("button",{onClick:a,className:(0,o.cn)("w-full h-14 roun
1ded-2xl font-black text-lg text-white shadow-lg","hover:scale-[1.02] active:scale-95 transition-all",g?"bg-linear-to-r from-amber-400 to-amber-600 shadow-amber-500/20":"bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-600 shadow-dynamic-primary-500/20"),children:x("continueLearning")||"Continue Learning"})]})})}}}]);
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.