{"version":3,"sources":["src/app/app.component.ts","src/app/app.component.html","node_modules/@angular/material/fesm2022/radio.mjs","node_modules/@angular/platform-browser/fesm2022/animations.mjs","node_modules/@angular/platform-browser/fesm2022/animations/async.mjs","src/app/constants/legacy-tech.routing.ts","src/app/app.routing.ts","src/app/util/prefix-title-strategy.ts","node_modules/@angular/material-luxon-adapter/fesm2022/material-luxon-adapter.mjs","src/app/app.config.ts","src/main.ts"],"sourcesContent":["import { Component, OnInit, OnDestroy, inject } from '@angular/core';\nimport {\n RouterEvent,\n NavigationStart,\n NavigationEnd,\n NavigationCancel,\n NavigationError,\n Router,\n RouterOutlet,\n} from '@angular/router';\nimport {\n ContentFilterPipe,\n ContentService,\n ContentModelVm,\n getContentByPurpose,\n LoadingComponent,\n LoadingService,\n SafeMarkupPipe,\n GoogleTagManagerService,\n OneTrustService,\n DynatraceService,\n} from '@bfy/bfy-ui-shared';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'br-root',\n templateUrl: './app.component.html',\n styleUrl: './app.component.scss',\n imports: [\n ContentFilterPipe,\n SafeMarkupPipe,\n RouterOutlet,\n LoadingComponent,\n ],\n})\nexport class AppComponent implements OnInit, OnDestroy {\n pageContent: ContentModelVm[] = [];\n globalContent: ContentModelVm[] = [];\n subHeaderMessage: string;\n headerTextExample: string;\n title!: string;\n isLoading = true;\n\n private routerEventsSubscription: Subscription;\n\n private loadingService = inject(LoadingService);\n private contentService = inject(ContentService);\n private router = inject(Router);\n private googleTagManagerService = inject(GoogleTagManagerService);\n private oneTrustService = inject(OneTrustService);\n private dynatraceService = inject(DynatraceService);\n\n ngOnInit(): void {\n this.oneTrustService.addToDom().then(() => {\n this.dynatraceService.addToDom();\n this.googleTagManagerService.addGtmToDom();\n });\n\n this.routerEventsSubscription = this.router.events.subscribe(\n (event: any): void => {\n this.navigationInterceptor(event);\n },\n );\n\n this.contentService.globalContent // XXX might need override page context option\n .subscribe({\n next: (result) => {\n this.globalContent = result;\n const spinnerContent: [number, string][] = [\n [0, ''],\n [\n 3,\n getContentByPurpose(\n this.globalContent,\n 'spinnerMessageAfter3Seconds',\n ),\n ],\n [\n 8,\n getContentByPurpose(\n this.globalContent,\n 'spinnerMessageAfter8Seconds',\n ),\n ],\n [\n 13,\n getContentByPurpose(\n this.globalContent,\n 'spinnerMessageAfter13Seconds',\n ),\n ],\n ];\n\n this.loadingService.messages = spinnerContent;\n },\n error: (err: unknown) => console.log(err),\n });\n }\n\n ngOnDestroy(): void {\n this.routerEventsSubscription.unsubscribe();\n }\n\n get hasInformationalMessage(): boolean {\n return (\n getContentByPurpose(this.globalContent, 'informationalMessage')\n ?.length > 0\n );\n }\n\n private navigationInterceptor(event: RouterEvent): void {\n if (event instanceof NavigationStart) {\n this.loadingService.start();\n } else if (event instanceof NavigationEnd) {\n // undoing the spinner needs to be very slightly delayed to allow the sub-components\n // time to turn the spinner on for themselves and avoid the content \"hidden\" flag\n // getting set to false too soon\n setTimeout(() => this.loadingService.stop());\n } else if (event instanceof NavigationCancel) {\n this.isLoading = false;\n this.loadingService.stop();\n } else if (event instanceof NavigationError) {\n this.isLoading = false;\n this.loadingService.stop();\n }\n }\n}\n","