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UG,GAAgCF,oDAAhCE,EAAgCI,QAAhCJ,EAAgC,qBAF7B,gBAEHA,CAAgC,gEC4DtC,IAAMK,GAAkB,MAAzB,MAAOA,EAAkBR,kDAAlBQ,EAAkB,sCAAlBA,IAAkBR,yCAJlB,IAACS,QAAiBC,KAE5BC,SAtDCC,KACAC,KACAC,KACAC,KACAC,KACAC,IACAC,IACAH,KACAI,cAAsB,CACpB,CACEC,KAAM,GACNC,WAAY,QACZC,UAAW,QAEb,CACEF,KAAM,QACNG,sBAAuB,SACvBC,UAAW9K,EACX0J,QAAS,CACPlF,cAAeiF,IAGnB,CACEiB,KAAM,gBACNI,UAAWC,MAEb,CACEL,KAAM,WACNI,UAAWE,KAEb,CACEN,KAAM,mBACNI,UAAWG,MAEb,CACEP,KAAM,uBACNI,UAAWI,MAEb,CACER,KAAM,kBACNI,UAAWK,MAEb,CACET,KAAM,iBACNI,UAAWM,MAEb,CACEV,KAAM,oBACNI,UAAWO,kBAQNvB,CAAkB","names":["i0","CrossFieldErrorMatcherEmail","isErrorState","control","form","touched","errors","emailNotMatched","LoginComponent","constructor","_fb","accountsService","router","apiHelp","appLoadService","route","apollo","sanitizer","this","queryParams","subscribe","params","idParam","id","loginMessage","programTypeCodeOptionSet","localStorage","getItem","console","log","loginForm","group","firstName","Validators","lastName","email","confirmEmail","verified","validators","c","get","value","valueChanges","values","Object","keys","forEach","key","setValue","toLowerCase","trim","emitEvent","regprEnabled","ngOnInit","query","AUTH_QUERY_LOGIN","pipe","map","result","data","authentication","previousEmail","previousIsAuthenticated","isAuthenticated","previousIsVerified","isVerified","env","readEnvironSettings","uriApi","uriEbbFiles","substr","lastIndexOf","uriSiteRoot","spaBaseUrl","uriSpaRedirectLogin","uriSpaRegistration","programsSplit","split","availablePrograms","snapshot","programCycles","filter","program","includes","typeCodeOptionSet","programCycleMultipleDwellingsRestriction","multipleDwellings","programCycleMultipleDwellingsAllowed","length","programCycleKey","loadHelpText","getList","listHelp","JSON","parse","stringify","availableFemaProgram","registrationMessage","getHelpTextItemAnswer","verifyAndAgreeHelp","programTypeMap","ESS","EMR","error","text","item","findIndex","i","name","bypassSecurityTrustHtml","answer","registerpropertydisable","valid","submitLogin","isLoading","nonce","Math","random","toString","substring","loginInfo","loginGuest","anyDwellings","anyDwellingsFound","preventRegistrationOfMultipleDwellings","loginRes$","take","watchQuery","AnyDwellingsQuery","fetchPolicy","variables","anydwellings","navigate","b2cLogin","e","window","location","href","sendToB2c","preventDefault","continue","getApplicationList","matchingProgramApplication","a","x","stateCode","statusCode","y","_Ebb_ProgramCycleId","matchingProgramDwelling","b","navigateByUrl","startOver","removeItem","logout","ListApplicationsForMultipleQuery","applications","dwellings","static","core","selectors","ProgramCycleRegistrationResolver","resolve","GET_PROGRAMCYCLES_QUERY","programcyclescanregister","factory","RegistrationModule","provideNgxMask","NavigationService","imports","CommonModule","MatProgressBarModule","MatStepperModule","MatCheckboxModule","QualificationModule","NgxTrimDirectiveModule","SharedModule","RouterModule","path","redirectTo","pathMatch","runGuardsAndResolvers","component","QualificationComponent","RegistrationCompletedComponent","NoPolicyComponent","NotQualifiedPolicyComponent","MultiPolicyComponent","PleaseContactComponent","PleaseContactEssComponent"],"sourceRoot":"webpack:///","sources":["./apps/ebb-registration/src/app/modules/registration/components/login/login.component.html","./apps/ebb-registration/src/app/modules/registration/components/login/login.component.ts","./apps/ebb-registration/src/app/modules/registration/services/resolvers/programcycle-resolver.registration.service.ts","./apps/ebb-registration/src/app/modules/registration/registration.module.ts"],"sourcesContent":["\r\n
\r\n
\r\n
\r\n

