import * as i0 from '@angular/core';
import { InjectionToken, Input, Optional, Directive, signal, ContentChildren, Inject, ViewEncapsulation, ChangeDetectionStrategy, Component, EventEmitter, DOCUMENT, ElementRef, HostBinding, ViewChild, Output, computed, NgModule } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import * as i1 from '@angular/forms';
import { FormGroup, ControlContainer, FormsModule } from '@angular/forms';
import { FD_FORM_FIELD_CONTROL } from '@fundamental-ngx/cdk/forms';
import { Subject, Subscription, startWith, switchMap, filter, zip, debounceTime } from 'rxjs';
import { trigger, state, transition, style, animate, keyframes } from '@angular/animations';
import { CdkScrollable } from '@angular/cdk/overlay';
import { NgTemplateOutlet, NgClass } from '@angular/common';
import * as i1$1 from '@fundamental-ngx/cdk/utils';
import { resizeObservable, TabbableElementService, InitialFocusDirective } from '@fundamental-ngx/cdk/utils';
import { LinkComponent } from '@fundamental-ngx/core/link';
import * as i2 from '@fundamental-ngx/core/list';
import { ListModule } from '@fundamental-ngx/core/list';
import { ObjectStatusComponent } from '@fundamental-ngx/core/object-status';
import { ScrollbarDirective } from '@fundamental-ngx/core/scrollbar';
import { FdTranslatePipe } from '@fundamental-ngx/i18n';
import * as i2$1 from '@fundamental-ngx/core/bar';
import { BarModule } from '@fundamental-ngx/core/bar';
import { ButtonComponent } from '@fundamental-ngx/core/button';
import * as i1$2 from '@fundamental-ngx/core/popover';
import { PopoverModule } from '@fundamental-ngx/core/popover';
import { SegmentedButtonComponent } from '@fundamental-ngx/core/segmented-button';
import { getFormState } from '@fundamental-ngx/platform/form';
import { countBy, flatten, mergeWith } from 'lodash-es';

const FDP_MESSAGE_POPOVER_DEFAULT_CONFIG = {
    errors: {
        email: 'platformMessagePopover.defaultErrors.email',
        max: 'platformMessagePopover.defaultErrors.max',
        maxlength: 'platformMessagePopover.defaultErrors.maxLength',
        min: 'platformMessagePopover.defaultErrors.min',
        minlength: 'platformMessagePopover.defaultErrors.minLength',
        pattern: 'platformMessagePopover.defaultErrors.pattern',
        required: 'platformMessagePopover.defaultErrors.required',
        requiredTrue: 'platformMessagePopover.defaultErrors.requiredTrue'
    }
};
const FDP_MESSAGE_POPOVER_CONFIG = new InjectionToken('FdpMessagePopoverConfig');

class MessagePopoverFormItemDirective {
    /** @hidden */
    constructor(elementRef, control) {
        this.elementRef = elementRef;
        this.control = control;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MessagePopoverFormItemDirective, deps: [{ token: i0.ElementRef }, { token: i1.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.4", type: MessagePopoverFormItemDirective, isStandalone: true, selector: "[fdpMessagePopoverFormItem]", inputs: { label: ["fdpMessagePopoverFormItem", "label"], errorTypes: "errorTypes" }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MessagePopoverFormItemDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[fdpMessagePopoverFormItem]',
                    standalone: true
                }]
        }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.NgControl, decorators: [{
                    type: Optional
                }] }], propDecorators: { label: [{
                type: Input,
                args: ['fdpMessagePopoverFormItem']
            }], errorTypes: [{
                type: Input
            }] } });

/**
 * Converts Object Status into Message Popover State
 * @param status Object status
 * @returns Message Popover State.
 */
function convertFormStateToMessagePopoverState(state) {
    switch (state) {
        case 'error':
            return 'negative';
        case 'warning':
            return 'critical';
        case 'default':
            return 'neutral';
        default:
            return state;
    }
}
/**
 * Converts Form State into Object status type.
 * @param type Form state.
 * @returns `ObjectStatus` type.
 */
function convertFormState(type) {
    switch (type) {
        case 'success':
            return 'positive';
        case 'error':
            return 'negative';
        case 'warning':
            return 'critical';
        case 'information':
            return 'informative';
        default:
            return 'neutral';
    }
}

