import * as i0 from '@angular/core';
import { inject, ElementRef, booleanAttribute, Input, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, EventEmitter, Injectable, signal, ViewContainerRef, ChangeDetectorRef, Renderer2, PLATFORM_ID, ContentChildren, ViewChild, Output, Directive, NgModule } from '@angular/core';
import { DOCUMENT, isPlatformBrowser, isPlatformServer } from '@angular/common';
import { Overlay, ScrollDispatcher, ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';
import * as i1$1 from '@angular/cdk/a11y';
import { ActiveDescendantKeyManager, A11yModule } from '@angular/cdk/a11y';
import { ScrollingModule } from '@angular/cdk/scrolling';
import * as i2 from '@angular/cdk/observers';
import { ObserversModule } from '@angular/cdk/observers';
import { Subject, Subscription, fromEvent, takeUntil } from 'rxjs';
import { TemplatePortal } from '@angular/cdk/portal';
import { trigger, state, transition, style, animate } from '@angular/animations';
import * as i1 from '@eui/components/eui-icon';
import { EUI_ICON } from '@eui/components/eui-icon';

const openClose = trigger('openClose', [
    state('open', style({
        opacity: 1,
        transform: 'scale(1)',
    })),
    state('closed', style({
        opacity: 0,
        transform: 'scale(0.9)',
    })),
    transition('closed => open', [animate('50ms 25ms linear')]),
]);

class EuiDropdownItemComponent {
    constructor() {
        this.elementRef = inject(ElementRef);
        this.role = 'menuitem';
    }
    // Make item programmatically focusable using roving tabindex to properly announce the items in the screen reader
    get tabIndex() {
        return this.isFocus ? 0 : -1;
    }
    get cssClasses() {
        return [
            'eui-dropdown-item',
            this.isActive ? 'eui-dropdown-item--active' : '',
            this.isFocus ? 'eui-dropdown-item--focused' : '',
            this.subDropdown ? 'eui-dropdown-item--has-subdropdown' : '',
        ]
            .join(' ')
            .trim();
    }
    setActiveStyles() {
        this.isFocus = true;
    }
    setInactiveStyles() {
        this.isFocus = false;
    }
    focus(options) {
        this.elementRef.nativeElement.focus({ preventScroll: true, ...options });
    }
    click() {
        this.elementRef.nativeElement.click();
    }
    mouseenter() {
        const mouseenterEvent = new Event('mouseenter');
        this.elementRef.nativeElement.dispatchEvent(mouseenterEvent);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EuiDropdownItemComponent, isStandalone: true, selector: "eui-dropdown-item, [euiDropdownItem]", inputs: { subDropdown: "subDropdown", isActive: ["isActive", "isActive", booleanAttribute], isFocus: ["isFocus", "isFocus", booleanAttribute] }, host: { properties: { "attr.role": "this.role", "attr.tabindex": "this.tabIndex", "class": "this.cssClasses" } }, ngImport: i0, template: "<div class=\"eui-dropdown-item__container\">\n    <div class=\"eui-dropdown-item__content\">\n        @if (subDropdown) {\n            <div class=\"eui-dropdown-item__content-icon eui-dropdown-item__content-icon--left\">\n                <eui-icon-svg icon=\"chevron-back:sharp\" size=\"s\" fillColor=\"neutral\"></eui-icon-svg>\n            </div>\n        }\n        <div class=\"eui-dropdown-item__content-text\">\n            <ng-content></ng-content>\n        </div>\n        @if (subDropdown) {\n            <div class=\"eui-dropdown-item__content-icon eui-dropdown-item__content-icon--right\">\n                <eui-icon-svg icon=\"chevron-forward:sharp\" size=\"s\" fillColor=\"neutral\"></eui-icon-svg>\n            </div>\n        }\n    </div>\n</div>\n", dependencies: [{ kind: "component", type: i1.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-dropdown-item, [euiDropdownItem]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
                        ...EUI_ICON,
                    ], template: "<div class=\"eui-dropdown-item__container\">\n    <div class=\"eui-dropdown-item__content\">\n        @if (subDropdown) {\n            <div class=\"eui-dropdown-item__content-icon eui-dropdown-item__content-icon--left\">\n                <eui-icon-svg icon=\"chevron-back:sharp\" size=\"s\" fillColor=\"neutral\"></eui-icon-svg>\n            </div>\n        }\n        <div class=\"eui-dropdown-item__content-text\">\n            <ng-content></ng-content>\n        </div>\n        @if (subDropdown) {\n            <div class=\"eui-dropdown-item__content-icon eui-dropdown-item__content-icon--right\">\n                <eui-icon-svg icon=\"chevron-forward:sharp\" size=\"s\" fillColor=\"neutral\"></eui-icon-svg>\n            </div>\n        }\n    </div>\n</div>\n" }]
        }], propDecorators: { subDropdown: [{
                type: Input
            }], role: [{
                type: HostBinding,
                args: ['attr.role']
            }], tabIndex: [{
                type: HostBinding,
                args: ['attr.tabindex']
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], isActive: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isFocus: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }] } });

/**
 * Service to manage the state of dropdowns in the application.
 * This service provides an event emitter to notify when a dropdown is opened or closed.
 *
 * @deprecated This service is deprecated and will be removed in future versions. Use
 * `EuiDropdownComponent` output events instead.
 */
class EuiDropdownService {
    constructor() {
        /**
         * Event emitter that emits a boolean value indicating whether the dropdown is open or closed.
         * @deprecated Use `EuiDropdownComponent` output events instead.
         */
        this.isDropdownOpen = new EventEmitter();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownService }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownService, decorators: [{
            type: Injectable
        }] });

