PageSourceSearch

https://drahmedfarhat.com/front/_next/static/chunks/3934-07634291e573d60a.js

js drahmedfarhat.com collected 2026-09-24 14:43:51 UTC 16,729 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3934],{36070:(e,t,n)=>{n.d(t,{c:()=>g});var r=n(95155),a=n(47065),s=n(18955),i=n(902),l=n(52056),o=n(39324),c=n(61362),d=n(78874),u=n(24589),m=n(52987),x=n(35626),f=n(6439);function g(e){var t;let{open:n,onClose:g,onConfirm:h,stats:p,isUploading:v}=e,y=(0,s.c)("dashboard.learning"),w=(0,i.Ym)(),{activeQuiz:I}=(0,f.G)(e=>e.quiz),b=(null==I||null==(t=I.language)?void 0:t.write_position)?"rtl"===I.language.write_position:"ar"===w,S=Math.round(p.answered/p.total*100);return(0,r.jsx)(a.r,{open:n,onClose:g,maxWidth:"xl",className:"rounded-4xl",children:(0,r.jsxs)("div",{className:"flex flex-col items-center text-center space-y-6 py-2 px-2",children:[(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)("div",{className:"w-20 h-20 rounded-full bg-orange-100 dark:bg-orange-900/20 flex items-center justify-center animate-in zoom-in duration-300",children:(0,r.jsx)(l.A,{className:"w-10 h-10 text-orange-500"})})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("h3",{className:"text-2xl font-black text-dynamic-secondary-500 leading-tight",children:y("confirmEndQuiz")||"Are you sure you want to end the quiz?"}),(0,r.jsx)("p",{className:"text-gray-500 dark:text-gray-400 max-w-xs mx-auto text-sm font-medium leading-relaxed",children:y("confirmEndDesc")||"After confirmation, your answers will be submitted mostly and you won't be able to edit them."})]}),(0,r.jsxs)("div",{className:"w-full flex flex-col items-center mt-6 gap-8",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-8 md:gap-12 w-full",children:[(0,r.jsxs)("div",{className:"relative w-32 h-32 flex items-center justify-center",children:[(0,r.jsxs)("svg",{className:"transform -rotate-90 w-32 h-32",children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:"vibrantGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:"#8b5cf6"})," ",(0,r.jsx)("stop",{offset:"100%",stopColor:"#3b82f6"})," "]})}),(0,r.jsx)("circle",{cx:"64",cy:"64",r:"58",stroke:"currentColor",strokeWidth:"2",fill:"transparent",strokeDasharray:"4 6",className:"text-gray-200 dark:text-gray-700"}),(0,r.jsx)("circle",{cx:"64",cy:"64",r:56,stroke:"url(#vibrantGradient)",strokeWidth:"6",strokeLinecap:"round",fill:"transparent",strokeDasharray:2*Math.PI*56,strokeDashoffset:2*Math.PI*56-S/100*(2*Math.PI*56),className:"filter drop-shadow-lg"})]}),(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center pt-2",children:[(0,r.jsxs)("span",{className:"text-3xl font-black text-dynamic-secondary-500 tracking-tight",children:[S,"%"]}),(0,r.jsx)("span",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:y("completed")||"Done"})]})]}),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,r.jsx)("span",{className:"text-gray-400 text-xs font-medium",children:y("timeLeft")||"Time Left"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 text-dynamic-secondary-500",children:[(0,r.jsx)("div",{className:"p-2 rounded-xl bg-gray-100 dark:bg-white/5",children:(0,r.jsx)(o.A,{className:"w-5 h-5 mx-auto"})}),(0,r.jsx)("span",{className:"text-2xl font-black font-mono tracking-wider",children:(e=>{if(null==e||isNaN(e)||e<0)return"--:--";let t=Math.floor(e/60);return"".concat(t.toString().padStart(2,"0"),":").concat((e%60).toString().padStart(2,"0"))})(p.timeLeftSeconds)})]})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-6 md:gap-12 w-full max-w-2xl px-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 text-start",children:[(0,r.jsx)("div",{className:"w-12 h-12 shrink-0 rounded-2xl bg-cyan-400 text-white flex items-center justify-center shadow-lg shadow-cyan-400/20",children:(0,r.jsx)(c.A,{className:"w-6 h-6"})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"text-2xl font-black text-cyan-400 leading-none",children:p.answered}),(0,r.jsx)("span",{className:"text-[10px] font-bold text-gray-400 mt-1",children:y("answered")||"Answered"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 text-start",children:[(0,r.jsx)("div",{className:"w-12 h-12 shrink-0 rounded-2xl bg-rose-400 text-white flex items-center justify-center shadow-lg shadow-rose-400/20",children:(0,r.jsx)(d.A,{className:"w-6 h-6"})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"text-2xl font-black text-rose-400 leading-none",children:p.unanswered}),(0,r.jsx)("span",{className:"text-[10px] font-bold text-gray-400 mt-1",children:y("unanswered")||"Skipped"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 text-start",children:[(0,r.jsx)("div",{className:"w-12 h-12 shrink-0 rounded-2xl bg-indigo-500 text-white flex items-center justify-center shadow-lg shadow-indigo-500/20",children:(0,r.jsx)(u.A,{className:"w-6 h-6"})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"text-2xl font-black text-indigo-500 leading-none",children:p.flagged}),(0,r.jsx)("span",{className:"text-[10px] font-bold text-gray-400 mt-1",children:y("flagged")||"Marked"})]})]})]}),(0,r.jsxs)("div",{className:"flex flex-col w-full max-w-80 gap-3 mt-4",children:[(0,r.jsxs)("button",{onClick:g,className:"w-full h-12 rounded-full bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700 text-white font-black text-base shadow-xl shadow-dynamic-primary-500/20 hover:scale-[1.02] active:scale-95 transition-all flex items-center justify-center gap-2",children:[b?(0,r.jsx)(m.A,{className:"w-4 h-4"}):(0,r.jsx)(x.A,{className:"w-4 h-4"}),y("continueQuiz")]}),(0,r.jsx)("button",{onClick:h,disabled:v,className:"group relative w-full h-12 p-[1.5px] rounded-full transition-all ".concat(v?"bg-gray-300 opacity-50 cursor-not-allowed":"bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700 hover:scale-[1.02] active:scale-95"),children:(0,r.jsx)("div",{className:"h-full w-full rounded-full bg-[#fcfaf9] dark:bg-dashboard-card flex items-center justify-center gap-2 transition-all",children:(0,r.jsx)("span",{className:"text-base font-bold ".concat(v?"text-gray-400":"bg-linear-to-r from-dynamic-primary-400 to-dynamic-primary-700 bg-clip-text text-transparent"),children:y(v?"waitMediaUpload":"endQuizAction")})})})]})]})]})})}},59685:(e,t,n)=>{n.d(t,{UP:()=>i,rn:()=>l});var r=n(12115),a=n(26405);function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"user";return"".concat(n,"_").concat(e,"_").concat(t)}function i(){let{user:e}=(0,a.x)(),t=null==e?void 0:e.id;return(0,r.useMemo)(()=>{let e=function(e){let t=e?String(e):null;return{setItem:function(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return console.warn("[UserStorage] Cannot save: No user ID provided"),!1;try{let{prefix:a="user",ttl:i}=r,l={value:n,userId:t,savedAt:Date.now(),ttl:i},o=s(t,e,a);return localStorage.setItem(o,JSON.stringify(l)),!0}catch(e){return console.error("[UserStorage] Failed to save:",e),!1}},getItem:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return console.warn("[UserStorage] Cannot retrieve: No user ID provided"),null;try{let{prefix:r="user"}=n,a=s(t,e,r),i=localStorage.getItem(a);if(!i)return null;let l=JSON.parse(i);if(l.userId!==t)return console.warn("[UserStorage] User mismatch, ignoring stored data"),null;if(l.ttl&&Date.now()-l.savedAt>l.ttl)return localStorage.removeItem(a),null;return l.value}catch(e){return console.error("[UserStorage] Failed to retrieve:",e),null}},removeItem:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return console.warn("[UserStorage] Cannot remove: No user ID provided"),!1;try{let{prefix:r="user"}=n,a=s(t,e,r);return localStorage.removeItem(a),!0}catch(e){return console.error("[UserStorage] Failed to remove:",e),!1}},hasItem:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return!1;try{let{prefix:r="user"}=n,a=s(t,e,r),i=localStorage.getItem(a);if(!i)return!1;let l=JSON.parse(i);if(l.userId!==t)return!1;if(l.ttl&&Date.now()-l.savedAt>l.ttl)return localStorage.removeItem(a),!1;return!0}catch(e){return!1}},userId:t,isReady:!!t}}(t);return{setItem:function(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.setItem(t,n,r)},getItem:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.getItem(t,n)},removeItem:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.removeItem(t,n)},hasItem:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.hasItem(t,n)},userId:e.userId,isReady:e.isReady}},[t])}let l={HOUR:36e5,DAY:864e5,WEEK:6048e5,MONTH:2592e6}},66777:(e,t,n)=>{n.d(t,{y:()=>s});var r=n(12115),a=n(59685);function s(e){let{quizId:t,durationMinutes:n,endAt:s,isResuming:i=!1,onTick:l,onTimeExpired:o}=e,{setItem:c,getItem:d,removeItem:u,userId:m,isReady:x}=(0,a.UP)(),[f,g]=(0,r.useState)(null),[h,p]=(0,r.useState)(!1),v=(0,r.useRef)(null),y=(0,r.useRef)(l),w=(0,r.useRef)(o);(0,r.useEffect)(()=>{y.current=l,w.current=o},[l,o]);let I=(0,r.useCallback)(()=>"quizStart_".concat(t),[t]),b=(0,r.useCallback)(e=>{let t=Date.now(),r=60*n*1e3-(t-e);return s&&(r=Math.min(r,new Date(s).getTime()-t)),Math.max(0,Math.floor(r/1e3))},[n,s]),S=(0,r.useCallback)(()=>
1{if(!x||!m)return;let e=I(),t=d(e);t&&i||c(e,t=Date.now(),{ttl:60*n*1e3+864e5});let r=b(t);if(g(r),y.current&&y.current(r),r<=0)return void p(!0);v.current&&clearInterval(v.current),v.current=setInterval(()=>{let e=b(t);g(e),y.current&&y.current(e),e<=0&&(v.current&&clearInterval(v.current),p(!0),w.current&&w.current())},1e3)},[x,m,I,d,c,i,n,b]),j=(0,r.useCallback)(()=>{v.current&&(clearInterval(v.current),v.current=null),x&&m&&u(I()),g(null),p(!1)},[x,m,I,u]);return(0,r.useEffect)(()=>()=>{v.current&&clearInterval(v.current)},[]),{remainingSeconds:f,isExpired:h,startTimer:S,clearTimer:j,isReady:x}}},68120:(e,t,n)=>{n.d(t,{Ay:()=>Q,B9:()=>j,BK:()=>w,Ce:()=>f,E_:()=>g,Il:()=>y,JY:()=>u,Kx:()=>b,Nh:()=>d,PQ:()=>m,Yx:()=>x,gB:()=>I,ge:()=>p,gi:()=>o,l$:()=>N,l5:()=>v,r1:()=>c,ro:()=>h});var r=n(59267),a=n(50659);let s={activeQuiz:null,currentSectionIndex:0,currentQuestionIndex:0,answers:{},timeLeft:null,status:"idle",flags:[],maxReachedGlobalIndex:0,lastTickTimestamp:null,startTime:null,questionTimings:{},currentQuestionStartTime:null,classId:null,reportData:null,activeUploads:0},i=(e,t,n)=>{if(!e)return 0;let r=0;for(let n=0;n<t;n++)r+=e.sections[n].questions.length;return r+n},l=(0,r.Z0)({name:"quiz",initialState:s,reducers:{startQuiz:(e,t)=>{let n=t.payload,r=n&&"object"==typeof n&&"quiz"in n?n.quiz:n,s=null==n?void 0:n.classId;if(!r)return;let i=JSON.parse(JSON.stringify((0,a.lf)(r)));i.sections&&(i.sections=i.sections.map(e=>({...e,questions:(e.questions||[]).map(t=>({...t,question_type:(t.question_type||t.answer_type||"").toUpperCase(),originalSectionTitle:e.title,originalSectionDescription:e.description}))}))),1===i.randomized&&i.sections&&(i.sections=i.sections.map(e=>({...e,questions:(e=>{let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t})(e.questions)}))),e.activeQuiz=i,e.status="active",e.currentSectionIndex=0,e.currentQuestionIndex=0,e.answers={},e.flags=[],e.maxReachedGlobalIndex=0,e.lastTickTimestamp=Date.now(),e.activeUploads=0;let l=new Date;e.startTime="".concat(l.getFullYear(),"-").concat(String(l.getMonth()+1).padStart(2,"0"),"-").concat(String(l.getDate()).padStart(2,"0")," ").concat(String(l.getHours()).padStart(2,"0"),":").concat(String(l.getMinutes()).padStart(2,"0"),":").concat(String(l.getSeconds()).padStart(2,"0")),e.questionTimings={},e.currentQuestionStartTime=Date.now(),e.classId=s||null,i.duration?e.timeLeft=60*i.duration:i.timer?e.timeLeft=60*i.timer:e.timeLeft=null},setLoading:e=>{e.status="loading"},setError:e=>{e.status="error"},setAnswer:(e,t)=>{e.answers[t.payload.questionId]=t.payload.answer},toggleFlag:(e,t)=>{let n=t.payload;e.flags.includes(n)?e.flags=e.flags.filter(e=>e!==n):e.flags.push(n)},nextQuestion:e=>{var t,n;let r=null==(t=e.activeQuiz)?void 0:t.sections[e.currentSectionIndex];if(!r)return;let a=r.questions[e.currentQuestionIndex];if(a&&e.currentQuestionStartTime){let t=Math.round((Date.now()-e.currentQuestionStartTime)/1e3),n=String(a.id);e.questionTimings[n]=(e.questionTimings[n]||0)+t}e.currentQuestionIndex<r.questions.length-1?e.currentQuestionIndex+=1:e.currentSectionIndex<((null==(n=e.activeQuiz)?void 0:n.sections.length)||0)-1&&(e.currentSectionIndex+=1,e.currentQuestionIndex=0),e.currentQuestionStartTime=Date.now();let s=i(e.activeQuiz,e.currentSectionIndex,e.currentQuestionIndex);e.maxReachedGlobalIndex=Math.max(e.maxReachedGlobalIndex,s)},prevQuestion:e=>{var t,n;let r=null==(t=e.activeQuiz)?void 0:t.sections[e.currentSectionIndex],a=null==r?void 0:r.questions[e.currentQuestionIndex];if(a&&e.currentQuestionStartTime){let t=Math.round((Date.now()-e.currentQuestionStartTime)/1e3),n=String(a.id);e.questionTimings[n]=(e.questionTimings[n]||0)+t}if(e.currentQuestionIndex>0)e.currentQuestionIndex-=1;else if(e.currentSectionIndex>0){e.currentSectionIndex-=1;let t=null==(n=e.activeQuiz)?void 0:n.sections[e.currentSectionIndex];e.currentQuestionIndex=t.questions.length-1}e.currentQuestionStartTime=Date.now()},goToQuestion:(e,t)=>{var n;let r=null==(n=e.activeQuiz)?void 0:n.sections[e.currentSectionIndex],a=null==r?void 0:r.questions[e.currentQuestionIndex];if(a&&e.currentQuestionStartTime){let t=Math.round((Date.now()-e.currentQuestionStartTime)/1e3),n=String(a.id);e.questionTimings[n]=(e.questionTimings[n]||0)+t}e.currentSectionIndex=t.payload.sectionIndex,e.currentQuestionIndex=t.payload.questionIndex,e.currentQuestionStartTime=Date.now();let s=i(e.activeQuiz,e.currentSectionIndex,e.currentQuestionIndex);e.maxReachedGlobalIndex=Math.max(e.maxReachedGlobalIndex,s)},setTimeLeft:(e,t)=>{e.timeLeft=t.payload},resetLocalAnswers:e=>{e.answers={},e.flags=[]},setSubmitting:e=>{e.status="submitting"},setCompleted:e=>{e.status="completed",e.timeLeft=null},resetQuiz:e=>s,recordCurrentQuestionTime:e=>{if(e.activeQuiz&&e.currentQuestionStartTime){let t=Date.now(),n=(t-e.currentQuestionStartTime)/1e3,r=e.activeQuiz.sections[e.currentSectionIndex],a=null==r?void 0:r.questions[e.currentQuestionIndex];a&&(e.questionTimings[a.id]=(e.questionTimings[a.id]||0)+n),e.currentQuestionStartTime=t}},restoreProgress:(e,t)=>{let n=t.payload;e.answers=n.answers,e.flags=n.flags,e.currentSectionIndex=n.currentSectionIndex,e.currentQuestionIndex=n.currentQuestionIndex,e.startTime=n.startTime,e.questionTimings=n.questionTimings,e.t
1imeLeft=n.timeLeft,e.maxReachedGlobalIndex=n.maxReachedGlobalIndex,e.currentQuestionStartTime=Date.now()},setReportData:(e,t)=>{e.reportData=t.payload},incrementUpload:e=>{e.activeUploads+=1},decrementUpload:e=>{e.activeUploads>0&&(e.activeUploads-=1)}}}),{startQuiz:o,setLoading:c,setError:d,setAnswer:u,toggleFlag:m,nextQuestion:x,prevQuestion:f,goToQuestion:g,setTimeLeft:h,resetLocalAnswers:p,setSubmitting:v,setCompleted:y,resetQuiz:w,recordCurrentQuestionTime:I,restoreProgress:b,setReportData:S,incrementUpload:j,decrementUpload:N}=l.actions,Q=l.reducer},82002:(e,t,n)=>{n.d(t,{AS:()=>i,Ay:()=>o,hQ:()=>s,ht:()=>l,x3:()=>a});let r=(0,n(59267).Z0)({name:"modal",initialState:{activeModal:null,modalData:null,viewWarningConfirmed:!1},reducers:{openGlobalModal:(e,t)=>{e.activeModal=t.payload.type,e.modalData=t.payload.data||null},closeGlobalModal:e=>{e.activeModal=null,e.modalData=null},confirmViewWarning:e=>{e.viewWarningConfirmed=!0},resetViewWarning:e=>{e.viewWarningConfirmed=!1}}}),{openGlobalModal:a,closeGlobalModal:s,confirmViewWarning:i,resetViewWarning:l}=r.actions,o=r.reducer},83087:(e,t,n)=>{n.d(t,{H:()=>l});var r=n(95155);n(12115);var a=n(18955),s=n(346),i=n(50659);let l=e=>{let{level:t,className:n,size:l="md"}=e,o=(0,a.c)("dashboard.learning");if(!t)return null;let c=(0,i.TZ)(t),d=o("difficultyEasy")||"سهل",u="bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20";return"medium"===c?(d=o("difficultyMedium")||"متوسط",u="bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20"):"hard"===c?(d=o("difficultyHard")||"صعب",u="bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20"):"very_hard"===c&&(d=o("difficultyVeryHard")||"صعب جداً",u="bg-rose-500/10 text-rose-600 dar
1k:text-rose-400 border-rose-500/20"),(0,r.jsx)("span",{className:(0,s.cn)("font-bold border rounded-lg inline-flex items-center justify-center select-none shrink-0","sm"===l?"text-xs px-2.5 py-0.5":"text-sm px-3 py-1",u,n),children:d})}}}]);

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.