{ "version": 3, "sources": ["../PEP-Site/src/app/core/services/video-data-track.service.ts", "../PEP-Site/src/app/core/guards/route-locale.guard.ts", "../PEP-Site/src/app/core/services/tier.service.ts", "../PEP-Site/src/app/core/extensions/api-mock.service.ts"], "sourcesContent": ["import { Injectable } from '@angular/core';\r\nimport { InitializedVideoAction, ProgressedVideoAction, PlayedVideoAction, SeekedVideoAction, CompletedVideoAction } from '@pepconnect/models/analytics/video-track.model';\r\nimport { Observable, take } from 'rxjs';\r\nimport { ApiService } from './api.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class VideoDataTrackService {\r\n\r\n constructor(private api: ApiService) { }\r\n\r\n getSessionGuid(): Observable {\r\n return this.api.get('v2/analytics/session/new');\r\n }\r\n\r\n trackInitializedVideo(initializedVideoAction: InitializedVideoAction) {\r\n return this.api.sendBeacon('v2/analytics/video/initialized', initializedVideoAction).pipe(take(1)).subscribe();\r\n }\r\n\r\n trackPlayedVideo(playedVideoAction: PlayedVideoAction) {\r\n return this.api.sendBeacon('v2/analytics/video/played', playedVideoAction).pipe(take(1)).subscribe();\r\n }\r\n\r\n trackPausedVideo(pausedVideoAction: ProgressedVideoAction) {\r\n return this.api.sendBeacon('v2/analytics/video/paused', pausedVideoAction).pipe(take(1)).subscribe();\r\n }\r\n\r\n trackSeekedVideo(seekedVideoAction: SeekedVideoAction) {\r\n return this.api.sendBeacon('v2/analytics/video/seeked', seekedVideoAction).pipe(take(1)).subscribe();\r\n }\r\n\r\n trackCompletedVideo(completedVideoAction: CompletedVideoAction) {\r\n return this.api.sendBeacon('v2/analytics/video/completed', completedVideoAction).pipe(take(1)).subscribe();\r\n }\r\n\r\n trackTerminatedVideo(terminatedVideoAction: ProgressedVideoAction) {\r\n return this.api.sendBeacon('v2/analytics/video/terminated', terminatedVideoAction).pipe(take(1)).subscribe();\r\n }\r\n\r\n}\r\n\r\n\r\n", "import { ActivatedRouteSnapshot, Router, RouterStateSnapshot, CanActivateFn, CanActivateChildFn } from '@angular/router';\r\nimport { of } from 'rxjs';\r\nimport { first, switchMap } from 'rxjs/operators';\r\nimport { AppState } from '@pepconnect/state';\r\nimport { selectAuthState } from '@pepconnect/state/auth/auth.selector';\r\nimport { Store } from '@ngrx/store';\r\nimport { LocaleService } from '@pepconnect/services/locale.service';\r\nimport { inject } from '@angular/core';\r\n\r\n/**\r\n * This is essentially useless at the moment because AngularJS does not respect the guards\r\n * but in the future this is the preferred method to making sure that the users locale matches\r\n * the locale in the route. Once we're off AngularJS this would replace the functionality within\r\n * RouteListenerService.listenforRouteChange that duplicates this function, but until then that\r\n * functionality needs to stay there because it fires regardless of NGX or AngluarJS\r\n * **/\r\n\r\nexport const canActivateRouteLocale: CanActivateFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => {\r\n const store = inject(Store);\r\n const router = inject(Router);\r\n const localeService = inject(LocaleService);\r\n return store.select(selectAuthState).pipe(first(authState => authState.isInitialized), switchMap(authState => {\r\n // check if this route _should_ have a locale (some routes do not like sso)\r\n if (route.paramMap.has('locale')) {\r\n // make sure the locale is not blank\r\n const locale = route.paramMap.get('locale');\r\n if (!locale || authState.user.locale.locale !== locale) {\r\n // if the users locale does not match the route locale, redirect the user\r\n localeService.updateRouteLocaleParam(authState.user.locale, router, route);\r\n return of(false);\r\n }\r\n }\r\n return of(true);\r\n }));\r\n}\r\n\r\nexport const canActivateRouteLocaleChild: CanActivateChildFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => canActivateRouteLocale(route, state);\r\n", "import { Injectable } from '@angular/core';\r\nimport { Store } from '@ngrx/store';\r\nimport { first, switchMap } from 'rxjs/operators';\r\nimport { AppState } from '@pepconnect/state';\r\nimport { setTiers } from '@pepconnect/state/auth/auth.actions';\r\nimport { Tier } from '@pepconnect/models/content/tier.model';\r\nimport { User } from '@pepconnect/models/user/user.model';\r\nimport { ApiService } from './api.service';\r\nimport { Discipline } from '@pepconnect/models/content/discipline.model';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport { BaseStateService } from '@pepconnect/shared/base/base-state-service/base-state-service';\r\nimport { of } from 'rxjs';\r\n\r\ndeclare const cloudMedia: any;\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class TierService extends BaseStateService {\r\n\r\n constructor(private api: ApiService, protected store: Store, private translateSvc: TranslateService) { super(store); }\r\n\r\n fetchTiers(locale: number) {\r\n // need to add a common handler that injects the angularjs logger service and then pipe the error to that\r\n return this.api.get('v2/startup/tiers?locale=' + locale);\r\n }\r\n\r\n hydrateTiers(user: User) {\r\n this.fetchTiers(user.locale.id).pipe(first()).subscribe((data: Tier[]) => {\r\n this.store.dispatch(setTiers({ tiers: data }))\r\n })\r\n }\r\n\r\n fetchTier(contentLocale: string, friendlyUrl: string, userLocale: number) {\r\n // need to add a common handler that injects the angularjs logger service and then pipe the error to that\r\n return this.api.get(`v2/tiers/${contentLocale}/${friendlyUrl}?locale=${userLocale}`);\r\n }\r\n\r\n /** Adds an event discipline to a tier if the tier requires events to be shown () */\r\n transformTier(tier: Tier) {\r\n return this.$userLocale.pipe(first(), switchMap(userLocale => {\r\n const transformed = this.addEventDiscipline(tier, userLocale.locale);\r\n return of(transformed)\r\n }));\r\n }\r\n\r\n /** Adds the events discipline if showEvents is true on the tier */\r\n addEventDiscipline(tier: Tier, locale: string) {\r\n if (tier.showEvents && !tier.disciplines.some(({ id }) => id === 3100)) {\r\n\r\n const eventMenuItem = this.getEventDiscipline(locale);\r\n // update disciplines array with new menu item\r\n const updatedDisciplines = [...tier.disciplines, eventMenuItem];\r\n\r\n tier = Object.assign({}, tier);\r\n // assgin updated discpline list to tier object\r\n tier.disciplines = updatedDisciplines;\r\n }\r\n return tier;\r\n }\r\n\r\n private getEventDiscipline(locale: string) {\r\n const eventMenuItem = {\r\n id: 3100,\r\n name: this.translateSvc.instant('EVENTS_TEXT'),\r\n color: \"#9933cc\",\r\n trainingAreas: [{\r\n name: this.translateSvc.instant('VIEW_ALL_EVENTS_TEXT'),\r\n links: [{\r\n rel: \"page\", href: \"/\" + locale + \"/events\"\r\n }],\r\n imageURL: cloudMedia.Utils.cloudTransformUrl('CMS/Images/B01E68AA-74F3-4AF6-8534-CABB880C1F65.jpg')\r\n }],\r\n hasEmployeeOnlyContent: false,\r\n imageURL: '',\r\n employeeOnly: false\r\n } as Discipline;\r\n return eventMenuItem;\r\n }\r\n}\r\n", "import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { ApiService } from '@pepconnect/services/api.service';\r\nimport { EnvironmentService } from '@pepconnect/services/environment.service';\r\nimport { Observable, of, throwError } from 'rxjs';\r\nimport { catchError, map } from 'rxjs/operators';\r\nimport { FileBlob } from './api-main.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiMockService extends ApiService {\r\n\r\n constructor(\r\n private http: HttpClient,\r\n private env: EnvironmentService\r\n ) {\r\n super();\r\n }\r\n\r\n // list of locales available in inline\r\n private inlineLocales = new Set(['en-us', 'es-es', 'de-de', 'fr-fr', 'it-it', 'pl-pl', 'pt-br', 'id-id', 'ja-jp', 'zh-cn', 'ko-kr', 'ru-ru', 'tr-tr', 'vi-vn', 'th-th', 'fi-fi', 'da-dk', 'nl-nl', 'nb-no', 'es-mx', 'pt-pt']);\r\n\r\n /**\r\n * Implementation of ApiService.get. This should not be called directly\r\n * @param endpoint\r\n */\r\n get(endpoint: string): Observable {\r\n // trim off any query strings since we don't need these for mock data\r\n endpoint = endpoint.split('?')[0];\r\n\r\n // for pages(content) that has locale in the path, ignore them and take to same mocked file\r\n const segments = endpoint.split('/').filter(s => !this.inlineLocales.has(s));\r\n endpoint = segments.join('/');\r\n\r\n return this.http.get(`${this.env.mockUrl}${endpoint}.json`).pipe(\r\n catchError(err => {\r\n return throwError(() => err)\r\n })\r\n );\r\n\r\n }\r\n\r\n /**\r\n * Implementation of ApiService.get. This should not be called directly\r\n * @param endpoint\r\n */\r\n getBlob(endpoint: string): Observable {\r\n // trim off any query strings since we don't need these for mock data\r\n endpoint = endpoint.split(\"?\")[0];\r\n\r\n return this.http.get(`${this.env.mockUrl}${endpoint}.json`).pipe(\r\n map(r => new FileBlob()),\r\n catchError(err => {\r\n return throwError(() => err)\r\n })\r\n );\r\n\r\n }\r\n\r\n /**\r\n * Implementation of ApiService.post. This should not be called directly\r\n * @param endpoint\r\n * @param data\r\n */\r\n post(endpoint: string, data: any): Observable {\r\n return this.get(endpoint);\r\n }\r\n\r\n /**\r\n * Implementation of ApiService.postJSON. This should not be called directly\r\n * @param endpoint\r\n * @param data\r\n */\r\n postJson(endpoint: string, data: any): Observable {\r\n return of({} as T)\r\n }\r\n\r\n /**\r\n* Implementation of ApiService.postFile. This should not be called directly\r\n* @param endpoint\r\n* @param data\r\n*/\r\n postFile(endpoint: string, data: any): Observable {\r\n return of({} as T)\r\n }\r\n\r\n /**\r\n * Implementation of ApiService.postFileWithToken\r\n * @param endpoint\r\n * @param data\r\n */\r\n postFileWithToken(endpoint: string, data: any, token: string): Observable {\r\n return of({} as T)\r\n }\r\n\r\n /**\r\n* Implementation of ApiService.postFile. This should not be called directly\r\n* @param endpoint\r\n* @param data\r\n*/\r\n postFormData(endpoint: string, data: any): Observable {\r\n return of({} as T)\r\n }\r\n\r\n\r\n /**\r\n * Implementation of ApiService.put. This should not be called directly.\r\n * @param endpoint\r\n * @param data\r\n */\r\n put(endpoint: string, data: any): Observable {\r\n return of({} as T)\r\n }\r\n\r\n delete(endpoint: string): Observable {\r\n return of({} as T)\r\n }\r\n\r\n sendBeacon(endpoint: string, data: any) {\r\n return of()\r\n }\r\n\r\n}\r\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQM,IAAO,wBAAP,MAAO,uBAAqB;EAEhC,YAAoB,KAAe;AAAf,SAAA,MAAA;EAAmB;EAEvC,iBAAc;AACZ,WAAO,KAAK,IAAI,IAAI,0BAA0B;EAChD;EAEA,sBAAsB,wBAA8C;AAClE,WAAO,KAAK,IAAI,WAAW,kCAAkC,sBA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