@hmcts/opal-frontend-common 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ export declare abstract class AbstractSortableTablePaginationComponent extends A
5
5
  itemsPerPageSignal: import("@angular/core").WritableSignal<number>;
6
6
  startIndexComputed: import("@angular/core").Signal<number>;
7
7
  endIndexComputed: import("@angular/core").Signal<number>;
8
- paginatedTableDataComputed: import("@angular/core").Signal<import("../abstract-sortable-table/interfaces/abstract-sortable-table-interfaces").IAbstractTableData<import("@hmcts/opal-frontend-common/types").SortableValues>[]>;
8
+ paginatedTableDataComputed: import("@angular/core").Signal<import("@hmcts/opal-frontend-common/components/abstract").IAbstractTableData<import("@hmcts/opal-frontend-common/types").SortableValues>[]>;
9
9
  /**
10
10
  * Handles sorting changes and resets the page to the first page.
11
11
  *
@@ -18,3 +18,4 @@ export * from './interfaces/abstract-form-array-control.interface';
18
18
  export * from './interfaces/abstract-form-array-controls.interface';
19
19
  export * from './interfaces/abstract-form-base-form-error-summary-message.interface';
20
20
  export * from './interfaces/abstract-form-control-error-message.interface';
21
+ export * from './abstract-sortable-table/interfaces/abstract-sortable-table-interfaces';
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MojNotificationBadgeComponent {
3
+ badgeId: string;
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<MojNotificationBadgeComponent, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<MojNotificationBadgeComponent, "opal-lib-moj-notification-badge", never, { "badgeId": { "alias": "badgeId"; "required": true; }; }, {}, never, ["*"], true, never>;
6
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MojSortableTableRowDataComponent {
3
+ id: string;
4
+ hostClass: string;
5
+ get hostId(): string;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<MojSortableTableRowDataComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<MojSortableTableRowDataComponent, "opal-lib-moj-sortable-table-row-data,[opal-lib-moj-sortable-table-row-data]", never, { "id": { "alias": "id"; "required": true; }; }, {}, never, ["*"], true, never>;
8
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MojSortableTableStatusComponent {
3
+ columnTitle: string;
4
+ sortDirection: 'ascending' | 'descending' | 'none';
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<MojSortableTableStatusComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<MojSortableTableStatusComponent, "opal-lib-moj-sortable-table-status", never, { "columnTitle": { "alias": "columnTitle"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; }, {}, never, never, true, never>;
7
+ }
@@ -6,6 +6,7 @@ export declare class MojSubNavigationItemComponent {
6
6
  subNavItemFragment: string;
7
7
  subNavItemText: string;
8
8
  activeSubNavItemFragment: string;
9
+ count: string;
9
10
  /**
10
11
  * Handles the click event of a sub-navigation item.
11
12
  * @param event - The click event.
@@ -13,5 +14,5 @@ export declare class MojSubNavigationItemComponent {
13
14
  */
14
15
  handleItemClick(event: Event, item: string): void;
15
16
  static ɵfac: i0.ɵɵFactoryDeclaration<MojSubNavigationItemComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<MojSubNavigationItemComponent, "opal-lib-moj-sub-navigation-item", never, { "subNavItemId": { "alias": "subNavItemId"; "required": true; }; "subNavItemFragment": { "alias": "subNavItemFragment"; "required": true; }; "subNavItemText": { "alias": "subNavItemText"; "required": true; }; "activeSubNavItemFragment": { "alias": "activeSubNavItemFragment"; "required": true; }; }, {}, never, never, true, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<MojSubNavigationItemComponent, "opal-lib-moj-sub-navigation-item", never, { "subNavItemId": { "alias": "subNavItemId"; "required": true; }; "subNavItemFragment": { "alias": "subNavItemFragment"; "required": true; }; "subNavItemText": { "alias": "subNavItemText"; "required": true; }; "activeSubNavItemFragment": { "alias": "activeSubNavItemFragment"; "required": true; }; "count": { "alias": "count"; "required": false; }; }, {}, never, never, true, never>;
17
18
  }
@@ -5,6 +5,7 @@ export * from './moj-button-menu/moj-button-menu.component';
5
5
  export * from './moj-date-picker/moj-date-picker.component';
6
6
  export * from './moj-header/moj-header-navigation-item/moj-header-navigation-item.component';
7
7
  export * from './moj-header/moj-header.component';
8
+ export * from './moj-notification-badge/moj-notification-badge.component';
8
9
  export * from './moj-page-header/moj-page-header.component';
9
10
  export * from './moj-pagination/moj-pagination-item/moj-pagination-item.component';
10
11
  export * from './moj-pagination/moj-pagination-link/moj-pagination-link.component';
@@ -13,7 +14,9 @@ export * from './moj-pagination/moj-pagination.component';
13
14
  export * from './moj-primary-navigation/moj-primary-navigation-item/moj-primary-navigation-item.component';
14
15
  export * from './moj-primary-navigation/moj-primary-navigation.component';
15
16
  export * from './moj-sortable-table/moj-sortable-table-header/moj-sortable-table-header.component';
17
+ export * from './moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row-data/moj-sortable-table-row-data.component';
16
18
  export * from './moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row.component';
19
+ export * from './moj-sortable-table/moj-sortable-table-status/moj-sortable-table-status.component';
17
20
  export * from './moj-sortable-table/moj-sortable-table.component';
18
21
  export * from './moj-sub-navigation/moj-sub-navigation-item/moj-sub-navigation-item.component';