/**
 * @description
 * The eui-dropdown component is composed of a trigger, usually a button, which allows to display the dropdown content specified with the eui-dropdown-content.
 */
class EuiDropdownComponent {
    constructor() {
        /**
         * Sets the `data-e2e` attribute for dropodown panel. Default: `eui-dropdown`.
         *
         * @default 'eui-dropdown'
         */
        this.e2eAttr = 'eui-dropdown';
        /**
         * Sets the `tabindex` attribute for a dropdown panel.
         *
         * @default -1
         */
        this.tabIndex = -1;
        /**
         * Sets the `width` attribute for the dropdown panel.
         *
         * @default 'auto'
         */
        this.width = 'auto';
        /**
         * Sets the `height` attribute for the dropdown panel.
         *
         * @default 'auto'
         */
        this.height = 'auto';
        /**
         * Sets the `position` attribute for the dropdown panel.
         *
         * @default 'bottom'
         */
        this.position = 'bottom';
        /**
         * Sets the `subDropdownPosition` attribute for a multi-level dropdown.
         *
         * @default 'right'
         */
        this.subDropdownPosition = 'right';
        /**
         * Sets the `isBlock` attribute in order for the dropdown to take the full width of the parent container.
         *
         * @default false
         */
        this.isBlock = false;
        /**
         * Sets the `isDropDownRightAligned` attribute to align the menu panel on the right of the opening element.
         *
         * @default false
         */
        this.isDropDownRightAligned = false;
        /**
         * Sets the `hasClosedOnClickInside` attribute which controls the auto-closing of the menu when clicking inside.
         *
         * @default true
         */
        this.hasClosedOnClickInside = true;
        /**
         * Sets the `isLabelUpdatedFromSelectedItem` attribute which updates the label of the trigger with the selected item.
         *
         * @default false
         */
        this.isLabelUpdatedFromSelectedItem = false;
        /**
         * Sets the `isExpandOnHover` attribute which opens the sub dropdown upon hover.
         *
         * @default false
         */
        this.isExpandOnHover = false;
        /**
         * Sets the `hasTabNavigation` attribute to tab within the dropdown content when there is rich content.
         *
         * @default false
         */
        this.hasTabNavigation = false;
        /**
         * Sets the `isRightClickEnabled` attribute to trigger the menu using the right mouse click.
         *
         * @default false
         */
        this.isRightClickEnabled = false;
        this.euiDisabled = false;
        /**
         * Event emitted when the menu expands.
         */
        this.expand = new EventEmitter();
        this.isDropdownOpen = new EventEmitter();
        this.trapFocusAutoCapture = true;
        this.isOpened = signal(false);
        this.dropdownService = inject(EuiDropdownService);
        this.mousePositionX = 0;
        this.mousePositionY = 0;
        this.initialScrollX = 0;
        this.initialScrollY = 0;
        this.originX = 'start';
        this.originY = 'bottom';
        this.overlayX = 'start';
        this.overlayY = 'top';
        this.destroy$ = new Subject();
        this.scrollDispatcherSubscription = new Subscription();
        this.keydownListenerSubscription = new Subscription();
        this.euiDropdownItemsEventSubscriptions = [];
        this.activeDescendantKeyManagerChangeSubscription = new Subscription();
        this.scrollSubscription = new Subscription();
        this.overlay = inject(Overlay);
        this.viewContainerRef = inject(ViewContainerRef);
        this.scrollDispatcher = inject(ScrollDispatcher);
        this.cd = inject(ChangeDetectorRef);
        this._renderer = inject(Renderer2);
        this.platformId = inject(PLATFORM_ID);
        this.document = inject(DOCUMENT);
    }
    /**
     * @description
     * Computes and returns the CSS classes for the component based on its current state.
     *
     * @returns {string} Space-separated string of CSS class names
     */
    get cssClasses() {
        return [
            'eui-dropdown',
            this.isBlock ? 'eui-dropdown--block' : '',
            this.isRightClickEnabled ? 'eui-dropdown--contextual-menu' : '',
        ].join(' ').trim();
    }
    ngOnInit() {
        // Currently, the `cdkTrapFocusAutoCapture` is only checked once on init.
        if (this.hasDropdownItems) {
            this.trapFocusAutoCapture = false;
        }
        else {
            this.trapFocusAutoCapture = true;
        }
        if (this.hasTabNavigation) {
            this.trapFocusAutoCapture = true;
            this.hasClosedOnClickInside = false;
        }
        if (this.isRightClickEnabled) {
            this.hasTabNavigation = false; // UX wise, contextual menu contains only menu items accessible through arrow keys nav
        }
        this.setPosition();
        // TODO: Remove this in the future, when the `isDropdownOpen` signal is used instead.
        this.isDropdownOpen.subscribe(isOpen => this.dropdownService.isDropdownOpen.emit(isOpen));
    }
    ngAfterViewInit() {
        this.templatePortal = new TemplatePortal(this.templatePortalContent, this.viewContainerRef);
        if (this.triggerRef && this.triggerRef.nativeElement.firstElementChild) {
            if (this.isFocusableElement(this.triggerRef.nativeElement.firstElementChild)) {
                this._renderer?.setAttribute(this.triggerRef.nativeElement.firstElementChild, 'aria-haspopup', 'menu');
                this._renderer?.setAttribute(this.triggerRef.nativeElement.firstElementChild, 'aria-expanded', 'false');
            }
            else if (this.triggerRef.nativeElement.firstElementChild.firstChild && this.isFocusableElement(this.triggerRef.nativeElement.firstElementChild.firstChild)) {
                this._renderer?.setAttribute(this.triggerRef.nativeElement.firstElementChild.firstChild, 'aria-haspopup', 'menu');
                this._renderer?.setAttribute(this.triggerRef.nativeElement.firstElementChild.firstChild, 'aria-expanded', 'false');
            }
        }
    }
    ngOnDestroy() {
        this.destroy$.next(true);
        this.destroy$.unsubscribe();
        this.euiDropdownItemsEventSubscriptions.forEach((euiDropdownItemsEventSubscription) => {
            euiDropdownItemsEventSubscription.unsubscribe();
        });
        this.keydownListenerSubscription.unsubscribe();
        this.scrollDispatcherSubscription.unsubscribe();
        this.activeDescendantKeyManagerChangeSubscription.unsubscribe();
        this.overlayRef?.dispose();
        this.overlayRef = null;
        this.activeDescendantKeyManager = null;
        this.scrollSubscription.unsubscribe();
    }
    /**
     * Whether the eui-dropdown is open.
     *
     * @deprecated This property will be removed in the future. Use `isOpened` signal instead.
     *
     * @usageNotes
     * ```html
     * <eui-dropdown #dropdown>
     *      <my-component *ngIf="dropdown.isOpen"></my-component>
     * </eui-dropdown>
     * ```
     * @returns A boolean with value `true` when open, otherwise `false`.
     */
    get isOpen() {
        return this.isOpened();
    }
    /**
     * Method fired upon clicking the dropdown trigger.
     *
     * @param e Event triggered when the dropdown trigger is clicked.
     */
    onTriggerClicked(e) {
        if (!e.target.querySelector('.disabled') &&
            !e.target.querySelector(':disabled') &&
            !this.isOpened()) {
            if (this.isBlock) {
                this.width = this.triggerRef.nativeElement.offsetWidth + 'px';
            }
            this.openDropdown(e.target);
            this.expand.emit(true);
            e.stopPropagation();
        }
    }
    /**
     * Method fired upon right clicking the dropdown trigger in case of context menu.
     *
     * @param e Event triggered when the dropdown trigger is right clicked.
     */
    onTriggerRightClicked(e) {
        if (!e.target.querySelector('.disabled') &&
            !e.target.querySelector(':disabled') &&
            !this.isOpened()) {
            if (this.isBlock) {
                this.width = this.triggerRef.nativeElement.offsetWidth + 'px';
            }
            this.mousePositionX = e.clientX;
            this.mousePositionY = e.clientY;
            if (isPlatformBrowser(this.platformId)) {
                this.initialScrollX = window.pageXOffset;
                this.initialScrollY = window.pageYOffset;
            }
            this.openDropdown(e.target);
            e.preventDefault();
            e.stopPropagation();
        }
    }
    /**
     * Method fired upon clicking the dropdown content.
     *
     */
    onClick() {
        if (this.hasClosedOnClickInside &&
            !this.activeDescendantKeyManager?.activeItem.subDropdown &&
            !this.activeDescendantKeyManager?.activeItem.elementRef?.nativeElement?.disabled) {
            this.closeDropdown(true);
        }
    }
    /**
     * Method fired when the dropdown is opened.
     *
     * @param origin Origin of the dropdown position
     * @param position Position of the dropdown
     * @param position.x X coordinate of the dropdown position
     * @param position.y Y coordinate of the dropdown position
     */
    openDropdown(origin, position) {
        this.origin = origin;
        if (position) {
            this.mousePositionX = position.x;
            this.mousePositionY = position.y;
            if (isPlatformBrowser(this.platformId)) {
                this.initialScrollX = window.pageXOffset;
                this.initialScrollY = window.pageYOffset;
            }
        }
        if (this.isRightClickEnabled) {
            this.scrollSubscription = fromEvent(window, 'scroll').subscribe((event) => {
                this.overlayRef?.updatePositionStrategy(this.getContextualMenuPositionStrategy());
            });
        }
        if (!this.isTriggerFocusableOnClose(origin)) {
            this.origin = origin.closest('button:not([disabled])') || this.triggerRef.nativeElement.firstChild;
            if (!this.origin) {
                this.origin = origin.closest('a');
            }
            if (!this.origin) {
                this.origin = origin;
            }
        }
        if (!this.isOpened()) {
            this.scrollDispatcherSubscription = this.scrollDispatcher
                .ancestorScrolled(this.origin)
                .pipe(takeUntil(this.destroy$))
                .subscribe((event) => {
                if (!this.isVisible(this.origin, event ? event.getElementRef().nativeElement : this.document.querySelector('body'))) {
                    this.closeDropdown();
                }
            });
            const positionStrategy = this.isRightClickEnabled ? this.getContextualMenuPositionStrategy() : this.getPositionStrategy();
            const scrollStrategy = this.overlay.scrollStrategies.reposition({ scrollThrottle: 10 });
            this.overlayRef = this.overlay.create({
                hasBackdrop: false,
                backdropClass: 'eui-dropdown__backdrop',
                panelClass: ['eui-dropdown__panel', this.subDropdownPosition === 'right' ? 'eui-dropdown--subdropdown-position-right' : 'eui-dropdown--subdropdown-position-left'],
                positionStrategy,
                scrollStrategy,
                disposeOnNavigation: true,
            });
            this.overlayRef.attach(this.templatePortal);
            if (this.isRightClickEnabled) {
                this.overlayRef?.updatePositionStrategy(this.getContextualMenuPositionStrategy());
            }
            this.overlayRef
                .outsidePointerEvents()
                .pipe(takeUntil(this.destroy$))
                .subscribe(() => {
                this.closeDropdown();
            });
            this.overlayRef
                .backdropClick()
                .pipe(takeUntil(this.destroy$))
                .subscribe(() => {
                this.closeDropdown();
            });
            this.overlayRef
                .keydownEvents()
                .pipe(takeUntil(this.destroy$))
                .subscribe((keyboardEvent) => {
                if (keyboardEvent.key?.toLowerCase() === 'escape') {
                    this.closeDropdown();
                }
            });
            if (this.hasDropdownItems) {
                this.euiDropdownItems.toArray().forEach((euiDropdownItem, i) => {
                    if (this.isExpandOnHover) {
                        this.euiDropdownItemsEventSubscriptions[i] = fromEvent(euiDropdownItem.elementRef.nativeElement, 'mouseenter').pipe(takeUntil(this.destroy$)).subscribe((e) => {
                            this.activeDescendantKeyManager.setActiveItem(euiDropdownItem);
                            if (this.activeDescendantKeyManager.activeItem?.subDropdown) {
                                this.activeDescendantKeyManager.activeItem?.subDropdown.setParentDropdown(this);
                                this.activeDescendantKeyManager.activeItem?.subDropdown.overlayRef.detachBackdrop();
                                this.keydownListenerSubscription.unsubscribe();
                            }
                            const triggerOutsidePointerEvents = (subDropdown) => {
                                subDropdown?.overlayRef?._outsidePointerEvents.next(e);
                                if (subDropdown?.hasDropdownItems) {
                                    subDropdown.euiDropdownItems.toArray().forEach((s) => {
                                        triggerOutsidePointerEvents(s.subDropdown);
                                    });
                                }
                            };
                            this.euiDropdownItems
                                .filter((item) => !item.isFocus)
                                .forEach((euiDropdownItemHavingSubDropdown) => {
                                triggerOutsidePointerEvents(euiDropdownItemHavingSubDropdown.subDropdown);
                            });
                        });
                    }
                    else {
                        this.euiDropdownItemsEventSubscriptions[i] = fromEvent(euiDropdownItem.elementRef.nativeElement, 'click').pipe(takeUntil(this.destroy$)).subscribe(() => {
                            this.activeDescendantKeyManager.setActiveItem(euiDropdownItem);
                            if (this.activeDescendantKeyManager.activeItem?.subDropdown) {
                                this.activeDescendantKeyManager.activeItem?.subDropdown.setParentDropdown(this);
                                this.activeDescendantKeyManager.activeItem?.subDropdown.overlayRef.detachBackdrop();
                                this.keydownListenerSubscription.unsubscribe();
                            }
                            const labelElement = this.triggerRef.nativeElement.querySelector('button .eui-label');
                            if (this.isLabelUpdatedFromSelectedItem && labelElement) {
                                labelElement.innerText = euiDropdownItem.elementRef.nativeElement.innerText;
                            }
                        });
                    }
                });
                this.activeDescendantKeyManager = new ActiveDescendantKeyManager(this.euiDropdownItems)
                    .withHomeAndEnd(true)
                    .withVerticalOrientation(true)
                    .withWrap();
                this.activeDescendantKeyManager.setFirstItemActive();
            }
            this.createKeyboardHandlerSubscription();
            this.isOpened.set(true);
            this.isDropdownOpen.emit(true);
            // Announce expanded on trigger
            if (this.triggerRef?.nativeElement.firstElementChild && this.isFocusableElement(this.triggerRef.nativeElement.firstElementChild)) {
                this._renderer?.setAttribute(this.triggerRef.nativeElement.firstElementChild, 'aria-expanded', 'true');
            }
            else if (this.triggerRef?.nativeElement.firstElementChild?.firstChild && this.isFocusableElement(this.triggerRef.nativeElement.firstElementChild.firstChild)) {
                this._renderer?.setAttribute(this.triggerRef.nativeElement.firstElementChild.firstChild, 'aria-expanded', 'true');
            }
        }
    }
    /**
     * Close a dropdown
     *
     * @param recursively If true, close the parent dropdown as well
     */
    closeDropdown(recursively = false) {
        this.isOpened.set(false);
        this.expand.emit(false);
        this.euiDropdownItemsEventSubscriptions.forEach((euiDropdownItemsEventSubscription) => {
            euiDropdownItemsEventSubscription.unsubscribe();
        });
        this.keydownListenerSubscription.unsubscribe();
        if (this.hasDropdownItems) {
            this.activeDescendantKeyManager?.setFirstItemActive();
        }
        this.scrollDispatcherSubscription.unsubscribe();
        this.activeDescendantKeyManagerChangeSubscription.unsubscribe();
        this.scrollSubscription.unsubscribe();
        this.overlayRef?.dispose();
        this.overlayRef = null;
        this.activeDescendantKeyManager = null;
        if (this.trapFocusAutoCapture) {
            this.origin.focus();
        }
        // Update aria-expanded on the trigger
        if (this.triggerRef?.nativeElement.firstElementChild && this.isFocusableElement(this.triggerRef.nativeElement.firstElementChild)) {
            this._renderer?.setAttribute(this.triggerRef.nativeElement.firstElementChild, 'aria-expanded', 'false');
        }
        else if (this.triggerRef?.nativeElement.firstElementChild?.firstChild && this.isFocusableElement(this.triggerRef.nativeElement.firstElementChild.firstChild)) {
            this._renderer?.setAttribute(this.triggerRef.nativeElement.firstElementChild.firstChild, 'aria-expanded', 'false');
        }
        if (recursively && this.parentDropdown) {
            this.parentDropdown.closeDropdown(true);
        }
        this.isDropdownOpen.emit(false);
    }
    /**
     * Method fired when the dropdown content is changed.
     *
     */
    projectContentChanged() {
        if (!this.isRightClickEnabled) {
            this.positionStrategy = this.getPositionStrategy();
            this.overlayRef.updatePositionStrategy(this.positionStrategy);
        }
    }
    /**
     * Handles the keyboard navigation on the menu items upon opening the dropdown.
     *
     */
    createKeyboardHandlerSubscription() {
        this.keydownListenerSubscription = fromEvent(document, 'keydown').subscribe((event) => {
            if (this.isOpened()) {
                if (event.code === 'Enter' &&
                    !this.hasTabNavigation &&
                    this.activeDescendantKeyManager?.activeItem &&
                    !this.activeDescendantKeyManager.activeItem.elementRef?.nativeElement?.disabled) {
                    this.activeDescendantKeyManager.activeItem.isFocus = true;
                    // eslint-disable-next-line
                    this.isExpandOnHover
                        ? this.activeDescendantKeyManager.activeItem.mouseenter()
                        : this.activeDescendantKeyManager.activeItem.click();
                    if (this.activeDescendantKeyManager?.activeItem?.subDropdown) {
                        this.activeDescendantKeyManager.activeItem.subDropdown.setParentDropdown(this);
                        this.keydownListenerSubscription.unsubscribe();
                    }
                    else {
                        this.closeDropdown();
                    }
                    event.preventDefault();
                }
                else if ((this.subDropdownPosition === 'right' && event.code === 'ArrowLeft') || this.subDropdownPosition === 'left' && event.code === 'ArrowRight') {
                    if (this.parentDropdown) {
                        this.parentDropdown.createKeyboardHandlerSubscription();
                        this.closeDropdown();
                    }
                    event.preventDefault();
                }
                else if ((this.subDropdownPosition === 'right' && event.code === 'ArrowRight') || (this.subDropdownPosition === 'left' && event.code === 'ArrowLeft')) {
                    if (this.activeDescendantKeyManager?.activeItem?.subDropdown) {
                        this.activeDescendantKeyManager.activeItem.isFocus = true;
                        // eslint-disable-next-line
                        this.isExpandOnHover
                            ? this.activeDescendantKeyManager.activeItem.mouseenter()
                            : this.activeDescendantKeyManager.activeItem.click();
                        this.activeDescendantKeyManager.activeItem.subDropdown.setParentDropdown(this);
                        this.keydownListenerSubscription.unsubscribe();
                    }
                    event.preventDefault();
                }
                else if (event.code === 'Tab' && !this.hasTabNavigation) {
                    this.closeDropdown(true);
                }
                else {
                    // Delegate to key manager and then move DOM focus to the active item (roving tabindex)
                    const before = this.activeDescendantKeyManager?.activeItem;
                    this.activeDescendantKeyManager?.onKeydown(event);
                    const active = this.activeDescendantKeyManager?.activeItem;
                    if (active && active !== before && !active.elementRef?.nativeElement?.disabled) {
                        // Update roving tabindex and move focus so that screen readers announce it
                        active.isFocus = true;
                        active.focus?.({ preventScroll: true });
                    }
                    // Prevent default arrow key behavior when navigating within the menu
                    if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.code)) {
                        event.preventDefault();
                    }
                }
                this.cd.markForCheck();
            }
        });
    }
    /**
     * Sets the parent dropdown for a sub-dropdown.
     *
     * @param parentDropdown Parent dropdown component
     */
    setParentDropdown(parentDropdown) {
        this.parentDropdown = parentDropdown;
        this.position = this.subDropdownPosition;
        this.setPosition();
        const positionStrategy = this.getPositionStrategy();
        this.overlayRef.updatePositionStrategy(positionStrategy);
    }
    /**
     * Checks the existence of focusable elements
     * @param origin The element to check
     */
    isFocusableElement(origin) {
        if (!(origin instanceof Element)) {
            return false;
        }
        return (origin.matches('button') ||
            origin.matches('a') ||
            origin.matches('input') ||
            origin.matches('select') ||
            origin.matches('textarea') ||
            origin.matches('[tabindex]:not([tabindex="-1"])'));
    }
    /**
     * Method that returns the dropdown items.
     *
     * @type {boolean}
     */
    get hasDropdownItems() {
        return this.euiDropdownItems?.length > 0;
    }
    /**
     * Method that returns the strategy for the overlay position.
     *
     * @type {FlexibleConnectedPositionStrategy}
     */
    getPositionStrategy() {
        return this.overlay
            .position()
            .flexibleConnectedTo(this.origin)
            .withPositions([
            new ConnectionPositionPair({ originX: this.originX, originY: this.originY }, { overlayX: this.overlayX, overlayY: this.overlayY }),
        ])
            .withFlexibleDimensions(false)
            .withLockedPosition(true);
    }
    /**
     * Method that returns the strategy for the contextual menu position.
     *
     * @type {GlobalPositionStrategy}
     */
    getContextualMenuPositionStrategy() {
        if (isPlatformServer(this.platformId)) {
            throw new Error('getContextualMenuPositionStrategy is not supported on the server');
        }
        const panelHeight = this.overlayRef?.overlayElement.clientHeight || 0;
        const scrollX = window.scrollX || window.pageXOffset;
        const scrollY = window.scrollY || window.pageYOffset;
        const newX = this.mousePositionX + (this.initialScrollX - scrollX);
        const newY = this.mousePositionY + (this.initialScrollY - scrollY);
        const menuBottomPosition = newY + panelHeight;
        const isMenuBelowWindowBottom = menuBottomPosition > window.innerHeight;
        const positionStrategy = this.overlay
            .position()
            .global()
            .left(newX + 'px');
        if (isMenuBelowWindowBottom) {
            positionStrategy.bottom(window.innerHeight - newY + 'px');
        }
        else {
            positionStrategy.top(newY + 'px');
        }
        return positionStrategy;
    }
    /**
     * Method that checks if the dropdown is visible.
     *
     * @param origin Origin of the dropdown position
     * @param scrollableParent Scrollable parent element
     * @type {boolean}
     */
    isVisible(origin, scrollableParent) {
        const originY = origin.getBoundingClientRect().y;
        const scrollableParentY = Math.abs(scrollableParent.getBoundingClientRect().y);
        const scrollableParentHeight = scrollableParent.getBoundingClientRect().height - 50;
        return ((originY > 0 && originY < scrollableParentHeight) ||
            (originY - scrollableParentY > 0 && originY < scrollableParentY + scrollableParentHeight));
    }
    /**
     * Method that checks if the trigger is focusable upon closing the dropdown panel.
     *
     * @param origin Origin html element
     * @type {boolean}
     */
    isTriggerFocusableOnClose(origin) {
        return origin.matches('button:not([disabled])') || origin.matches('a');
    }
    /**
     * Method that sets the position of the dropdown panel.
     *
     */
    setPosition() {
        if (this.position === 'top') {
            this.originY = 'top';
            this.overlayY = 'bottom';
            if (this.isDropDownRightAligned) {
                this.originX = 'end';
                this.overlayX = 'end';
            }
        }
        if (this.position === 'right') {
            this.originX = 'end';
            this.overlayX = 'start';
            this.overlayY = 'center';
        }
        if (this.position === 'bottom') {
            this.originY = 'bottom';
            this.overlayY = 'top';
            if (this.isDropDownRightAligned) {
                this.originX = 'end';
                this.overlayX = 'end';
            }
        }
        if (this.position === 'left') {
            this.originX = 'start';
            this.overlayX = 'end';
            this.overlayY = 'center';
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.17", type: EuiDropdownComponent, isStandalone: true, selector: "eui-dropdown", inputs: { e2eAttr: "e2eAttr", tabIndex: "tabIndex", width: "width", height: "height", position: "position", subDropdownPosition: "subDropdownPosition", isBlock: ["isBlock", "isBlock", booleanAttribute], isDropDownRightAligned: ["isDropDownRightAligned", "isDropDownRightAligned", booleanAttribute], hasClosedOnClickInside: ["hasClosedOnClickInside", "hasClosedOnClickInside", booleanAttribute], isLabelUpdatedFromSelectedItem: ["isLabelUpdatedFromSelectedItem", "isLabelUpdatedFromSelectedItem", booleanAttribute], isExpandOnHover: ["isExpandOnHover", "isExpandOnHover", booleanAttribute], hasTabNavigation: ["hasTabNavigation", "hasTabNavigation", booleanAttribute], isRightClickEnabled: ["isRightClickEnabled", "isRightClickEnabled", booleanAttribute], euiDisabled: ["euiDisabled", "euiDisabled", booleanAttribute] }, outputs: { expand: "expand", isDropdownOpen: "isDropdownOpen" }, host: { properties: { "class": "this.cssClasses" } }, providers: [EuiDropdownService], queries: [{ propertyName: "euiDropdownItems", predicate: EuiDropdownItemComponent, descendants: true }], viewQueries: [{ propertyName: "templatePortalContent", first: true, predicate: ["templatePortalContent"], descendants: true }, { propertyName: "triggerRef", first: true, predicate: ["triggerRef"], descendants: true }], ngImport: i0, template: "<div #triggerRef class=\"eui-dropdown__trigger-container\"\n    (click)=\"!isRightClickEnabled ? onTriggerClicked($event) : null\"\n    (contextmenu)=\"isRightClickEnabled ? onTriggerRightClicked($event) : null\">\n    <ng-content></ng-content>\n</div>\n\n<ng-template #templatePortalContent>\n    <div\n        attr.data-e2e=\"{{ e2eAttr }}\"\n        [@openClose]=\"isOpened() ? 'open' : 'closed'\"\n        cdkTrapFocus\n        [cdkTrapFocusAutoCapture]=\"trapFocusAutoCapture\"\n        role=\"menu\"\n        aria-orientation=\"vertical\"\n        aria-label=\"eUI dropdown panel\"\n        class=\"eui-dropdown__panel-container eui-19\"\n        [style.max-height]=\"height\"\n        [style.width]=\"width\"\n        [tabindex]=\"tabIndex\"\n        (click)=\"onClick()\"\n        (cdkObserveContent)=\"projectContentChanged()\">\n        <ng-content select=\"eui-dropdown-content\"></ng-content>\n    </div>\n</ng-template>\n", styles: [".eui-19 .eui-dropdown .eui-dropdown{display:none}.eui-19 .eui-dropdown .eui-dropdown__trigger-container{display:inherit}.eui-19 .eui-dropdown__panel{position:inherit}.eui-19 .eui-dropdown__panel .eui-dropdown-content{display:block}.eui-19 .eui-dropdown__panel.eui-dropdown--subdropdown-position-left .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon.eui-dropdown-item__content-icon--right,.eui-19 .eui-dropdown__panel.eui-dropdown--subdropdown-position-right .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon.eui-dropdown-item__content-icon--left{display:none}.eui-19 .eui-dropdown__panel-container{background:var(--eui-c-surface-container);border-radius:var(--eui-br-m);box-shadow:var(--eui-sh-2);display:block;height:auto;min-width:8rem;overflow:auto;position:relative}.eui-19 .eui-dropdown__panel-container::-webkit-scrollbar{display:inherit;height:10px;width:10px;background-color:var(--eui-c-s-secondary-surface-light)}.eui-19 .eui-dropdown__panel-container::-webkit-scrollbar-thumb{background-color:var(--_eui-scrollbars-foreground-color);border-radius:5rem;background-clip:padding-box;border:2px solid transparent}.eui-19 .eui-dropdown__panel-container::-webkit-scrollbar-thumb:hover{background-color:var(--eui-c-s-secondary-surface);border:0;cursor:grab}.eui-19 .eui-dropdown__panel-container:focus::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dropdown__panel-container:focus-visible::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dropdown__panel-container::-webkit-scrollbar-track{background-color:var(--eui-c-s-secondary-surface-light);border-radius:0}@-moz-document url-prefix(){.eui-19 .eui-dropdown__panel-container{scrollbar-color:var(--eui-c-s-secondary-surface) var(--eui-c-s-secondary-surface-light);scrollbar-width:auto}}@-moz-document url-prefix(){.eui-19 .eui-dropdown__panel-container:focus,.eui-19 .eui-dropdown__panel-container:focus-visible{scrollbar-color:var(--eui-c-focus-visible) var(--eui-c-s-secondary-surface-light)}}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item{background:none;border:var(--eui-bw-none);box-shadow:none;color:var(--eui-c-text);cursor:pointer;display:block;outline:none;padding:var(--eui-s-xs) var(--eui-s-s);position:relative;-webkit-tap-highlight-color:transparent;text-align:left;text-decoration:none;-webkit-user-select:none;user-select:none;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item--has-subdropdown+*:not(.eui-dropdown-item){display:none}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container{align-items:center;display:flex;min-height:calc(var(--eui-s-m) + var(--eui-s-2xs))}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content{align-items:center;display:flex;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-text{align-items:center;display:flex;width:100%}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-text .eui-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon{align-items:center;display:flex}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon--right{margin-left:var(--eui-s-s)}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon--left{margin-right:var(--eui-s-s)}.eui-19 .eui-dropdown-item:hover{background-color:var(--eui-c-hover)}.eui-19 .eui-dropdown-item:disabled{pointer-events:none;color:var(--eui-c-disabled)}.eui-19 .eui-dropdown-item:disabled:hover{background:none}.eui-19 .eui-dropdown-item--active{background-color:var(--eui-c-active-bg-alt)!important}.eui-19 .eui-dropdown-item--active:disabled{background:none!important}.eui-19 .eui-dropdown-item--focused{background-color:var(--eui-c-focus)!important}.eui-19 .eui-dropdown-item--focused:disabled{background:none!important}.eui-19 .eui-dropdown--block .eui-dropdown__trigger-container .eui-button{display:inherit;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "ngmodule", type: ScrollingModule }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: ObserversModule }, { kind: "directive", type: i2.CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }], animations: [openClose], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-dropdown', animations: [openClose], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
                        OverlayModule,
                        ScrollingModule,
                        A11yModule,
                        ObserversModule,
                    ], providers: [EuiDropdownService], template: "<div #triggerRef class=\"eui-dropdown__trigger-container\"\n    (click)=\"!isRightClickEnabled ? onTriggerClicked($event) : null\"\n    (contextmenu)=\"isRightClickEnabled ? onTriggerRightClicked($event) : null\">\n    <ng-content></ng-content>\n</div>\n\n<ng-template #templatePortalContent>\n    <div\n        attr.data-e2e=\"{{ e2eAttr }}\"\n        [@openClose]=\"isOpened() ? 'open' : 'closed'\"\n        cdkTrapFocus\n        [cdkTrapFocusAutoCapture]=\"trapFocusAutoCapture\"\n        role=\"menu\"\n        aria-orientation=\"vertical\"\n        aria-label=\"eUI dropdown panel\"\n        class=\"eui-dropdown__panel-container eui-19\"\n        [style.max-height]=\"height\"\n        [style.width]=\"width\"\n        [tabindex]=\"tabIndex\"\n        (click)=\"onClick()\"\n        (cdkObserveContent)=\"projectContentChanged()\">\n        <ng-content select=\"eui-dropdown-content\"></ng-content>\n    </div>\n</ng-template>\n", styles: [".eui-19 .eui-dropdown .eui-dropdown{display:none}.eui-19 .eui-dropdown .eui-dropdown__trigger-container{display:inherit}.eui-19 .eui-dropdown__panel{position:inherit}.eui-19 .eui-dropdown__panel .eui-dropdown-content{display:block}.eui-19 .eui-dropdown__panel.eui-dropdown--subdropdown-position-left .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon.eui-dropdown-item__content-icon--right,.eui-19 .eui-dropdown__panel.eui-dropdown--subdropdown-position-right .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon.eui-dropdown-item__content-icon--left{display:none}.eui-19 .eui-dropdown__panel-container{background:var(--eui-c-surface-container);border-radius:var(--eui-br-m);box-shadow:var(--eui-sh-2);display:block;height:auto;min-width:8rem;overflow:auto;position:relative}.eui-19 .eui-dropdown__panel-container::-webkit-scrollbar{display:inherit;height:10px;width:10px;background-color:var(--eui-c-s-secondary-surface-light)}.eui-19 .eui-dropdown__panel-container::-webkit-scrollbar-thumb{background-color:var(--_eui-scrollbars-foreground-color);border-radius:5rem;background-clip:padding-box;border:2px solid transparent}.eui-19 .eui-dropdown__panel-container::-webkit-scrollbar-thumb:hover{background-color:var(--eui-c-s-secondary-surface);border:0;cursor:grab}.eui-19 .eui-dropdown__panel-container:focus::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dropdown__panel-container:focus-visible::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dropdown__panel-container::-webkit-scrollbar-track{background-color:var(--eui-c-s-secondary-surface-light);border-radius:0}@-moz-document url-prefix(){.eui-19 .eui-dropdown__panel-container{scrollbar-color:var(--eui-c-s-secondary-surface) var(--eui-c-s-secondary-surface-light);scrollbar-width:auto}}@-moz-document url-prefix(){.eui-19 .eui-dropdown__panel-container:focus,.eui-19 .eui-dropdown__panel-container:focus-visible{scrollbar-color:var(--eui-c-focus-visible) var(--eui-c-s-secondary-surface-light)}}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item{background:none;border:var(--eui-bw-none);box-shadow:none;color:var(--eui-c-text);cursor:pointer;display:block;outline:none;padding:var(--eui-s-xs) var(--eui-s-s);position:relative;-webkit-tap-highlight-color:transparent;text-align:left;text-decoration:none;-webkit-user-select:none;user-select:none;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item--has-subdropdown+*:not(.eui-dropdown-item){display:none}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container{align-items:center;display:flex;min-height:calc(var(--eui-s-m) + var(--eui-s-2xs))}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content{align-items:center;display:flex;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-text{align-items:center;display:flex;width:100%}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-text .eui-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon{align-items:center;display:flex}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon--right{margin-left:var(--eui-s-s)}.eui-19 .eui-dropdown__panel-container .eui-dropdown-item .eui-dropdown-item__container .eui-dropdown-item__content .eui-dropdown-item__content-icon--left{margin-right:var(--eui-s-s)}.eui-19 .eui-dropdown-item:hover{background-color:var(--eui-c-hover)}.eui-19 .eui-dropdown-item:disabled{pointer-events:none;color:var(--eui-c-disabled)}.eui-19 .eui-dropdown-item:disabled:hover{background:none}.eui-19 .eui-dropdown-item--active{background-color:var(--eui-c-active-bg-alt)!important}.eui-19 .eui-dropdown-item--active:disabled{background:none!important}.eui-19 .eui-dropdown-item--focused{background-color:var(--eui-c-focus)!important}.eui-19 .eui-dropdown-item--focused:disabled{background:none!important}.eui-19 .eui-dropdown--block .eui-dropdown__trigger-container .eui-button{display:inherit;width:100%}\n"] }]
        }], propDecorators: { e2eAttr: [{
                type: Input
            }], tabIndex: [{
                type: Input
            }], width: [{
                type: Input
            }], height: [{
                type: Input
            }], position: [{
                type: Input
            }], subDropdownPosition: [{
                type: Input
            }], isBlock: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isDropDownRightAligned: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasClosedOnClickInside: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isLabelUpdatedFromSelectedItem: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isExpandOnHover: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasTabNavigation: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isRightClickEnabled: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], euiDisabled: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], expand: [{
                type: Output
            }], isDropdownOpen: [{
                type: Output
            }], templatePortalContent: [{
                type: ViewChild,
                args: ['templatePortalContent']
            }], triggerRef: [{
                type: ViewChild,
                args: ['triggerRef']
            }], euiDropdownItems: [{
                type: ContentChildren,
                args: [EuiDropdownItemComponent, { descendants: true }]
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }] } });

