PageSourceSearch

https://adelkhalil-academy.com/front/_next/static/chunks/4350-ad14573e2c6c0c9e.js

js adelkhalil-academy.com collected 2026-10-02 01:23:35 UTC 14,621 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4350],{47065:(e,t,a)=>{a.d(t,{A:()=>o,r:()=>c});var l=a(95155),r=a(12115),n=a(47650),s=a(346);function c(e){let{open:t,onClose:a,title:c,children:o,footer:i,maxWidth:d="md",closeOnOutsideClick:u=!0,showCloseButton:m=!0,duration:x=300,className:p,headerClassName:h,bodyClassName:y,footerClassName:f,closeButtonClassName:b,container:v,dir:g}=e,[j,w]=(0,r.useState)(t),[N,k]=(0,r.useState)(t?"opening":"closing"),C=(0,r.useRef)(null);if((0,r.useEffect)(()=>{if(t)C.current&&window.clearTimeout(C.current),w(!0),k("opening"),C.current=window.setTimeout(()=>k("open"),x);else{if(!j)return;k("closing"),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>{w(!1)},x)}return()=>{C.current&&window.clearTimeout(C.current)}},[t]),(0,r.useEffect)(()=>(j&&!v&&(document.body.style.overflow="hidden"),()=>{v||(document.body.style.overflow="unset")}),[j,v]),(0,r.useEffect)(()=>{if(!j)return;let e=e=>{"Escape"===e.key&&m&&a()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[j,a,m]),!j||"undefined"==typeof document)return null;let A=(0,l.jsxs)("div",{className:(0,s.cn)("fixed inset-0 z-9999 flex-center p-4",v?"absolute z-1000 opacity-100! visible! pointer-events-auto!":"fixed"),onClick:e=>{u&&e.target===e.currentTarget&&a()},role:"dialog","aria-modal":"true",dir:g,children:[(0,l.jsx)("div",{className:(0,s.cn)("fixed inset-0 bg-black/60 backdrop-blur-[2px] pointer-events-none",v?"absolute":"fixed","closing"===N?"animate-dialog-overlay-exit":"animate-dialog-overlay")}),(0,l.jsxs)("div",{onDoubleClick:e=>e.stopPropagation(),onMouseDown:e=>v&&e.stopPropagation(),onClick:e=>v&&e.stopPropagation(),onKeyDown:e=>v&&e.stopPropagation(),className:(0,s.cn)("relative w-full rounded-2xl border bg-dashboard-card shadow-2xl transform-gpu",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full"}[d],v?"max-h-full":"max-h-[90vh]","overflow-hidden flex flex-col pointer-events-auto","closing"===N?"animate-dialog-content-exit":"animate-dialog-content",p),children:[(0,l.jsxs)("div",{className:(0,s.cn)("text-dynamic-secondary-500 bg-dashboard-card px-6 pt-4 pb-2 flex items-center justify-between shrink-0",h),children:[c&&c,m&&(0,l.jsx)("button",{onClick:a,className:(0,s.cn)("text-text-secondary hover:text-dynamic-secondary-500 transition-colors p-1 hover:bg-dashboard-card-collapsed rounded-lg cursor-pointer",b),"aria-label":"Close",children:(0,l.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,l.jsx)("div",{className:(0,s.cn)("px-6 py-6 text-muted flex-1 min-h-0 overflow-y-auto w-full",y),children:o}),i&&(0,l.jsx)("div",{className:(0,s.cn)("bg-dashboard-card px-6 py-4 shrink-0",f),children:i})]})]});return(0,n.createPortal)(A,v||document.body)}let o=c},60536:(e,t,a)=>{a.d(t,{c:()=>r});var l=a(30926);let r=(0,l.createServerReference)("408478a19c0b80961ae912eacec47168fcf61e2b79",l.callServer,void 0,l.findSourceMapURL,"revalidateCoursePage")},64350:(e,t,a)=>{a.d(t,{f:()=>C});var l=a(95155),r=a(12115),n=a(15239),s=a(18955),c=a(902),o=a(8842),i=a(46392),d=a(60536),u=a(47065),m=a(70667),x=a(6439),p=a(82063),h=a(76907),y=a(45345),f=a(65229),b=a(40653),v=a(6132),g=a(26983),j=a(47937),w=a(35299),N=a(61362),k=a(20063);function C(e){let{open:t,onClose:a,course:C,target:A,onSuccess:S}=e,V=(0,s.c)("courses"),E=(0,c.Ym)(),T=(0,o.rd)(),L=(0,k.usePathname)(),_=(0,k.useSearchParams)(),M=(0,r.useRef)(null),P=!!(0,x.G)(e=>e.auth.user),R="".concat(L||"").concat((null==_?void 0:_.toString())?"?".concat(_.toString()):""),[D,F]=(0,r.useState)(""),[I,U]=(0,r.useState)(""),[z,K]=(0,r.useState)(!1),{mutate:G,isPending:B}=(0,i.DK)(),W=(null==A?void 0:A.type)||"course",Y=A?Number(A.id):Number(null==C?void 0:C.id),$=Number(null==C?void 0:C.id);(0,r.useEffect)(()=>{if(t){if(!P){a(),T.push("/auth/login?returnUrl=".concat(encodeURIComponent(R)));return}F(""),U(""),"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.readText&&K(!0);let e=setTimeout(()=>{var e;null==(e=M.current)||e.focus()},150);return()=>clearTimeout(e)}},[t,P,R,a,T]);let q=async()=>{try{if(navigator.clipboard&&"function"==typeof navigator.clipboard.readText){let t=await navigator.clipboard.readText();if(t){var e;F(t.trim()),U(""),null==(e=M.current)||e.focus()}}}catch(e){}},H=()=>
1{if(!P){a(),T.push("/auth/login?returnUrl=".concat(encodeURIComponent(R)));return}let e=D.trim();e&&!B&&(U(""),G({itemType:W,itemId:Y,coupon:e,courseId:$},{onSuccess:async e=>{if(e.success){if(F(""),U(""),a(),S)try{S()}catch(e){}let e=(null==C?void 0:C.slug)||$;try{e&&await (0,d.c)(e)}catch(e){}if("chapter"===W)T.push("/dashboard/my-courses/".concat($,"/chapters/").concat(Y));else if("class"===W){var t,l;let e=((null==C?void 0:C.chapter)||(null==C||null==(l=C.course_type)||null==(t=l.recorded)?void 0:t.chapter)||[]).find(e=>{var t;return null==(t=e.classes)?void 0:t.some(e=>{var t;return(null==(t=e.id)?void 0:t.toString())===Y.toString()})}),a=null==e?void 0:e.id;a?T.push("/dashboard/my-courses/".concat($,"/chapters/").concat(a,"/classes/").concat(Y)):T.push("/dashboard/my-courses/".concat($))}else $?T.push("/dashboard/my-courses/".concat($)):T.refresh()}else U(e.error||e.message||V("failedToApplyCoupon",{defaultValue:"Failed to apply coupon"}))},onError:e=>{var t,a;U((null==e||null==(a=e.response)||null==(t=a.data)?void 0:t.message)||(null==e?void 0:e.message)||V("failedToApplyCoupon",{defaultValue:"Failed to apply coupon"}))}}))},J=(0,r.useMemo)(()=>{var e,t,a,l,r;if("course"===W)return{title:(null==C?void 0:C.title)||"",typeLabel:V("course",{defaultValue:"دورة"}),price:null==C?void 0:C.price};if(null==A?void 0:A.title)return{title:A.title,typeLabel:"chapter"===W?V("chapter",{defaultValue:"فصل"}):V("lecture",{defaultValue:"حصة"}),price:null!=A.price?A.price:null==C?void 0:C.price};let n=null!=(l=null!=(a=null==C||null==(t=C.course_type)||null==(e=t.recorded)?void 0:e.chapter)?a:null==C?void 0:C.chapter)?l:[];if("chapter"===W){let e=n.find(e=>{var t,a;return(null==(t=e.id)?void 0:t.toString())===(null==A||null==(a=A.id)?void 0:a.toString())});return{title:(null==e?void 0:e.chapter_name)||(null==e?void 0:e.title)||"".concat(V("chapter",{defaultValue:"فصل"})," ").concat(null==A?void 0:A.id),typeLabel:V("chapter",{defaultValue:"فصل"}),price:(null==A?void 0:A.price)!=null?A.price:null==e?void 0:e.price}}if("class"===W)for(let e of n){let t=null==(r=e.classes)?void 0:r.find(e=>{var t,a;return(null==(t=e.id)?void 0:t.toString())===(null==A||null==(a=A.id)?void 0:a.toString())});if(t)return{title:t.title||"".concat(V("lecture",{defaultValue:"حصة"})," ").concat(null==A?void 0:A.id),typeLabel:V("lecture",{defaultValue:"حصة"}),price:(null==A?void 0:A.price)!=null?A.price:t.price}}return{title:(null==C?void 0:C.title)||"",typeLabel:V("course",{defaultValue:"دورة"}),price:(null==A?void 0:A.price)!=null?A.price:null==C?void 0:C.price}},[W,A,C,V]),O=(0,r.useMemo)(()=>{var e,t;return(null==C||null==(e=C.instructor)?void 0:e.name)||(null==C?void 0:C.instructor_name)||(null==C||null==(t=C.instructor)?void 0:t.full_name)},[C]),Q=(0,r.useMemo)(()=>
1"chapter"===W?V("buyChapterViaCoupon",{defaultValue:"شراء الفصل عبر كوبون"}):"class"===W?V("buyClassViaCoupon",{defaultValue:"شراء الحصة عبر كوبون"}):V("buyViaCoupon",{defaultValue:"الشراء عبر كوبون"}),[W,V]),X=(0,r.useMemo)(()=>"course"===W?V("couponModalSubtitle"):V("couponModalItemSubtitle"),[W,V]),Z=(0,r.useMemo)(()=>"course"===W?V("confirmAndRedeem"):V("confirmAndRedeemItem"),[W,V]);return(0,l.jsx)(u.r,{open:t,onClose:()=>{B||(a(),F(""),U(""))},className:"w-full max-w-120 bg-dashboard-card border-dynamic-secondary-500/10 rounded-3xl overflow-hidden",title:(0,l.jsxs)("div",{className:"flex items-center gap-2 text-dynamic-secondary-500 text-lg font-bold",children:[(0,l.jsx)(p.A,{className:"w-5 h-5 text-dynamic-primary-500"}),(0,l.jsx)("span",{children:Q})]}),headerClassName:"bg-dashboard-card border-b border-dynamic-secondary-500/10 px-6 py-4",children:(0,l.jsxs)("div",{className:"p-6 sm:p-7 space-y-5",dir:"ar"===E?"rtl":"ltr",children:[(0,l.jsxs)("div",{className:"text-center space-y-2",children:[(0,l.jsx)("div",{className:"w-14 h-14 rounded-2xl bg-dynamic-primary-500/10 border border-dynamic-primary-500/20 text-dynamic-primary-500 flex items-center justify-center mx-auto shadow-sm",children:(0,l.jsx)(p.A,{className:"w-7 h-7"})}),(0,l.jsx)("h3",{className:"text-xl sm:text-2xl font-bold text-dynamic-secondary-500 tracking-tight",children:V("applyCoupon")}),(0,l.jsx)("p",{className:"text-xs sm:text-sm text-text-secondary max-w-sm mx-auto leading-relaxed",children:X})]}),(C||J.title)&&(0,l.jsxs)("div",{className:"flex items-center gap-3.5 p-3.5 rounded-2xl bg-dashboard-card-collapsed border border-dynamic-secondary-500/10 shadow-sm",children:[(0,l.jsx)("div",{className:"relative w-16 h-16 rounded-xl overflow-hidden shrink-0 border border-dynamic-secondary-500/10 bg-black/10",children:(0,l.jsx)(n.default,{src:(null==C?void 0:C.preview_image)||"/images/course-placeholder.jpg",alt:J.title||"Item",fill:!0,className:"object-cover"})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"inline-flex items-center text-[10px] font-bold text-dynamic-primary-500 bg-dynamic-primary-500/10 px-2 py-0.5 rounded-md uppercase tracking-wider",children:J.typeLabel}),"course"!==W&&(null==C?void 0:C.title)&&(0,l.jsx)("span",{className:"text-[11px] text-text-secondary truncate",children:C.title})]}),(0,l.jsx)("h4",{className:"text-sm font-bold text-dynamic-secondary-500 truncate leading-snug mt-1",children:J.title}),O&&(0,l.jsx)("p",{className:"text-xs text-text-secondary truncate mt-0.5",children:O}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-semibold text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 px-2 py-0.5 rounded-md",children:[(0,l.jsx)(h.A,{className:"w-3 h-3"}),V("instantAccess")]}),Number(J.price)>0&&(0,l.jsxs)("span",{className:"text-[11px] text-text-secondary line-through",children:[Number(J.price).toFixed(2)," ",(null==C?void 0:C.currency)||"EGP"]})]})]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"block text-xs sm:text-sm font-semibold text-dynamic-secondary-500",children:V("enterCoupon")}),(0,l.jsxs)("div",{className:"relative flex items-center",children:[(0,l.jsx)("div",{className:"absolute start-3.5 text-dynamic-primary-500 pointer-events-none",children:(0,l.jsx)(y.A,{className:"w-5 h-5"})}),(0,l.jsx)("input",{ref:M,type:"text",value:D,onChange:e=>{F(e.target.value),I&&U("")},onKeyDown:e=>{"Enter"===e.key&&D.trim()&&!B&&(e.preventDefault(),H())},placeholder:V("couponInputPlaceholder"),disabled:B,spellCheck:!1,autoCorrect:"off",autoCapitalize:"characters",autoComplete:"off",className:"w-full bg-dashboard-card-collapsed border-2 border-dynamic-secondary-500/20 focus:border-dynamic-primary-500 rounded-2xl py-3.5 ps-11 pe-20 text-dynamic-secondary-500 font-mono font-bold tracking-wider placeholder:font-sans placeholder:tracking-normal placeholder:font-normal placeholder:text-dynamic-secondary-500/40 outline-none shadow-sm focus:ring-4 focus:ring-dynamic-primary-500/10 text-base"}),(0,l.jsx)("div",{className:"absolute end-2.5 flex items-center gap-1",children:D?(0,l.jsx)("button",{type:"button",onClick:()=>{var e;F(""),U(""),null==(e=M.current)||e.focus()},disabled:B,className:"p-1.5 text-text-secondary hover:text-dynamic-secondary-500 rounded-lg hover:bg-dynamic-secondary-500/10 transition-colors",title:V("clearCode"),"aria-label":V("clearCode"),children:(0,l.jsx)(f.A,{className:"w-4 h-4"})}):z?(0,l.jsxs)("button",{type:"button",onClick:q,disabled:B,className:"flex items-center gap-1 px-2.5 py-1 text-xs font-semibold text-dynamic-primary-500 bg-dynamic-primary-500/10 hover:bg-dynamic-primary-500/20 rounded-lg transition-colors cursor-pointer",children:[(0,l.jsx)(b.A,{className:"w-3.5 h-3.5"}),(0,l.jsx)("span",{children:V("pasteCode")})]}):null})]})]}),I&&(0,l.jsxs)("div",{className:"flex items-start gap-2.5 p-3.5 bg-red-500/10 border border-red-500/30 text-red-500 rounded-2xl text-xs sm:text-sm animate-in fade-in slide-in-from-top-2 duration-200",children:[(0,l.jsx)(v.A,{className:"w-4 h-4 shrink-0 mt-0.5"}),(0,l.jsx)("span",{className:"leading-snug",children:I})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-2 pt-1 border-t border-dynamic-secondary-500/10",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center text-center p-2 rounded-xl bg-dynamic-secondary-500/5",children:[(0,l.jsx)(g.A,{className:"w-4 h-4 text-dynamic-primary-500 mb-1"}),(0,l.jsx)("span",{className:"text-[11px] font-bold text-dynamic-secondary-500",children:V("instantAccess")})]}),(0,l.jsxs)("div",{className:"flex flex-col items-center text-center p-2 rounded-xl bg-dynamic-secondary-500/5",children:[(0,l.jsx)(j.A,{className:"w-4 h-4 text-dynamic-primary-500 mb-1"}),(0,l.jsx)("span",{className:"text-[11px] font-bold text-dynamic-secondary-500",children:V("fullAccess")})]}),(0,l.jsxs)("div",{className:"flex flex-col items-center text-center p-2 rounded-xl bg-dynamic-secondary-500/5",children:[(0,l.jsx)(h.A,{className:"w-4 h-4 text-dynamic-primary-500 mb-1"}),(0,l.jsx)("span",{className:"text-[11px] font-bold text-dynamic-secondary-500",children:V("noExtraFees")})]})]}),(0,l.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,l.jsx)(m.$,{onClick:H,disabled:!D.trim()||B,className:"w-full h-12 rounded-2xl bg-dynamic-primary-500 hover:bg-dynamic-primary-600 text-white font-bold text-base transition-all shadow-lg shadow-dynamic-primary-500/20 flex items-center justify-center gap-2 cursor-pointer active:scale-[0.99]",children:B?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(w.A,{className:"w-5 h-5 animate-spin"}),(0,l.jsx)("span",{children:V("adding")||"..."})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(N.A,{className:"w-5 h-5"}),(0,l.jsx)("span",{children:Z})]})}),(0,l.jsx)("button",{type:"button",onClick:()=>{B||(a(),F(""),U(""))},disabled:B,className:"w-full py-2 text-xs sm:text-sm font-medium text-text-secondary hover:text-dynamic-secondary-500 transition-colors text-center cursor-pointer",children:V("close")})]})]})})}}}]);

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.