class MessagePopoverFormWrapperComponent {
    /**
     * User-passed forms.
     */
    set forms(forms) {
        if (!forms) {
            return;
        }
        if (!Array.isArray(forms)) {
            forms = [forms];
        }
        this._ngForms = forms;
        this._startListeningForErrors();
    }
    /** User-passed form fields. */
    set formFields(value) {
        this._formFields = value;
        this._listenToFormFieldErrors(value);
    }
    get formFields() {
        return this._formFields;
    }
    /** @hidden */
    constructor(_destroyRef, _config) {
        this._destroyRef = _destroyRef;
        this._config = _config;
        /** Message Popover instance. */
        this.messagePopover$ = new Subject();
        /**
         * Error models Signal. Emitted when form submitted and contains invalid fields.
         */
        this.errors$ = signal([], ...(ngDevMode ? [{ debugName: "errors$" }] : []));
        /** @hidden */
        this._formFields = [];
        /** @hidden */
        this._ngForms = [];
        /** @hidden */
        this._formItemErrorsSubscription = new Subscription();
        /** @hidden */
        this._formSubmitted = false;
    }
    /** @hidden */
    ngAfterViewInit() {
        // Forms are passed via input property.
        if (this._ngForms.length > 0) {
            return;
        }
        this._projectedForm?.changes.pipe(startWith(null), takeUntilDestroyed(this._destroyRef)).subscribe(() => {
            this._ngForms = this._projectedForm.toArray();
            this._startListeningForErrors();
        });
    }
    /**
     * Sets Message Popover component instance.
     */
    setMessagePopover(messagePopover) {
        this.messagePopover$.next(messagePopover);
        // this.messagePopover = messagePopover;
    }
    /**
     * Programmatically add new form to array of forms.
     * @param forms
     */
    addForms(forms) {
        const formsArray = Array.isArray(forms) ? forms : [forms];
        this._ngForms.push(...formsArray);
        this._startListeningForErrors();
    }
    /**
     * Programmatically add new form fields to array of listened form fields.
     * @param formFields
     */
    addFormFields(formFields) {
        this._formFields.push(...formFields);
        this._listenToFormFieldErrors(this._formFields);
    }
    /** @hidden */
    ngOnDestroy() {
        this._formItemErrorsSubscription.unsubscribe();
    }
    /**
     * @hidden
     * Listens to the form submission and collects form control errors.
     */
    _startListeningForErrors() {
        if (!this._ngForms) {
            return;
        }
        this._formErrorsSubscription?.unsubscribe();
        this.errors$.set([]);
        const formSubmitEvents = this._ngForms.map((form) => form.ngSubmit.pipe(switchMap(() => form.statusChanges.pipe(startWith(form.status), filter((status) => status.toLowerCase() !== 'pending')))));
        this._formErrorsSubscription = zip(...formSubmitEvents)
            .pipe(takeUntilDestroyed(this._destroyRef))
            .subscribe(() => {
            this._formSubmitted = true;
            const errors = this._directiveItems.length > 0 ? this._collectPlainFormData() : this._collectAdvancedFormData();
            this.errors$.set(errors);
        });
        this._listenToFormFieldErrors(this._projectedFormFieldControls.toArray());
        this._projectedFormFieldControls?.changes.subscribe(() => {
            this._listenToFormFieldErrors(this._projectedFormFieldControls.toArray());
        });
    }
    /** @hidden */
    _listenToFormFieldErrors(fields) {
        this._formItemErrorsSubscription.unsubscribe();
        this._formItemErrorsSubscription = new Subscription();
        fields?.forEach((field) => {
            this._formItemErrorsSubscription.add(field.formField?.errorsChange$.subscribe(() => {
                if (!this._formSubmitted) {
                    return;
                }
                const errors = this._directiveItems.length > 0
                    ? this._collectPlainFormData()
                    : this._collectAdvancedFormData();
                this.errors$.set(errors);
            }));
        });
    }
    /** @hidden */
    _collectPlainFormData() {
        const errors = [
            {
                errors: []
            }
        ];
        const fields = this._directiveItems.toArray();
        this._ngForms.forEach((form) => {
            Object.keys(form.form.controls).forEach((controlName) => {
                const control = form.form.get(controlName);
                const field = fields.find((formField) => formField.control?.name === controlName);
                if (!control?.errors || !field) {
                    return;
                }
                const configErrors = Object.keys(this._config.errors);
                Object.keys(control.errors)
                    .filter((error) => configErrors.includes(error))
                    .forEach((errorKey) => {
                    const errorObj = control.errors[errorKey];
                    const errorTextModel = this._getConfigErrorModel(errorKey, field.errorTypes);
                    const errorConfig = field?.errorTypes ? field?.errorTypes[errorKey] : null;
                    const errorState = errorConfig && this._isAdvancedError(errorConfig) && errorConfig.type
                        ? errorConfig.type
                        : 'error';
                    const error = {
                        name: controlName,
                        type: errorTextModel.type,
                        state: convertFormState(errorState),
                        fieldName: field?.label ?? '',
                        element: field?.elementRef,
                        heading: {
                            type: 'string',
                            error: errorObj,
                            message: errorTextModel.heading
                        },
                        description: {
                            type: 'string',
                            error: errorObj,
                            message: errorTextModel.description
                        },
                        errors: control.errors
                    };
                    errors[0].errors.push(error);
                });
            });
        });
        return errors;
    }
    /** @hidden */
    _collectAdvancedFormData() {
        let errors = [];
        const fields = this.formFields.length > 0 ? this.formFields : this._projectedFormFieldControls.toArray();
        /**
         * Iterates over form controls to collect their errors.
         * @param form Form Group or a collection of Form Groups.
         */
        const iterateOverForm = (form) => {
            if (Array.isArray(form)) {
                form.forEach((formGroup) => {
                    errors = iterateOverForm(formGroup);
                });
                return errors;
            }
            Object.keys(form.controls).forEach((controlName) => {
                const control = form.get(controlName);
                const field = fields.find((formField) => formField.id === controlName);
                if (control instanceof FormGroup) {
                    errors = iterateOverForm(control);
                }
                if (!control?.errors || !field) {
                    return;
                }
                Object.keys(control.errors).forEach((errorKey) => {
                    const errorDirective = field.formField?.groupedErrors.find((groupedError) => groupedError.directive.error === errorKey);
                    const groupName = this._getGroupName(field?.formField);
                    const error = this._getErrorModel(controlName, groupName, control, field, errorKey, errorDirective, control.errors[errorKey]);
                    let errorGroupIndex = errors.findIndex((errorGroup) => errorGroup.group === groupName);
                    if (errorGroupIndex === -1) {
                        errorGroupIndex =
                            errors.push({
                                group: groupName,
                                errors: []
                            }) - 1;
                    }
                    const group = errors[errorGroupIndex];
                    group.errors.push(error);
                });
            });
            return errors;
        };
        return iterateOverForm(this._ngForms.map((form) => form.form));
    }
    /**
     * @hidden
     * Creates error model
     */
    _getErrorModel(controlName, groupName, control, field, errorKey, errorDirective, error) {
        let state = 'error';
        const configError = this._config.errors[errorKey];
        if (errorDirective?.directive.type) {
            state = errorDirective.directive.type;
        }
        else if (this._isAdvancedError(configError)) {
            state = configError.type;
        }
        return {
            name: controlName,
            type: state,
            state: convertFormState(state),
            group: groupName,
            fieldName: field?.formField?.label ?? '',
            heading: this._getErrorText(field, errorDirective, 'heading', errorKey, error),
            description: this._getErrorText(field, errorDirective, 'description', errorKey, error),
            errors: control.errors,
            formField: field,
            element: field?.elementRef
        };
    }
    /**
     * @hidden
     * Creates error text based on the type of the error.
     * @param field Form Field Control.
     * @param errorDirective Optional Error directive
     * @param section Section where text should be rendered.
     * @param errorKey
     * @param error
     */
    _getErrorText(field, errorDirective, section = 'heading', errorKey, error) {
        const errorTextObj = {
            error: errorDirective?.error,
            type: errorDirective?.directive ? 'directive' : field?.formField?.i18Strings ? 'templateRef' : 'string'
        };
        if (errorTextObj.type === 'string') {
            const errorTextModel = this._getConfigErrorModel(errorKey);
            errorTextObj.error = error;
            errorTextObj.message = errorTextModel[section];
            return errorTextObj;
        }
        if (errorDirective?.directive) {
            errorTextObj.message =
                section === 'heading'
                    ? (errorDirective.directive._headingTemplateRef ?? errorDirective.directive._descriptionTemplateRef)
                    : errorDirective.directive._descriptionTemplateRef;
            return errorTextObj;
        }
        errorTextObj.message = field?.formField?.i18Strings ?? null;
        return errorTextObj;
    }
    /** @hidden */
    _getGroupName(formField) {
        const parts = [];
        if (formField?.formGroupContainer?.mainTitle) {
            parts.push(formField.formGroupContainer.mainTitle);
        }
        if (formField?.formFieldGroup?.label) {
            parts.push(formField.formFieldGroup.label);
        }
        return parts.join(', ');
    }
    /** @hidden */
    _getConfigErrorModel(errorKey, customErrorTypes) {
        const configError = customErrorTypes && customErrorTypes[errorKey] ? customErrorTypes[errorKey] : this._config.errors[errorKey];
        const isPlainError = !this._isAdvancedError(configError);
        const errorType = isPlainError ? 'error' : configError.type;
        const headingMessage = isPlainError ? configError : configError.heading;
        const descriptionMessage = isPlainError ? undefined : configError.description;
        return {
            type: errorType,
            heading: headingMessage,
            description: descriptionMessage
        };
    }
    /** @hidden */
    _isAdvancedError(error) {
        return !!error && typeof error !== 'string';
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MessagePopoverFormWrapperComponent, deps: [{ token: i0.DestroyRef }, { token: FDP_MESSAGE_POPOVER_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: MessagePopoverFormWrapperComponent, isStandalone: true, selector: "fdp-message-popover-form-wrapper", inputs: { forms: "forms", formFields: "formFields" }, queries: [{ propertyName: "_projectedForm", predicate: ControlContainer, descendants: true }, { propertyName: "_projectedFormFieldControls", predicate: FD_FORM_FIELD_CONTROL, descendants: true }, { propertyName: "_directiveItems", predicate: MessagePopoverFormItemDirective, descendants: true }], exportAs: ["messagePopoverWrapper"], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MessagePopoverFormWrapperComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'fdp-message-popover-form-wrapper',
                    template: `<ng-content></ng-content>`,
                    exportAs: 'messagePopoverWrapper',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    encapsulation: ViewEncapsulation.None,
                    standalone: true
                }]
        }], ctorParameters: () => [{ type: i0.DestroyRef }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [FDP_MESSAGE_POPOVER_CONFIG]
                }] }], propDecorators: { _projectedForm: [{
                type: ContentChildren,
                args: [ControlContainer, { descendants: true }]
            }], _projectedFormFieldControls: [{
                type: ContentChildren,
                args: [FD_FORM_FIELD_CONTROL, { descendants: true }]
            }], _directiveItems: [{
                type: ContentChildren,
                args: [MessagePopoverFormItemDirective, { descendants: true }]
            }], forms: [{
                type: Input
            }], formFields: [{
                type: Input
            }] } });