\r\n You are connected as {{ previousEmail }}. Is this you? Continue or Logout\r\n

\r\n
\r\n
\r\n\r\n
\r\n

\r\n You already have an account in our legacy system.
\r\n Please continue to our Property Owner Dashboard to upgrade your account\r\n

\r\n
\r\n
\r\n
\r\n

Property Registration

\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n Contact First Name\r\n \r\n Contact First Name is required\r\n You have exceeded the maximum number of 100 characters.\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n Contact Last Name\r\n \r\n Contact Last Name is required\r\n You have exceeded the maximum number of 100 characters.\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n Contact Email Address\r\n \r\n Contact Email Address is required\r\n Invalid Contact Email Address\r\n You have exceeded the maximum number of 100 characters.\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n Confirm Contact Email Address\r\n \r\n Confirm Contact Email Address is required\r\n Invalid Contact Email Address\r\n You have exceeded the maximum number of 100 characters.\r\n Email Adresses do not match\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n REGISTER PROPERTY\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n","import { map, take } from 'rxjs/operators';\r\nimport { Apollo } from 'apollo-angular';\r\nimport { AccountsService } from './../../services/accounts/accounts.service';\r\nimport {\r\n FormGroup,\r\n FormBuilder,\r\n Validators,\r\n AbstractControl,\r\n FormControl,\r\n FormGroupDirective,\r\n NgForm\r\n} from '@angular/forms';\r\nimport { Component, OnInit } from '@angular/core';\r\nimport {\r\n ILoginForm,\r\n AUTH_QUERY_LOGIN,\r\n ListApplicationsForMultipleQuery,\r\n AnyDwellingsQuery,\r\n IApplication,\r\n IProgramCycle,\r\n IDwelling,\r\n IHelp,\r\n HelpApiService,\r\n AppLoadService\r\n} from '@ebb-v2/ebb-integration';\r\nimport { Observable } from 'rxjs';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport { ErrorStateMatcher } from '@angular/material/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\n\r\nclass CrossFieldErrorMatcherEmail implements ErrorStateMatcher {\r\n isErrorState(\r\n control: FormControl | null,\r\n form: FormGroupDirective | NgForm | null\r\n ): boolean {\r\n return (\r\n (control.touched && control.errors) ||\r\n (form.errors && form.errors.emailNotMatched)\r\n );\r\n }\r\n}\r\n\r\n@Component({\r\n selector: 'hom-login',\r\n templateUrl: './login.component.html',\r\n styleUrls: ['./login.component.scss']\r\n})\r\nexport class LoginComponent implements OnInit {\r\n public loginForm: FormGroup;\r\n public loginInfo: any;\r\n public loginRes$: Observable;\r\n public returnMessage: string;\r\n public previousEmail: string;\r\n public previousIsAuthenticated = false;\r\n public previousIsVerified = false;\r\n public loginMessage: null | 'AlreadyHaveContact';\r\n public confirmEmailErr = false;\r\n public errorMatcherEmail = new CrossFieldErrorMatcherEmail();\r\n private uriApi: string;\r\n private uriEbbFiles: string;\r\n private uriSpaRedirectLogin: string;\r\n private uriSpaRegistration: string;\r\n public programTypeCodeOptionSet: string;\r\n public programCycleMultipleDwellingsAllowed: boolean;\r\n public programCycleMultipleDwellingsRestriction: IProgramCycle[];\r\n public programCycleKey: string;\r\n public registrationMessage: SafeHtml;\r\n public listHelp: IHelp[] = [];\r\n public verifyAndAgreeHelp: SafeHtml;\r\n public registerpropertydisable = true;\r\n public isLoading = false;\r\n\r\n constructor(\r\n private _fb: FormBuilder,\r\n private accountsService: AccountsService,\r\n private router: Router,\r\n private readonly apiHelp: HelpApiService,\r\n public readonly appLoadService: AppLoadService,\r\n private route: ActivatedRoute,\r\n private apollo: Apollo,\r\n private sanitizer: DomSanitizer\r\n ) {\r\n this.route.queryParams.subscribe(params => {\r\n const idParam = params['id'];\r\n const emailParam = params['email'];\r\n if (idParam === 'AlreadyHaveContact') {\r\n this.loginMessage = idParam;\r\n }\r\n this.programTypeCodeOptionSet = this.accountsService.programTypeCodeOptionSet;\r\n });\r\n\r\n if (localStorage.getItem('firstName') && localStorage.getItem('lastName')) {\r\n console.log(\r\n `${localStorage.getItem('firstName')} ${localStorage.getItem(\r\n 'lastName'\r\n )}`\r\n );\r\n }\r\n\r\n this.loginForm = this._fb.group(\r\n {\r\n firstName: ['', [Validators.required, Validators.maxLength(100)]],\r\n lastName: ['', [Validators.required, Validators.maxLength(100)]],\r\n email: [\r\n null,\r\n [\r\n Validators.required,\r\n Validators.pattern(\r\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\r\n ),\r\n Validators.maxLength(100)\r\n ]\r\n ],\r\n confirmEmail: [\r\n null,\r\n [\r\n Validators.required,\r\n Validators.pattern(\r\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\r\n ),\r\n Validators.maxLength(100)\r\n ]\r\n ],\r\n verified: [false, [Validators.required, Validators.requiredTrue]]\r\n },\r\n {\r\n validators: (c: AbstractControl): { emailNotMatched: boolean } => {\r\n if (\r\n c.get('confirmEmail').value &&\r\n c.get('email').value !== c.get('confirmEmail').value\r\n ) {\r\n return { emailNotMatched: true };\r\n }\r\n }\r\n }\r\n );\r\n\r\n // Ensure email is lowercase\r\n this.loginForm.valueChanges.subscribe(values => {\r\n Object.keys(values).forEach(key => {\r\n const value = this.loginForm.get(key).value;\r\n if (value && (key === 'email' || key === 'confirmEmail')) {\r\n this.loginForm\r\n .get(key)\r\n .setValue(value.toLowerCase().trim(), { emitEvent: false });\r\n }\r\n });\r\n this.regprEnabled();\r\n });\r\n }\r\n\r\n public ngOnInit(): void {\r\n this.apollo\r\n .query({\r\n query: AUTH_QUERY_LOGIN\r\n })\r\n .pipe(map(result => result.data as any))\r\n .subscribe(({ authentication }) => {\r\n if (authentication.email) {\r\n this.previousEmail = authentication.email;\r\n this.previousIsAuthenticated = authentication.isAuthenticated;\r\n this.previousIsVerified = authentication.isVerified;\r\n } else {\r\n this.previousEmail = '';\r\n }\r\n });\r\n\r\n const env = this.appLoadService.readEnvironSettings();\r\n if (env.uriApi) {\r\n this.uriApi = env.uriApi;\r\n console.log(`registration LoginComponent this.uriApi='${this.uriApi}'`);\r\n this.uriEbbFiles = this.uriApi.substr(0, this.uriApi.lastIndexOf('/'));\r\n if (env.uriSiteRoot) {\r\n const spaBaseUrl = env.uriSiteRoot;\r\n console.log(`registration LoginComponent spaBaseUrl='${spaBaseUrl}'`);\r\n this.uriSpaRedirectLogin = `${spaBaseUrl}/login`;\r\n this.uriSpaRegistration = `${spaBaseUrl}/register/questionnaire`;\r\n } else {\r\n this.uriSpaRedirectLogin = `${this.uriEbbFiles}/files/portal/login`;\r\n }\r\n console.log(\r\n `registration LoginComponent this.uriSpaRedirectLogin='${\r\n this.uriSpaRedirectLogin\r\n }'`\r\n );\r\n }\r\n\r\n const programsSplit = this.programTypeCodeOptionSet.split('|');\r\n const availablePrograms = this.route.snapshot.data['programCycles'].filter(\r\n program => programsSplit.includes(program.typeCodeOptionSet)\r\n ) as IProgramCycle[];\r\n this.programCycleMultipleDwellingsRestriction = availablePrograms.filter(\r\n program => program.multipleDwellings !== true\r\n );\r\n this.programCycleMultipleDwellingsAllowed = true;\r\n\r\n if (\r\n this.programCycleMultipleDwellingsRestriction &&\r\n this.programCycleMultipleDwellingsRestriction.length > 0\r\n ) {\r\n this.programCycleMultipleDwellingsAllowed = false;\r\n this.programCycleKey = this.programCycleMultipleDwellingsRestriction[0].id;\r\n }\r\n\r\n this.loadHelpText(availablePrograms);\r\n this.regprEnabled();\r\n }\r\n\r\n private loadHelpText(availablePrograms: IProgramCycle[]): void {\r\n this.apiHelp.getList().subscribe(\r\n data => {\r\n this.listHelp = JSON.parse(JSON.stringify(data));\r\n\r\n const availableFemaProgram = availablePrograms.filter(\r\n program => program.typeCodeOptionSet === 'FEMA'\r\n )[0];\r\n\r\n if (this.programTypeCodeOptionSet === 'CEA BB') {\r\n this.registrationMessage = this.getHelpTextItemAnswer(\r\n this.listHelp,\r\n 'CEABBRegistrationMessage'\r\n );\r\n } else if (this.programTypeCodeOptionSet === 'ESS') {\r\n this.registrationMessage = this.getHelpTextItemAnswer(\r\n this.listHelp,\r\n 'ESSRegistrationMessage'\r\n );\r\n } else if (this.programTypeCodeOptionSet === 'EMR') {\r\n this.registrationMessage = this.getHelpTextItemAnswer(\r\n this.listHelp,\r\n 'EMRRegistrationMessage'\r\n );\r\n } else {\r\n this.registrationMessage = this.getHelpTextItemAnswer(\r\n this.listHelp,\r\n 'EBBRegistrationMessage'\r\n );\r\n }\r\n\r\n this.verifyAndAgreeHelp = this.getHelpTextItemAnswer(\r\n this.listHelp,\r\n 'RegisterHomeownerFemaVerifyAndAgree'\r\n );\r\n\r\n if (availablePrograms[0]) {\r\n if (!availableFemaProgram) {\r\n this.verifyAndAgreeHelp = this.getHelpTextItemAnswer(\r\n this.listHelp,\r\n 'RegisterHomeownerEbbVerifyAndAgree'\r\n );\r\n }\r\n\r\n const programTypeMap = {\r\n 'CEA BB': 'RegisterHomeownerCeabbVerifyAndAgree',\r\n ESS: 'RegisterHomeownerEssVerifyAndAgree',\r\n EMR: 'RegisterPropertyOwnerEMRVerifyAndAgree'\r\n };\r\n\r\n for (let program of availablePrograms) {\r\n if (programTypeMap[program.typeCodeOptionSet]) {\r\n this.verifyAndAgreeHelp = this.getHelpTextItemAnswer(\r\n this.listHelp,\r\n programTypeMap[program.typeCodeOptionSet]\r\n );\r\n break;\r\n }\r\n }\r\n }\r\n },\r\n error => console.log(error)\r\n );\r\n }\r\n\r\n public getHelpTextItemAnswer(listHelp: IHelp[], text: string): SafeHtml {\r\n let item = listHelp.findIndex(\r\n i => i.name.toLowerCase() === text.toLowerCase()\r\n );\r\n\r\n if (item < 0) {\r\n return '';\r\n }\r\n\r\n return this.sanitizer.bypassSecurityTrustHtml(this.listHelp[item].answer);\r\n }\r\n\r\n public regprEnabled() {\r\n this.registerpropertydisable = !this.loginForm.valid;\r\n }\r\n\r\n public submitLogin(loginForm: ILoginForm): void {\r\n if (this.loginForm.valid) {\r\n this.isLoading = true;\r\n this.registerpropertydisable = true;\r\n\r\n const nonce: string =\r\n Math.random()\r\n .toString(36)\r\n .substring(2, 4) +\r\n Math.random()\r\n .toString(36)\r\n .substring(2, 4);\r\n this.loginInfo = {\r\n firstName: loginForm.firstName,\r\n lastName: loginForm.lastName,\r\n email: loginForm.email,\r\n nonce\r\n };\r\n\r\n if (this.programCycleMultipleDwellingsAllowed) {\r\n this.loginGuest();\r\n } else {\r\n this.anyDwellings(loginForm.email, this.programCycleKey).subscribe(\r\n anyDwellingsFound => {\r\n if (anyDwellingsFound) {\r\n this.preventRegistrationOfMultipleDwellings();\r\n } else {\r\n this.loginGuest();\r\n }\r\n //this.isLoading = false;\r\n //this.registerpropertydisable = !this.loginForm.valid;\r\n },\r\n error => {\r\n console.log(\r\n 'LoginComponent.submitLogin anyDwellings error: ' + error\r\n );\r\n this.isLoading = false;\r\n this.registerpropertydisable = !this.loginForm.valid;\r\n }\r\n );\r\n }\r\n }\r\n }\r\n\r\n private loginGuest() {\r\n this.loginRes$ = this.accountsService.loginGuest(\r\n this.loginInfo,\r\n '/register/questionnaire'\r\n );\r\n this.loginRes$.pipe(take(1)).subscribe(\r\n () => {\r\n //this.isLoading = false;\r\n //this.registerpropertydisable = !this.loginForm.valid;\r\n },\r\n error => {\r\n console.log('LoginComponent.loginGuest error: ' + error);\r\n this.isLoading = false;\r\n this.registerpropertydisable = !this.loginForm.valid;\r\n }\r\n );\r\n }\r\n\r\n private anyDwellings(\r\n email: string,\r\n programCycleKey: string\r\n ): Observable {\r\n return this.apollo\r\n .watchQuery({\r\n query: AnyDwellingsQuery,\r\n fetchPolicy: 'network-only',\r\n variables: {\r\n email: email,\r\n programCycleKey: programCycleKey\r\n }\r\n })\r\n .valueChanges.pipe(\r\n map(result => result.data['anydwellings'] as boolean),\r\n take(1)\r\n );\r\n }\r\n\r\n private preventRegistrationOfMultipleDwellings() {\r\n this.router.navigate(['register', 'no-multi-policy']);\r\n }\r\n\r\n public b2cLogin(e): void {\r\n window.location.href = this.accountsService.sendToB2c(\r\n this.loginForm.get('email').value\r\n );\r\n e.preventDefault();\r\n }\r\n\r\n public continue(e): void {\r\n e.preventDefault();\r\n\r\n if (\r\n !this.programCycleMultipleDwellingsAllowed &&\r\n this.previousIsAuthenticated &&\r\n this.previousIsVerified\r\n ) {\r\n this.getApplicationList().subscribe(data => {\r\n const matchingProgramApplication = data.a\r\n ? data.a.filter(\r\n x =>\r\n (x.stateCode === 0 ||\r\n (x.stateCode === 1 && x.statusCode === 700000000)) &&\r\n this.programCycleMultipleDwellingsRestriction.filter(\r\n y => x._Ebb_ProgramCycleId === y.id\r\n ).length > 0\r\n )\r\n : [];\r\n const matchingProgramDwelling = data.b\r\n ? data.b.filter(\r\n x =>\r\n x.stateCode === 0 &&\r\n x.statusCode !== 1 &&\r\n this.programCycleMultipleDwellingsRestriction.filter(\r\n y => x._Ebb_ProgramCycleId === y.id\r\n ).length > 0\r\n )\r\n : [];\r\n\r\n if (\r\n (matchingProgramApplication &&\r\n matchingProgramApplication.length > 0) ||\r\n (matchingProgramDwelling && matchingProgramDwelling.length > 0)\r\n ) {\r\n this.preventRegistrationOfMultipleDwellings();\r\n } else {\r\n this.router.navigateByUrl('/register/questionnaire');\r\n }\r\n });\r\n } else {\r\n this.router.navigateByUrl('/register/questionnaire');\r\n }\r\n }\r\n\r\n public startOver(e): void {\r\n localStorage.removeItem('firstName');\r\n localStorage.removeItem('lastName');\r\n window.location.href = this.accountsService.logout();\r\n e.preventDefault();\r\n }\r\n\r\n private getApplicationList(): Observable<{\r\n a: IApplication[];\r\n b: IDwelling[];\r\n }> {\r\n return this.apollo\r\n .query({\r\n query: ListApplicationsForMultipleQuery,\r\n fetchPolicy: 'network-only'\r\n })\r\n .pipe(\r\n map(result => {\r\n return {\r\n a: result.data['applications'] as IApplication[],\r\n b: result.data['dwellings'] as IDwelling[]\r\n };\r\n })\r\n );\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Resolve } from '@angular/router';\r\nimport { Observable, of, EMPTY } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { IProgramCycle } from '@ebb-v2/ebb-integration';\r\nimport { Apollo} from 'apollo-angular';\r\nimport {GET_PROGRAMCYCLES_QUERY } from '@ebb-v2/ebb-integration';\r\n\r\n\r\nexport interface IProgramCycleList {\r\n id: string;\r\n programCycles: IProgramCycle[];\r\n }\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n })\r\nexport class ProgramCycleRegistrationResolver implements Resolve {\r\n\r\n constructor(\r\n private apollo: Apollo\r\n ) { }\r\n\r\n resolve(): Observable {\r\n return this.apollo\r\n .query ({\r\n query: GET_PROGRAMCYCLES_QUERY,\r\n fetchPolicy: 'network-only'\r\n })\r\n .pipe(map(result => result.data['programcyclescanregister'] as IProgramCycle[]));\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { RouterModule } from '@angular/router';\r\n\r\nimport { SharedModule } from '../_shared/shared.module';\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { QualificationComponent, QualificationModule, NoPolicyComponent, MultiPolicyComponent, PleaseContactComponent, PleaseContactEssComponent, NotQualifiedPolicyComponent} from '@ebb-v2/ebb-integration';\r\nimport { NgxTrimDirectiveModule } from 'ngx-trim-directive';\r\nimport { ProgramCycleRegistrationResolver } from './services/resolvers/programcycle-resolver.registration.service';\r\nimport { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';\r\nimport { MatLegacyProgressBarModule as MatProgressBarModule } from '@angular/material/legacy-progress-bar';\r\nimport { MatStepperModule } from '@angular/material/stepper';\r\nimport { NgxMaskDirective, NgxMaskPipe, provideNgxMask } from 'ngx-mask';\r\nimport { RegistrationCompletedComponent } from '../_shared/components/registrationcompleted/registrationcompleted.component';\r\nimport { NavigationService } from '../_shared/services/navigationservice/navigation.service';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@NgModule({\r\n declarations: [\r\n LoginComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n MatProgressBarModule,\r\n MatStepperModule,\r\n MatCheckboxModule,\r\n QualificationModule,\r\n NgxTrimDirectiveModule,\r\n SharedModule, \r\n MatCheckboxModule,NgxMaskDirective,NgxMaskPipe,\r\n RouterModule.forChild([\r\n {\r\n path: '',\r\n redirectTo: 'login',\r\n pathMatch: 'full'\r\n },\r\n {\r\n path: 'login',\r\n runGuardsAndResolvers: 'always',\r\n component: LoginComponent,\r\n resolve: {\r\n programCycles: ProgramCycleRegistrationResolver\r\n }\r\n },\r\n {\r\n path: 'questionnaire',\r\n component: QualificationComponent\r\n },\r\n {\r\n path: 'complete',\r\n component: RegistrationCompletedComponent\r\n },\r\n {\r\n path: 'policy-not-found',\r\n component: NoPolicyComponent\r\n },\r\n {\r\n path: 'policy-not-qualified',\r\n component: NotQualifiedPolicyComponent\r\n },\r\n {\r\n path: 'no-multi-policy',\r\n component: MultiPolicyComponent\r\n },\r\n {\r\n path: 'please-contact',\r\n component: PleaseContactComponent\r\n },\r\n {\r\n path: 'please-contactess',\r\n component: PleaseContactEssComponent\r\n }\r\n ])\r\n ],\r\n providers: [provideNgxMask(),NavigationService\r\n \r\n ],\r\n})\r\nexport class RegistrationModule { }\r\n"],"x_google_ignoreList":[]}