// eslint-disable-next-line @angular-eslint/directive-selector
class EuiDropdownContentDirective {
    constructor() {
        this.role = 'menu';
        this.c = 'eui-dropdown-content';
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: EuiDropdownContentDirective, isStandalone: true, selector: "eui-dropdown-content", host: { properties: { "attr.role": "this.role", "class": "this.c" } }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownContentDirective, decorators: [{
            type: Directive,
            args: [{ selector: 'eui-dropdown-content' }]
        }], propDecorators: { role: [{
                type: HostBinding,
                args: ['attr.role']
            }], c: [{
                type: HostBinding,
                args: ['class']
            }] } });

/**
 * Module for the EuiDropdown component.
 *
 * @deprecated Use {@link EUI_DROPDOWN} directly instead.
 */
class EuiDropdownModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownModule, imports: [EuiDropdownComponent, EuiDropdownItemComponent, EuiDropdownContentDirective], exports: [EuiDropdownComponent, EuiDropdownItemComponent, EuiDropdownContentDirective] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownModule, imports: [EuiDropdownComponent, EuiDropdownItemComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [EuiDropdownComponent, EuiDropdownItemComponent, EuiDropdownContentDirective],
                    exports: [EuiDropdownComponent, EuiDropdownItemComponent, EuiDropdownContentDirective],
                }]
        }] });
class EuiDropdownContentModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownContentModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownContentModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDropdownContentModule, decorators: [{
            type: NgModule,
            args: [{}]
        }] });

const EUI_DROPDOWN = [
    EuiDropdownComponent,
    EuiDropdownItemComponent,
    EuiDropdownContentDirective,
];

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

export { EUI_DROPDOWN, EuiDropdownComponent, EuiDropdownContentDirective, EuiDropdownContentModule, EuiDropdownItemComponent, EuiDropdownModule, EuiDropdownService };
//# sourceMappingURL=eui-components-eui-dropdown.mjs.map
