"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[33499],{33499:(e,r,o)=>{o.r(r),o.d(r,{CoreEnrolHelper:()=>E,CoreEnrolHelperService:()=>u});var n=o(10467),t=o(79555),l=o(59656),c=o(81690),s=o(4838),a=o(24502),i=o(54438);let u=(()=>{var e;class CoreEnrolHelperService{getEnrolmentIcons(e,r){return(0,n.A)((function*(){e=a.R.unique(e);let o=[],t=!1;const c=e.map(function(){var e=(0,n.A)((function*(e){const n=yield l.CoreEnrolDelegate.getInfoIcons(e,r);if(n.length)return o=o.concat(n),void 0;const c=l.CoreEnrolDelegate.getEnrolmentAction(e);t=t||c===l.CoreEnrolAction.BROWSER}));return function(r){return e.apply(this,arguments)}}());return yield Promise.all(c),t&&o.push({className:"enrol_browser",label:"core.courses.otherenrolments",icon:"fas-up-right-from-square"}),0==o.length&&o.push({className:"enrol_locked",label:"core.courses.notenrollable",icon:"fas-lock"}),o}))()}getEnrolmentsByType(e,r){return(0,n.A)((function*(){const o=yield s.CoreEnrol.getCourseEnrolmentMethods(e),n=[],t=[];let a=!1,i=!1;return o.forEach((e=>{if(!c.j.isTrueOrOne(e.status))return;switch(l.CoreEnrolDelegate.getEnrolmentAction(e.type)){case l.CoreEnrolAction.SELF:n.push(e);break;case l.CoreEnrolAction.GUEST:t.push(e);break;case l.CoreEnrolAction.BROWSER:a=!0;break;case l.CoreEnrolAction.NOT_SUPPORTED:i=!0}})),null==r||r.forEach((e=>{if(o.some((r=>r.type===e)))return;const r=l.CoreEnrolDelegate.getEnrolmentAction(e);a=a||r===l.CoreEnrolAction.BROWSER,i=i||r===l.CoreEnrolAction.NOT_SUPPORTED})),{self:n,guest:t,hasBrowser:a,hasNotSupported:i}}))()}}return(e=CoreEnrolHelperService).ɵfac=function CoreEnrolHelperService_Factory(r){return new(r||e)},e.ɵprov=i.jDH({token:e,factory:e.ɵfac,providedIn:"root"}),CoreEnrolHelperService})();const E=(0,t.Qd)(u)}}]);