PageSourceSearch

https://www.milesmasterclass.com/chunk-XXNH4L6T.js

js milesmasterclass.com collected 2026-10-01 16:22:33 UTC 12,053 bytes, 2 lines download raw bytes

1import{b as _,p as K,u as Q}from"./chunk-BARDQGK6.js";import{a as W}from"./chunk-L2OTBMCP.js";import{c as N,e as O}from"./chunk-DTI2P45D.js";import{y as Y}from"./chunk-UPMGB634.js";import{b as J}from"./chunk-FORES6YT.js";import{c as B}from"./chunk-EEREY6TG.js";import{a as H}from"./chunk-XAAKPWGS.js";import{a as $}from"./chunk-XZBHOAEY.js";import{b as z}from"./chunk-2XTP3JNB.js";import{c as j}from"./chunk-UFNZXUZG.js";import{a as L,b as q}from"./chunk-IHJCQUK6.js";import{c as I}from"./chunk-KLAEZ5UA.js";import{a as U}from"./chunk-FJMQYAVB.js";import{$b as a,A as E,Ab as A,Ac as x,Dc as l,Fc as b,H as D,Ia as k,Z as R,_b as v,ac as n,ba as w,bd as T,cd as F,ga as d,lb as u,mc as f,p as S,sa as P,za as p}from"./chunk-WOGKWOFI.js";import{a as C,b as y}from"./chunk-QJI7QS7F.js";var M=class m{dialogRef;data;selectedMode=p(null);close(){this.dialogRef.close()}confirmSelection(){let e=this.selectedMode();if(e===null)return;let o={cpe_mode_status:e};this.dialogRef.close(o)}static \u0275fac=function(o){return new(o||m)};static \u0275cmp=A({type:m,selectors:[["app-select-cpe-mode"]],hostAttrs:[1,"block"],decls:49,vars:30,consts:[["role","dialog","aria-labelledby","modal-title","aria-describedby","modal-description",1,"bg-linear-to-br","from-[#0d1a2d]","to-[#1a2332]","rounded-lg","shadow-2xl","flex","flex-col","md:w-[50svw]","w-[95svw]","mx-auto","md:overflow-hidden"],[1,"flex","justify-between","items-center","px-6","md:py-4","py-2","bg-[#162033]","border-b","border-gray-700"],[1,"flex","items-center","gap-3"],["id","modal-title",1,"text-white","md:text-xl","text-lg","font-semibold","capitalize"],["variant","close","size","sm",3,"clicked"],[1,"flex","flex-col","p-6","space-y-6","max-h-[80dvh]","overflow-y-auto"],[1,"space-y-4"],["for","preview-mode",1,"group","relative","block","cursor-pointer","rounded-lg","border-2","transition-all","duration-300","p-5"],[1,"flex","gap-4"],[1,"shrink-0","mt-1"],["autocomplete","off","type","radio","name","mode","id","preview-mode",1,"w-5","h-5","text-blue-600","bg-gray-700","border-gray-600",3,"change","checked"],[1,"flex-1","space-y-2"],[1,"text-white","font-semibold","text-lg"],[1,"px-2","py-1","text-green-100","text-xs","font-medium","rounded-full","bg-green-600"],[1,"text-gray-300","md:text-sm","text-xs","leading-relaxed"],[1,"flex","flex-wrap","gap-2","mt-3"],[1,"inline-flex","items-center","px-2","py-1","bg-gray-700","text-gray-300","md:text-xs","text-[10px]","rounded"],["for","cpe-mode",1,"group","relative","block","cursor-pointer","rounded-lg","border-2","transition-all","duration-300","p-5"],["autocomplete","off","type","radio","name","mode","id","cpe-mode",1,"w-5","h-5","text-blue-600","bg-gray-700","border-gray-600",3,"change","checked"],[1,"inline-flex","items-center","px-2","py-1","bg-blue-700","text-blue-100","md:text-xs","text-[10px]","rounded"],[1,"flex","flex-col","sm:flex-row","sm:justify-end","gap-3","pt-4","border-t","border-gray-700"],["variant","secondary",3,"clicked"],["variant","default",3,"clicked","disabled"]],template:function(o,t){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),l(4),n()(),a(5,"app-button",4),f("clicked",function(){return t.close()}),n()(),a(6,"div",5)(7,"div",6)(8,"label",7)(9,"div",8)(10,"div",9)(11,"input",10),f("change",function(){return t.selectedMode.set(!1)}),n()(),a(12,"div",11)(13,"div",2)(14,"h3",12),l(15,"\u{1F3AD} Preview Mode"),n(),a(16,"span",13),l(17," FREE "),n()(),a(18,"p",14),l(19," Preview Mode lets you go at your own pace, no strings attached. No certificate here, but if you change your mind and want that CPE cert, you can switch\u2014just know you\u2019ll have to start from scratch! "),n(),a(20,"div",15)(21,"span",16),l(22," \u2713 Self-paced learning "),n(),a(23,"span",16),l(24," \u2713 No time restrictions "),n(),a(25,"span",16),l(26," \u2717 No certificate "),n()()()()(),a(27,"label",17)(28,"div",8)(29,"div",9)(30,"input",18),f("change",function(){return t.selectedMode.set(!0)}),n()(),a(31,"div",11)(32,"div",2)(33,"h3",12),l(34,"\u{1F3C6} CPE Certification Mode"),n()(),a(35,"p",14),l(36),n(),a(37,"div",15)(38,"span",19),l(39," \u2713 CPE Certificate "),n(),a(40,"span",19),l(41," \u2713 Quizzes & Assessments "),n(),a(42,"span",19),l(43," \u2713 Progress tracking "),n()()()()()(),a(44,"div",20)(45,"app-button",21),f("
1clicked",function(){return t.close()}),l(46," Cancel "),n(),a(47,"app-button",22),f("clicked",function(){return t.confirmSelection()}),l(48),n()()()()),o&2&&(u(4),b(" Choose Your ",t.data.type," Mode "),u(4),x("border-blue-500",t.selectedMode()===!1)("bg-blue-500/10",t.selectedMode()===!1)("border-gray-600",t.selectedMode()!==!1)("hover:border-gray-500",t.selectedMode()!==!1)("bg-gray-800/50",t.selectedMode()!==!1)("hover:bg-gray-700/50",t.selectedMode()!==!1),u(3),v("checked",t.selectedMode()===!1),u(16),x("border-blue-500",t.selectedMode()===!0)("bg-blue-500/10",t.selectedMode()===!0)("border-gray-600",t.selectedMode()!==!0)("hover:border-gray-500",t.selectedMode()!==!0)("bg-gray-800/50",t.selectedMode()!==!0)("hover:bg-gray-700/50",t.selectedMode()!==!0),u(3),v("checked",t.selectedMode()===!0),u(6),b(" Ready to earn that CPE certificate? ",t.data.type==="Podcast"&&t.data.format==="audio"?"listen":"watch"," at the set speed, tackle quizzes, and ace the final exam. It\u2019s a straight path to certification, but hey, it\u2019s an investment in your future! "),u(11),v("disabled",t.selectedMode()===null),u(),b(" Continue with ",t.selectedMode()===!1?"Preview Mode":t.selectedMode()===!0?"CPE Mode":"Selected Mode"," "))},dependencies:[z,Y],encapsulation:2})};var G=class m{logger=d(U);notification=d($);http=d(L);auth=d(j);router=d(O);route=d(N);dialog=d(H);utils=d(Q);payment=d(J);analytics=d(B);destroyRef=d(P);courseDetails=p(null);courseChapters=p([]);loading=p(!1);error=p(null);downloadingExerciseFiles=this.utils.downloadingExerciseFiles;cartItemRemovedEffect=k(()=>{let e=this.payment.cartItemRemoved();F(()=>{e&&this.courseDetails()?.id===e&&this.courseDetails.update(o=>o&&y(C({},o),{is_added_to_cart:!1}))})});currentProgress=T(()=>{let e=this.courseChapters();if(e.length===0)return 0;let o=0,t=0;return e.forEach(r=>{let i=r.video_duration||0;o+=i,r.play_history?.is_completed?t+=i:r.play_history?.time_status&&(t+=Math.min(r.play_history.time_status,i))}),o===0?0:Math.round(t/o*100)});loadCourse(e){this.loading.set(!0),this.error.set(null);let o={id:e.id},t={id:e.id,course_type:e.course_type};E({details:this.http.get(_.getCourseDetails.path.replace(":course_type",e.course_type),{params:o}),chapters:this.http.get(_.getCourseChapter.path,{params:t})}).pipe(R(({details:r,chapters:i})=>{r?.data&&(r.data.learning_objective_list=r.data.learning_objectives.split(`\r
2`),this.courseDetails.set(K(r.data)),this.analytics.trackEvent("view_item",{course_id:r.data.id,course_name:r.data.title,course_type:e.course_type})),i?.data&&this.courseChapters.set(i.data),this.loading.set(!1)}),D(r=>(this.loading.set(!1),this.error.set(r?.error?.message||"Failed to load course data"),this.logger.error("Failed to load course",r),S(null)))).subscribe()}launchCourse(){if(!this.auth.isLoggedIn()){this.router.navigate(["/auth/login"],{queryParams:{redirect:this.router.url}});return}if(!this.courseDetails()?.cpe_mode_details){this.selectCpeModeDialog();return}this.analytics.trackEvent("start_course",{course_id:this.courseDetails()?.id,course_type:this.courseDetails()?.course_type}),this.navigateToChapter()}navigateToChapter(e){if(!this.auth.isLoggedIn()){this.router.navigate(["/auth/login"],{queryParams:{redirect:this.router.url}});return}let o=this.courseDetails(),t=this.courseChapters();if(!o||t.length===0){this.notification.error("Error","Course data not available");return}if(!this.utils.requireCpeModeAccess(o))return;if(!this.courseDetails()?.cpe_mode_details){this.selectCpeModeDialog();return}let r;if(e!==void 0){let c=t.findIndex(h=>h.id===e);if(c===-1){this.notification.error("Error","Chapter not found");return}r=t[c];let g=this.getBlockingChapter(c);if(g){this.notification.info("Chapter Locked",`Please complete "${g.chapter_name}" before accessing this chapter.`);return}}else r=this.findInProgressChapter();r||(r=t[0]);let i=this.utils.slugify(r.chapter_name),s=this.router.url.split("/");this.router.navigate([...s,"chapter",r.id,i])}isChapterComplete(e){let o=this.courseDetails(),r=this.courseChapters().find(h=>h.id===e);if(!r||!o)return!1;let i=!!r.play_history?.is_completed,s=o.chapter_wise_details?.find(h=>h.chapter_id===e),c=s?s.status:!1;return!!o.cpe_mode_details?.cpe_mode?i&&c:i}getBlockingChapter(e){let o=this.courseDetails(),t=this.courseChapters();if(o?.cpe_mode_details?.cpe_mode){for(let i=0;i<e;i++)if(!this.isChapterComplete(t[i].id))return t[i]}}findInProgressChapter(){let e=this.courseDetails(),o=this.courseChapters();if(!e||o.length===0)return;if(!!e.cpe_mode_details?.cpe_mode)return o.find(r=>!this.isChapterComplete(r.id));{let r=o.filter(s=>!s.play_history?.is_completed);return r.length===0?void 0:r.filter(s=>s.play_history?.updated_at).sort((s,c)=>{let g=new Date(s.play_history?.updated_at||0).getTime();return new Date(c.play_history?.updated_at||0).getTime()-g})[0]||r[0]}}selectCpeModeDialog(){let e=this.courseDetails();if(!e||!this.utils.requireCpeModeAccess(e))return;this.dialog.open(M,{maxWidth:"100%",enterAnimationDuration:"300ms",exitAnimationDuration:"300ms",disableClose:!0,data:{type:"Masterclass",format:"video",isFree:e.is_free,activePlan:e.active_plan}}).afterClosed$.subscribe(t=>{t&&this.selectCpeMode(t.cpe_mode_status)})}selectCpeMode(e,o=!0){let t=this.courseDetails();if(!t){this.notification.error("Error","Course data not available");return}this.loading.set(!0);let r={masterclass_id:t.id,cpe_mode_status:e};this.http.post(_.setCpeMode.path,r).pipe(R(()=>{this.loading.set(!1),this.notification.success("Mode Selected",e?"CPE Certification Mode enabled":"Preview Mode enabled");let i=new Date().toISOString();this.courseDetails.update(s=>s&&y(C({}
2,s),{cpe_mode_details:{cpe_mode:e,class_started:i,class_ends_on:i},chapter_wise_details:s.chapter_wise_details.map(c=>y(C({},c),{status:!1}))})),this.courseChapters.update(s=>s.map(c=>y(C({},c),{play_history:null}))),o&&setTimeout(()=>this.navigateToChapter(),500)}),D(i=>(this.loading.set(!1),this.logger.error("Failed to set CPE mode",i),S(null)))).subscribe()}toggleCpeMode(e){let o=e===!0;if(o){let s=this.courseDetails();if(!s||!this.utils.requireCpeModeAccess(s))return}let t=o?"Switching to CPE Mode?":"Switching to Preview Mode?",r=o?"Heads up! Switching means starting fresh - your current progress will reset. Step into CPE Mode to earn your certificate and level up your learning journey.":"Heads up! Switching to Preview Mode means you can explore freely without CPE tracking. Your CPE progress will be paused.";this.dialog.open(W,{maxWidth:"100%",enterAnimationDuration:"300ms",exitAnimationDuration:"300ms",disableClose:!1,data:{title:t,content:[{type:"text",value:r}],buttons:[{label:"Switch",variant:"default",action:"confirm"}]}}).afterClosed$.subscribe(s=>{s&&this.selectCpeMode(e,!1)})}clear(){this.courseDetails.set(null),this.courseChapters.set([]),this.loading.set(!1),this.error.set(null)}fetchCourseContent(e,o={}){let t={params:e};return o.skipErrorNotification&&(t.context=new I().set(q,!0)),this.http.get(_.getCourseContent.path,t)}startFinalAssessment(e,o,t){this.utils.startFinalAssessment(e,o,t,this.courseDetails()?.exam_rules)}openCertificateDownloadDialog(){let e=this.courseDetails();e&&this.utils.openCertificateDownloadDialog(e)}submitFeedback(){if(!this.courseDetails())return;let o=this.router.url.split("?")[0];this.router.navigate([o,"feedback"],{queryParams:{redirect:this.router.url}})}openShareDialog(){this.courseDetails()&&this.utils.openShareDialog()}openAdditionalResources(){let e=this.courseDetails();e&&this.utils.openAdditionalResources(e.id)}downloadExerciseFiles(e){let o=this.courseDetails();o&&this.utils.downloadExerciseFiles(o.id,o.title,e)}static \u0275fac=function(o){return new(o||m)};static \u0275prov=w({token:m,factory:m.\u0275fac})};export{G as a};

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.