class MessageViewComponent {
    /** @hidden */
    constructor(_destroyRef, _tabbableService, _document) {
        this._destroyRef = _destroyRef;
        this._tabbableService = _tabbableService;
        this._document = _document;
        /** Event emitted when user clicks on error entry containing additional description. */
        this.openDetails = new EventEmitter();
        /** Event emitted when user clicks on error entry and item's element should be focused. */
        this.focusItem = new EventEmitter();
        /** Event emitted when user clicks on the field link to focus on the field itself. */
        this.closePopover = new EventEmitter();
        /** @Hidden */
        this._initialClass = 'fd-message-popover__view-container';
        /** @hidden */
        this._activeListElement = null;
    }
    /** @hidden */
    ngAfterViewInit() {
        resizeObservable(this._detailsView.nativeElement)
            .pipe(debounceTime(20), takeUntilDestroyed(this._destroyRef))
            .subscribe(() => {
            const { height } = this._detailsView.nativeElement.getBoundingClientRect();
            this._listView.nativeElement.style.minHeight = `${height}px`;
        });
    }
    /** @hidden */
    _showDetails(entry) {
        this._activeListElement = this._document.activeElement;
        if (!entry.description.message) {
            this._focusElement(undefined, entry);
            return;
        }
        this.currentScreen = 'details';
        this.openDetails.emit(entry);
    }
    /** @hidden */
    _focusElement(event, item) {
        if (!item?.element?.nativeElement) {
            return;
        }
        event?.stopImmediatePropagation();
        this.closePopover.emit(false);
        this.focusItem.emit(item);
        setTimeout(() => {
            const tabbableElement = this._tabbableService.getTabbableElement(item.element?.nativeElement);
            tabbableElement?.focus();
        });
    }
    /** @hidden */
    _onListAnimationComplete(event) {
        if (event.toState === 'open' && this._activeListElement) {
            this._activeListElement.focus();
            this._activeListElement = null;
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MessageViewComponent, deps: [{ token: i0.DestroyRef }, { token: i1$1.TabbableElementService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: MessageViewComponent, isStandalone: true, selector: "fdp-message-view", inputs: { currentScreen: "currentScreen", filteredErrors: "filteredErrors", currentEntry: "currentEntry" }, outputs: { openDetails: "openDetails", focusItem: "focusItem", closePopover: "closePopover" }, host: { properties: { "class": "this._initialClass" } }, providers: [TabbableElementService], viewQueries: [{ propertyName: "_listView", first: true, predicate: ["listView"], descendants: true, read: ElementRef }, { propertyName: "_detailsView", first: true, predicate: ["detailsView"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-template #headingTemplate let-item>\n    <ng-template #directiveHeading>\n        <ng-template\n            [ngTemplateOutlet]=\"item.heading.message || item.description.message\"\n            [ngTemplateOutletContext]=\"{ $implicit: item.heading.error }\"\n        ></ng-template>\n    </ng-template>\n    <ng-template #i18nHeading>\n        <ng-template\n            [ngTemplateOutlet]=\"item.heading.message\"\n            [ngTemplateOutletContext]=\"{ $implicit: item.errors }\"\n        ></ng-template>\n    </ng-template>\n    <ng-template #stringHeading>\n        {{ item.heading.message | fdTranslate: { error: item.heading.error } : item.heading.message }}\n    </ng-template>\n    <ng-template\n        [ngTemplateOutlet]=\"\n            item.heading.type === 'directive'\n                ? directiveHeading\n                : item.heading.type === 'string'\n                  ? stringHeading\n                  : i18nHeading\n        \"\n    ></ng-template>\n</ng-template>\n<ng-template #descriptionTemplate let-item>\n    <ng-template #directiveDescription>\n        <ng-template\n            [ngTemplateOutlet]=\"item.description.message!\"\n            [ngTemplateOutletContext]=\"{ $implicit: item.description.error }\"\n        ></ng-template>\n    </ng-template>\n    <ng-template #i18nDescription>\n        <ng-template\n            [ngTemplateOutlet]=\"item.description.message!\"\n            [ngTemplateOutletContext]=\"{ $implicit: item.errors }\"\n        ></ng-template>\n    </ng-template>\n    <ng-template #stringDescription>\n        {{ item.description.message | fdTranslate: { error: item.description.error } : item.description.message }}\n    </ng-template>\n    <ng-template\n        [ngTemplateOutlet]=\"\n            item.heading.type === 'directive'\n                ? directiveDescription\n                : item.heading.type === 'string'\n                  ? stringDescription\n                  : i18nDescription\n        \"\n    ></ng-template>\n</ng-template>\n<div class=\"fd-message-view\">\n    <section\n        class=\"fd-message-view__list\"\n        tabindex=\"-1\"\n        [@openCloseList]=\"currentScreen === 'list' ? 'open' : 'closed'\"\n        (@openCloseList.done)=\"_onListAnimationComplete($event)\"\n        fd-scrollbar\n    >\n        <ul #listView fd-list class=\"message-popover__list fd-list--message-view\" [navigationIndicator]=\"true\">\n            @for (group of filteredErrors; track group) {\n                @if (group.group) {\n                    <li fd-list-group-header>\n                        <span fd-list-title>{{ group.group }}</span>\n                    </li>\n                }\n                @for (item of group.errors; track item; let i = $index) {\n                    <li fd-list-item [tabindex]=\"i === 0 ? 0 : -1\" [byline]=\"true\" (click)=\"_showDetails(item)\">\n                        <ng-template #itemIcon>\n                            <span\n                                fd-object-status\n                                class=\"fd-list__icon\"\n                                [status]=\"item.state\"\n                                [glyph]=\"'message-' + item.type\"\n                            ></span>\n                        </ng-template>\n                        <ng-template #listSubtitle>\n                            <span class=\"fd-list__subtitle\">\n                                <ng-template\n                                    [ngTemplateOutlet]=\"headingTemplate\"\n                                    [ngTemplateOutletContext]=\"{ $implicit: item }\"\n                                ></ng-template>\n                            </span>\n                        </ng-template>\n                        @if (item.element && !!item.description.message) {\n                            <span fd-list-link [navigationIndicator]=\"!!item.description.message\">\n                                <ng-template [ngTemplateOutlet]=\"itemIcon\"></ng-template>\n                                <span fd-list-content>\n                                    <span fd-list-title>\n                                        <a tabindex=\"0\" fd-link (click)=\"_focusElement($event, item)\">\n                                            {{ item.fieldName }}\n                                        </a>\n                                    </span>\n                                    <ng-template [ngTemplateOutlet]=\"listSubtitle\"></ng-template>\n                                </span>\n                            </span>\n                        } @else {\n                            <a fd-list-link [navigationIndicator]=\"!!item.description.message\">\n                                <ng-template [ngTemplateOutlet]=\"itemIcon\"></ng-template>\n                                <span fd-list-content>\n                                    <span fd-list-title>{{ item.fieldName }}</span>\n                                    <ng-template [ngTemplateOutlet]=\"listSubtitle\"></ng-template>\n                                </span>\n                            </a>\n                        }\n                    </li>\n                }\n            }\n        </ul>\n    </section>\n    <section class=\"fd-message-view__details\" [@openCloseDetails]=\"currentScreen === 'details' ? 'open' : 'closed'\">\n        <div #detailsView>\n            @if (currentEntry) {\n                <span class=\"fd-message-view__details-title\">\n                    <span\n                        fd-object-status\n                        class=\"fd-message-view__icon\"\n                        [status]=\"currentEntry.state\"\n                        [glyph]=\"'message-' + currentEntry.type\"\n                    ></span>\n                    <ng-template\n                        [ngTemplateOutlet]=\"headingTemplate\"\n                        [ngTemplateOutletContext]=\"{ $implicit: currentEntry }\"\n                    ></ng-template>\n                </span>\n                @if (currentEntry.description.message) {\n                    <span class=\"fd-message-view__details-description\">\n                        <ng-template\n                            [ngTemplateOutlet]=\"descriptionTemplate\"\n                            [ngTemplateOutletContext]=\"{ $implicit: currentEntry }\"\n                        ></ng-template>\n                    </span>\n                }\n            }\n        </div>\n    </section>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ScrollbarDirective, selector: "[fdScrollbar], [fd-scrollbar]", inputs: ["noHorizontalScroll", "noVerticalScroll", "alwaysVisible"] }, { kind: "ngmodule", type: ListModule }, { kind: "component", type: i2.ListComponent, selector: "[fd-list], [fdList]", inputs: ["dropdownMode", "multiInputMode", "mobileMode", "hasMessage", "noBorder", "navigationIndicator", "selection", "keyboardSupport", "byline", "subline", "theme", "unreadIndicator", "role", "settingsList", "settingsListFooter"], outputs: ["focusEscapeList"] }, { kind: "component", type: i2.ListItemComponent, selector: "[fdListItem] ,[fd-list-item]", inputs: ["selected", "noData", "action", "interactive", "growing", "counter", "active", "unread", "byline", "ariaRole", "id", "preventClick", "settingsListTpl"], outputs: ["keyDown"], exportAs: ["fdListItem"] }, { kind: "directive", type: i2.ListTitleDirective, selector: "[fd-list-title], [fdListTitle]", inputs: ["wrap", "truncate"] }, { kind: "directive", type: i2.ListGroupHeaderDirective, selector: "[fdListGroupHeader], [fd-list-group-header]", inputs: ["nativeElementId"], outputs: ["keyDown"] }, { kind: "directive", type: i2.ListLinkDirective, selector: "[fd-list-link], [fdListLink]", inputs: ["navigationIndicator", "navigated", "focusable"] }, { kind: "directive", type: i2.ListContentDirective, selector: "[fdListContent], [fd-list-content]", inputs: ["twoCol"] }, { kind: "component", type: ObjectStatusComponent, selector: "[fd-object-status]", inputs: ["class", "status", "glyph", "glyphFont", "label", "glyphAriaLabel", "indicationColor", "clickable", "inverted", "large", "secondaryIndication", "textTemplate"] }, { kind: "component", type: LinkComponent, selector: "[fdLink], [fd-link]", inputs: ["class", "emphasized", "disabled", "inverted", "subtle", "undecorated"] }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], animations: [
            trigger('openCloseList', [
                // ...
                state('open', style({
                    transform: 'translateX(0)',
                    opacity: 1
                })),
                state('closed', style({
                    transform: 'translateX(-50px)',
                    opacity: 0
                })),
                transition('open => closed', [animate('.1s cubic-bezier(0, 0, 0.2, 1)')]),
                transition('closed => open', [animate('0.1s .1s cubic-bezier(0, 0, 0.2, 1)')])
            ]),
            trigger('openCloseDetails', [
                state('open', style({
                    transform: 'translateX(0)',
                    opacity: 1,
                    display: 'block'
                })),
                state('closed', style({
                    transform: 'translateX(50px)',
                    opacity: 0
                })),
                transition('open => closed', [
                    animate('.1s cubic-bezier(0, 0, 0.2, 1)', keyframes([
                        style({
                            transform: 'translateX(0)',
                            opacity: 1,
                            display: 'block'
                        }),
                        style({
                            transform: 'translateX(50px)',
                            opacity: 0,
                            display: 'none'
                        })
                    ]))
                ]),
                transition('closed => open', [
                    style({
                        display: 'block'
                    }),
                    animate('0.1s .1s cubic-bezier(0, 0, 0.2, 1)')
                ])
            ])
        ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MessageViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fdp-message-view', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [TabbableElementService], animations: [
                        trigger('openCloseList', [
                            // ...
                            state('open', style({
                                transform: 'translateX(0)',
                                opacity: 1
                            })),
                            state('closed', style({
                                transform: 'translateX(-50px)',
                                opacity: 0
                            })),
                            transition('open => closed', [animate('.1s cubic-bezier(0, 0, 0.2, 1)')]),
                            transition('closed => open', [animate('0.1s .1s cubic-bezier(0, 0, 0.2, 1)')])
                        ]),
                        trigger('openCloseDetails', [
                            state('open', style({
                                transform: 'translateX(0)',
                                opacity: 1,
                                display: 'block'
                            })),
                            state('closed', style({
                                transform: 'translateX(50px)',
                                opacity: 0
                            })),
                            transition('open => closed', [
                                animate('.1s cubic-bezier(0, 0, 0.2, 1)', keyframes([
                                    style({
                                        transform: 'translateX(0)',
                                        opacity: 1,
                                        display: 'block'
                                    }),
                                    style({
                                        transform: 'translateX(50px)',
                                        opacity: 0,
                                        display: 'none'
                                    })
                                ]))
                            ]),
                            transition('closed => open', [
                                style({
                                    display: 'block'
                                }),
                                animate('0.1s .1s cubic-bezier(0, 0, 0.2, 1)')
                            ])
                        ])
                    ], imports: [
                        NgTemplateOutlet,
                        CdkScrollable,
                        ScrollbarDirective,
                        ListModule,
                        ObjectStatusComponent,
                        LinkComponent,
                        FdTranslatePipe
                    ], template: "<ng-template #headingTemplate let-item>\n    <ng-template #directiveHeading>\n        <ng-template\n            [ngTemplateOutlet]=\"item.heading.message || item.description.message\"\n            [ngTemplateOutletContext]=\"{ $implicit: item.heading.error }\"\n        ></ng-template>\n    </ng-template>\n    <ng-template #i18nHeading>\n        <ng-template\n            [ngTemplateOutlet]=\"item.heading.message\"\n            [ngTemplateOutletContext]=\"{ $implicit: item.errors }\"\n        ></ng-template>\n    </ng-template>\n    <ng-template #stringHeading>\n        {{ item.heading.message | fdTranslate: { error: item.heading.error } : item.heading.message }}\n    </ng-template>\n    <ng-template\n        [ngTemplateOutlet]=\"\n            item.heading.type === 'directive'\n                ? directiveHeading\n                : item.heading.type === 'string'\n                  ? stringHeading\n                  : i18nHeading\n        \"\n    ></ng-template>\n</ng-template>\n<ng-template #descriptionTemplate let-item>\n    <ng-template #directiveDescription>\n        <ng-template\n            [ngTemplateOutlet]=\"item.description.message!\"\n            [ngTemplateOutletContext]=\"{ $implicit: item.description.error }\"\n        ></ng-template>\n    </ng-template>\n    <ng-template #i18nDescription>\n        <ng-template\n            [ngTemplateOutlet]=\"item.description.message!\"\n            [ngTemplateOutletContext]=\"{ $implicit: item.errors }\"\n        ></ng-template>\n    </ng-template>\n    <ng-template #stringDescription>\n        {{ item.description.message | fdTranslate: { error: item.description.error } : item.description.message }}\n    </ng-template>\n    <ng-template\n        [ngTemplateOutlet]=\"\n            item.heading.type === 'directive'\n                ? directiveDescription\n                : item.heading.type === 'string'\n                  ? stringDescription\n                  : i18nDescription\n        \"\n    ></ng-template>\n</ng-template>\n<div class=\"fd-message-view\">\n    <section\n        class=\"fd-message-view__list\"\n        tabindex=\"-1\"\n        [@openCloseList]=\"currentScreen === 'list' ? 'open' : 'closed'\"\n        (@openCloseList.done)=\"_onListAnimationComplete($event)\"\n        fd-scrollbar\n    >\n        <ul #listView fd-list class=\"message-popover__list fd-list--message-view\" [navigationIndicator]=\"true\">\n            @for (group of filteredErrors; track group) {\n                @if (group.group) {\n                    <li fd-list-group-header>\n                        <span fd-list-title>{{ group.group }}</span>\n                    </li>\n                }\n                @for (item of group.errors; track item; let i = $index) {\n                    <li fd-list-item [tabindex]=\"i === 0 ? 0 : -1\" [byline]=\"true\" (click)=\"_showDetails(item)\">\n                        <ng-template #itemIcon>\n                            <span\n                                fd-object-status\n                                class=\"fd-list__icon\"\n                                [status]=\"item.state\"\n                                [glyph]=\"'message-' + item.type\"\n                            ></span>\n                        </ng-template>\n                        <ng-template #listSubtitle>\n                            <span class=\"fd-list__subtitle\">\n                                <ng-template\n                                    [ngTemplateOutlet]=\"headingTemplate\"\n                                    [ngTemplateOutletContext]=\"{ $implicit: item }\"\n                                ></ng-template>\n                            </span>\n                        </ng-template>\n                        @if (item.element && !!item.description.message) {\n                            <span fd-list-link [navigationIndicator]=\"!!item.description.message\">\n                                <ng-template [ngTemplateOutlet]=\"itemIcon\"></ng-template>\n                                <span fd-list-content>\n                                    <span fd-list-title>\n                                        <a tabindex=\"0\" fd-link (click)=\"_focusElement($event, item)\">\n                                            {{ item.fieldName }}\n                                        </a>\n                                    </span>\n                                    <ng-template [ngTemplateOutlet]=\"listSubtitle\"></ng-template>\n                                </span>\n                            </span>\n                        } @else {\n                            <a fd-list-link [navigationIndicator]=\"!!item.description.message\">\n                                <ng-template [ngTemplateOutlet]=\"itemIcon\"></ng-template>\n                                <span fd-list-content>\n                                    <span fd-list-title>{{ item.fieldName }}</span>\n                                    <ng-template [ngTemplateOutlet]=\"listSubtitle\"></ng-template>\n                                </span>\n                            </a>\n                        }\n                    </li>\n                }\n            }\n        </ul>\n    </section>\n    <section class=\"fd-message-view__details\" [@openCloseDetails]=\"currentScreen === 'details' ? 'open' : 'closed'\">\n        <div #detailsView>\n            @if (currentEntry) {\n                <span class=\"fd-message-view__details-title\">\n                    <span\n                        fd-object-status\n                        class=\"fd-message-view__icon\"\n                        [status]=\"currentEntry.state\"\n                        [glyph]=\"'message-' + currentEntry.type\"\n                    ></span>\n                    <ng-template\n                        [ngTemplateOutlet]=\"headingTemplate\"\n                        [ngTemplateOutletContext]=\"{ $implicit: currentEntry }\"\n                    ></ng-template>\n                </span>\n                @if (currentEntry.description.message) {\n                    <span class=\"fd-message-view__details-description\">\n                        <ng-template\n                            [ngTemplateOutlet]=\"descriptionTemplate\"\n                            [ngTemplateOutletContext]=\"{ $implicit: currentEntry }\"\n                        ></ng-template>\n                    </span>\n                }\n            }\n        </div>\n    </section>\n</div>\n" }]
        }], ctorParameters: () => [{ type: i0.DestroyRef }, { type: i1$1.TabbableElementService }, { type: Document, decorators: [{
                    type: Inject,
                    args: [DOCUMENT]
                }] }], propDecorators: { currentScreen: [{
                type: Input
            }], filteredErrors: [{
                type: Input
            }], currentEntry: [{
                type: Input
            }], openDetails: [{
                type: Output
            }], focusItem: [{
                type: Output
            }], closePopover: [{
                type: Output
            }], _listView: [{
                type: ViewChild,
                args: ['listView', { read: ElementRef }]
            }], _detailsView: [{
                type: ViewChild,
                args: ['detailsView', { read: ElementRef }]
            }], _initialClass: [{
                type: HostBinding,
                args: ['class']
            }] } });

class MessagePopoverComponent {
    constructor() {
        /** Event emits when user clicks on error entry and item's element needs to be focused. */
        this.focusItem = new EventEmitter();
        /** Current message popover screen. Can be `list` or `details`. */
        this.currentScreen = 'list';
        /** @hidden */
        this._currentErrorType$ = signal('all', ...(ngDevMode ? [{ debugName: "_currentErrorType$" }] : []));
        /** @hidden */
        this._errorTypes$ = computed(() => {
            const countedErrors = this._countedErrors$();
            const errorTypes = Object.keys(countedErrors);
            return errorTypes.map((errorType) => ({
                group: errorType,
                count: countedErrors[errorType],
                state: convertFormState(errorType)
            }));
        }, ...(ngDevMode ? [{ debugName: "_errorTypes$" }] : []));
        /** @hidden */
        this._priorityStateItemsCount$ = computed(() => this._countedErrors$()[this._priorityFormState$()] || 0, ...(ngDevMode ? [{ debugName: "_priorityStateItemsCount$" }] : []));
        /** @hidden */
        this._priorityFormState$ = computed(() => {
            const countedErrors = this._countedErrors$();
            const errorTypes = Object.keys(countedErrors);
            return getFormState(errorTypes);
        }, ...(ngDevMode ? [{ debugName: "_priorityFormState$" }] : []));
        /** @hidden */
        this._priorityState$ = computed(() => convertFormStateToMessagePopoverState(this._priorityFormState$()), ...(ngDevMode ? [{ debugName: "_priorityState$" }] : []));
        /** @hidden */
        this._filteredErrors$ = computed(() => {
            const groupedErrors = this._groupedErrors$();
            const errorType = this._currentErrorType$();
            if (errorType === 'all') {
                return groupedErrors;
            }
            const filteredErrors = [];
            groupedErrors.forEach((group) => {
                const errors = group.errors.filter((error) => error.type === errorType);
                if (errors.length === 0) {
                    return;
                }
                filteredErrors.push({
                    group: group.group,
                    errors
                });
            });
            return filteredErrors;
        }, ...(ngDevMode ? [{ debugName: "_filteredErrors$" }] : []));
        this._groupedErrors$ = computed(() => this._wrapper$()?.errors$() || [], ...(ngDevMode ? [{ debugName: "_groupedErrors$" }] : []));
        this._wrapper$ = signal(null, ...(ngDevMode ? [{ debugName: "_wrapper$" }] : []));
        this._countedErrors$ = computed(() => countBy(flatten(Object.values(this._groupedErrors$().map((group) => group.errors))), 'type'), ...(ngDevMode ? [{ debugName: "_countedErrors$" }] : []));
    }
    /** Message Popover Wrapper component. */
    set wrapper(value) {
        value?.setMessagePopover(this);
        this._wrapper$.set(value);
    }
    get wrapper() {
        return this._wrapper$();
    }
    /** @hidden */
    _showList() {
        this.currentScreen = 'list';
        this.currentEntry = null;
    }
    /** @hidden */
    _showDetails(entry) {
        this.currentScreen = 'details';
        this.currentEntry = entry;
    }
    /** @hidden */
    _closePopover(focusLast = true) {
        this._popover.close(focusLast);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MessagePopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: MessagePopoverComponent, isStandalone: true, selector: "fdp-message-popover", inputs: { wrapper: "wrapper" }, outputs: { focusItem: "focusItem" }, viewQueries: [{ propertyName: "_popover", first: true, predicate: ["popover"], descendants: true }], ngImport: i0, template: "@if (_errorTypes$().length > 0) {\n    <fd-popover\n        #popover\n        placement=\"top-start\"\n        [focusTrapped]=\"true\"\n        [focusAutoCapture]=\"true\"\n        [disableScrollbar]=\"true\"\n    >\n        <fd-popover-control>\n            <button\n                fd-button\n                type=\"button\"\n                class=\"fd-message-popover__trigger fd-message-popover__trigger\"\n                [ngClass]=\"'fd-message-popover__trigger--' + _priorityState$()\"\n                [glyph]=\"'message-' + _priorityFormState$()\"\n                [label]=\"_priorityStateItemsCount$().toString()\"\n            ></button>\n        </fd-popover-control>\n        <div>\n            <div fd-popover-body-header>\n                <div fd-bar barDesign=\"header\" class=\"fd-bar--growing\">\n                    <div fd-bar-left>\n                        @if (currentScreen === 'list') {\n                            <fd-segmented-button\n                                [ngModel]=\"_currentErrorType$()\"\n                                (ngModelChange)=\"_currentErrorType$.set($event)\"\n                            >\n                                <button\n                                    fd-button\n                                    [label]=\"'platformMessagePopover.allErrors' | fdTranslate\"\n                                    value=\"all\"\n                                ></button>\n                                @for (type of _errorTypes$(); track type) {\n                                    <button fd-button [value]=\"type.group\">\n                                        <span\n                                            fd-object-status\n                                            [status]=\"type.state\"\n                                            [glyph]=\"'message-' + type.group\"\n                                        ></span>\n                                        <span class=\"fd-button__text\">{{ type.count }}</span>\n                                    </button>\n                                }\n                            </fd-segmented-button>\n                        }\n                        @if (currentScreen === 'details') {\n                            <button\n                                fd-button\n                                fdkInitialFocus\n                                fdType=\"transparent\"\n                                glyph=\"navigation-left-arrow\"\n                                title=\"Go back\"\n                                (click)=\"_showList()\"\n                            ></button>\n                        }\n                    </div>\n                    <div fd-bar-right>\n                        <button fd-button fdType=\"transparent\" (click)=\"popover.close()\" glyph=\"decline\"></button>\n                    </div>\n                </div>\n            </div>\n            <fdp-message-view\n                [currentScreen]=\"currentScreen\"\n                [filteredErrors]=\"_filteredErrors$()\"\n                [currentEntry]=\"currentEntry\"\n                (openDetails)=\"_showDetails($event)\"\n                (closePopover)=\"_closePopover($event)\"\n                (focusItem)=\"focusItem.emit($event)\"\n            ></fdp-message-view>\n        </div>\n    </fd-popover>\n}\n", styles: [".fd-message-view{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;position:relative}.fd-message-view:after,.fd-message-view:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__list{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;max-height:50vh;max-width:26rem;padding-block:0;padding-inline:0}.fd-message-view__list:after,.fd-message-view__list:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__list--hidden{opacity:0}.fd-message-view__details{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:none;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;inset:0;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-block:1rem;padding-inline:0;padding-inline:3.5rem 1rem;position:absolute}.fd-message-view__details:after,.fd-message-view__details:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__details-title{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapGroup_TitleTextColor);font-family:var(--sapFontFamily);font-family:var(--sapFontHeaderFamily);font-size:var(--sapFontSize);font-size:var(--sapFontHeader5Size);font-weight:400;font-weight:var(--sapFontHeaderWeight);forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-margin-after:1rem;display:block;margin-block-end:1rem;white-space:normal;-webkit-margin-start:0;margin-inline-start:0}.fd-message-view__details-title:after,.fd-message-view__details-title:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__details-title .fd-message-view__icon{font-size:1rem;margin-block:0;margin-inline:-2rem .5rem}.fd-message-view__details-description{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;line-height:1.4;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-margin-after:1rem;display:block;margin-block-end:1rem;white-space:normal}.fd-message-view__details-description:after,.fd-message-view__details-description:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__details--visible{display:block}.fd-message-popover__trigger{--fdButtonFocusColor:var(--sapContent_ContrastFocusColor);border-width:var(--fdMessagePopover_Trigger_Border_Width);text-shadow:var(--fdButtonTextShadow)}.fd-message-popover__trigger.fd-message-popover__trigger--critical{--fdButtonColor:var(--sapButton_Critical_TextColor);--fdButtonBackgroundColor:var(--sapButton_Critical_Background);--fdButtonBorderColor:var(--sapButton_Critical_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Critical_Regular_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-focus,.fd-message-popover__trigger.fd-message-popover__trigger--critical:focus{z-index:5}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-focus:after,.fd-message-popover__trigger.fd-message-popover__trigger--critical:focus:after{border-color:var(--fdButtonFocusColor)}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-hover,.fd-message-popover__trigger.fd-message-popover__trigger--critical:hover{--fdButtonColor:var(--sapButton_Critical_Hover_TextColor);--fdButtonBackgroundColor:var(--sapButton_Critical_Hover_Background);--fdButtonBorderColor:var(--sapButton_Critical_Hover_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Critical_Hover_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-active,.fd-message-popover__trigger.fd-message-popover__trigger--critical:active{--fdButtonColor:var(--sapButton_Critical_Active_TextColor);--fdButtonBackgroundColor:var(--sapButton_Critical_Active_Background);--fdButtonBorderColor:var(--sapButton_Critical_Active_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Critical_Active_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Active_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-disabled,.fd-message-popover__trigger.fd-message-popover__trigger--critical:disabled,.fd-message-popover__trigger.fd-message-popover__trigger--critical[aria-disabled=true]{--fdButtonColor:var(--sapButton_Critical_TextColor);--fdButtonBackgroundColor:var(--sapButton_Critical_Background);--fdButtonBorderColor:var(--sapButton_Critical_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Critical_Regular_Text_Shadow);opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-message-popover__trigger.fd-message-popover__trigger--negative{--fdButtonColor:var(--sapButton_Negative_TextColor);--fdButtonBackgroundColor:var(--sapButton_Negative_Background);--fdButtonBorderColor:var(--sapButton_Negative_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Negative_Regular_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-focus,.fd-message-popover__trigger.fd-message-popover__trigger--negative:focus{z-index:5}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-focus:after,.fd-message-popover__trigger.fd-message-popover__trigger--negative:focus:after{border-color:var(--fdButtonFocusColor)}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-hover,.fd-message-popover__trigger.fd-message-popover__trigger--negative:hover{--fdButtonColor:var(--sapButton_Negative_Hover_TextColor);--fdButtonBackgroundColor:var(--sapButton_Negative_Hover_Background);--fdButtonBorderColor:var(--sapButton_Negative_Hover_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Negative_Hover_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-active,.fd-message-popover__trigger.fd-message-popover__trigger--negative:active{--fdButtonColor:var(--sapButton_Negative_Active_TextColor);--fdButtonBackgroundColor:var(--sapButton_Negative_Active_Background);--fdButtonBorderColor:var(--sapButton_Negative_Active_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Negative_Active_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Active_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-disabled,.fd-message-popover__trigger.fd-message-popover__trigger--negative:disabled,.fd-message-popover__trigger.fd-message-popover__trigger--negative[aria-disabled=true]{--fdButtonColor:var(--sapButton_Negative_TextColor);--fdButtonBackgroundColor:var(--sapButton_Negative_Background);--fdButtonBorderColor:var(--sapButton_Negative_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Negative_Regular_Text_Shadow);opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-message-popover__trigger.fd-message-popover__trigger--success{--fdButtonColor:var(--sapButton_Success_TextColor);--fdButtonBackgroundColor:var(--sapButton_Success_Background);--fdButtonBorderColor:var(--sapButton_Success_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Success_Regular_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-focus,.fd-message-popover__trigger.fd-message-popover__trigger--success:focus{z-index:5}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-focus:after,.fd-message-popover__trigger.fd-message-popover__trigger--success:focus:after{border-color:var(--fdButtonFocusColor)}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-hover,.fd-message-popover__trigger.fd-message-popover__trigger--success:hover{--fdButtonColor:var(--sapButton_Success_Hover_TextColor);--fdButtonBackgroundColor:var(--sapButton_Success_Hover_Background);--fdButtonBorderColor:var(--sapButton_Success_Hover_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Success_Hover_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-active,.fd-message-popover__trigger.fd-message-popover__trigger--success:active{--fdButtonColor:var(--sapButton_Success_Active_TextColor);--fdButtonBackgroundColor:var(--sapButton_Success_Active_Background);--fdButtonBorderColor:var(--sapButton_Success_Active_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Success_Active_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Active_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-disabled,.fd-message-popover__trigger.fd-message-popover__trigger--success:disabled,.fd-message-popover__trigger.fd-message-popover__trigger--success[aria-disabled=true]{--fdButtonColor:var(--sapButton_Success_TextColor);--fdButtonBackgroundColor:var(--sapButton_Success_Background);--fdButtonBorderColor:var(--sapButton_Success_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Success_Regular_Text_Shadow);opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-message-popover__trigger.fd-message-popover__trigger--information{--fdButtonColor:var(--fdMessagePopover_Information_Regular_Color);--fdButtonBackgroundColor:var(--fdMessagePopover_Information_Regular_Background_Color);--fdButtonBorderColor:var(--fdMessagePopover_Information_Regular_Border_Color);--fdButtonTextShadow:var(--fdMessagePopover_Information_Regular_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Information_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-focus,.fd-message-popover__trigger.fd-message-popover__trigger--information:focus{z-index:5}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-focus:after,.fd-message-popover__trigger.fd-message-popover__trigger--information:focus:after{border-color:var(--fdButtonFocusColor)}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-hover,.fd-message-popover__trigger.fd-message-popover__trigger--information:hover{--fdButtonColor:var(--fdMessagePopover_Information_Hover_Color);--fdButtonBackgroundColor:var(--fdMessagePopover_Information_Hover_Background_Color);--fdButtonBorderColor:var(--fdMessagePopover_Information_Hover_Border_Color);--fdButtonTextShadow:var(--fdMessagePopover_Information_Hover_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-active,.fd-message-popover__trigger.fd-message-popover__trigger--information:active{--fdButtonColor:var(--fdMessagePopover_Information_Active_Color);--fdButtonBackgroundColor:var(--fdMessagePopover_Information_Active_Background_Color);--fdButtonBorderColor:var(--fdMessagePopover_Information_Active_Border_Color);--fdButtonTextShadow:var(--fdMessagePopover_Information_Active_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Active_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-disabled,.fd-message-popover__trigger.fd-message-popover__trigger--information:disabled,.fd-message-popover__trigger.fd-message-popover__trigger--information[aria-disabled=true]{--fdButtonColor:var(--fdMessagePopover_Information_Regular_Color);--fdButtonBackgroundColor:var(--fdMessagePopover_Information_Regular_Background_Color);--fdButtonBorderColor:var(--fdMessagePopover_Information_Regular_Border_Color);--fdButtonTextShadow:var(--fdMessagePopover_Information_Regular_Text_Shadow);opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-message-popover__view-container{border-bottom-left-radius:var(--fdPopover_Border_Radius);border-bottom-right-radius:var(--fdPopover_Border_Radius);overflow:hidden;display:block;max-height:40vh}.fd-message-popover__view-container .fd-message-view .fd-list__item:first-child{border-top-left-radius:0;border-top-right-radius:0}.fd-message-popover__view-container .fd-message-view .fd-list__item:first-child:before{border-top-left-radius:0;border-top-right-radius:0}.fd-message-popover__view-container .fd-message-view .fd-list__item:last-child{border-bottom-left-radius:0;border-bottom-right-radius:0}.fd-message-popover__view-container .fd-message-view .fd-list__item:last-child:before{border-bottom-left-radius:0;border-bottom-right-radius:0}.fd-message-view__list{min-width:20rem;min-height:10rem;max-height:40vh}.fd-message-view__list .fd-link{font-size:inherit}.fd-message-view__list .fd-list__link:active,.fd-message-view__list .fd-list__link.is-active{--sapLinkColor: var(--sapList_Active_TextColor);--sapLink_Active_Color: var(--sapList_Active_TextColor)}\n/*! Bundled license information:\n\nfundamental-styles/dist/message-popover.css:\n  (*!\n   * Fundamental Library Styles v0.40.1\n   * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"], dependencies: [{ kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i1$2.PopoverControlComponent, selector: "fd-popover-control, [fdPopoverControl]" }, { kind: "directive", type: i1$2.PopoverBodyHeaderDirective, selector: "[fdPopoverBodyHeader], [fd-popover-body-header]" }, { kind: "component", type: i1$2.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll"] }, { kind: "component", type: ButtonComponent, selector: "button[fd-button], a[fd-button], span[fd-button]", inputs: ["class", "id"], exportAs: ["fd-button"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: BarModule }, { kind: "component", type: i2$1.BarComponent, selector: "[fd-bar]", inputs: ["class", "barDesign", "inPage", "inHomePage", "clear", "size", "role"] }, { kind: "directive", type: i2$1.BarLeftDirective, selector: "[fd-bar-left]" }, { kind: "directive", type: i2$1.BarRightDirective, selector: "[fd-bar-right]" }, { kind: "component", type: SegmentedButtonComponent, selector: "fd-segmented-button", inputs: ["toggle", "vertical"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ObjectStatusComponent, selector: "[fd-object-status]", inputs: ["class", "status", "glyph", "glyphFont", "label", "glyphAriaLabel", "indicationColor", "clickable", "inverted", "large", "secondaryIndication", "textTemplate"] }, { kind: "directive", type: InitialFocusDirective, selector: "[fdkInitialFocus]", inputs: ["fdkInitialFocus", "enabled", "focusLastElement"] }, { kind: "component", type: MessageViewComponent, selector: "fdp-message-view", inputs: ["currentScreen", "filteredErrors", "currentEntry"], outputs: ["openDetails", "focusItem", "closePopover"] }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MessagePopoverComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fdp-message-popover', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
                        PopoverModule,
                        ButtonComponent,
                        NgClass,
                        BarModule,
                        SegmentedButtonComponent,
                        FormsModule,
                        ObjectStatusComponent,
                        InitialFocusDirective,
                        MessageViewComponent,
                        FdTranslatePipe
                    ], template: "@if (_errorTypes$().length > 0) {\n    <fd-popover\n        #popover\n        placement=\"top-start\"\n        [focusTrapped]=\"true\"\n        [focusAutoCapture]=\"true\"\n        [disableScrollbar]=\"true\"\n    >\n        <fd-popover-control>\n            <button\n                fd-button\n                type=\"button\"\n                class=\"fd-message-popover__trigger fd-message-popover__trigger\"\n                [ngClass]=\"'fd-message-popover__trigger--' + _priorityState$()\"\n                [glyph]=\"'message-' + _priorityFormState$()\"\n                [label]=\"_priorityStateItemsCount$().toString()\"\n            ></button>\n        </fd-popover-control>\n        <div>\n            <div fd-popover-body-header>\n                <div fd-bar barDesign=\"header\" class=\"fd-bar--growing\">\n                    <div fd-bar-left>\n                        @if (currentScreen === 'list') {\n                            <fd-segmented-button\n                                [ngModel]=\"_currentErrorType$()\"\n                                (ngModelChange)=\"_currentErrorType$.set($event)\"\n                            >\n                                <button\n                                    fd-button\n                                    [label]=\"'platformMessagePopover.allErrors' | fdTranslate\"\n                                    value=\"all\"\n                                ></button>\n                                @for (type of _errorTypes$(); track type) {\n                                    <button fd-button [value]=\"type.group\">\n                                        <span\n                                            fd-object-status\n                                            [status]=\"type.state\"\n                                            [glyph]=\"'message-' + type.group\"\n                                        ></span>\n                                        <span class=\"fd-button__text\">{{ type.count }}</span>\n                                    </button>\n                                }\n                            </fd-segmented-button>\n                        }\n                        @if (currentScreen === 'details') {\n                            <button\n                                fd-button\n                                fdkInitialFocus\n                                fdType=\"transparent\"\n                                glyph=\"navigation-left-arrow\"\n                                title=\"Go back\"\n                                (click)=\"_showList()\"\n                            ></button>\n                        }\n                    </div>\n                    <div fd-bar-right>\n                        <button fd-button fdType=\"transparent\" (click)=\"popover.close()\" glyph=\"decline\"></button>\n                    </div>\n                </div>\n            </div>\n            <fdp-message-view\n                [currentScreen]=\"currentScreen\"\n                [filteredErrors]=\"_filteredErrors$()\"\n                [currentEntry]=\"currentEntry\"\n                (openDetails)=\"_showDetails($event)\"\n                (closePopover)=\"_closePopover($event)\"\n                (focusItem)=\"focusItem.emit($event)\"\n            ></fdp-message-view>\n        </div>\n    </fd-popover>\n}\n", styles: [".fd-message-view{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;position:relative}.fd-message-view:after,.fd-message-view:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__list{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;max-height:50vh;max-width:26rem;padding-block:0;padding-inline:0}.fd-message-view__list:after,.fd-message-view__list:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__list--hidden{opacity:0}.fd-message-view__details{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:none;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;inset:0;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-block:1rem;padding-inline:0;padding-inline:3.5rem 1rem;position:absolute}.fd-message-view__details:after,.fd-message-view__details:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__details-title{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapGroup_TitleTextColor);font-family:var(--sapFontFamily);font-family:var(--sapFontHeaderFamily);font-size:var(--sapFontSize);font-size:var(--sapFontHeader5Size);font-weight:400;font-weight:var(--sapFontHeaderWeight);forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-margin-after:1rem;display:block;margin-block-end:1rem;white-space:normal;-webkit-margin-start:0;margin-inline-start:0}.fd-message-view__details-title:after,.fd-message-view__details-title:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__details-title .fd-message-view__icon{font-size:1rem;margin-block:0;margin-inline:-2rem .5rem}.fd-message-view__details-description{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;line-height:1.4;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-margin-after:1rem;display:block;margin-block-end:1rem;white-space:normal}.fd-message-view__details-description:after,.fd-message-view__details-description:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-message-view__details--visible{display:block}.fd-message-popover__trigger{--fdButtonFocusColor:var(--sapContent_ContrastFocusColor);border-width:var(--fdMessagePopover_Trigger_Border_Width);text-shadow:var(--fdButtonTextShadow)}.fd-message-popover__trigger.fd-message-popover__trigger--critical{--fdButtonColor:var(--sapButton_Critical_TextColor);--fdButtonBackgroundColor:var(--sapButton_Critical_Background);--fdButtonBorderColor:var(--sapButton_Critical_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Critical_Regular_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-focus,.fd-message-popover__trigger.fd-message-popover__trigger--critical:focus{z-index:5}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-focus:after,.fd-message-popover__trigger.fd-message-popover__trigger--critical:focus:after{border-color:var(--fdButtonFocusColor)}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-hover,.fd-message-popover__trigger.fd-message-popover__trigger--critical:hover{--fdButtonColor:var(--sapButton_Critical_Hover_TextColor);--fdButtonBackgroundColor:var(--sapButton_Critical_Hover_Background);--fdButtonBorderColor:var(--sapButton_Critical_Hover_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Critical_Hover_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-active,.fd-message-popover__trigger.fd-message-popover__trigger--critical:active{--fdButtonColor:var(--sapButton_Critical_Active_TextColor);--fdButtonBackgroundColor:var(--sapButton_Critical_Active_Background);--fdButtonBorderColor:var(--sapButton_Critical_Active_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Critical_Active_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Active_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--critical.is-disabled,.fd-message-popover__trigger.fd-message-popover__trigger--critical:disabled,.fd-message-popover__trigger.fd-message-popover__trigger--critical[aria-disabled=true]{--fdButtonColor:var(--sapButton_Critical_TextColor);--fdButtonBackgroundColor:var(--sapButton_Critical_Background);--fdButtonBorderColor:var(--sapButton_Critical_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Critical_Regular_Text_Shadow);opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-message-popover__trigger.fd-message-popover__trigger--negative{--fdButtonColor:var(--sapButton_Negative_TextColor);--fdButtonBackgroundColor:var(--sapButton_Negative_Background);--fdButtonBorderColor:var(--sapButton_Negative_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Negative_Regular_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-focus,.fd-message-popover__trigger.fd-message-popover__trigger--negative:focus{z-index:5}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-focus:after,.fd-message-popover__trigger.fd-message-popover__trigger--negative:focus:after{border-color:var(--fdButtonFocusColor)}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-hover,.fd-message-popover__trigger.fd-message-popover__trigger--negative:hover{--fdButtonColor:var(--sapButton_Negative_Hover_TextColor);--fdButtonBackgroundColor:var(--sapButton_Negative_Hover_Background);--fdButtonBorderColor:var(--sapButton_Negative_Hover_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Negative_Hover_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-active,.fd-message-popover__trigger.fd-message-popover__trigger--negative:active{--fdButtonColor:var(--sapButton_Negative_Active_TextColor);--fdButtonBackgroundColor:var(--sapButton_Negative_Active_Background);--fdButtonBorderColor:var(--sapButton_Negative_Active_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Negative_Active_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Active_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--negative.is-disabled,.fd-message-popover__trigger.fd-message-popover__trigger--negative:disabled,.fd-message-popover__trigger.fd-message-popover__trigger--negative[aria-disabled=true]{--fdButtonColor:var(--sapButton_Negative_TextColor);--fdButtonBackgroundColor:var(--sapButton_Negative_Background);--fdButtonBorderColor:var(--sapButton_Negative_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Negative_Regular_Text_Shadow);opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-message-popover__trigger.fd-message-popover__trigger--success{--fdButtonColor:var(--sapButton_Success_TextColor);--fdButtonBackgroundColor:var(--sapButton_Success_Background);--fdButtonBorderColor:var(--sapButton_Success_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Success_Regular_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-focus,.fd-message-popover__trigger.fd-message-popover__trigger--success:focus{z-index:5}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-focus:after,.fd-message-popover__trigger.fd-message-popover__trigger--success:focus:after{border-color:var(--fdButtonFocusColor)}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-hover,.fd-message-popover__trigger.fd-message-popover__trigger--success:hover{--fdButtonColor:var(--sapButton_Success_Hover_TextColor);--fdButtonBackgroundColor:var(--sapButton_Success_Hover_Background);--fdButtonBorderColor:var(--sapButton_Success_Hover_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Success_Hover_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-active,.fd-message-popover__trigger.fd-message-popover__trigger--success:active{--fdButtonColor:var(--sapButton_Success_Active_TextColor);--fdButtonBackgroundColor:var(--sapButton_Success_Active_Background);--fdButtonBorderColor:var(--sapButton_Success_Active_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Success_Active_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Active_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--success.is-disabled,.fd-message-popover__trigger.fd-message-popover__trigger--success:disabled,.fd-message-popover__trigger.fd-message-popover__trigger--success[aria-disabled=true]{--fdButtonColor:var(--sapButton_Success_TextColor);--fdButtonBackgroundColor:var(--sapButton_Success_Background);--fdButtonBorderColor:var(--sapButton_Success_BorderColor);--fdButtonTextShadow:var(--fdMessagePopover_Success_Regular_Text_Shadow);opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-message-popover__trigger.fd-message-popover__trigger--information{--fdButtonColor:var(--fdMessagePopover_Information_Regular_Color);--fdButtonBackgroundColor:var(--fdMessagePopover_Information_Regular_Background_Color);--fdButtonBorderColor:var(--fdMessagePopover_Information_Regular_Border_Color);--fdButtonTextShadow:var(--fdMessagePopover_Information_Regular_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Information_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-focus,.fd-message-popover__trigger.fd-message-popover__trigger--information:focus{z-index:5}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-focus:after,.fd-message-popover__trigger.fd-message-popover__trigger--information:focus:after{border-color:var(--fdButtonFocusColor)}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-hover,.fd-message-popover__trigger.fd-message-popover__trigger--information:hover{--fdButtonColor:var(--fdMessagePopover_Information_Hover_Color);--fdButtonBackgroundColor:var(--fdMessagePopover_Information_Hover_Background_Color);--fdButtonBorderColor:var(--fdMessagePopover_Information_Hover_Border_Color);--fdButtonTextShadow:var(--fdMessagePopover_Information_Hover_Text_Shadow)}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-active,.fd-message-popover__trigger.fd-message-popover__trigger--information:active{--fdButtonColor:var(--fdMessagePopover_Information_Active_Color);--fdButtonBackgroundColor:var(--fdMessagePopover_Information_Active_Background_Color);--fdButtonBorderColor:var(--fdMessagePopover_Information_Active_Border_Color);--fdButtonTextShadow:var(--fdMessagePopover_Information_Active_Text_Shadow);--fdButtonFocusColor:var(--fdMessagePopover_Active_Focus_Outline_Color)}.fd-message-popover__trigger.fd-message-popover__trigger--information.is-disabled,.fd-message-popover__trigger.fd-message-popover__trigger--information:disabled,.fd-message-popover__trigger.fd-message-popover__trigger--information[aria-disabled=true]{--fdButtonColor:var(--fdMessagePopover_Information_Regular_Color);--fdButtonBackgroundColor:var(--fdMessagePopover_Information_Regular_Background_Color);--fdButtonBorderColor:var(--fdMessagePopover_Information_Regular_Border_Color);--fdButtonTextShadow:var(--fdMessagePopover_Information_Regular_Text_Shadow);opacity:var(--sapContent_DisabledOpacity);pointer-events:none}.fd-message-popover__view-container{border-bottom-left-radius:var(--fdPopover_Border_Radius);border-bottom-right-radius:var(--fdPopover_Border_Radius);overflow:hidden;display:block;max-height:40vh}.fd-message-popover__view-container .fd-message-view .fd-list__item:first-child{border-top-left-radius:0;border-top-right-radius:0}.fd-message-popover__view-container .fd-message-view .fd-list__item:first-child:before{border-top-left-radius:0;border-top-right-radius:0}.fd-message-popover__view-container .fd-message-view .fd-list__item:last-child{border-bottom-left-radius:0;border-bottom-right-radius:0}.fd-message-popover__view-container .fd-message-view .fd-list__item:last-child:before{border-bottom-left-radius:0;border-bottom-right-radius:0}.fd-message-view__list{min-width:20rem;min-height:10rem;max-height:40vh}.fd-message-view__list .fd-link{font-size:inherit}.fd-message-view__list .fd-list__link:active,.fd-message-view__list .fd-list__link.is-active{--sapLinkColor: var(--sapList_Active_TextColor);--sapLink_Active_Color: var(--sapList_Active_TextColor)}\n/*! Bundled license information:\n\nfundamental-styles/dist/message-popover.css:\n  (*!\n   * Fundamental Library Styles v0.40.1\n   * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"] }]
        }], propDecorators: { _popover: [{
                type: ViewChild,
                args: ['popover']
            }], wrapper: [{
                type: Input
            }], focusItem: [{
                type: Output
            }] } });