19
22
  export * from './moj-sub-navigation/moj-sub-navigation.component';
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-components-abstract.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-base/abstract-form-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/abstract-form-alias-base.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-base/abstract-form-array-base.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-parent-base/abstract-form-parent-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-parent-base/abstract-form-array-parent-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-removal-base/abstract-form-array-removal-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table/abstract-sortable-table.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table-pagination/abstract-sortable-table-pagination.component.ts","../../../projects/opal-frontend-common/components/abstract/public-api.ts","../../../projects/opal-frontend-common/components/abstract/hmcts-opal-frontend-common-components-abstract.ts"],"sourcesContent":["import { ChangeDetectorRef, Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core';\nimport { FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Subject, takeUntil } from 'rxjs';\nimport { IAbstractFormBaseFieldError } from './interfaces/abstract-form-base-field-error.interface';\nimport { IAbstractFormBaseFieldErrors } from './interfaces/abstract-form-base-field-errors.interface';\nimport { IAbstractFormBaseFormError } from './interfaces/abstract-form-base-form-error.interface';\nimport { IAbstractFormBaseFormErrorSummaryMessage } from '../interfaces/abstract-form-base-form-error-summary-message.interface';\nimport { IAbstractFormBaseHighPriorityFormError } from './interfaces/abstract-form-base-high-priority-form-error.interface';\nimport { IAbstractFormBaseForm } from './interfaces/abstract-form-base-form.interface';\nimport { IAbstractFormControlErrorMessage } from '../interfaces/abstract-form-control-error-message.interface';\nimport { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';\nimport { UtilsService } from '@hmcts/opal-frontend-common/services';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormBaseComponent implements OnInit, OnDestroy {\n @Output() protected unsavedChanges = new EventEmitter<boolean>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Output() protected formSubmit = new EventEmitter<IAbstractFormBaseForm<any>>();\n\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private readonly router = inject(Router);\n private readonly activatedRoute = inject(ActivatedRoute);\n protected readonly utilsService = inject(UtilsService);\n\n public form!: FormGroup;\n public formControlErrorMessages!: IAbstractFormControlErrorMessage;\n public formErrorSummaryMessage!: IAbstractFormBaseFormErrorSummaryMessage[];\n protected fieldErrors!: IAbstractFormBaseFieldErrors;\n protected formSubmitted = false;\n protected readonly ngUnsubscribe = new Subject<void>();\n public formErrors!: IAbstractFormBaseFormError[];\n\n constructor() {}\n\n /**\n * Scrolls to the label of the component and focuses on the field id\n *\n * @param fieldId - Field id of the component\n */\n private scroll(fieldId: string): void {\n let labelTarget;\n let fieldElement;\n\n const autocompleteLabel = document.querySelector(`label[for=${fieldId}-autocomplete]`);\n const regularLabel = document.querySelector(`label[for=${fieldId}]`);\n const fieldsetLegend = document.querySelector(`#${fieldId} .govuk-fieldset__legend`);\n\n if (autocompleteLabel) {\n labelTarget = autocompleteLabel;\n fieldElement = document.getElementById(`${fieldId}-autocomplete`);\n } else {\n labelTarget = regularLabel || fieldsetLegend;\n fieldElement = document.getElementById(fieldId);\n }\n\n if (fieldElement) {\n if (labelTarget) {\n labelTarget.scrollIntoView({ behavior: 'smooth' });\n }\n fieldElement.focus();\n }\n }\n\n /**\n * Returns the highest priority form error from the given error keys and field errors.\n * @param errorKeys - An array of error keys.\n * @param fieldErrors - An object containing field errors.\n * @returns The highest priority form error or null if no errors are found.\n */\n private getHighestPriorityError(\n errorKeys: string[] = [],\n fieldErrors: IAbstractFormBaseFieldError = {},\n ): IAbstractFormBaseHighPriorityFormError | null {\n if (errorKeys.length && Object.keys(fieldErrors).length) {\n const errors = errorKeys.map((errorType: string) => {\n return {\n ...fieldErrors[errorType],\n type: errorType,\n };\n });\n\n const sortedErrors = [...errors].sort((a, b) => a.priority - b.priority);\n\n return sortedErrors[0];\n }\n return null;\n }\n\n /**\n * Retrieves the details of the highest priority form error for a given control path.\n * @param controlPath - The path to the control in the form.\n * @returns The details of the highest priority form error, or null if there are no errors.\n */\n private getFieldErrorDetails(controlPath: (string | number)[]): IAbstractFormBaseHighPriorityFormError | null {\n // Get the control\n const control = this.form.get(controlPath);\n\n // If we have errors\n const controlErrors = control?.errors;\n\n if (controlErrors) {\n /// Get all the error keys\n const controlKey = controlPath[controlPath.length - 1];\n const errorKeys = Object.keys(controlErrors) || [];\n const fieldErrors = this.fieldErrors[controlKey] || {};\n\n if (errorKeys.length && Object.keys(fieldErrors).length) {\n return this.getHighestPriorityError(errorKeys, fieldErrors);\n }\n }\n return null;\n }\n\n /**\n * Retrieves all form errors from the provided form and its nested form groups.\n *\n * @param form - The form group to retrieve errors from.\n * @param controlPath - An optional array representing the path to the current control within the form group.\n * @returns An array of form errors, each containing the field ID, error message, priority, and type.\n */\n private getFormErrors(form: FormGroup, controlPath: (string | number)[] = []): IAbstractFormBaseFormError[] {\n // recursively get all errors from all controls in the form including nested form group controls\n const formControls = form.controls;\n\n const errorSummary = Object.keys(formControls)\n .filter((controlName) => formControls[controlName].invalid)\n .map((controlName) => {\n const control = formControls[controlName];\n\n if (control instanceof FormGroup) {\n return this.getFormErrors(control, [...controlPath, controlName]);\n }\n\n if (control instanceof FormArray) {\n return control.controls\n .map((controlItem, index) => {\n // We only support FormGroups in FormArrays\n if (controlItem instanceof FormGroup) {\n return this.getFormErrors(controlItem, [...controlPath, controlName, index]);\n }\n\n return [];\n })\n .flat();\n }\n\n const getFieldErrorDetails = this.getFieldErrorDetails([...controlPath, controlName]);\n\n // Return the error summary entry\n // If we don't have the error details, return a null message\n return {\n fieldId: controlName,\n message: getFieldErrorDetails?.message ?? null,\n priority: getFieldErrorDetails?.priority ?? 999999999,\n type: getFieldErrorDetails?.type ?? null,\n };\n })\n .flat();\n\n // Remove any null errors\n return errorSummary.filter((item) => item?.message !== null);\n }\n\n /**\n * Sets the error messages for the form controls and error summary based on the provided form errors.\n * @param formErrors - An array of form errors containing field IDs and error messages.\n */\n private setErrorMessages(formErrors: IAbstractFormBaseFormError[]) {\n // Reset the form error messages\n this.formControlErrorMessages = {};\n this.formErrorSummaryMessage = [];\n\n // Set the form error messages based on the error summary entries\n formErrors.forEach((entry) => {\n this.formControlErrorMessages[entry.fieldId] = entry.message;\n this.formErrorSummaryMessage.push({ fieldId: entry.fieldId, message: entry.message });\n });\n }\n\n /**\n * Gets the indexes of the date fields to remove based on the form error summary message.\n * @returns An array of indexes representing the date fields to remove.\n */\n private getDateFieldsToRemoveIndexes(): number[] {\n const indexesToRemove: number[] = [];\n // The order of the field ids is important\n // this is the order in which we want to remove them\n const foundIndexes = this.getFormErrorSummaryIndex(\n ['dayOfMonth', 'monthOfYear', 'year'],\n this.formErrorSummaryMessage,\n );\n\n // Determine which indexes to remove based on the found fields\n switch (foundIndexes.length) {\n case 3:\n // All three date fields are present\n indexesToRemove.push(foundIndexes[1], foundIndexes[2]);\n break;\n case 2:\n // Two date fields are present\n indexesToRemove.push(foundIndexes[1]);\n break;\n }\n\n return indexesToRemove;\n }\n\n /**\n * Returns an array of indices corresponding to the positions of the given field IDs in the form error summary message array.\n *\n * @param fieldIds - An array of field IDs to search for in the form error summary message array.\n * @param formErrorSummaryMessage - An array of form error summary messages.\n * @returns An array of indices corresponding to the positions of the field IDs in the form error summary message array.\n */\n private getFormErrorSummaryIndex(\n fieldIds: string[],\n formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[],\n ): number[] {\n return fieldIds.reduce((acc: number[], field) => {\n const index = formErrorSummaryMessage.findIndex((error) => error.fieldId === field);\n return index !== -1 ? [...acc, index] : acc;\n }, []);\n }\n\n /**\n * Removes error summary messages from the given array based on the specified indexes.\n *\n * @param formErrorSummaryMessage - The array of error summary messages.\n * @param indexes - The indexes of the error summary messages to be removed.\n * @returns The updated array of error summary messages.\n */\n private removeErrorSummaryMessages(\n formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[],\n indexes: number[],\n ): IAbstractFormBaseFormErrorSummaryMessage[] {\n return formErrorSummaryMessage.filter((_, index) => !indexes.includes(index));\n }\n\n /**\n * Splits the form errors into two arrays based on the provided field IDs.\n * Errors with field IDs included in the fieldIds array will be moved to the removedFormErrors array,\n * while the remaining errors will be moved to the cleanFormErrors array.\n *\n * @param fieldIds - An array of field IDs to filter the form errors.\n * @param formErrors - An array of form errors to be split.\n * @returns An array containing two arrays: cleanFormErrors and removedFormErrors.\n */\n private splitFormErrors(\n fieldIds: string[],\n formErrors: IAbstractFormBaseFormError[],\n ): IAbstractFormBaseFormError[][] {\n const cleanFormErrors: IAbstractFormBaseFormError[] = [];\n const removedFormErrors: IAbstractFormBaseFormError[] = [];\n\n formErrors.forEach((error) => {\n if (fieldIds.includes(error.fieldId)) {\n removedFormErrors.push(error);\n } else {\n cleanFormErrors.push(error);\n }\n });\n\n return [cleanFormErrors, removedFormErrors];\n }\n\n /**\n * Manipulates the error message for specific fields in the formErrors array.\n * @param fields - An array of field IDs to target for error message manipulation.\n * @param messageOverride - The new error message to be used for the targeted fields.\n * @param errorType - The type of error to match for the targeted fields.\n * @param formErrors - An array of IFormError objects representing the form errors.\n * @returns An array of IFormError objects with the manipulated error messages.\n */\n private manipulateFormErrorMessage(\n fields: string[],\n messageOverride: string,\n errorType: string,\n formErrors: IAbstractFormBaseFormError[],\n ): IAbstractFormBaseFormError[] {\n const manipulatedFields: IAbstractFormBaseFormError[] = [];\n formErrors.forEach((field) => {\n if (fields.includes(field.fieldId)) {\n if (field.type === errorType) {\n manipulatedFields.push({ ...field, message: messageOverride });\n } else {\n manipulatedFields.push(field);\n }\n } else {\n manipulatedFields.push(field);\n }\n });\n\n return manipulatedFields;\n }\n\n /**\n * Retrieves the form errors with the highest priority.\n *\n * @param formErrors - An array of form errors.\n * @returns An array of form errors with the highest priority.\n */\n private getHighPriorityFormErrors(formErrors: IAbstractFormBaseFormError[]): IAbstractFormBaseFormError[] {\n // Get the lowest priority (1 is the highest priority, 3 is the lowest priority)\n const lowestPriority = Math.min(...formErrors.map((item) => item.priority));\n return formErrors.filter((item) => item.priority === lowestPriority);\n }\n\n /**\n * Focuses on the error summary element and scrolls to the top of the page.\n *\n * This method first triggers change detection to ensure the view is up-to-date.\n * It then selects the error summary element with the class 'govuk-error-summary'.\n * If the error summary element is found, it sets focus on it without scrolling the page.\n * Finally, it calls a utility service to scroll to the top of the page.\n *\n * @private\n */\n private focusAndScrollToErrorSummary(): void {\n this.changeDetectorRef.detectChanges();\n\n const errorSummary = document.querySelector('.govuk-error-summary') as HTMLElement;\n if (errorSummary) {\n errorSummary.focus({ preventScroll: true });\n this.utilsService.scrollToTop();\n }\n }\n\n /**\n * Setup listener for the form value changes and to emit hasUnsavedChanges\n */\n private setupListener(): void {\n this.form.valueChanges.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.unsavedChanges.emit(this.hasUnsavedChanges());\n });\n }\n\n /**\n * Adds controls to a form group.\n *\n * @param formGroup - The form group to add controls to.\n * @param controls - An array of form array control validations.\n * @param index - The index of the form array control.\n */\n protected addControlsToFormGroup(\n formGroup: FormGroup,\n controls: IAbstractFormArrayControlValidation[],\n index: number,\n ): void {\n controls.forEach(({ controlName, validators }) => {\n formGroup.addControl(`${controlName}_${index}`, new FormControl(null, validators));\n });\n }\n\n /**\n * Creates a form control with the specified validators and initial value.\n *\n * @param validators - An array of validator functions.\n * @param initialValue - The initial value for the form control. Defaults to null.\n * @returns The created form control.\n */\n protected createFormControl(validators: ValidatorFn[], initialValue: string | null = null): FormControl {\n return new FormControl(initialValue, { validators: [...validators] });\n }\n\n /**\n * Handles the error messages and populates the relevant variables\n */\n protected handleErrorMessages(): void {\n this.formErrors = this.getFormErrors(this.form);\n\n this.setErrorMessages(this.formErrors);\n\n this.formErrorSummaryMessage = this.removeErrorSummaryMessages(\n this.formErrorSummaryMessage,\n this.getDateFieldsToRemoveIndexes(),\n );\n }\n\n /**\n * Checks whether the form has been touched and submitted\n *\n * @returns boolean\n */\n protected hasUnsavedChanges(): boolean {\n return this.form.dirty && !this.formSubmitted;\n }\n\n /**\n * Sets the value of a specified form control and marks it as touched.\n *\n * @param {string} value - The value to set for the form control.\n * @param {string} control - The name of the form control to update.\n */\n protected setInputValue(value: string, control: string) {\n this.form.controls[control].patchValue(value);\n this.form.controls[control].markAsTouched();\n }\n\n /**\n * Handles the form errors for the date input fields.\n * @param formErrors - An array of form errors.\n * @returns An array of form errors with the manipulated error messages.\n */\n protected handleDateInputFormErrors() {\n const dateInputFields = ['dayOfMonth', 'monthOfYear', 'year'];\n const splitFormErrors = this.splitFormErrors(dateInputFields, this.formErrors);\n const highPriorityDateControlErrors = this.getHighPriorityFormErrors(splitFormErrors[1]);\n let manipulatedFormErrors: IAbstractFormBaseFormError[] = highPriorityDateControlErrors;\n\n // If we have more than one error then we want to manipulate the error message\n if (highPriorityDateControlErrors.length > 1) {\n manipulatedFormErrors = this.manipulateFormErrorMessage(\n dateInputFields,\n 'Please enter a DOB',\n 'required',\n manipulatedFormErrors,\n );\n }\n\n return [...splitFormErrors[0], ...manipulatedFormErrors];\n }\n\n /**\n * Sets the initial error messages for the form controls.\n *\n * @param form - The FormGroup instance.\n */\n protected setInitialErrorMessages(): void {\n const formControls = this.form.controls;\n const initialFormControlErrorMessages: IAbstractFormControlErrorMessage = {};\n\n Object.keys(formControls).forEach((controlName) => {\n initialFormControlErrorMessages[controlName] = null;\n });\n\n this.formControlErrorMessages = initialFormControlErrorMessages;\n this.formErrorSummaryMessage = [];\n }\n\n /**\n * Repopulates the search form with the data from the account enquiry search.\n * @param state - The state object containing the search form data.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected rePopulateForm(state: any): void {\n this.form.patchValue(state);\n }\n\n /**\n * Adds a new form control to the form group.\n *\n * @param controlName - The name of the control to add.\n * @param validators - An array of validators to apply to the control.\n */\n protected createControl(controlName: string, validators: ValidatorFn[]): void {\n this.form.addControl(controlName, new FormControl(null, validators));\n }\n\n /**\n * Updates the validators of an existing form control.\n *\n * @param controlName - The name of the control to update.\n * @param validators - An array of validators to apply to the control.\n */\n protected updateControl(controlName: string, validators: ValidatorFn[]): void {\n const control = this.form.get(controlName);\n if (control) {\n control.setValidators(validators);\n control.updateValueAndValidity();\n } else {\n this.createControl(controlName, validators);\n }\n }\n\n /**\n * Removes a control from the form.\n *\n * @param controlName - The name of the control to remove.\n */\n protected removeControl(controlName: string): void {\n if (this.formControlErrorMessages[controlName]) {\n this.removeControlErrors(controlName);\n }\n this.form.removeControl(controlName);\n }\n\n /**\n * Removes the error message associated with the specified control name from the formControlErrorMessages object.\n *\n * @param controlName - The name of the control for which to remove the error message.\n */\n protected removeControlErrors(controlName: string): void {\n delete this.formControlErrorMessages[controlName];\n }\n\n /**\n * Clears the search form.\n */\n public handleClearForm(): void {\n this.form.reset();\n }\n\n /**\n * Handles the scroll of the component error from the summary\n *\n * @param fieldId - Field id of the component\n */\n public scrollTo(fieldId: string): void {\n this['scroll'](fieldId);\n }\n\n /**\n * Handles route with the supplied route\n *\n * @param route string of route\n * @param nonRelative boolean indicating if route is relative to the parent\n */\n public handleRoute(route: string, nonRelative: boolean = false, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n this.unsavedChanges.emit(this.hasUnsavedChanges());\n if (nonRelative) {\n this.router.navigate([route]);\n } else {\n this.router.navigate([route], { relativeTo: this.activatedRoute.parent });\n }\n }\n\n /**\n * Handles the form submission event.\n *\n * @param event - The form submission event.\n * @returns void\n */\n public handleFormSubmit(event: SubmitEvent): void {\n this.handleErrorMessages();\n\n if (this.form.valid) {\n this.formSubmitted = true;\n const nestedFlow = event.submitter ? event.submitter.className.includes('nested-flow') : false;\n this.unsavedChanges.emit(this.hasUnsavedChanges());\n this.formSubmit.emit({ formData: this.form.value, nestedFlow: nestedFlow });\n } else {\n this.focusAndScrollToErrorSummary();\n }\n }\n\n /**\n * Handles the input event to convert all letters in the input value to uppercase.\n * This method is triggered by an input event and modifies the input value directly.\n *\n * @param event - The input event triggered by the user.\n */\n public handleUppercaseInputMask(event: Event): void {\n const input = event.target as HTMLInputElement;\n input.value = this.utilsService.upperCaseAllLetters(input.value);\n }\n\n public ngOnInit(): void {\n if (this.form) {\n this.setupListener();\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n}\n","import { AbstractFormBaseComponent } from '../abstract-form-base/abstract-form-base.component';\nimport { takeUntil } from 'rxjs';\nimport { Component, OnDestroy, OnInit } from '@angular/core';\nimport { IAbstractFormAliasBaseAliasControls } from './interfaces/abstract-form-alias-base-alias-controls.interface';\nimport { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';\nimport { IAbstractFormArrayControls } from '../interfaces/abstract-form-array-controls.interface';\nimport { FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { IAbstractFormArrayControl } from '../interfaces/abstract-form-array-control.interface';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n public aliasControls: IAbstractFormAliasBaseAliasControls[] = [];\n public aliasControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public aliasFields: string[] = [];\n\n /**\n * Builds an array of form controls for the given form array.\n *\n * @param formControlCount - An array of numbers representing the number of form controls to create.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - An array of field names.\n * @param controlValidation - An array of control validation objects.\n * @returns An array of form controls for the given form array.\n */\n private buildFormAliasControls(\n formControlCount: number[],\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): IAbstractFormArrayControls[] {\n // Directly map each index to a control\n return formControlCount.map((_element, index) =>\n this.addAliasControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds alias controls to the form array.\n *\n * @param index - The index of the form array.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the fields for the alias controls.\n * @param controlValidation - The validation rules for the alias controls.\n * @returns An object containing the form controls.\n */\n private addAliasControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formAliases = this.form.get(formArrayName) as FormArray;\n const formAliasesFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createAliasControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formAliasesFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formAliases.push(formAliasesFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Removes all form alias controls from a FormArray and clears any associated error messages.\n *\n * @param formArrayControls - An array of form array controls.\n * @param formArrayName - The name of the FormArray.\n * @param fieldNames - An array of field names associated with the form array controls.\n * @returns An empty array of form array controls.\n */\n private removeAllFormAliasControls(\n formArrayControls: IAbstractFormArrayControls[],\n formArrayName: string,\n fieldNames: string[],\n ): [] {\n const control = this.form.get(formArrayName) as FormArray;\n\n // Clear the error messages...\n [...formArrayControls].forEach((_element, index) => {\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n });\n\n // Reset the form array controls...\n control.clear();\n\n // Return en empty array of form array controls...\n return [];\n }\n\n /**\n * Creates a FormArray with the specified validators and controls.\n *\n * @param validators - An array of validators to apply to the FormArray.\n * @param controls - An optional array of initial FormControl instances to add to the FormArray.\n * @returns A new FormArray instance.\n */\n protected createFormAlias(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Removes a form alias control at the specified index from the given form array controls.\n *\n * @param index - The index of the form alias control to remove.\n * @param formArrayControls - The array of form array controls.\n * @returns The updated array of form array controls after removing the specified control.\n */\n protected removeFormAliasControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Sets up the alias form controls based on the provided alias count array and form array name.\n * If there are any aliases, the alias controls will be re-populated.\n *\n * @param aliasCountArray - An array containing the count of aliases.\n * @param formArrayName - The name of the form array.\n */\n protected setupAliasFormControls(aliasCountArray: number[], formArrayName: string): void {\n // Re-populate the alias controls if there are any aliases\n if (aliasCountArray.length) {\n this.aliasControls = this.buildFormAliasControls(\n aliasCountArray,\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n }\n }\n\n /**\n * Removes the form alias controls errors for a specific index in a form array.\n *\n * @param index - The index of the form array control.\n * @param formArrayControls - An array of form array controls.\n * @param fieldNames - An array of field names to remove errors from.\n */\n protected removeFormAliasControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n fieldNames.forEach((field) => {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n });\n }\n }\n\n /**\n * Creates alias controls for the given fields and index.\n * @param fields - The list of fields for which alias controls need to be created.\n * @param index - The index value used to generate unique identifiers for the controls.\n * @returns An object containing the alias controls.\n */\n protected createAliasControls(fields: string[], index: number): { [key: string]: IAbstractFormArrayControl } {\n return fields.reduce(\n (controls, field) => ({\n ...controls,\n [field]: {\n inputId: `${field}_${index}`,\n inputName: `${field}_${index}`,\n controlName: `${field}_${index}`,\n },\n }),\n {},\n );\n }\n\n /**\n * Sets up the alias checkbox listener.\n *\n * @param formCheckboxName - The name of the checkbox control in the form.\n * @param formArrayName - The name of the form array control in the form.\n */\n protected setUpAliasCheckboxListener(formCheckboxName: string, formArrayName: string): void {\n // Ensure any existing subscription is cleared to avoid memory leaks\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n\n const addAliasControl = this.form.get(formCheckboxName);\n if (!addAliasControl) {\n return;\n }\n\n addAliasControl.valueChanges.pipe(takeUntil(this['ngUnsubscribe'])).subscribe((shouldAddAlias) => {\n this.aliasControls = shouldAddAlias\n ? this.buildFormAliasControls([0], formArrayName, this.aliasFields, this.aliasControlsValidation)\n : this.removeAllFormAliasControls(this.aliasControls, formArrayName, this.aliasFields);\n });\n }\n\n /**\n * Removes a form alias control from a form array and updates the list of form array controls.\n * @param index - The index of the form alias control to be removed.\n * @param formArrayName - The name of the form array.\n * @param formArrayControls - The list of form array controls.\n * @param fieldNames - The names of the fields associated with the form array controls.\n * @returns The updated list of form array controls after removing the specified control.\n */\n public removeFormAliasControls(\n index: number,\n formArrayName: string,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): IAbstractFormArrayControls[] {\n // Get the form array...\n const control = this.form.get(formArrayName) as FormArray;\n\n // Remove the form array control based on index\n control.removeAt(index);\n\n // Then remove the form array controls errors...\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormAliasControl(index, formArrayControls);\n }\n\n /**\n * Adds an alias to the specified index of the form array.\n *\n * @param index - The index at which to add the alias.\n * @param formArrayName - The name of the form array.\n */\n public addAlias(index: number, formArrayName: string): void {\n this.aliasControls.push(\n this.addAliasControls(index, formArrayName, this.aliasFields, this.aliasControlsValidation),\n );\n }\n\n /**\n * Removes an alias from the form array.\n *\n * @param index - The index of the alias to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeAlias(index: number, formArrayName: string): void {\n this.aliasControls = this.removeFormAliasControls(index, formArrayName, this.aliasControls, this.aliasFields);\n }\n\n public override ngOnInit(): void {\n super.ngOnInit();\n }\n\n public override ngOnDestroy(): void {\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n super.ngOnDestroy();\n }\n}\n","import { Component, OnDestroy, OnInit } from '@angular/core';\nimport { AbstractFormBaseComponent } from '../abstract-form-base/abstract-form-base.component';\nimport { IAbstractFormArrayControls } from '../interfaces/abstract-form-array-controls.interface';\nimport { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';\nimport { AbstractControl, FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { IAbstractFormArrayControl } from '../interfaces/abstract-form-array-control.interface';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n public formArrayControls: IAbstractFormArrayControls[] = [];\n public formArrayControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public formArrayFields: string[] = [];\n\n /**\n * Builds an array of form controls for a form array.\n *\n * @param formControlCount - An array of numbers representing the number of form controls to create.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - An array of field names for the form controls.\n * @param controlValidation - An array of control validation configurations.\n * @returns An array of form controls for the form array.\n */\n private buildFormArrayControls(\n formControlCount: number[],\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): IAbstractFormArrayControls[] {\n // Directly map each index to a control\n return formControlCount.map((_element, index) =>\n this.addFormArrayControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds form array controls to the specified form array.\n *\n * @param index - The index at which the form array controls should be added.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the form controls to be created.\n * @param controlValidation - The validation rules for the form controls.\n * @returns An object containing the form controls that were added.\n */\n private addFormArrayControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formArray = this.form.get(formArrayName) as FormArray;\n const formArrayFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createFormArrayControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formArrayFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formArray.push(formArrayFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Creates a new instance of FormArray with the specified validators and controls.\n *\n * @param validators - An array of validator functions to be applied to the form array.\n * @param controls - An optional array of form controls to initialize the form array with.\n * @returns A new instance of FormArray.\n */\n protected createFormArray(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Sets up the form array form controls based on the provided parameters.\n *\n * @param formArrayCountArray - An array of numbers representing the count of form array controls.\n * @param formArrayName - The name of the form array.\n */\n protected setupFormArrayFormControls(formArrayCountArray: number[], formArrayName: string): void {\n if (formArrayCountArray.length) {\n this.formArrayControls = this.buildFormArrayControls(\n formArrayCountArray,\n formArrayName,\n this.formArrayFields,\n this.formArrayControlsValidation,\n );\n }\n }\n\n /**\n * Creates an object with form array controls based on the given fields and index.\n *\n * @param fields - An array of field names.\n * @param index - The index of the form array.\n * @returns An object with form array controls.\n */\n protected createFormArrayControls(fields: string[], index: number): { [key: string]: IAbstractFormArrayControl } {\n return fields.reduce(\n (controls, field) => ({\n ...controls,\n [field]: {\n inputId: `${field}_${index}`,\n inputName: `${field}_${index}`,\n controlName: `${field}_${index}`,\n },\n }),\n {},\n );\n }\n\n /**\n * Removes form array controls errors for a specific index.\n *\n * @param index - The index of the form array control.\n * @param formArrayControls - An array of form array controls.\n * @param fieldNames - An array of field names to remove errors from.\n */\n protected removeFormArrayControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n fieldNames.forEach((field) => {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n });\n }\n }\n\n /**\n * Adds controls to the form array at the specified index.\n *\n * @param index - The index at which the controls should be added.\n * @param formArrayName - The name of the form array.\n */\n public addControlsToFormArray(index: number, formArrayName: string): void {\n this.formArrayControls.push(\n this.addFormArrayControls(index, formArrayName, this.formArrayFields, this.formArrayControlsValidation),\n );\n }\n\n /**\n * Removes a form array control at the specified index from the given array of form array controls.\n *\n * @param index - The index of the form array control to be removed.\n * @param formArrayControls - The array of form array controls.\n * @returns The updated array of form array controls after removing the specified control.\n */\n protected removeFormArrayControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Retrieves the value of a form control or returns a default value if the control is null or undefined.\n *\n * @param control - The form control to retrieve the value from.\n * @param defaultValue - The default value to return if the control is null or undefined.\n * @returns The value of the control if it exists, otherwise the default value.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected getControlValueOrDefault(control: AbstractControl | null, defaultValue: any): any {\n return control?.value || defaultValue;\n }\n\n /**\n * Removes a form array control at the specified index and updates the form array controls and errors.\n *\n * @param index - The index of the form array control to remove.\n * @param formArrayName - The name of the form array.\n * @param formArrayControls - The list of form array controls.\n * @param fieldNames - The names of the fields associated with the form array controls.\n * @returns The updated list of form array controls.\n */\n public removeFormArrayControls(\n index: number,\n formArrayName: string,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): IAbstractFormArrayControls[] {\n // Get the form array...\n const control = this.form.get(formArrayName) as FormArray;\n\n // Remove the form array control based on index\n control.removeAt(index);\n\n // Then remove the form array controls errors...\n this.removeFormArrayControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormArrayControl(index, formArrayControls);\n }\n\n /**\n * Removes controls from a form array at the specified index.\n *\n * @param index - The index at which to remove the controls.\n * @param formArrayName - The name of the form array.\n */\n public removeControlsFromFormArray(index: number, formArrayName: string): void {\n this.formArrayControls = this.removeFormArrayControls(\n index,\n formArrayName,\n this.formArrayControls,\n this.formArrayFields,\n );\n }\n\n /**\n * Removes a form array control from the specified form array.\n *\n * @param formArrayControl - The form array control to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeFormArrayControlFromArray(formArrayControl: IAbstractFormArrayControls, formArrayName: string): void {\n const formArrayControlIndex = this.formArrayControls.findIndex((control) => control === formArrayControl);\n this.removeFormArrayControls(formArrayControlIndex, formArrayName, this.formArrayControls, this.formArrayFields);\n }\n\n /**\n * Retrieves the FormGroup at the specified index from a FormArray.\n *\n * @param index - The index of the FormGroup to retrieve.\n * @param formArrayName - The name of the FormArray.\n * @returns The FormGroup at the specified index.\n */\n public getFormArrayFormGroup(index: number, formArrayName: string): FormGroup {\n const formArray = this.form.get(formArrayName) as FormArray;\n return formArray.controls[index] as FormGroup;\n }\n\n /**\n * Retrieves the FormControl from a FormGroup within a FormArray at the specified index.\n *\n * @param formGroup - The FormGroup containing the FormControl.\n * @param controlName - The name of the FormControl.\n * @param index - The index of the FormArray.\n * @returns The FormControl at the specified index.\n */\n public getFormArrayFormGroupControl(formGroup: FormGroup, controlName: string, index: number): FormControl {\n return formGroup.controls[`${controlName}_${index}`] as FormControl;\n }\n\n /**\n * Adds validators to a specific form control within a form array group.\n *\n * @param formGroup - The form group containing the form array.\n * @param controlName - The name of the form control within the form array group.\n * @param index - The index of the form array group within the form array.\n * @param validators - An array of validator functions to be added to the form control.\n */\n public addFormArrayFormGroupControlValidators(formControl: FormControl, validators: ValidatorFn[]): void {\n formControl.setValidators(validators);\n formControl.updateValueAndValidity({ emitEvent: false });\n }\n\n /**\n * Removes validators from a specific form control within a form array group.\n * @param formGroup - The form group containing the form array.\n * @param controlName - The name of the form control within the form array group.\n * @param index - The index of the form array group within the form array.\n */\n public removeFormArrayFormGroupControlValidators(formControl: FormControl): void {\n formControl.clearValidators();\n formControl.setErrors(null);\n formControl.setValue(null, { emitEvent: false });\n formControl.updateValueAndValidity({ emitEvent: false });\n }\n\n /**\n * Reverses the form array data by appending the index to each key in the objects.\n *\n * @param data - An array of objects containing form data.\n * @returns An array of objects with keys modified to include their index in the original array.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public addIndexToFormArrayData(data: any[]): { [key: string]: any }[] {\n return data.map((item, index) =>\n Object.entries(item).reduce(\n (indexedObject, [key, value]) => {\n if (value !== undefined) {\n indexedObject[`${key}_${index}`] = value;\n }\n return indexedObject;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {} as { [key: string]: any },\n ),\n );\n }\n\n public override ngOnInit(): void {\n super.ngOnInit();\n }\n\n public override ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n super.ngOnDestroy();\n }\n}\n","import { inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { CanDeactivateTypes } from '@hmcts/opal-frontend-common/types';\n\nexport abstract class AbstractFormParentBaseComponent {\n private readonly router = inject(Router);\n private readonly activatedRoute = inject(ActivatedRoute);\n\n public stateUnsavedChanges!: boolean;\n\n /**\n * If the user navigates externally from the site or closes the tab\n * Check if there is unsaved changes form state -> warning message\n * Otherwise -> no warning message\n *\n * @returns boolean\n */\n canDeactivate(): CanDeactivateTypes {\n if (this.stateUnsavedChanges) {\n return false;\n } else {\n return true;\n }\n }\n\n /**\n * Navigates to the specified route using the Angular router.\n *\n * @param route - The route to navigate to.\n */\n protected routerNavigate(route: string, nonRelative: boolean = false, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n\n if (nonRelative) {\n this.router.navigate([route]);\n } else {\n this.router.navigate([route], { relativeTo: this.activatedRoute.parent });\n }\n }\n\n /**\n * Checks if an object has any non-empty values.\n *\n * @param form - The object representing form data with key-value pairs.\n * @returns A boolean indicating whether the object has any non-empty values.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected hasFormValues(form: { [key: string]: any }): boolean {\n return Object.values(form).some(Boolean);\n }\n}\n","import { AbstractFormParentBaseComponent } from '../abstract-form-parent-base/abstract-form-parent-base.component';\n\nexport abstract class AbstractFormArrayParentBaseComponent extends AbstractFormParentBaseComponent {\n /**\n * Removes index suffixes from keys in an array of objects and restructures the data.\n *\n * This function takes an array of objects where keys have an index suffix (e.g., `key_0`, `key_1`),\n * and returns a new array of objects where the keys are grouped by their base name without the index.\n *\n * @param data - The array of objects with indexed keys.\n * @returns A new array of objects with keys grouped by their base name.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public removeIndexFromFormArrayData(data: any[]): any[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return data.reduce((result: any[], indexedObject) => {\n let currentIndex!: number;\n Object.keys(indexedObject).forEach((key) => {\n const match = RegExp(/^(.*)_(\\d+)$/).exec(key);\n if (match) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, baseKey, index] = match;\n const idx = parseInt(index, 10);\n\n currentIndex = idx; // Set the current index based on the last indexed key\n\n result[idx] = result[idx] || {};\n result[idx][baseKey] = indexedObject[key];\n } else {\n // For non-indexed keys, use the currentIndex if available\n result[currentIndex] = result[currentIndex] || {};\n result[currentIndex][key] = indexedObject[key];\n }\n });\n return result;\n }, []);\n }\n}\n","import { FormArray, FormGroup } from '@angular/forms';\nimport { Component, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { IAbstractFormArrayRemovalBaseControlValue } from './interfaces/abstract-form-array-removal-base-control-value.interface';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormArrayRemovalComponent {\n private readonly router = inject(Router);\n private readonly activatedRoute = inject(ActivatedRoute);\n\n protected getFormArrayControlValue(\n formArray: FormArray,\n controlName: string,\n rowIndex: number,\n defaultValue: IAbstractFormArrayRemovalBaseControlValue[keyof IAbstractFormArrayRemovalBaseControlValue],\n ): IAbstractFormArrayRemovalBaseControlValue[keyof IAbstractFormArrayRemovalBaseControlValue] {\n const value = formArray.controls[rowIndex]?.get(controlName)?.value;\n\n if (typeof value === 'string' && !isNaN(Number(value))) {\n return Number(value);\n }\n\n return value ?? defaultValue;\n }\n\n /**\n * Removes a control from the given form array at the specified index and renumbers the remaining controls.\n *\n * @param formArray - The form array from which to remove the control.\n * @param removeIndex - The index of the control to remove.\n * @param fieldNames - The names of the fields associated with the controls.\n * @param dynamicFieldPrefix - The prefix used for dynamically generated field names.\n */\n protected removeControlAndRenumber(\n formArray: FormArray,\n removeIndex: number,\n fieldNames: string[],\n dynamicFieldPrefix: string,\n ): void {\n formArray.removeAt(removeIndex);\n this.renumberControls(formArray, removeIndex, fieldNames, dynamicFieldPrefix);\n }\n\n /**\n * Renumber the controls in a FormArray starting from a specific index.\n * This method updates the control keys of each FormGroup within the FormArray.\n *\n * @param formArray - The FormArray to renumber the controls for.\n * @param startIndex - The index to start renumbering the controls from.\n * @param fieldNames - The names of the fields in the FormGroup.\n * @param dynamicFieldPrefix - The prefix to use for dynamic field names.\n */\n protected renumberControls(\n formArray: FormArray,\n startIndex: number,\n fieldNames: string[],\n dynamicFieldPrefix: string,\n ): void {\n const formGroups = formArray.controls.slice(startIndex);\n for (const [index, formGroup] of formGroups.entries()) {\n this.updateControlKeys(formGroup as FormGroup, index + startIndex, fieldNames, dynamicFieldPrefix);\n }\n }\n\n /**\n * Updates the control keys in a form group based on the provided parameters.\n * @param formGroup - The form group to update.\n * @param index - The index of the form group within an array.\n * @param fieldNames - An array of field names to update.\n * @param dynamicFieldPrefix - The prefix to use for dynamic field keys.\n */\n protected updateControlKeys(\n formGroup: FormGroup,\n index: number,\n fieldNames: string[],\n dynamicFieldPrefix: string,\n ): void {\n fieldNames.forEach((field) => {\n const currentKey = `${dynamicFieldPrefix}_${field}_${index + 1}`;\n const newKey = `${dynamicFieldPrefix}_${field}_${index}`;\n\n // Retrieve the current control, if it exists\n const control = formGroup.get(currentKey);\n\n if (control) {\n // Remove the old control first, then add it with the new key\n formGroup.removeControl(currentKey);\n\n // Add the control with the updated key\n formGroup.addControl(newKey, control);\n }\n });\n }\n\n /**\n * Handles route with the supplied route\n *\n * @param route string of route\n * @param nonRelative boolean indicating if route is relative to the parent\n */\n public handleRoute(route: string, nonRelative: boolean = false, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n if (nonRelative) {\n this.router.navigate([route]);\n } else {\n this.router.navigate([route], { relativeTo: this.activatedRoute.parent });\n }\n }\n}\n","import { Component, EventEmitter, OnInit, Output, inject, signal } from '@angular/core';\nimport { IAbstractSortState, IAbstractTableData } from './interfaces/abstract-sortable-table-interfaces';\nimport { SortService } from '@hmcts/opal-frontend-common/services';\nimport { SortableValues, SortDirectionType } from '@hmcts/opal-frontend-common/types';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractSortableTableComponent implements OnInit {\n private readonly sortService = inject(SortService);\n\n public abstractTableDataSignal = signal<IAbstractTableData<SortableValues>[]>([]);\n public abstractExistingSortState: IAbstractSortState | null = null;\n public sortStateSignal = signal<IAbstractSortState>({});\n public sortedColumnTitleSignal = signal<string>('');\n public sortedColumnDirectionSignal = signal<SortDirectionType>('none');\n\n @Output() abstractSortState = new EventEmitter<IAbstractSortState>();\n\n /**\n * Creates an initial sort state for a table based on the provided table data.\n *\n * @param tableData - Array of table data objects representing table rows.\n * @returns Initial sort state object with column names as keys and 'none' as values.\n */\n private createSortState(tableData: IAbstractTableData<SortableValues>[] | null): IAbstractSortState {\n return tableData?.length\n ? Object.keys(tableData[0]).reduce<IAbstractSortState>((state, key) => {\n state[key] = 'none';\n return state;\n }, {})\n : {};\n }\n /**\n * Initializes the sort state for the sortable table component.\n *\n * This method sets the initial sort state based on the existing sort state or creates a new one\n * if none exists. It then updates the sort state signal with the initial sort state.\n *\n * If an existing sort state is found, it iterates over each entry and triggers the sort change\n * for each key that has a sort type other than 'none'.\n *\n * @private\n * @returns {void}\n */\n private initialiseSortState(): void {\n const existingSortState = this.abstractExistingSortState;\n const initialSortState = existingSortState || this.createSortState(this.abstractTableDataSignal());\n\n this.sortStateSignal.set(initialSortState);\n\n if (existingSortState) {\n Object.entries(existingSortState).forEach(([key, sortType]) => {\n if (sortType !== 'none') {\n this.onSortChange({ key, sortType });\n }\n });\n }\n this.getSortedColumn();\n }\n\n /**\n * Updates the sort state for a given column key and sort type.\n * Resets the sort state for all other columns to 'none'.\n *\n * @param key - The column to sort by.\n * @param sortType - Sorting order ('ascending' or 'descending').\n */\n private updateSortState(key: string, sortType: 'ascending' | 'descending'): void {\n this.sortStateSignal.set(\n Object.keys(this.sortStateSignal()).reduce<IAbstractSortState>((state, columnKey) => {\n state[columnKey] = columnKey === key ? sortType : 'none';\n return state;\n }, {}),\n );\n }\n\n /**\n * Retrieves the sorted table data based on the specified key and sort type.\n *\n * @param key - The key of the property to sort by.\n * @param sortType - The type of sorting to apply, either 'ascending' or 'descending'.\n * @returns An array of sorted table data objects.\n */\n private getSortedTableData(key: string, sortType: 'ascending' | 'descending'): IAbstractTableData<SortableValues>[] {\n return sortType === 'ascending'\n ? (this.sortService.sortObjectArrayAsc(\n this.abstractTableDataSignal(),\n key,\n ) as IAbstractTableData<SortableValues>[])\n : (this.sortService.sortObjectArrayDesc(\n this.abstractTableDataSignal(),\n key,\n ) as IAbstractTableData<SortableValues>[]);\n }\n\n /**\n * Determines the first column with a sort state other than 'none' and updates the sorted column signals accordingly.\n *\n * - If a sorted column is found, updates the `sortedColumnTitleSignal` and `sortedColumnDirectionSignal` with the column key and state.\n * - If no sorted column is found, sets the `sortedColumnTitleSignal` to an empty string and `sortedColumnDirectionSignal` to 'none'.\n *\n * @private\n * @returns {void}\n */\n private getSortedColumn(): void {\n // Find the first column that has a sort state other than 'none'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const sortedColumn = Object.entries(this.sortStateSignal()).find(([_, state]) => state !== 'none');\n\n // If a sorted column is found, set the signal to the sorted column key and state\n if (sortedColumn) {\n const [columnKey, state] = sortedColumn;\n this.sortedColumnTitleSignal.set(columnKey);\n this.sortedColumnDirectionSignal.set(state);\n } else {\n // Otherwise, set the signal to null\n this.sortedColumnTitleSignal.set('');\n this.sortedColumnDirectionSignal.set('none');\n }\n }\n\n /**\n * Handles the change in sorting for the table.\n *\n * @param event - An object containing the key to sort by and the sort type.\n * @param event.key - The key of the column to sort.\n * @param event.sortType - The type of sorting to apply ('ascending' or 'descending').\n *\n * This method updates the sort state, sorts the table data based on the provided key and sort type,\n * updates the table data signal, and emits the updated sort state.\n */\n protected onSortChange(event: { key: string; sortType: 'ascending' | 'descending' }): void {\n const { key, sortType } = event;\n\n this.updateSortState(key, sortType);\n this.getSortedColumn();\n const sortedData = this.getSortedTableData(key, sortType);\n\n // Update the table data signal\n this.abstractTableDataSignal.set(sortedData);\n\n // Emit the updated sort state\n this.abstractSortState.emit(this.sortStateSignal());\n }\n\n /**\n * Lifecycle hook to initialise the sort state.\n */\n public ngOnInit(): void {\n this.initialiseSortState();\n }\n}\n","import { Component, computed, signal } from '@angular/core';\nimport { AbstractSortableTableComponent } from '../abstract-sortable-table/abstract-sortable-table.component';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractSortableTablePaginationComponent extends AbstractSortableTableComponent {\n // Signal for the current page. Used to calculate the start and end indices for pagination.\n public currentPageSignal = signal(1);\n\n // Signal for the number of items per page. Determines how many items are displayed on each page.\n public itemsPerPageSignal = signal(10);\n\n // Signal for the start index (1-based). Automatically updates when `currentPageSignal` or `itemsPerPageSignal` changes.\n public startIndexComputed = computed(() => {\n const currentPage = this.currentPageSignal();\n return (currentPage - 1) * this.itemsPerPageSignal() + 1;\n });\n\n // Signal for the end index (1-based). Automatically recalculates when `startIndexComputed` or `abstractTableDataSignal` changes.\n public endIndexComputed = computed(() => {\n const startIndex = this.startIndexComputed();\n return Math.min(startIndex + this.itemsPerPageSignal() - 1, this.abstractTableDataSignal().length);\n });\n\n // Computed signal for paginated table data. Reactively slices `abstractTableDataSignal` based on `startIndexComputed` and `endIndexComputed`.\n public paginatedTableDataComputed = computed(() => {\n const data = this.abstractTableDataSignal(); // Full table data\n\n return data.slice(this.startIndexComputed() - 1, this.endIndexComputed()); // Return paginated data subset\n });\n\n /**\n * Handles sorting changes and resets the page to the first page.\n *\n * @param event - The sorting event containing:\n * - `key`: The column key to sort by.\n * - `sortType`: The sorting order, either 'ascending' or 'descending'.\n *\n * Resets `currentPageSignal` to 1 and triggers re-sorting of `abstractTableDataSignal`.\n */\n public override onSortChange(event: { key: string; sortType: 'ascending' | 'descending' }): void {\n super.onSortChange(event); // Update the sort state and sort the data\n this.currentPageSignal.set(1); // Reset the page to the first page\n }\n\n /**\n * Handles the event when the page is changed.\n *\n * @param newPage - The new page number to set. If the provided page number is out of range,\n * it will be clamped between 1 and the total number of pages.\n */\n public onPageChange(newPage: number): void {\n const totalPages = Math.ceil(this.abstractTableDataSignal().length / this.itemsPerPageSignal());\n this.currentPageSignal.set(Math.max(1, Math.min(newPage, totalPages)));\n }\n}\n","// ABSTRACT CLASSES\nexport * from './abstract-form-alias-base/abstract-form-alias-base';\nexport * from './abstract-form-array-base/abstract-form-array-base';\nexport * from './abstract-form-array-parent-base/abstract-form-array-parent-base.component';\nexport * from './abstract-form-array-removal-base/abstract-form-array-removal-base.component';\nexport * from './abstract-form-base/abstract-form-base.component';\nexport * from './abstract-form-parent-base/abstract-form-parent-base.component';\nexport * from './abstract-sortable-table/abstract-sortable-table.component';\nexport * from './abstract-sortable-table-pagination/abstract-sortable-table-pagination.component';\n\n// INTERFACES\nexport * from './abstract-form-base/interfaces/abstract-form-base-field-error.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-field-errors.interface';\nexport * from './interfaces/abstract-form-base-form-error-summary-message.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-form-error.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-form.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-high-priority-form-error.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-status.interface';\nexport * from './interfaces/abstract-form-array-control-validation.interface';\nexport * from './interfaces/abstract-form-array-control.interface';\nexport * from './interfaces/abstract-form-array-controls.interface';\nexport * from './interfaces/abstract-form-base-form-error-summary-message.interface';\nexport * from './interfaces/abstract-form-control-error-message.interface';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAiBsB,yBAAyB,CAAA;AACzB,IAAA,cAAc,GAAG,IAAI,YAAY,EAAW;;AAE5C,IAAA,UAAU,GAAG,IAAI,YAAY,EAA8B;AAE9D,IAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC7C,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AAE/C,IAAA,IAAI;AACJ,IAAA,wBAAwB;AACxB,IAAA,uBAAuB;AACpB,IAAA,WAAW;IACX,aAAa,GAAG,KAAK;AACZ,IAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;AAC/C,IAAA,UAAU;AAEjB,IAAA,WAAA,GAAA;AAEA;;;;AAIG;AACK,IAAA,MAAM,CAAC,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SAAA,EAAA,CAAA;AAAxC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wCAAwC,+FAFlD,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEQ,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBAH7D,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;ACLD;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-components-abstract.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-base/abstract-form-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/abstract-form-alias-base.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-base/abstract-form-array-base.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-parent-base/abstract-form-parent-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-parent-base/abstract-form-array-parent-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-removal-base/abstract-form-array-removal-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table/abstract-sortable-table.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table-pagination/abstract-sortable-table-pagination.component.ts","../../../projects/opal-frontend-common/components/abstract/public-api.ts","../../../projects/opal-frontend-common/components/abstract/hmcts-opal-frontend-common-components-abstract.ts"],"sourcesContent":["import { ChangeDetectorRef, Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core';\nimport { FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Subject, takeUntil } from 'rxjs';\nimport { IAbstractFormBaseFieldError } from './interfaces/abstract-form-base-field-error.interface';\nimport { IAbstractFormBaseFieldErrors } from './interfaces/abstract-form-base-field-errors.interface';\nimport { IAbstractFormBaseFormError } from './interfaces/abstract-form-base-form-error.interface';\nimport { IAbstractFormBaseFormErrorSummaryMessage } from '../interfaces/abstract-form-base-form-error-summary-message.interface';\nimport { IAbstractFormBaseHighPriorityFormError } from './interfaces/abstract-form-base-high-priority-form-error.interface';\nimport { IAbstractFormBaseForm } from './interfaces/abstract-form-base-form.interface';\nimport { IAbstractFormControlErrorMessage } from '../interfaces/abstract-form-control-error-message.interface';\nimport { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';\nimport { UtilsService } from '@hmcts/opal-frontend-common/services';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormBaseComponent implements OnInit, OnDestroy {\n @Output() protected unsavedChanges = new EventEmitter<boolean>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Output() protected formSubmit = new EventEmitter<IAbstractFormBaseForm<any>>();\n\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private readonly router = inject(Router);\n private readonly activatedRoute = inject(ActivatedRoute);\n protected readonly utilsService = inject(UtilsService);\n\n public form!: FormGroup;\n public formControlErrorMessages!: IAbstractFormControlErrorMessage;\n public formErrorSummaryMessage!: IAbstractFormBaseFormErrorSummaryMessage[];\n protected fieldErrors!: IAbstractFormBaseFieldErrors;\n protected formSubmitted = false;\n protected readonly ngUnsubscribe = new Subject<void>();\n public formErrors!: IAbstractFormBaseFormError[];\n\n constructor() {}\n\n /**\n * Scrolls to the label of the component and focuses on the field id\n *\n * @param fieldId - Field id of the component\n */\n private scroll(fieldId: string): void {\n let labelTarget;\n let fieldElement;\n\n const autocompleteLabel = document.querySelector(`label[for=${fieldId}-autocomplete]`);\n const regularLabel = document.querySelector(`label[for=${fieldId}]`);\n const fieldsetLegend = document.querySelector(`#${fieldId} .govuk-fieldset__legend`);\n\n if (autocompleteLabel) {\n labelTarget = autocompleteLabel;\n fieldElement = document.getElementById(`${fieldId}-autocomplete`);\n } else {\n labelTarget = regularLabel || fieldsetLegend;\n fieldElement = document.getElementById(fieldId);\n }\n\n if (fieldElement) {\n if (labelTarget) {\n labelTarget.scrollIntoView({ behavior: 'smooth' });\n }\n fieldElement.focus();\n }\n }\n\n /**\n * Returns the highest priority form error from the given error keys and field errors.\n * @param errorKeys - An array of error keys.\n * @param fieldErrors - An object containing field errors.\n * @returns The highest priority form error or null if no errors are found.\n */\n private getHighestPriorityError(\n errorKeys: string[] = [],\n fieldErrors: IAbstractFormBaseFieldError = {},\n ): IAbstractFormBaseHighPriorityFormError | null {\n if (errorKeys.length && Object.keys(fieldErrors).length) {\n const errors = errorKeys.map((errorType: string) => {\n return {\n ...fieldErrors[errorType],\n type: errorType,\n };\n });\n\n const sortedErrors = [...errors].sort((a, b) => a.priority - b.priority);\n\n return sortedErrors[0];\n }\n return null;\n }\n\n /**\n * Retrieves the details of the highest priority form error for a given control path.\n * @param controlPath - The path to the control in the form.\n * @returns The details of the highest priority form error, or null if there are no errors.\n */\n private getFieldErrorDetails(controlPath: (string | number)[]): IAbstractFormBaseHighPriorityFormError | null {\n // Get the control\n const control = this.form.get(controlPath);\n\n // If we have errors\n const controlErrors = control?.errors;\n\n if (controlErrors) {\n /// Get all the error keys\n const controlKey = controlPath[controlPath.length - 1];\n const errorKeys = Object.keys(controlErrors) || [];\n const fieldErrors = this.fieldErrors[controlKey] || {};\n\n if (errorKeys.length && Object.keys(fieldErrors).length) {\n return this.getHighestPriorityError(errorKeys, fieldErrors);\n }\n }\n return null;\n }\n\n /**\n * Retrieves all form errors from the provided form and its nested form groups.\n *\n * @param form - The form group to retrieve errors from.\n * @param controlPath - An optional array representing the path to the current control within the form group.\n * @returns An array of form errors, each containing the field ID, error message, priority, and type.\n */\n private getFormErrors(form: FormGroup, controlPath: (string | number)[] = []): IAbstractFormBaseFormError[] {\n // recursively get all errors from all controls in the form including nested form group controls\n const formControls = form.controls;\n\n const errorSummary = Object.keys(formControls)\n .filter((controlName) => formControls[controlName].invalid)\n .map((controlName) => {\n const control = formControls[controlName];\n\n if (control instanceof FormGroup) {\n return this.getFormErrors(control, [...controlPath, controlName]);\n }\n\n if (control instanceof FormArray) {\n return control.controls\n .map((controlItem, index) => {\n // We only support FormGroups in FormArrays\n if (controlItem instanceof FormGroup) {\n return this.getFormErrors(controlItem, [...controlPath, controlName, index]);\n }\n\n return [];\n })\n .flat();\n }\n\n const getFieldErrorDetails = this.getFieldErrorDetails([...controlPath, controlName]);\n\n // Return the error summary entry\n // If we don't have the error details, return a null message\n return {\n fieldId: controlName,\n message: getFieldErrorDetails?.message ?? null,\n priority: getFieldErrorDetails?.priority ?? 999999999,\n type: getFieldErrorDetails?.type ?? null,\n };\n })\n .flat();\n\n // Remove any null errors\n return errorSummary.filter((item) => item?.message !== null);\n }\n\n /**\n * Sets the error messages for the form controls and error summary based on the provided form errors.\n * @param formErrors - An array of form errors containing field IDs and error messages.\n */\n private setErrorMessages(formErrors: IAbstractFormBaseFormError[]) {\n // Reset the form error messages\n this.formControlErrorMessages = {};\n this.formErrorSummaryMessage = [];\n\n // Set the form error messages based on the error summary entries\n formErrors.forEach((entry) => {\n this.formControlErrorMessages[entry.fieldId] = entry.message;\n this.formErrorSummaryMessage.push({ fieldId: entry.fieldId, message: entry.message });\n });\n }\n\n /**\n * Gets the indexes of the date fields to remove based on the form error summary message.\n * @returns An array of indexes representing the date fields to remove.\n */\n private getDateFieldsToRemoveIndexes(): number[] {\n const indexesToRemove: number[] = [];\n // The order of the field ids is important\n // this is the order in which we want to remove them\n const foundIndexes = this.getFormErrorSummaryIndex(\n ['dayOfMonth', 'monthOfYear', 'year'],\n this.formErrorSummaryMessage,\n );\n\n // Determine which indexes to remove based on the found fields\n switch (foundIndexes.length) {\n case 3:\n // All three date fields are present\n indexesToRemove.push(foundIndexes[1], foundIndexes[2]);\n break;\n case 2:\n // Two date fields are present\n indexesToRemove.push(foundIndexes[1]);\n break;\n }\n\n return indexesToRemove;\n }\n\n /**\n * Returns an array of indices corresponding to the positions of the given field IDs in the form error summary message array.\n *\n * @param fieldIds - An array of field IDs to search for in the form error summary message array.\n * @param formErrorSummaryMessage - An array of form error summary messages.\n * @returns An array of indices corresponding to the positions of the field IDs in the form error summary message array.\n */\n private getFormErrorSummaryIndex(\n fieldIds: string[],\n formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[],\n ): number[] {\n return fieldIds.reduce((acc: number[], field) => {\n const index = formErrorSummaryMessage.findIndex((error) => error.fieldId === field);\n return index !== -1 ? [...acc, index] : acc;\n }, []);\n }\n\n /**\n * Removes error summary messages from the given array based on the specified indexes.\n *\n * @param formErrorSummaryMessage - The array of error summary messages.\n * @param indexes - The indexes of the error summary messages to be removed.\n * @returns The updated array of error summary messages.\n */\n private removeErrorSummaryMessages(\n formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[],\n indexes: number[],\n ): IAbstractFormBaseFormErrorSummaryMessage[] {\n return formErrorSummaryMessage.filter((_, index) => !indexes.includes(index));\n }\n\n /**\n * Splits the form errors into two arrays based on the provided field IDs.\n * Errors with field IDs included in the fieldIds array will be moved to the removedFormErrors array,\n * while the remaining errors will be moved to the cleanFormErrors array.\n *\n * @param fieldIds - An array of field IDs to filter the form errors.\n * @param formErrors - An array of form errors to be split.\n * @returns An array containing two arrays: cleanFormErrors and removedFormErrors.\n */\n private splitFormErrors(\n fieldIds: string[],\n formErrors: IAbstractFormBaseFormError[],\n ): IAbstractFormBaseFormError[][] {\n const cleanFormErrors: IAbstractFormBaseFormError[] = [];\n const removedFormErrors: IAbstractFormBaseFormError[] = [];\n\n formErrors.forEach((error) => {\n if (fieldIds.includes(error.fieldId)) {\n removedFormErrors.push(error);\n } else {\n cleanFormErrors.push(error);\n }\n });\n\n return [cleanFormErrors, removedFormErrors];\n }\n\n /**\n * Manipulates the error message for specific fields in the formErrors array.\n * @param fields - An array of field IDs to target for error message manipulation.\n * @param messageOverride - The new error message to be used for the targeted fields.\n * @param errorType - The type of error to match for the targeted fields.\n * @param formErrors - An array of IFormError objects representing the form errors.\n * @returns An array of IFormError objects with the manipulated error messages.\n */\n private manipulateFormErrorMessage(\n fields: string[],\n messageOverride: string,\n errorType: string,\n formErrors: IAbstractFormBaseFormError[],\n ): IAbstractFormBaseFormError[] {\n const manipulatedFields: IAbstractFormBaseFormError[] = [];\n formErrors.forEach((field) => {\n if (fields.includes(field.fieldId)) {\n if (field.type === errorType) {\n manipulatedFields.push({ ...field, message: messageOverride });\n } else {\n manipulatedFields.push(field);\n }\n } else {\n manipulatedFields.push(field);\n }\n });\n\n return manipulatedFields;\n }\n\n /**\n * Retrieves the form errors with the highest priority.\n *\n * @param formErrors - An array of form errors.\n * @returns An array of form errors with the highest priority.\n */\n private getHighPriorityFormErrors(formErrors: IAbstractFormBaseFormError[]): IAbstractFormBaseFormError[] {\n // Get the lowest priority (1 is the highest priority, 3 is the lowest priority)\n const lowestPriority = Math.min(...formErrors.map((item) => item.priority));\n return formErrors.filter((item) => item.priority === lowestPriority);\n }\n\n /**\n * Focuses on the error summary element and scrolls to the top of the page.\n *\n * This method first triggers change detection to ensure the view is up-to-date.\n * It then selects the error summary element with the class 'govuk-error-summary'.\n * If the error summary element is found, it sets focus on it without scrolling the page.\n * Finally, it calls a utility service to scroll to the top of the page.\n *\n * @private\n */\n private focusAndScrollToErrorSummary(): void {\n this.changeDetectorRef.detectChanges();\n\n const errorSummary = document.querySelector('.govuk-error-summary') as HTMLElement;\n if (errorSummary) {\n errorSummary.focus({ preventScroll: true });\n this.utilsService.scrollToTop();\n }\n }\n\n /**\n * Setup listener for the form value changes and to emit hasUnsavedChanges\n */\n private setupListener(): void {\n this.form.valueChanges.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.unsavedChanges.emit(this.hasUnsavedChanges());\n });\n }\n\n /**\n * Adds controls to a form group.\n *\n * @param formGroup - The form group to add controls to.\n * @param controls - An array of form array control validations.\n * @param index - The index of the form array control.\n */\n protected addControlsToFormGroup(\n formGroup: FormGroup,\n controls: IAbstractFormArrayControlValidation[],\n index: number,\n ): void {\n controls.forEach(({ controlName, validators }) => {\n formGroup.addControl(`${controlName}_${index}`, new FormControl(null, validators));\n });\n }\n\n /**\n * Creates a form control with the specified validators and initial value.\n *\n * @param validators - An array of validator functions.\n * @param initialValue - The initial value for the form control. Defaults to null.\n * @returns The created form control.\n */\n protected createFormControl(validators: ValidatorFn[], initialValue: string | null = null): FormControl {\n return new FormControl(initialValue, { validators: [...validators] });\n }\n\n /**\n * Handles the error messages and populates the relevant variables\n */\n protected handleErrorMessages(): void {\n this.formErrors = this.getFormErrors(this.form);\n\n this.setErrorMessages(this.formErrors);\n\n this.formErrorSummaryMessage = this.removeErrorSummaryMessages(\n this.formErrorSummaryMessage,\n this.getDateFieldsToRemoveIndexes(),\n );\n }\n\n /**\n * Checks whether the form has been touched and submitted\n *\n * @returns boolean\n */\n protected hasUnsavedChanges(): boolean {\n return this.form.dirty && !this.formSubmitted;\n }\n\n /**\n * Sets the value of a specified form control and marks it as touched.\n *\n * @param {string} value - The value to set for the form control.\n * @param {string} control - The name of the form control to update.\n */\n protected setInputValue(value: string, control: string) {\n this.form.controls[control].patchValue(value);\n this.form.controls[control].markAsTouched();\n }\n\n /**\n * Handles the form errors for the date input fields.\n * @param formErrors - An array of form errors.\n * @returns An array of form errors with the manipulated error messages.\n */\n protected handleDateInputFormErrors() {\n const dateInputFields = ['dayOfMonth', 'monthOfYear', 'year'];\n const splitFormErrors = this.splitFormErrors(dateInputFields, this.formErrors);\n const highPriorityDateControlErrors = this.getHighPriorityFormErrors(splitFormErrors[1]);\n let manipulatedFormErrors: IAbstractFormBaseFormError[] = highPriorityDateControlErrors;\n\n // If we have more than one error then we want to manipulate the error message\n if (highPriorityDateControlErrors.length > 1) {\n manipulatedFormErrors = this.manipulateFormErrorMessage(\n dateInputFields,\n 'Please enter a DOB',\n 'required',\n manipulatedFormErrors,\n );\n }\n\n return [...splitFormErrors[0], ...manipulatedFormErrors];\n }\n\n /**\n * Sets the initial error messages for the form controls.\n *\n * @param form - The FormGroup instance.\n */\n protected setInitialErrorMessages(): void {\n const formControls = this.form.controls;\n const initialFormControlErrorMessages: IAbstractFormControlErrorMessage = {};\n\n Object.keys(formControls).forEach((controlName) => {\n initialFormControlErrorMessages[controlName] = null;\n });\n\n this.formControlErrorMessages = initialFormControlErrorMessages;\n this.formErrorSummaryMessage = [];\n }\n\n /**\n * Repopulates the search form with the data from the account enquiry search.\n * @param state - The state object containing the search form data.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected rePopulateForm(state: any): void {\n this.form.patchValue(state);\n }\n\n /**\n * Adds a new form control to the form group.\n *\n * @param controlName - The name of the control to add.\n * @param validators - An array of validators to apply to the control.\n */\n protected createControl(controlName: string, validators: ValidatorFn[]): void {\n this.form.addControl(controlName, new FormControl(null, validators));\n }\n\n /**\n * Updates the validators of an existing form control.\n *\n * @param controlName - The name of the control to update.\n * @param validators - An array of validators to apply to the control.\n */\n protected updateControl(controlName: string, validators: ValidatorFn[]): void {\n const control = this.form.get(controlName);\n if (control) {\n control.setValidators(validators);\n control.updateValueAndValidity();\n } else {\n this.createControl(controlName, validators);\n }\n }\n\n /**\n * Removes a control from the form.\n *\n * @param controlName - The name of the control to remove.\n */\n protected removeControl(controlName: string): void {\n if (this.formControlErrorMessages[controlName]) {\n this.removeControlErrors(controlName);\n }\n this.form.removeControl(controlName);\n }\n\n /**\n * Removes the error message associated with the specified control name from the formControlErrorMessages object.\n *\n * @param controlName - The name of the control for which to remove the error message.\n */\n protected removeControlErrors(controlName: string): void {\n delete this.formControlErrorMessages[controlName];\n }\n\n /**\n * Clears the search form.\n */\n public handleClearForm(): void {\n this.form.reset();\n }\n\n /**\n * Handles the scroll of the component error from the summary\n *\n * @param fieldId - Field id of the component\n */\n public scrollTo(fieldId: string): void {\n this['scroll'](fieldId);\n }\n\n /**\n * Handles route with the supplied route\n *\n * @param route string of route\n * @param nonRelative boolean indicating if route is relative to the parent\n */\n public handleRoute(route: string, nonRelative: boolean = false, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n this.unsavedChanges.emit(this.hasUnsavedChanges());\n if (nonRelative) {\n this.router.navigate([route]);\n } else {\n this.router.navigate([route], { relativeTo: this.activatedRoute.parent });\n }\n }\n\n /**\n * Handles the form submission event.\n *\n * @param event - The form submission event.\n * @returns void\n */\n public handleFormSubmit(event: SubmitEvent): void {\n this.handleErrorMessages();\n\n if (this.form.valid) {\n this.formSubmitted = true;\n const nestedFlow = event.submitter ? event.submitter.className.includes('nested-flow') : false;\n this.unsavedChanges.emit(this.hasUnsavedChanges());\n this.formSubmit.emit({ formData: this.form.value, nestedFlow: nestedFlow });\n } else {\n this.focusAndScrollToErrorSummary();\n }\n }\n\n /**\n * Handles the input event to convert all letters in the input value to uppercase.\n * This method is triggered by an input event and modifies the input value directly.\n *\n * @param event - The input event triggered by the user.\n */\n public handleUppercaseInputMask(event: Event): void {\n const input = event.target as HTMLInputElement;\n input.value = this.utilsService.upperCaseAllLetters(input.value);\n }\n\n public ngOnInit(): void {\n if (this.form) {\n this.setupListener();\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n}\n","import { AbstractFormBaseComponent } from '../abstract-form-base/abstract-form-base.component';\nimport { takeUntil } from 'rxjs';\nimport { Component, OnDestroy, OnInit } from '@angular/core';\nimport { IAbstractFormAliasBaseAliasControls } from './interfaces/abstract-form-alias-base-alias-controls.interface';\nimport { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';\nimport { IAbstractFormArrayControls } from '../interfaces/abstract-form-array-controls.interface';\nimport { FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { IAbstractFormArrayControl } from '../interfaces/abstract-form-array-control.interface';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n public aliasControls: IAbstractFormAliasBaseAliasControls[] = [];\n public aliasControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public aliasFields: string[] = [];\n\n /**\n * Builds an array of form controls for the given form array.\n *\n * @param formControlCount - An array of numbers representing the number of form controls to create.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - An array of field names.\n * @param controlValidation - An array of control validation objects.\n * @returns An array of form controls for the given form array.\n */\n private buildFormAliasControls(\n formControlCount: number[],\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): IAbstractFormArrayControls[] {\n // Directly map each index to a control\n return formControlCount.map((_element, index) =>\n this.addAliasControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds alias controls to the form array.\n *\n * @param index - The index of the form array.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the fields for the alias controls.\n * @param controlValidation - The validation rules for the alias controls.\n * @returns An object containing the form controls.\n */\n private addAliasControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formAliases = this.form.get(formArrayName) as FormArray;\n const formAliasesFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createAliasControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formAliasesFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formAliases.push(formAliasesFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Removes all form alias controls from a FormArray and clears any associated error messages.\n *\n * @param formArrayControls - An array of form array controls.\n * @param formArrayName - The name of the FormArray.\n * @param fieldNames - An array of field names associated with the form array controls.\n * @returns An empty array of form array controls.\n */\n private removeAllFormAliasControls(\n formArrayControls: IAbstractFormArrayControls[],\n formArrayName: string,\n fieldNames: string[],\n ): [] {\n const control = this.form.get(formArrayName) as FormArray;\n\n // Clear the error messages...\n [...formArrayControls].forEach((_element, index) => {\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n });\n\n // Reset the form array controls...\n control.clear();\n\n // Return en empty array of form array controls...\n return [];\n }\n\n /**\n * Creates a FormArray with the specified validators and controls.\n *\n * @param validators - An array of validators to apply to the FormArray.\n * @param controls - An optional array of initial FormControl instances to add to the FormArray.\n * @returns A new FormArray instance.\n */\n protected createFormAlias(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Removes a form alias control at the specified index from the given form array controls.\n *\n * @param index - The index of the form alias control to remove.\n * @param formArrayControls - The array of form array controls.\n * @returns The updated array of form array controls after removing the specified control.\n */\n protected removeFormAliasControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Sets up the alias form controls based on the provided alias count array and form array name.\n * If there are any aliases, the alias controls will be re-populated.\n *\n * @param aliasCountArray - An array containing the count of aliases.\n * @param formArrayName - The name of the form array.\n */\n protected setupAliasFormControls(aliasCountArray: number[], formArrayName: string): void {\n // Re-populate the alias controls if there are any aliases\n if (aliasCountArray.length) {\n this.aliasControls = this.buildFormAliasControls(\n aliasCountArray,\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n }\n }\n\n /**\n * Removes the form alias controls errors for a specific index in a form array.\n *\n * @param index - The index of the form array control.\n * @param formArrayControls - An array of form array controls.\n * @param fieldNames - An array of field names to remove errors from.\n */\n protected removeFormAliasControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n fieldNames.forEach((field) => {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n });\n }\n }\n\n /**\n * Creates alias controls for the given fields and index.\n * @param fields - The list of fields for which alias controls need to be created.\n * @param index - The index value used to generate unique identifiers for the controls.\n * @returns An object containing the alias controls.\n */\n protected createAliasControls(fields: string[], index: number): { [key: string]: IAbstractFormArrayControl } {\n return fields.reduce(\n (controls, field) => ({\n ...controls,\n [field]: {\n inputId: `${field}_${index}`,\n inputName: `${field}_${index}`,\n controlName: `${field}_${index}`,\n },\n }),\n {},\n );\n }\n\n /**\n * Sets up the alias checkbox listener.\n *\n * @param formCheckboxName - The name of the checkbox control in the form.\n * @param formArrayName - The name of the form array control in the form.\n */\n protected setUpAliasCheckboxListener(formCheckboxName: string, formArrayName: string): void {\n // Ensure any existing subscription is cleared to avoid memory leaks\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n\n const addAliasControl = this.form.get(formCheckboxName);\n if (!addAliasControl) {\n return;\n }\n\n addAliasControl.valueChanges.pipe(takeUntil(this['ngUnsubscribe'])).subscribe((shouldAddAlias) => {\n this.aliasControls = shouldAddAlias\n ? this.buildFormAliasControls([0], formArrayName, this.aliasFields, this.aliasControlsValidation)\n : this.removeAllFormAliasControls(this.aliasControls, formArrayName, this.aliasFields);\n });\n }\n\n /**\n * Removes a form alias control from a form array and updates the list of form array controls.\n * @param index - The index of the form alias control to be removed.\n * @param formArrayName - The name of the form array.\n * @param formArrayControls - The list of form array controls.\n * @param fieldNames - The names of the fields associated with the form array controls.\n * @returns The updated list of form array controls after removing the specified control.\n */\n public removeFormAliasControls(\n index: number,\n formArrayName: string,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): IAbstractFormArrayControls[] {\n // Get the form array...\n const control = this.form.get(formArrayName) as FormArray;\n\n // Remove the form array control based on index\n control.removeAt(index);\n\n // Then remove the form array controls errors...\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormAliasControl(index, formArrayControls);\n }\n\n /**\n * Adds an alias to the specified index of the form array.\n *\n * @param index - The index at which to add the alias.\n * @param formArrayName - The name of the form array.\n */\n public addAlias(index: number, formArrayName: string): void {\n this.aliasControls.push(\n this.addAliasControls(index, formArrayName, this.aliasFields, this.aliasControlsValidation),\n );\n }\n\n /**\n * Removes an alias from the form array.\n *\n * @param index - The index of the alias to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeAlias(index: number, formArrayName: string): void {\n this.aliasControls = this.removeFormAliasControls(index, formArrayName, this.aliasControls, this.aliasFields);\n }\n\n public override ngOnInit(): void {\n super.ngOnInit();\n }\n\n public override ngOnDestroy(): void {\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n super.ngOnDestroy();\n }\n}\n","import { Component, OnDestroy, OnInit } from '@angular/core';\nimport { AbstractFormBaseComponent } from '../abstract-form-base/abstract-form-base.component';\nimport { IAbstractFormArrayControls } from '../interfaces/abstract-form-array-controls.interface';\nimport { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';\nimport { AbstractControl, FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { IAbstractFormArrayControl } from '../interfaces/abstract-form-array-control.interface';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n public formArrayControls: IAbstractFormArrayControls[] = [];\n public formArrayControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public formArrayFields: string[] = [];\n\n /**\n * Builds an array of form controls for a form array.\n *\n * @param formControlCount - An array of numbers representing the number of form controls to create.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - An array of field names for the form controls.\n * @param controlValidation - An array of control validation configurations.\n * @returns An array of form controls for the form array.\n */\n private buildFormArrayControls(\n formControlCount: number[],\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): IAbstractFormArrayControls[] {\n // Directly map each index to a control\n return formControlCount.map((_element, index) =>\n this.addFormArrayControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds form array controls to the specified form array.\n *\n * @param index - The index at which the form array controls should be added.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the form controls to be created.\n * @param controlValidation - The validation rules for the form controls.\n * @returns An object containing the form controls that were added.\n */\n private addFormArrayControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formArray = this.form.get(formArrayName) as FormArray;\n const formArrayFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createFormArrayControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formArrayFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formArray.push(formArrayFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Creates a new instance of FormArray with the specified validators and controls.\n *\n * @param validators - An array of validator functions to be applied to the form array.\n * @param controls - An optional array of form controls to initialize the form array with.\n * @returns A new instance of FormArray.\n */\n protected createFormArray(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Sets up the form array form controls based on the provided parameters.\n *\n * @param formArrayCountArray - An array of numbers representing the count of form array controls.\n * @param formArrayName - The name of the form array.\n */\n protected setupFormArrayFormControls(formArrayCountArray: number[], formArrayName: string): void {\n if (formArrayCountArray.length) {\n this.formArrayControls = this.buildFormArrayControls(\n formArrayCountArray,\n formArrayName,\n this.formArrayFields,\n this.formArrayControlsValidation,\n );\n }\n }\n\n /**\n * Creates an object with form array controls based on the given fields and index.\n *\n * @param fields - An array of field names.\n * @param index - The index of the form array.\n * @returns An object with form array controls.\n */\n protected createFormArrayControls(fields: string[], index: number): { [key: string]: IAbstractFormArrayControl } {\n return fields.reduce(\n (controls, field) => ({\n ...controls,\n [field]: {\n inputId: `${field}_${index}`,\n inputName: `${field}_${index}`,\n controlName: `${field}_${index}`,\n },\n }),\n {},\n );\n }\n\n /**\n * Removes form array controls errors for a specific index.\n *\n * @param index - The index of the form array control.\n * @param formArrayControls - An array of form array controls.\n * @param fieldNames - An array of field names to remove errors from.\n */\n protected removeFormArrayControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n fieldNames.forEach((field) => {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n });\n }\n }\n\n /**\n * Adds controls to the form array at the specified index.\n *\n * @param index - The index at which the controls should be added.\n * @param formArrayName - The name of the form array.\n */\n public addControlsToFormArray(index: number, formArrayName: string): void {\n this.formArrayControls.push(\n this.addFormArrayControls(index, formArrayName, this.formArrayFields, this.formArrayControlsValidation),\n );\n }\n\n /**\n * Removes a form array control at the specified index from the given array of form array controls.\n *\n * @param index - The index of the form array control to be removed.\n * @param formArrayControls - The array of form array controls.\n * @returns The updated array of form array controls after removing the specified control.\n */\n protected removeFormArrayControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Retrieves the value of a form control or returns a default value if the control is null or undefined.\n *\n * @param control - The form control to retrieve the value from.\n * @param defaultValue - The default value to return if the control is null or undefined.\n * @returns The value of the control if it exists, otherwise the default value.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected getControlValueOrDefault(control: AbstractControl | null, defaultValue: any): any {\n return control?.value || defaultValue;\n }\n\n /**\n * Removes a form array control at the specified index and updates the form array controls and errors.\n *\n * @param index - The index of the form array control to remove.\n * @param formArrayName - The name of the form array.\n * @param formArrayControls - The list of form array controls.\n * @param fieldNames - The names of the fields associated with the form array controls.\n * @returns The updated list of form array controls.\n */\n public removeFormArrayControls(\n index: number,\n formArrayName: string,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): IAbstractFormArrayControls[] {\n // Get the form array...\n const control = this.form.get(formArrayName) as FormArray;\n\n // Remove the form array control based on index\n control.removeAt(index);\n\n // Then remove the form array controls errors...\n this.removeFormArrayControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormArrayControl(index, formArrayControls);\n }\n\n /**\n * Removes controls from a form array at the specified index.\n *\n * @param index - The index at which to remove the controls.\n * @param formArrayName - The name of the form array.\n */\n public removeControlsFromFormArray(index: number, formArrayName: string): void {\n this.formArrayControls = this.removeFormArrayControls(\n index,\n formArrayName,\n this.formArrayControls,\n this.formArrayFields,\n );\n }\n\n /**\n * Removes a form array control from the specified form array.\n *\n * @param formArrayControl - The form array control to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeFormArrayControlFromArray(formArrayControl: IAbstractFormArrayControls, formArrayName: string): void {\n const formArrayControlIndex = this.formArrayControls.findIndex((control) => control === formArrayControl);\n this.removeFormArrayControls(formArrayControlIndex, formArrayName, this.formArrayControls, this.formArrayFields);\n }\n\n /**\n * Retrieves the FormGroup at the specified index from a FormArray.\n *\n * @param index - The index of the FormGroup to retrieve.\n * @param formArrayName - The name of the FormArray.\n * @returns The FormGroup at the specified index.\n */\n public getFormArrayFormGroup(index: number, formArrayName: string): FormGroup {\n const formArray = this.form.get(formArrayName) as FormArray;\n return formArray.controls[index] as FormGroup;\n }\n\n /**\n * Retrieves the FormControl from a FormGroup within a FormArray at the specified index.\n *\n * @param formGroup - The FormGroup containing the FormControl.\n * @param controlName - The name of the FormControl.\n * @param index - The index of the FormArray.\n * @returns The FormControl at the specified index.\n */\n public getFormArrayFormGroupControl(formGroup: FormGroup, controlName: string, index: number): FormControl {\n return formGroup.controls[`${controlName}_${index}`] as FormControl;\n }\n\n /**\n * Adds validators to a specific form control within a form array group.\n *\n * @param formGroup - The form group containing the form array.\n * @param controlName - The name of the form control within the form array group.\n * @param index - The index of the form array group within the form array.\n * @param validators - An array of validator functions to be added to the form control.\n */\n public addFormArrayFormGroupControlValidators(formControl: FormControl, validators: ValidatorFn[]): void {\n formControl.setValidators(validators);\n formControl.updateValueAndValidity({ emitEvent: false });\n }\n\n /**\n * Removes validators from a specific form control within a form array group.\n * @param formGroup - The form group containing the form array.\n * @param controlName - The name of the form control within the form array group.\n * @param index - The index of the form array group within the form array.\n */\n public removeFormArrayFormGroupControlValidators(formControl: FormControl): void {\n formControl.clearValidators();\n formControl.setErrors(null);\n formControl.setValue(null, { emitEvent: false });\n formControl.updateValueAndValidity({ emitEvent: false });\n }\n\n /**\n * Reverses the form array data by appending the index to each key in the objects.\n *\n * @param data - An array of objects containing form data.\n * @returns An array of objects with keys modified to include their index in the original array.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public addIndexToFormArrayData(data: any[]): { [key: string]: any }[] {\n return data.map((item, index) =>\n Object.entries(item).reduce(\n (indexedObject, [key, value]) => {\n if (value !== undefined) {\n indexedObject[`${key}_${index}`] = value;\n }\n return indexedObject;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {} as { [key: string]: any },\n ),\n );\n }\n\n public override ngOnInit(): void {\n super.ngOnInit();\n }\n\n public override ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n super.ngOnDestroy();\n }\n}\n","import { inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { CanDeactivateTypes } from '@hmcts/opal-frontend-common/types';\n\nexport abstract class AbstractFormParentBaseComponent {\n private readonly router = inject(Router);\n private readonly activatedRoute = inject(ActivatedRoute);\n\n public stateUnsavedChanges!: boolean;\n\n /**\n * If the user navigates externally from the site or closes the tab\n * Check if there is unsaved changes form state -> warning message\n * Otherwise -> no warning message\n *\n * @returns boolean\n */\n canDeactivate(): CanDeactivateTypes {\n if (this.stateUnsavedChanges) {\n return false;\n } else {\n return true;\n }\n }\n\n /**\n * Navigates to the specified route using the Angular router.\n *\n * @param route - The route to navigate to.\n */\n protected routerNavigate(route: string, nonRelative: boolean = false, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n\n if (nonRelative) {\n this.router.navigate([route]);\n } else {\n this.router.navigate([route], { relativeTo: this.activatedRoute.parent });\n }\n }\n\n /**\n * Checks if an object has any non-empty values.\n *\n * @param form - The object representing form data with key-value pairs.\n * @returns A boolean indicating whether the object has any non-empty values.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected hasFormValues(form: { [key: string]: any }): boolean {\n return Object.values(form).some(Boolean);\n }\n}\n","import { AbstractFormParentBaseComponent } from '../abstract-form-parent-base/abstract-form-parent-base.component';\n\nexport abstract class AbstractFormArrayParentBaseComponent extends AbstractFormParentBaseComponent {\n /**\n * Removes index suffixes from keys in an array of objects and restructures the data.\n *\n * This function takes an array of objects where keys have an index suffix (e.g., `key_0`, `key_1`),\n * and returns a new array of objects where the keys are grouped by their base name without the index.\n *\n * @param data - The array of objects with indexed keys.\n * @returns A new array of objects with keys grouped by their base name.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public removeIndexFromFormArrayData(data: any[]): any[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return data.reduce((result: any[], indexedObject) => {\n let currentIndex!: number;\n Object.keys(indexedObject).forEach((key) => {\n const match = RegExp(/^(.*)_(\\d+)$/).exec(key);\n if (match) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, baseKey, index] = match;\n const idx = parseInt(index, 10);\n\n currentIndex = idx; // Set the current index based on the last indexed key\n\n result[idx] = result[idx] || {};\n result[idx][baseKey] = indexedObject[key];\n } else {\n // For non-indexed keys, use the currentIndex if available\n result[currentIndex] = result[currentIndex] || {};\n result[currentIndex][key] = indexedObject[key];\n }\n });\n return result;\n }, []);\n }\n}\n","import { FormArray, FormGroup } from '@angular/forms';\nimport { Component, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { IAbstractFormArrayRemovalBaseControlValue } from './interfaces/abstract-form-array-removal-base-control-value.interface';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormArrayRemovalComponent {\n private readonly router = inject(Router);\n private readonly activatedRoute = inject(ActivatedRoute);\n\n protected getFormArrayControlValue(\n formArray: FormArray,\n controlName: string,\n rowIndex: number,\n defaultValue: IAbstractFormArrayRemovalBaseControlValue[keyof IAbstractFormArrayRemovalBaseControlValue],\n ): IAbstractFormArrayRemovalBaseControlValue[keyof IAbstractFormArrayRemovalBaseControlValue] {\n const value = formArray.controls[rowIndex]?.get(controlName)?.value;\n\n if (typeof value === 'string' && !isNaN(Number(value))) {\n return Number(value);\n }\n\n return value ?? defaultValue;\n }\n\n /**\n * Removes a control from the given form array at the specified index and renumbers the remaining controls.\n *\n * @param formArray - The form array from which to remove the control.\n * @param removeIndex - The index of the control to remove.\n * @param fieldNames - The names of the fields associated with the controls.\n * @param dynamicFieldPrefix - The prefix used for dynamically generated field names.\n */\n protected removeControlAndRenumber(\n formArray: FormArray,\n removeIndex: number,\n fieldNames: string[],\n dynamicFieldPrefix: string,\n ): void {\n formArray.removeAt(removeIndex);\n this.renumberControls(formArray, removeIndex, fieldNames, dynamicFieldPrefix);\n }\n\n /**\n * Renumber the controls in a FormArray starting from a specific index.\n * This method updates the control keys of each FormGroup within the FormArray.\n *\n * @param formArray - The FormArray to renumber the controls for.\n * @param startIndex - The index to start renumbering the controls from.\n * @param fieldNames - The names of the fields in the FormGroup.\n * @param dynamicFieldPrefix - The prefix to use for dynamic field names.\n */\n protected renumberControls(\n formArray: FormArray,\n startIndex: number,\n fieldNames: string[],\n dynamicFieldPrefix: string,\n ): void {\n const formGroups = formArray.controls.slice(startIndex);\n for (const [index, formGroup] of formGroups.entries()) {\n this.updateControlKeys(formGroup as FormGroup, index + startIndex, fieldNames, dynamicFieldPrefix);\n }\n }\n\n /**\n * Updates the control keys in a form group based on the provided parameters.\n * @param formGroup - The form group to update.\n * @param index - The index of the form group within an array.\n * @param fieldNames - An array of field names to update.\n * @param dynamicFieldPrefix - The prefix to use for dynamic field keys.\n */\n protected updateControlKeys(\n formGroup: FormGroup,\n index: number,\n fieldNames: string[],\n dynamicFieldPrefix: string,\n ): void {\n fieldNames.forEach((field) => {\n const currentKey = `${dynamicFieldPrefix}_${field}_${index + 1}`;\n const newKey = `${dynamicFieldPrefix}_${field}_${index}`;\n\n // Retrieve the current control, if it exists\n const control = formGroup.get(currentKey);\n\n if (control) {\n // Remove the old control first, then add it with the new key\n formGroup.removeControl(currentKey);\n\n // Add the control with the updated key\n formGroup.addControl(newKey, control);\n }\n });\n }\n\n /**\n * Handles route with the supplied route\n *\n * @param route string of route\n * @param nonRelative boolean indicating if route is relative to the parent\n */\n public handleRoute(route: string, nonRelative: boolean = false, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n if (nonRelative) {\n this.router.navigate([route]);\n } else {\n this.router.navigate([route], { relativeTo: this.activatedRoute.parent });\n }\n }\n}\n","import { Component, EventEmitter, OnInit, Output, inject, signal } from '@angular/core';\nimport { IAbstractSortState, IAbstractTableData } from './interfaces/abstract-sortable-table-interfaces';\nimport { SortService } from '@hmcts/opal-frontend-common/services';\nimport { SortableValues, SortDirectionType } from '@hmcts/opal-frontend-common/types';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractSortableTableComponent implements OnInit {\n private readonly sortService = inject(SortService);\n\n public abstractTableDataSignal = signal<IAbstractTableData<SortableValues>[]>([]);\n public abstractExistingSortState: IAbstractSortState | null = null;\n public sortStateSignal = signal<IAbstractSortState>({});\n public sortedColumnTitleSignal = signal<string>('');\n public sortedColumnDirectionSignal = signal<SortDirectionType>('none');\n\n @Output() abstractSortState = new EventEmitter<IAbstractSortState>();\n\n /**\n * Creates an initial sort state for a table based on the provided table data.\n *\n * @param tableData - Array of table data objects representing table rows.\n * @returns Initial sort state object with column names as keys and 'none' as values.\n */\n private createSortState(tableData: IAbstractTableData<SortableValues>[] | null): IAbstractSortState {\n return tableData?.length\n ? Object.keys(tableData[0]).reduce<IAbstractSortState>((state, key) => {\n state[key] = 'none';\n return state;\n }, {})\n : {};\n }\n /**\n * Initializes the sort state for the sortable table component.\n *\n * This method sets the initial sort state based on the existing sort state or creates a new one\n * if none exists. It then updates the sort state signal with the initial sort state.\n *\n * If an existing sort state is found, it iterates over each entry and triggers the sort change\n * for each key that has a sort type other than 'none'.\n *\n * @private\n * @returns {void}\n */\n private initialiseSortState(): void {\n const existingSortState = this.abstractExistingSortState;\n const initialSortState = existingSortState || this.createSortState(this.abstractTableDataSignal());\n\n this.sortStateSignal.set(initialSortState);\n\n if (existingSortState) {\n Object.entries(existingSortState).forEach(([key, sortType]) => {\n if (sortType !== 'none') {\n this.onSortChange({ key, sortType });\n }\n });\n }\n this.getSortedColumn();\n }\n\n /**\n * Updates the sort state for a given column key and sort type.\n * Resets the sort state for all other columns to 'none'.\n *\n * @param key - The column to sort by.\n * @param sortType - Sorting order ('ascending' or 'descending').\n */\n private updateSortState(key: string, sortType: 'ascending' | 'descending'): void {\n this.sortStateSignal.set(\n Object.keys(this.sortStateSignal()).reduce<IAbstractSortState>((state, columnKey) => {\n state[columnKey] = columnKey === key ? sortType : 'none';\n return state;\n }, {}),\n );\n }\n\n /**\n * Retrieves the sorted table data based on the specified key and sort type.\n *\n * @param key - The key of the property to sort by.\n * @param sortType - The type of sorting to apply, either 'ascending' or 'descending'.\n * @returns An array of sorted table data objects.\n */\n private getSortedTableData(key: string, sortType: 'ascending' | 'descending'): IAbstractTableData<SortableValues>[] {\n return sortType === 'ascending'\n ? (this.sortService.sortObjectArrayAsc(\n this.abstractTableDataSignal(),\n key,\n ) as IAbstractTableData<SortableValues>[])\n : (this.sortService.sortObjectArrayDesc(\n this.abstractTableDataSignal(),\n key,\n ) as IAbstractTableData<SortableValues>[]);\n }\n\n /**\n * Determines the first column with a sort state other than 'none' and updates the sorted column signals accordingly.\n *\n * - If a sorted column is found, updates the `sortedColumnTitleSignal` and `sortedColumnDirectionSignal` with the column key and state.\n * - If no sorted column is found, sets the `sortedColumnTitleSignal` to an empty string and `sortedColumnDirectionSignal` to 'none'.\n *\n * @private\n * @returns {void}\n */\n private getSortedColumn(): void {\n // Find the first column that has a sort state other than 'none'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const sortedColumn = Object.entries(this.sortStateSignal()).find(([_, state]) => state !== 'none');\n\n // If a sorted column is found, set the signal to the sorted column key and state\n if (sortedColumn) {\n const [columnKey, state] = sortedColumn;\n this.sortedColumnTitleSignal.set(columnKey);\n this.sortedColumnDirectionSignal.set(state);\n } else {\n // Otherwise, set the signal to null\n this.sortedColumnTitleSignal.set('');\n this.sortedColumnDirectionSignal.set('none');\n }\n }\n\n /**\n * Handles the change in sorting for the table.\n *\n * @param event - An object containing the key to sort by and the sort type.\n * @param event.key - The key of the column to sort.\n * @param event.sortType - The type of sorting to apply ('ascending' or 'descending').\n *\n * This method updates the sort state, sorts the table data based on the provided key and sort type,\n * updates the table data signal, and emits the updated sort state.\n */\n protected onSortChange(event: { key: string; sortType: 'ascending' | 'descending' }): void {\n const { key, sortType } = event;\n\n this.updateSortState(key, sortType);\n this.getSortedColumn();\n const sortedData = this.getSortedTableData(key, sortType);\n\n // Update the table data signal\n this.abstractTableDataSignal.set(sortedData);\n\n // Emit the updated sort state\n this.abstractSortState.emit(this.sortStateSignal());\n }\n\n /**\n * Lifecycle hook to initialise the sort state.\n */\n public ngOnInit(): void {\n this.initialiseSortState();\n }\n}\n","import { Component, computed, signal } from '@angular/core';\nimport { AbstractSortableTableComponent } from '../abstract-sortable-table/abstract-sortable-table.component';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractSortableTablePaginationComponent extends AbstractSortableTableComponent {\n // Signal for the current page. Used to calculate the start and end indices for pagination.\n public currentPageSignal = signal(1);\n\n // Signal for the number of items per page. Determines how many items are displayed on each page.\n public itemsPerPageSignal = signal(10);\n\n // Signal for the start index (1-based). Automatically updates when `currentPageSignal` or `itemsPerPageSignal` changes.\n public startIndexComputed = computed(() => {\n const currentPage = this.currentPageSignal();\n return (currentPage - 1) * this.itemsPerPageSignal() + 1;\n });\n\n // Signal for the end index (1-based). Automatically recalculates when `startIndexComputed` or `abstractTableDataSignal` changes.\n public endIndexComputed = computed(() => {\n const startIndex = this.startIndexComputed();\n return Math.min(startIndex + this.itemsPerPageSignal() - 1, this.abstractTableDataSignal().length);\n });\n\n // Computed signal for paginated table data. Reactively slices `abstractTableDataSignal` based on `startIndexComputed` and `endIndexComputed`.\n public paginatedTableDataComputed = computed(() => {\n const data = this.abstractTableDataSignal(); // Full table data\n\n return data.slice(this.startIndexComputed() - 1, this.endIndexComputed()); // Return paginated data subset\n });\n\n /**\n * Handles sorting changes and resets the page to the first page.\n *\n * @param event - The sorting event containing:\n * - `key`: The column key to sort by.\n * - `sortType`: The sorting order, either 'ascending' or 'descending'.\n *\n * Resets `currentPageSignal` to 1 and triggers re-sorting of `abstractTableDataSignal`.\n */\n public override onSortChange(event: { key: string; sortType: 'ascending' | 'descending' }): void {\n super.onSortChange(event); // Update the sort state and sort the data\n this.currentPageSignal.set(1); // Reset the page to the first page\n }\n\n /**\n * Handles the event when the page is changed.\n *\n * @param newPage - The new page number to set. If the provided page number is out of range,\n * it will be clamped between 1 and the total number of pages.\n */\n public onPageChange(newPage: number): void {\n const totalPages = Math.ceil(this.abstractTableDataSignal().length / this.itemsPerPageSignal());\n this.currentPageSignal.set(Math.max(1, Math.min(newPage, totalPages)));\n }\n}\n","// ABSTRACT CLASSES\nexport * from './abstract-form-alias-base/abstract-form-alias-base';\nexport * from './abstract-form-array-base/abstract-form-array-base';\nexport * from './abstract-form-array-parent-base/abstract-form-array-parent-base.component';\nexport * from './abstract-form-array-removal-base/abstract-form-array-removal-base.component';\nexport * from './abstract-form-base/abstract-form-base.component';\nexport * from './abstract-form-parent-base/abstract-form-parent-base.component';\nexport * from './abstract-sortable-table/abstract-sortable-table.component';\nexport * from './abstract-sortable-table-pagination/abstract-sortable-table-pagination.component';\n\n// INTERFACES\nexport * from './abstract-form-base/interfaces/abstract-form-base-field-error.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-field-errors.interface';\nexport * from './interfaces/abstract-form-base-form-error-summary-message.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-form-error.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-form.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-high-priority-form-error.interface';\nexport * from './abstract-form-base/interfaces/abstract-form-base-status.interface';\nexport * from './interfaces/abstract-form-array-control-validation.interface';\nexport * from './interfaces/abstract-form-array-control.interface';\nexport * from './interfaces/abstract-form-array-controls.interface';\nexport * from './interfaces/abstract-form-base-form-error-summary-message.interface';\nexport * from './interfaces/abstract-form-control-error-message.interface';\nexport * from './abstract-sortable-table/interfaces/abstract-sortable-table-interfaces';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAiBsB,yBAAyB,CAAA;AACzB,IAAA,cAAc,GAAG,IAAI,YAAY,EAAW;;AAE5C,IAAA,UAAU,GAAG,IAAI,YAAY,EAA8B;AAE9D,IAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC7C,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AAE/C,IAAA,IAAI;AACJ,IAAA,wBAAwB;AACxB,IAAA,uBAAuB;AACpB,IAAA,WAAW;IACX,aAAa,GAAG,KAAK;AACZ,IAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;AAC/C,IAAA,UAAU;AAEjB,IAAA,WAAA,GAAA;AAEA;;;;AAIG;AACK,IAAA,MAAM,CAAC,OAAe,EAAA;AAC5B,QAAA,IAAI,WAAW;AACf,QAAA,IAAI,YAAY;QAEhB,MAAM,iBAAiB,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAa,UAAA,EAAA,OAAO,CAAgB,cAAA,CAAA,CAAC;QACtF,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAa,UAAA,EAAA,OAAO,CAAG,CAAA,CAAA,CAAC;QACpE,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAI,CAAA,EAAA,OAAO,CAA0B,wBAAA,CAAA,CAAC;QAEpF,IAAI,iBAAiB,EAAE;YACrB,WAAW,GAAG,iBAAiB;YAC/B,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAG,EAAA,OAAO,CAAe,aAAA,CAAA,CA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