import { OnDestroy, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { RpxTranslationService } from 'rpx-xui-translation';
import { Subscription } from 'rxjs';
import { CaseEditDataService } from '../../../commons/case-edit-data/case-edit-data.service';
import { CaseField, ErrorMessage, Journey } from '../../../domain';
import { FlagType } from '../../../domain/case-flag';
import { CaseFlagState, FlagDetail, FlagDetailDisplayWithFormGroupPath, FlagsWithFormGroupPath } from './domain';
import { MultipageComponentStateService } from '../../../services';
import { AbstractFieldWriteJourneyComponent } from '../base-field/abstract-field-write-journey.component';
import { CaseFlagStateService } from '../../case-editor/services/case-flag-state.service';
import { CaseFlagFieldState } from './enums';
import { LinkedCasesService } from '../linked-cases/services';
import * as i0 from "@angular/core";
export declare class WriteCaseFlagFieldComponent extends AbstractFieldWriteJourneyComponent implements OnInit, OnDestroy, Journey {
    private readonly route;
    private readonly caseEditDataService;
    private readonly caseFlagStateService;
    private readonly rpxTranslationService;
    private readonly router;
    private readonly linkedCasesService;
    fieldState: number;
    caseFlagFieldState: typeof CaseFlagFieldState;
    errorMessages: ErrorMessage[];
    flagsData: FlagsWithFormGroupPath[];
    selectedFlag: FlagDetailDisplayWithFormGroupPath;
    caseFlagParentFormGroup: FormGroup;
    flagCommentsOptional: boolean;
    jurisdiction: string;
    caseTypeId: string;
    hmctsServiceId: string;
    isDisplayContextParameterUpdate: boolean;
    isDisplayContextParameterExternal: boolean;
    isDisplayContextParameter2Point1Enabled: boolean;
    caseTitle: string;
    caseTitleSubscription: Subscription;
    displayContextParameter: string;
    determinedLocation: FlagsWithFormGroupPath;
    private allCaseFlagStagesCompleted;
    navigatedTo: boolean;
    private readonly otherFlagTypeCode;
    private readonly selectedManageCaseLocation;
    readonly caseNameMissing = "Case name missing";
    flagTypeSubJourneyIndex: any;
    get flagType(): FlagType | null;
    get selectedFlagsLocation(): FlagsWithFormGroupPath | null;
    set selectedFlagsLocation(selectedLocation: FlagsWithFormGroupPath | null);
    constructor(route: ActivatedRoute, caseEditDataService: CaseEditDataService, caseFlagStateService: CaseFlagStateService, rpxTranslationService: RpxTranslationService, router: Router, linkedCasesService: LinkedCasesService, multipageComponentStateService: MultipageComponentStateService);
    ngOnInit(): void;
    handleBackButton(event: any): void;
    addState(data: any, url?: any): void;
    updateFlagTypeSubJourney(event: any): void;
    validateCaseFields(caseFields: any): any;
    onPageChange(): void;
    setDisplayContextParameterUpdate(displayContextParameter: string): boolean;
    setDisplayContextParameterExternal(displayContextParameter: string): boolean;
    setDisplayContextParameter2Point1Enabled(displayContextParameter: string): boolean;
    onCaseFlagStateEmitted(caseFlagState: CaseFlagState): void;
    canMoveToFinalReviewStage(caseFlagState: CaseFlagState): boolean;
    proceedToNextState(): void;
    setFlagsCaseFieldValue(): void;
    previousPage(): void;
    addFlagToCollection(): void;
    /**
     * Determines the correct location (i.e. either the internal or external instance of a `Flags` object) for a new flag,
     * according to the following:
     *
     * * Whether the user is internal or external (no effect for external users because they can access only the external
     * instance)
     * * The existence of two `Flags` objects - one internal, one external - linked by the same `groupId`;
     * * For flags of type "Other", whether "only visible to HMCTS staff" has been selected or not ("Other" defaults to
     * externally visible);
     * * For all other flag types, the value of the `externallyAvailable` attribute.
     *
     * If the user is internal then the new flag should be assigned to the external `Flags` instance if:
     * * Such an instance exists, AND
     * * The flag type is "Other" and "only visible to HMCTS staff" was not selected, OR
     * * The flag type is not "Other" and `externallyAvailable` is `true`.
     *
     * @param isInternalUser Whether the current user is internal or not
     * @param selectedFlagsLocation The currently selected location for the new flag
     * @param formValues All the values from the `caseFlagParentFormGroup`
     * @returns The correctly determined location: either the internal or external location (if one exists) where a groupId
     * is present; the original location otherwise. **Note:** If the external location is returned as undefined, this
     * indicates a configuration error
     */
    determineLocationForFlag(isInternalUser: boolean, selectedFlagsLocation: FlagsWithFormGroupPath, formValues: any): FlagsWithFormGroupPath;
    updateFlagInCollection(): void;
    isAtFinalState(): boolean;
    navigateToErrorElement(elementId: string): void;
    onFlagCommentsOptionalEmitted(_: any): void;
    populateNewFlagDetailInstance(): FlagDetail;
    moveToFinalReviewStage(): void;
    ngOnDestroy(): void;
    get manageFlagFinalState(): CaseFlagFieldState.FLAG_UPDATE | CaseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION;
    setDisplayContextParameter(caseFields: CaseField[]): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<WriteCaseFlagFieldComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<WriteCaseFlagFieldComponent, "ccd-write-case-flag-field", never, {}, {}, never, never, false, never>;
}
//# sourceMappingURL=write-case-flag-field.component.d.ts.map