class PlatformMessagePopoverModule {
    /**
     * Method allows users to apply custom configuration.
     * @param config Object containing error definitions.
     */
    static withConfig(config) {
        const customConfig = mergeWith(FDP_MESSAGE_POPOVER_DEFAULT_CONFIG, config, (obj, src) => {
            if (typeof obj === 'object' && !Array.isArray(obj)) {
                return Object.assign(obj, src);
            }
            else if (Array.isArray(obj)) {
                return obj.concat(src);
            }
            else {
                return src;
            }
        });
        return {
            ngModule: PlatformMessagePopoverModule,
            providers: [
                {
                    provide: FDP_MESSAGE_POPOVER_CONFIG,
                    useValue: customConfig
                }
            ]
        };
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformMessagePopoverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.4", ngImport: i0, type: PlatformMessagePopoverModule, imports: [MessagePopoverComponent,
            MessagePopoverFormWrapperComponent,
            MessageViewComponent,
            MessagePopoverFormItemDirective], exports: [MessagePopoverComponent,
            MessagePopoverFormWrapperComponent,
            MessageViewComponent,
            MessagePopoverFormItemDirective] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformMessagePopoverModule, providers: [
            {
                provide: FDP_MESSAGE_POPOVER_CONFIG,
                useValue: FDP_MESSAGE_POPOVER_DEFAULT_CONFIG
            }
        ], imports: [MessagePopoverComponent,
            MessageViewComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformMessagePopoverModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        MessagePopoverComponent,
                        MessagePopoverFormWrapperComponent,
                        MessageViewComponent,
                        MessagePopoverFormItemDirective
                    ],
                    exports: [
                        MessagePopoverComponent,
                        MessagePopoverFormWrapperComponent,
                        MessageViewComponent,
                        MessagePopoverFormItemDirective
                    ],
                    providers: [
                        {
                            provide: FDP_MESSAGE_POPOVER_CONFIG,
                            useValue: FDP_MESSAGE_POPOVER_DEFAULT_CONFIG
                        }
                    ]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { FDP_MESSAGE_POPOVER_CONFIG, FDP_MESSAGE_POPOVER_DEFAULT_CONFIG, MessagePopoverComponent, MessagePopoverFormItemDirective, MessagePopoverFormWrapperComponent, MessageViewComponent, PlatformMessagePopoverModule, convertFormState, convertFormStateToMessagePopoverState };
//# sourceMappingURL=fundamental-ngx-platform-message-popover.mjs.map
