1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[435],{5761:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/course/[courseId]",function(){return l(2285)}])},1258:function(e,t,l){"use strict";l.d(t,{Z:function(){return s}});let s=(0,l(1134).Z)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},4307:function(e,t,l){"use strict";l.d(t,{Z:function(){return s}});let s=(0,l(1134).Z)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},7865:function(e,t,l){"use strict";l.d(t,{Z:function(){return s}});let s=(0,l(1134).Z)("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]])},1203:function(e,t,l){"use strict";var s=l(5893),i=l(7294),n=l(8269);t.Z=e=>{let{course:t,onClose:l,onAddToCart:r}=e,[c,a]=(0,i.useState)(""),[o,d]=(0,i.useState)(""),[u,x]=(0,i.useState)(null),[h,m]=(0,i.useState)([]),[f,p]=(0,i.useState)([]),[g,v]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(!(null==t?void 0:t.coursePricing))return;let e=new Set;t.coursePricing.forEach(t=>{let l=[];t.liveAccess&&l.push("Live Access"),t.onlineContentAccess&&l.push("Recorded"),t.offlineContentAccess&&l.push("Pendrive"),t.faceToFaceAccess&&l.push("Face to Face"),t.quizAccess&&l.push("Test-Series"),l.length&&e.add(l.join(" + "))});let l=Array.from(e);m(l),l.length>0&&a(l[0])},[t]),(0,i.useEffect)(()=>{if(!c||!(null==t?void 0:t.coursePricing))return;let e=c.split(" + "),l=t.coursePricing.filter(t=>(e.includes("Live Access")?!0===t.liveAccess:null===t.liveAccess)&&(e.includes("Recorded")?!0===t.onlineContentAccess:null===t.onlineContentAccess)&&(e.includes("Pendrive")?!0===t.offlineContentAccess:null===t.offlineContentAccess)&&(e.includes("Face to Face")?!0===t.faceToFaceAccess:null===t.faceToFaceAccess)&&(e.includes("Test-Series")?!0===t.quizAccess:null===t.quizAccess)),s=new Set;l.forEach(e=>{e.variation&&s.add(e.variation)});let i=Array.from(s);p(i),i.length>0?d(i[0]):d("")},[c,t]),(0,i.useEffect)(()=>{if(!c||!(null==t?void 0:t.coursePricing))return;let e=c.split(" + "),l=t.coursePricing.filter(t=>{let l=(e.includes("Live Access")?!0===t.liveAccess:null===t.liveAccess)&&(e.includes("Recorded")?!0===t.onlineContentAccess:null===t.onlineContentAccess)&&(e.includes("Pendrive")?!0===t.offlineContentAccess:null===t.offlineContentAccess)&&(e.includes("Face to Face")?!0===t.faceToFaceAccess:null===t.faceToFaceAccess)&&(e.includes("Test-Series")?!0===t.quizAccess:null===t.quizAccess),s=!o||t.variation===o;return l&&s});v(l),l.length>0&&x(l[0])},[c,o,t]);let b=e=>{if("validity"===e.validityType&&e.duration){if("number"==typeof e.duration){let t=Math.floor(e.duration/864e5),l=Math.floor(t/365),s=t%365,i=Math.floor(s/30),n=s%30,r=[];return l&&r.push("".concat(l," Year").concat(l>1?"s":"")),i&&r.push("".concat(i," Month").concat(i>1?"s":"")),n&&r.push("".concat(n," Day").concat(n>1?"s":"")),r.length>0?r.join(" "):"N/A"}}else if("expiry"===e.validityType&&e.expiry)return new Date(e.expiry).toLocaleDateString("en-IN",{year:"numeric",month:"short",day:"numeric"});else if("lifetime"===e.validityType)return"Lifetime";return"N/A"},j=u||((null==t?void 0:t.coursePricing)&&t.coursePricing.length>0?t.coursePricing[0]:null),w=(null==j?void 0:j.price)||0,N=(null==j?void 0:j.discount)||0,y=Math.round(w-w*N/100),S=w>0;return(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl max-w-md w-full max-h-[90vh] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"".concat(n.TW," p-6 rounded-t-2xl relative"),children:[(0,s.jsx)("button",{onClick:l,className:"absolute top-4 right-4 text-white hover:bg-white/20 rounded-full p-2 transition",children:(0,s.jsx)(n.PJ.X,{})}),(0,s.jsx)("h2",{className:"text-2xl font-bold text-white mb-2",children:null==t?void 0:t.title}),(0,s.jsx)("p",{className:"text-white/90 text-sm",children:"Configure your course preferences"})]}),(0,s.jsxs)("form",{className:"p-6 space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-bold text-slate-700 mb-3",children:"Select Mode"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:h.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>a(e),className:"px-3 py-2 rounded-lg text-xs font-bold transition-all ".concat(c===e?"".concat(n.TW," text-white"):"border border-slate-200 text-slate-600 hover:border-indigo-300 hover:bg-slate-50"),children:e},e))})]}),f.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-bold text-slate-700 mb-3",children:"Select Variation"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:f.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>d(e),className:"px-3 py-2 rounded-lg text-xs font-bold transition-all ".concat(o===e?"".concat(n.TW," text-white"):"border border-slate-200 text-slate-600 hover:border-indigo-300 hover:bg-slate-50"),children:e},e))})]}),g.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-bold text-slate-700 mb-3",children:"Select Validity"}),(0,s.jsx)("select",{className:"w-full p-3 bg-slate-50 border border-slate-200 rounded-lg text-sm font-semibold outline-none focus:border-emerald-600",value:u?JSON.stringify(u):"",onCh
1ange:e=>x(JSON.parse(e.target.value)),children:g.map((e,t)=>(0,s.jsx)("option",{value:JSON.stringify(e),children:b(e)},t))})]}),S&&(0,s.jsx)("div",{className:"bg-emerald-50 border border-emerald-100 rounded-xl p-4 mt-6",children:(0,s.jsxs)("div",{className:"space-y-2",children:[N>0&&(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("span",{className:"text-sm text-slate-600 line-through",children:["â¹",w.toLocaleString("en-IN")]}),(0,s.jsxs)("span",{className:"text-xs font-bold text-emerald-600",children:[N,"% OFF"]})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"font-bold text-slate-700",children:"Total Price"}),(0,s.jsxs)("span",{className:"text-2xl font-bold text-emerald-700",children:["â¹",y.toLocaleString("en-IN")]})]})]})}),(0,s.jsxs)("button",{type:"button",onClick:()=>{let e=u||((null==t?void 0:t.coursePricing)&&t.coursePricing.length>0?t.coursePricing[0]:null);e&&(r({...t,pricingId:e.id,coursePricingId:e.id,selectedMode:c||"",selectedVariation:o||"",selectedValidity:u?b(u):"",finalPrice:Math.round(e.price-e.price*(e.discount||0)/100),originalPrice:e.price,discount:e.discount||0,type:"Course"}),l())},disabled:!S,className:"w-full ".concat(n.TW," ").concat(n.BV," text-white py-4 rounded-xl font-bold text-sm shadow-lg transition-all active:scale-95 flex items-center justify-center gap-2 ").concat(S?"":"opacity-50 cursor-not-allowed"),children:["Add to Cart ",(0,s.jsx)(n.PJ.Cart,{})]}),(0,s.jsx)("p",{className:"text-xs text-center text-slate-400 mt-3",children:"30-Day Money Back Guarantee"})]})]})})}},2285:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return y}});var s=l(5893),i=l(9008),n=l.n(i),r=l(1163),c=l(7294),a=l(3901),o=l(9066),d=l(4750),u=l(7865),x=l(8269),h=l(851),m=l(1203),f=l(7901),p=l(2081),g=l(1258),v=l(4307);let b=e=>{var t,l,i,n,r,a,o,d;let{courseData:u,onBack:m,onAddToCart:b}=e,[j,w]=(0,c.useState)(0),[N,y]=(0,c.useState)([]);(0,c.useEffect)(()=>{(async()=>{try{let e=await f.Z.fetchEmployee(p.Z);y(e.employees||[])}catch(e){console.error("Error fetching employees:",e)}})()},[]);let S=[];(null==u?void 0:u.logo)&&S.push({type:"logo",src:"".concat(null===h.Z||void 0===h.Z?void 0:h.Z.mediaBaseUrl).concat(u.logo),title:"Course Logo"}),(null==u?void 0:u.introVideo)&&S.push({type:"video",src:"".concat(null===h.Z||void 0===h.Z?void 0:h.Z.mediaBaseUrl).concat(u.introVideo),title:"Intro Video"}),(null==u?void 0:u.introVideo)||S.push({type:"video",title:"Watch Demo Lecture"});let k=async()=>{let e="localhost"===window.location.hostname?"http://localhost:3000":"https://myeduneedsclass.netlify.app/",t="".concat(e,"/course/").concat(null==u?void 0:u.id),l={title:(null==u?void 0:u.title)||"Course",url:t};try{navigator.share?await navigator.share(l):(await navigator.clipboard.writeText(t),setShowCopyAlert(!0),setTimeout(()=>setShowCopyAlert(!1),2e3))}catch(e){console.error("Error sharing:",e)}};return(0,s.jsx)("div",{className:"bg-slate-50 pt-8 pb-12 border-b border-slate-200",children:(0,s.jsxs)("div",{className:x.eF,children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500 mb-6 font-medium",children:[(0,s.jsx)("button",{onClick:m,className:"hover:text-slate-800",children:"Home"}),(0,s.jsx)("span",{children:"/"}),(0,s.jsx)("span",{className:"text-slate-800 font-bold truncate max-w-[200px]",children:(null==u?void 0:u.title)||"Financial Reporting"})]}),(0,s.jsxs)("div",{className:"flex flex-col lg:flex-row gap-10",children:[(0,s.jsx)("div",{className:"w-full lg:w-7/12",children:(0,s.jsxs)("div",{className:"relative aspect-video bg-black rounded-2xl overflow-hidden shadow-2xl group cursor-pointer border-4 border-white",children:[(null===(t=S[j])||void 0===t?void 0:t.type)==="logo"?(0,s.jsx)("img",{src:null===(l=S[j])||void 0===l?void 0:l.src,className:"w-full h-full object-cover",alt:"Course Logo"}):(null===(i=S[j])||void 0===i?void 0:i.type)==="video"?(0,s.jsx)("video",{src:(null===(n=S[j])||void 0===n?void 0:n.src)||"",className:"w-full h-full object-cover",controls:!0,autoPlay:!0,muted:!0}
1):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("img",{src:"https://placehold.co/1280x720/164e33/FFF?text=Demo+Lecture+Thumb",className:"w-full h-full object-cover opacity-80 group-hover:opacity-60 transition-opacity",alt:"Demo"}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)("div",{className:"h-16 w-16 bg-white/20 backdrop-blur-md rounded-full flex items-center justify-center border border-white/30 group-hover:scale-110 transition-transform",children:(0,s.jsx)(x.PJ.Play,{})})}),(0,s.jsx)("div",{className:"absolute bottom-4 left-4 bg-black/60 px-3 py-1 rounded-lg text-white text-xs font-bold backdrop-blur-sm",children:"Watch Demo Lecture (45 min)"})]}),S.length>1&&(0,s.jsx)("div",{className:"absolute bottom-4 right-4 flex gap-2",children:S.map((e,t)=>(0,s.jsx)("button",{onClick:()=>w(t),className:"h-2 rounded-full transition-all ".concat(t===j?"".concat(x.TW," w-8"):"bg-white/40 w-2 hover:bg-white/60")},t))}),S.length>1&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>{w(e=>0===e?S.length-1:e-1)},className:"absolute left-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white p-2 rounded-full backdrop-blur-sm transition-all",children:(0,s.jsx)(g.Z,{size:20})}),(0,s.jsx)("button",{onClick:()=>{w(e=>e===S.length-1?0:e+1)},className:"absolute right-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white p-2 rounded-full backdrop-blur-sm transition-all",children:(0,s.jsx)(v.Z,{size:20})})]})]})}),(0,s.jsxs)("div",{className:"w-full lg:w-5/12 space-y-4",children:[(0,s.jsx)("div",{className:"flex gap-2",children:(null==u?void 0:u.tags)&&(null==u?void 0:null===(r=u.tags)||void 0===r?void 0:r.length)>0&&(null==u?void 0:null===(a=u.tags)||void 0===a?void 0:a.map(e=>(0,s.jsx)("span",{className:"bg-emerald-100 text-emerald-800 text-[10px] font-bold px-2 py-1 rounded uppercase tracking-wider",children:null==e?void 0:e.tag},e)))}),(0,s.jsx)("h1",{className:"text-3xl md:text-4xl font-bold text-slate-900 leading-tight",children:(null==u?void 0:u.title)||"CA Final Financial Reporting (FR)"}),(0,s.jsx)("p",{className:"text-slate-500 text-sm leading-relaxed",children:null==u?void 0:u.shortDescription}),(0,s.jsxs)("div",{className:"flex items-center gap-6 py-4 border-y border-slate-200",children:[(null==u?void 0:null===(o=u.setting)||void 0===o?void 0:o.duration)!==0&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"p-2 bg-emerald-50 rounded-lg text-emerald-700",children:(0,s.jsx)(x.PJ.Clock,{})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] text-slate-500 uppercase font-bold",children:"Duration"}),(0,s.jsx)("p",{className:"text-sm font-bold text-slate-900",children:(e=>{if(!e||isNaN(e))return"0 hr";let t=Math.floor(e/3600),l=Math.floor(e%3600/60),s=Math.floor(e%60),i=[];return t>0&&i.push("".concat(t," hr").concat(t>1?"s":"")),l>0&&i.push("".concat(l," min").concat(l>1?"s":"")),s>0&&i.push("".concat(s," sec").concat(s>1?"s":"")),i.length?i.join(" "):"0 hr"})(null==u?void 0:null===(d=u.setting)||void 0===d?void 0:d.duration)})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"p-2 bg-blue-50 rounded-lg text-blue-700",children:(0,s.jsx)(x.PJ.Eye,{})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] text-slate-500 uppercase font-bold",children:"Watch Time"}),(0,s.jsx)("p",{className:"text-sm font-bold text-slate-900",children:(()=>{var e;let t=null==u?void 0:null===(e=u.coursePricing)||void 0===e?void 0:e[0];return(null==t?void 0:t.watchTime)&&"Unlimited"!==t.watchTime?"".concat(t.watchTime,"x"):"Unlimited"})()})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{children:(0,s.jsx)("div",{children:null==N?void 0:N.filter(e=>{var t;return null===(t=e.courseIds)||void 0===t?void 0:t.includes(Number(null==u?void 0:u.id))}).map(e=>(0,s.jsx)("img",{src:h.Z.mediaBaseUrl+e.profile,className:"h-12 w-12 rounded-full object-cover border-2 border-white",alt:e.firstName,title:"".concat(e.firstName," ").concat(e.lastName)},e.id))})}),(0,s.jsxs)("button",{onClick:k,className:"ml-auto text-slate-400 hover:text-slate-600 transition flex items-center gap-1 text-xs font-bold border border-slate-200 px-3 py-1.5 rounded-full",children:[(0,s.jsx)(x.PJ.Share,{})," Share"]})]})]})]})]})})},j=e=>{var t,l;let{courseData:i,onAddToCart:n}=e,[r,a]=(0,c.useState)("overview"),[o,d]=(0,c.useState)(null),[f,p]=(0,c.useState)(""),[g,v]=(0,c.useState)(null),[b,j]=(0,c.useState)([]),[w,N]=(0,c.useState)([]),[y,S]=(0,c.useState)([]),[k,A]=(0,c.useState)([]),[C,P]=(0,c.useState)(!1),[T,F]=(0,c.useState)([]),[E,L]=(0,c.useState)(null),[I,M]=(0,c.useState)([]);(0,c.useEffect)(()=>{let e=localStorage.getItem("cartCourses");e&&A(JSON.parse(e));let t=()=>{let e=localStorage.getItem("cartCourses");e&&A(JSON.parse(e))};return window.addEventListener("cartUpdated",t),()=>window.removeEventListener("cartUpdated",t)},[]),(0,c.useEffect)(()=>{var e;(null==i?void 0:null===(e=i.setting)||void 0===e?void 0:e.checkoutTag)&&I&&I.length>0&&F(I.filter(e=>(e.tags||[]).some(e=>e.id===i.setting.checkoutTag)))},[i,I]),(0,c.useEffect)(()=>
1{if(!(null==i?void 0:i.coursePricing))return;let e=new Set;i.coursePricing.forEach(t=>{let l=[];t.liveAccess&&l.push("Live Access"),t.onlineContentAccess&&l.push("Recorded"),t.offlineContentAccess&&l.push("Pendrive"),t.faceToFaceAccess&&l.push("Face to Face"),t.quizAccess&&l.push("Test-Series"),l.length&&e.add(l.join(" + "))});let t=Array.from(e);j(t),t.length>0&&d(t[0])},[i]),(0,c.useEffect)(()=>{if(!o||!(null==i?void 0:i.coursePricing))return;let e=o.split(" + "),t=i.coursePricing.filter(t=>(e.includes("Live Access")?!0===t.liveAccess:null===t.liveAccess)&&(e.includes("Recorded")?!0===t.onlineContentAccess:null===t.onlineContentAccess)&&(e.includes("Pendrive")?!0===t.offlineContentAccess:null===t.offlineContentAccess)&&(e.includes("Face to Face")?!0===t.faceToFaceAccess:null===t.faceToFaceAccess)&&(e.includes("Test-Series")?!0===t.quizAccess:null===t.quizAccess)),l=new Set;t.forEach(e=>{e.variation&&l.add(e.variation)});let s=Array.from(l);N(s),s.length>0?p(s[0]):p("")},[o,i]),(0,c.useEffect)(()=>{if(!o||!(null==i?void 0:i.coursePricing))return;let e=o.split(" + "),t=i.coursePricing.filter(t=>{let l=(e.includes("Live Access")?!0===t.liveAccess:null===t.liveAccess)&&(e.includes("Recorded")?!0===t.onlineContentAccess:null===t.onlineContentAccess)&&(e.includes("Pendrive")?!0===t.offlineContentAccess:null===t.offlineContentAccess)&&(e.includes("Face to Face")?!0===t.faceToFaceAccess:null===t.faceToFaceAccess)&&(e.includes("Test-Series")?!0===t.quizAccess:null===t.quizAccess),s=!f||t.variation===f;return l&&s});S(t),t.length>0&&v(t[0])},[o,f,i]);let Z=e=>{if("expiry"===e.validityType&&e.expiry)return new Date(e.expiry).toLocaleDateString("en-IN",{year:"numeric",month:"short",day:"numeric"});if("lifetime"===e.validityType)return"Lifetime";if("validity"===e.validityType&&e.duration){let t,l,s;if("object"==typeof e.duration&&null!==e.duration)t=e.duration.yr,l=e.duration.mon,s=e.duration.days;else if("number"==typeof e.duration){let i=Math.floor(e.duration/864e5);t=Math.floor(i/365);let n=i%365;l=Math.floor(n/30),s=n%30}let i=[];return t&&i.push("".concat(t," Year").concat(t>1?"s":"")),l&&i.push("".concat(l," Month").concat(l>1?"s":"")),s&&i.push("".concat(s," Day").concat(s>1?"s":"")),i.length>0?i.join(" "):"N/A"}return"N/A"},J=(()=>{let e=g||((null==i?void 0:i.coursePricing)&&i.coursePricing.length>0?i.coursePricing[0]:null);if(!e)return null;let t=e.price||0,l=e.discount||0;return{originalPrice:t,discountedPrice:Math.round(t-t*l/100),discount:l}})(),z=e=>{if(k.some(t=>t.id===e.id)){let t=k.filter(t=>t.id!==e.id);A(t),localStorage.setItem("cartCourses",JSON.stringify(t)),window.dispatchEvent(new Event("cartUpdated"))}else L(e),P(!0)};return(0,s.jsxs)("section",{className:"py-12 bg-white relative",children:[(0,s.jsx)("div",{className:x.eF,children:(0,s.jsxs)("div",{className:"flex flex-col lg:flex-row gap-12",children:[(0,s.jsx)("div",{className:"w-full ".concat(T.length>0?"lg:w-7/12":"lg:w-8/12"),children:(0,s.jsxs)("div",{className:"bg-emerald-50 p-6 rounded-2xl border border-emerald-100",children:[(0,s.jsx)("h3",{className:"font-bold text-lg text-emerald-900 mb-4",children:"Course Description"}),(0,s.jsx)("div",{className:"display-none text-sm text-emerald-800 leading-relaxed break-words prose prose-sm max-w-none [&>*]:max-w-full [&_img]:max-w-full [&_table]:max-w-full [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_*]:break-words",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:(null==i?void 0:i.description)||(null==i?void 0:i.longDescription)||"No description available for this course."}})]})}),(0,s.jsx)("div",{className:"w-full ".concat(T.length>0?"lg:w-5/12":"lg:w-4/12"," relative"),children:(0,s.jsx)("div",{className:"sticky top-28",children:(0,s.jsxs)("div",{className:"bg-white border border-slate-200 rounded-3xl shadow-2xl p-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("span",{className:"bg-red-100 text-red-600 text-[10px] font-bold px-2 py-1 rounded uppercase",children:"Limited Time Offer"}),(0,s.jsxs)("div",{className:"flex items-end gap-2 mt-2",children:[(0,s.jsxs)("span",{className:"text-4xl font-bold text-slate-900",children:["â¹",(null==J?void 0:null===(t=J.discountedPrice)||void 0===t?void 0:t.toLocaleStr
1ing("en-IN"))||(null==i?void 0:null===(l=i.price)||void 0===l?void 0:l.toLocaleString("en-IN"))]}),(null==J?void 0:J.originalPrice)&&J.originalPrice!==J.discountedPrice&&(0,s.jsxs)("span",{className:"text-sm text-slate-400 line-through mb-1.5",children:["â¹",J.originalPrice.toLocaleString("en-IN")]})]}),(null==J?void 0:J.discount)>0&&(0,s.jsxs)("p",{className:"text-xs text-emerald-600 font-bold mt-1",children:["You save (",J.discount,"% OFF)"]})]}),(0,s.jsxs)("div",{className:"space-y-4 mb-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-bold text-slate-700 uppercase mb-2",children:"Select Mode"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,s.jsx)("button",{onClick:()=>d(e),className:"px-3 py-2 rounded-lg text-xs font-bold transition-all max-w-full break-words text-center leading-tight ".concat(o===e?"border-2 ".concat(x.TW," text-white"):"border border-slate-200 text-slate-600 hover:border-emerald-300 hover:bg-slate-50"),children:e},e))})]}),w.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-bold text-slate-700 uppercase mb-2",children:"Select Variation"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:w.map(e=>(0,s.jsx)("button",{onClick:()=>p(e),className:"px-3 py-2 rounded-lg text-xs font-bold transition-all max-w-full break-words text-center leading-tight ".concat(f===e?"border-2 ".concat(x.TW," text-white"):"border border-slate-200 text-slate-600 hover:border-emerald-300 hover:bg-slate-50"),children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-bold text-slate-700 uppercase mb-2",children:"Select Validity"}),(0,s.jsx)("select",{className:"w-full p-2.5 rounded-lg border border-slate-200 text-sm font-semibold outline-none focus:border-emerald-600 bg-white",value:g?JSON.stringify(g):"",onChange:e=>v(JSON.parse(e.target.value)),children:y.map((e,t)=>(0,s.jsx)("option",{value:JSON.stringify(e),children:Z(e)},t))})]})]}),J&&(0,s.jsx)("div",{className:"bg-emerald-50 border border-emerald-100 rounded-xl p-4 mb-6",children:(0,s.jsxs)("div",{className:"space-y-2",children:[J.discount>0&&(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("span",{className:"text-sm text-slate-600 line-through",children:["â¹",J.originalPrice.toLocaleString("en-IN")]}),(0,s.jsxs)("span",{className:"text-xs font-bold text-emerald-600",children:[J.discount,"% OFF"]})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"font-bold text-slate-700",children:"Total Price"}),(0,s.jsxs)("span",{className:"text-2xl font-bold text-emerald-700",children:["â¹",J.discountedPrice.toLocaleString("en-IN")]})]})]})}),(0,s.jsx)("button",{onClick:()=>{if(k.some(e=>e.id===(null==i?void 0:i.id))){let e=k.filter(e=>e.id!==(null==i?void 0:i.id));A(e),localStorage.setItem("cartCourses",JSON.stringify(e)),window.dispatchEvent(new Event("cartUpdated"))}else{let e;let t=g||((null==i?void 0:i.coursePricing)&&i.coursePricing.length>0?i.coursePricing[0]:null);if(!t)return;let l={...i,pricingId:t.id,coursePricingId:t.id,selectedMode:o||"",selectedVariation:f||"",selectedValidity:g?Z(g):"",finalPrice:Math.round(t.price-t.price*(t.discount||0)/100),originalPrice:t.price,discount:t.discount||0,type:"Course"},s=k.findIndex(e=>e.coursePricingId===l.coursePricingId);-1!==s?(e=[...k])[s]=l:e=[...k,l],A(e),localStorage.setItem("cartCourses",JSON.stringify(e)),window.dispatchEvent(new Event("cartUpdated"))}},disabled:!o||!g||!J,className:"w-full py-4 rounded-xl font-bold text-sm shadow-lg transform transition active:scale-95 flex items-center justify-center gap-2 ".concat(o&&g&&J?k.some(e=>e.id===(null==i?void 0:i.id))?"bg-slate-700 hover:bg-slate-800 text-white":"".concat(x.TW," ").concat(x.BV," text-white"):"bg-slate-200 text-slate-400 cursor-not-allowed"),children:k.some(e=>e.id===(null==i?void 0:i.id))?(0,s.jsxs)(s.Fragment,{children:["Remove from Cart ",(0,s.jsx)(x.PJ.X,{})]}):(0,s.jsxs)(s.Fragment,{children:["Enroll Now ",(0,s.jsx)(x.PJ.Cart,{})]})})]})})})]})}),(0,s.jsx)("div",{className:"bg-white py-12",children:T.length>0&&(0,s.jsx)("div",{className:"w-full",children:(0,s.jsxs)("div",{className:x.eF,children:[(0,s.jsx)("h2",{className:"text-2xl md:text-3xl font-bold text-slate-900 mb-8",children:"Frequently Bought Together"}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 auto-rows-max w-fit",children:T.map(e=>(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg hover:shadow-2xl transition-all duration-300 border border-slate-100 hover:border-emerald-400 overflow-hidden flex flex-col group max-w-sm",children:[(0,s.jsxs)("div",{className:"".concat(x.TW," p-0 relative h-48 flex items-end justify-start overflow-hidden"),children:[e.logo&&(0,s.jsx)("img",{src:"".concat(h.Z.mediaBaseUrl).concat(e.logo),alt:e.title,className:"absolute inset-0 w-full h-full object-cover"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-trans
1parent to-black/40"}),e.badge&&(0,s.jsx)("span",{className:"absolute top-3 left-3 bg-white/20 backdrop-blur-md text-white text-xs font-bold px-2 py-1 rounded-full border border-white/30 z-10",children:e.badge}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-white text-xs font-bold relative z-10 p-4",children:[(0,s.jsx)(x.PJ.Clock,{size:18}),e.hours||"0"," Hours"]})]}),(0,s.jsxs)("div",{className:"p-3 flex-1 flex flex-col",children:[(0,s.jsx)("h3",{className:"text-sm font-bold text-slate-900 mb-1 line-clamp-2",children:e.title}),(0,s.jsxs)("div",{className:"mt-auto flex items-end justify-between",children:[(0,s.jsx)("div",{className:"flex flex-col",children:(()=>{var t;let l=null===(t=e.coursePricing)||void 0===t?void 0:t[0],i=(null==l?void 0:l.price)||0,n=(null==l?void 0:l.discount)||0;return(0,s.jsxs)(s.Fragment,{children:[n>0&&(0,s.jsxs)("span",{className:"text-sm text-slate-400 line-through",children:["â¹",i.toLocaleString("en-IN")]}),(0,s.jsxs)("span",{className:"text-lg font-bold text-slate-900",children:["â¹",(n>0?i-n/100*i:i).toLocaleString("en-IN")]})]})})()}),(0,s.jsx)("button",{onClick:()=>z(e),className:"h-10 w-10 rounded-full flex items-center justify-center shadow-lg transition-all duration-300 hover:scale-110 ".concat(k.some(t=>t.id===e.id)?"".concat(x.TW," bg-opacity-80"):x.TW),children:k.some(t=>t.id===e.id)?(0,s.jsx)(x.PJ.Check,{size:16,className:"text-white"}):(0,s.jsx)(u.Z,{size:16,className:"text-white"})})]})]})]},e.id))})]})})}),C&&(0,s.jsx)(m.Z,{course:E||i,onClose:()=>{P(!1),L(null)},onAddToCart:e=>{let t;let l=k.findIndex(t=>t.coursePricingId===e.coursePricingId);-1!==l?(t=[...k])[l]=e:t=[...k,e],A(t),localStorage.setItem("cartCourses",JSON.stringify(t)),window.dispatchEvent(new Event("cartUpdated"))}})]})};function w(e){let{courseData:t,onBack:l,onCourseClick:i,onAddToCart:n}=e,{isAuthenticated:r,user:c}=(0,o.a)();return(0,s.jsxs)("div",{className:"bg-white min-h-screen pb-20 md:pb-0",children:[(0,s.jsx)(b,{courseData:t,onBack:l,onAddToCart:n}),(0,s.jsx)(j,{courseData:t,onAddToCart:n})]})}var N=function(){let e=(0,r.useRouter)(),{courseId:t}=e.query,{authToken:l}=(0,o.a)(),[i,n]=(0,c.useState)([]),[a,u]=(0,c.useState)(!1),[x,h]=(0,c.useState)(null),[m,g]=(0,c.useState)(!0),[v,b]=(0,c.useState)(null),[j,N]=(0,c.useState)(null);return((0,c.useEffect)(()=>{{let e=new URLSearchParams(window.location.search),t=e.get("isMobile"),l=e.get("token");t&&b(t),l&&N(l)}},[]),(0,c.useEffect)(()=>{t&&(async()=>{try{g(!0);let e=await f.Z.getFreeCourseList(p.Z),l=((null==e?void 0:e.courses)||e||[]).find(e=>e.id===parseInt(t));h(l||null)}catch(e){console.error("Error fetching course:",e),h(null)}finally{g(!1)}})()},[t]),m)?(0,s.jsx)(d.aN,{}):x?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Ur,{show:a}),(0,s.jsx)(w,{courseData:x,onBack:()=>e.push("/"),onAddToCart:e=>{n([...i,e]),u(!0),setTimeout(()=>u(!1),2e3)}})]}):(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("h1",{className:"text-4xl font-bold text-slate-900 mb-4",children:"Course Not Found"}),(0,s.jsx)("button",{onClick:()=>e.push("/"),className:"bg-brandGreen text-white px-6 py-3 rounded-lg font-bold",children:"Back to Home"})]})})};function y(){let e=(0,r.useRouter)(),{courseId:t}=e.query,[l,i]=(0,c.useState)(null),[o,d]=(0,c.useState)(null);(0,c.useEffect)(()=>{{let e=new URLSearchParams(window.location.search),t=e.get("isMobile"),l=e.get("token");t&&i(t),l&&d(l)}},[]);let u=!!(l||o),x=()=>{let e=new URLSearchParams;l&&e.append("isMobile",l),o&&e.append("token",o);let t=e.toString();return t?"?".concat(t):""};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n(),{children:[(0,s.jsx)("title",{children:"Course Details - MyEduNeeds"}),(0,s.jsx)("meta",{name:"description",content:"View course details and enroll"}),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"})]}),u?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"bg-white border-b border-gray-200 sticky top-0 z-40",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center gap-3",children:(0,s.jsxs)("button",{onClick:()=>{e.push("/store".concat(x()))},className:"flex items-center gap-2 px-4 py-2 text-indigo-600 hover:bg-indigo-50 rounded-lg transition-colors font-semibold",children:[(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),"Back to Store"]})})}),(0,s.jsx)(N,{})]}):(0,s.jsx)(a.Z,{children:(0,s.jsx)(N,{})})]})}},9008:function(e,t,l){e.exports=l(3867)}},function(e){e.O(0,[808,901,888,774,179],function(){return e(e.s=5761)}),_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.