{"version":3,"file":"koobiq-components-dropdown.mjs","sources":["../../../packages/components/dropdown/dropdown-animations.ts","../../../packages/components/dropdown/dropdown-content.directive.ts","../../../packages/components/dropdown/dropdown-errors.ts","../../../packages/components/dropdown/dropdown.types.ts","../../../packages/components/dropdown/dropdown-item.component.ts","../../../packages/components/dropdown/dropdown-item.html","../../../packages/components/dropdown/dropdown.component.ts","../../../packages/components/dropdown/dropdown.html","../../../packages/components/dropdown/dropdown-trigger.directive.ts","../../../packages/components/dropdown/dropdown.module.ts","../../../packages/components/dropdown/koobiq-components-dropdown.ts"],"sourcesContent":["import {\n    animate,\n    AnimationTriggerMetadata,\n    group,\n    query,\n    state,\n    style,\n    transition,\n    trigger\n} from '@angular/animations';\n\n/**\n * Animations used by the kbq-dropdown component.\n * @docs-private\n */\nexport const kbqDropdownAnimations: {\n    readonly transformDropdown: AnimationTriggerMetadata;\n    readonly fadeInItems: AnimationTriggerMetadata;\n} = {\n    /**\n     * This animation controls the dropdown panel's entry and exit from the page.\n     *\n     * When the dropdown panel is added to the DOM, it scales in and fades in its border.\n     *\n     * When the dropdown panel is removed from the DOM, it simply fades out after a brief\n     * delay to display the ripple.\n     */\n    transformDropdown: trigger('transformDropdown', [\n        state(\n            'void',\n            style({\n                opacity: 0,\n                transform: 'scale(0.8)'\n            })\n        ),\n        transition(\n            'void => enter',\n            group([\n                query('.kbq-dropdown__content', animate('0ms linear', style({ opacity: 1 }))),\n                animate('0ms cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'scale(1)' }))\n            ])\n        ),\n        transition('* => void', animate('50ms 25ms linear', style({ opacity: 0 })))\n    ]),\n\n    /**\n     * This animation fades in the background color and content of the dropdown panel\n     * after its containing element is scaled in.\n     */\n    fadeInItems: trigger('fadeInItems', [\n        // now. Remove next time we do breaking changes.\n        state('showing', style({ opacity: 1 })),\n        transition('void => *', [\n            style({ opacity: 0 }),\n            animate('0ms 0ms cubic-bezier(0.55, 0, 0.55, 0.2)')\n        ])\n    ])\n};\n\nexport const fadeInItems = kbqDropdownAnimations.fadeInItems;\n\nexport const transformDropdown = kbqDropdownAnimations.transformDropdown;\n","import { DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n    ApplicationRef,\n    ComponentFactoryResolver,\n    Directive,\n    inject,\n    Injector,\n    OnDestroy,\n    TemplateRef,\n    ViewContainerRef\n} from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * Dropdown content that will be rendered lazily once the dropdown is opened.\n */\n@Directive({\n    selector: 'ng-template[kbqDropdownContent]'\n})\nexport class KbqDropdownContent implements OnDestroy {\n    protected readonly document = inject<Document>(DOCUMENT);\n\n    /** Emits when the dropdown content has been attached. */\n    attached = new Subject<void>();\n    private portal: TemplatePortal;\n    private outlet: DomPortalOutlet;\n\n    constructor(\n        private template: TemplateRef<any>,\n        private componentFactoryResolver: ComponentFactoryResolver,\n        private appRef: ApplicationRef,\n        private injector: Injector,\n        private viewContainerRef: ViewContainerRef\n    ) {}\n\n    /**\n     * Attaches the content with a particular context.\n     * @docs-private\n     */\n    attach(context: any = {}) {\n        if (!this.portal) {\n            this.portal = new TemplatePortal(this.template, this.viewContainerRef);\n        }\n\n        this.detach();\n\n        if (!this.outlet) {\n            this.outlet = new DomPortalOutlet(\n                this.document.createElement('div'),\n                this.componentFactoryResolver,\n                this.appRef,\n                this.injector\n            );\n        }\n\n        const element: HTMLElement = this.template.elementRef.nativeElement;\n\n        // Because we support opening the same dropdown from different triggers (which in turn have their\n        // own `OverlayRef` panel), we have to re-insert the host element every time, otherwise we\n        // risk it staying attached to a pane that's no longer in the DOM.\n        element.parentNode!.insertBefore(this.outlet.outletElement, element);\n        this.portal.attach(this.outlet, context);\n        this.attached.next();\n    }\n\n    /**\n     * Detaches the content.\n     * @docs-private\n     */\n    detach() {\n        if (this.portal?.isAttached) {\n            this.portal.detach();\n        }\n    }\n\n    ngOnDestroy() {\n        this.outlet?.dispose();\n    }\n}\n","/**\n * Throws an exception for the case when dropdown trigger doesn't have a valid kbq-dropdown instance\n * @docs-private\n */\nexport function throwKbqDropdownMissingError() {\n    throw Error(`kbqDropdownTriggerFor: must pass in an kbq-dropdown instance.\n    Example:\n      <kbq-dropdown #dropdown=\"kbqDropdown\"></kbq-dropdown>\n      <button [kbqDropdownTriggerFor]=\"dropdown\"></button>`);\n}\n\n/**\n * Throws an exception for the case when dropdown's x-position value isn't valid.\n * In other words, it doesn't match 'before' or 'after'.\n * @docs-private\n */\nexport function throwKbqDropdownInvalidPositionX() {\n    throw Error(`xPosition value must be either 'before', 'after', or 'center'.\n      Example: <kbq-dropdown [xPosition]=\"'center'\" #dropdown=\"kbqDropdown\"></kbq-dropdown>`);\n}\n\n/**\n * Throws an exception for the case when dropdown's y-position value isn't valid.\n * In other words, it doesn't match 'above' or 'below'.\n * @docs-private\n */\nexport function throwKbqDropdownInvalidPositionY() {\n    throw Error(`yPosition value must be either 'above' or below'.\n      Example: <kbq-dropdown [yPosition]=\"'above'\" #dropdown=\"kbqDropdown\"></kbq-dropdown>`);\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Direction } from '@angular/cdk/bidi';\nimport { EventEmitter, InjectionToken, QueryList, TemplateRef } from '@angular/core';\nimport { KbqDropdownContent } from './dropdown-content.directive';\nimport { KbqDropdownItem } from './dropdown-item.component';\n\n/** Position of the dropdown panel along the x-axis. */\nexport type KbqDropdownPositionX = 'before' | 'after' | 'center';\n/**\n * @deprecated Use `KbqDropdownPositionX` instead.\n * @docs-private\n */\nexport type DropdownPositionX = KbqDropdownPositionX;\n\n/** Position of the dropdown panel along the y-axis. */\nexport type KbqDropdownPositionY = 'above' | 'below';\n/**\n * @deprecated Use `KbqDropdownPositionY` instead.\n * @docs-private\n */\nexport type DropdownPositionY = KbqDropdownPositionY;\n\n/** Reason why the menu was closed. */\nexport type DropdownCloseReason = void | 'click' | 'keydown' | 'tab';\n\n/**\n * Interface for a custom dropdown panel that can be used with `kbqDropdownTriggerFor`.\n * @docs-private\n */\nexport interface KbqDropdownPanel {\n    xPosition: KbqDropdownPositionX;\n    yPosition: KbqDropdownPositionY;\n    overlapTriggerX: boolean;\n    overlapTriggerY: boolean;\n    templateRef: TemplateRef<any>;\n    closed: EventEmitter<DropdownCloseReason>;\n    parent?: KbqDropdownPanel | undefined;\n    triggerWidth?: string;\n    direction?: Direction;\n    lazyContent?: KbqDropdownContent;\n    backdropClass?: string;\n    hasBackdrop?: boolean;\n    items: QueryList<KbqDropdownItem>;\n    focusFirstItem(origin?: FocusOrigin): void;\n    resetActiveItem(): void;\n    setPositionClasses?(x: KbqDropdownPositionX, y: KbqDropdownPositionY): void;\n}\n\n/** Default `kbq-dropdown` options that can be overridden. */\nexport interface KbqDropdownDefaultOptions {\n    /** The x-axis position of the dropdown. */\n    xPosition: KbqDropdownPositionX;\n\n    /** The y-axis position of the dropdown. */\n    yPosition: KbqDropdownPositionY;\n\n    /** Whether the dropdown should overlap the dropdown trigger horizontally. */\n    overlapTriggerX: boolean;\n\n    /** Whether the dropdown should overlap the dropdown trigger vertically. */\n    overlapTriggerY: boolean;\n\n    /** Class to be applied to the dropdown's backdrop. */\n    backdropClass: string;\n\n    /** Whether the dropdown has a backdrop. */\n    hasBackdrop: boolean;\n}\n\n/**\n * Injection token used to provide the parent dropdown to dropdown-specific components.\n * @docs-private\n */\nexport const KBQ_DROPDOWN_PANEL = new InjectionToken<KbqDropdownPanel>('KBQ_DROPDOWN_PANEL');\n\n/** Injection token to be used to override the default options for `kbq-dropdown`. */\nexport const KBQ_DROPDOWN_DEFAULT_OPTIONS = new InjectionToken<KbqDropdownDefaultOptions>(\n    'kbq-dropdown-default-options',\n    {\n        providedIn: 'root',\n        factory: KBQ_DROPDOWN_DEFAULT_OPTIONS_FACTORY\n    }\n);\n\n/** @docs-private */\nexport function KBQ_DROPDOWN_DEFAULT_OPTIONS_FACTORY(): KbqDropdownDefaultOptions {\n    return {\n        overlapTriggerX: true,\n        overlapTriggerY: false,\n        xPosition: 'after',\n        yPosition: 'below',\n        backdropClass: 'cdk-overlay-transparent-backdrop',\n        hasBackdrop: false\n    };\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport {\n    AfterViewInit,\n    booleanAttribute,\n    ChangeDetectionStrategy,\n    Component,\n    ContentChild,\n    ElementRef,\n    HostListener,\n    Inject,\n    Input,\n    OnDestroy,\n    Optional,\n    ViewChild,\n    ViewEncapsulation\n} from '@angular/core';\nimport { IFocusableOption } from '@koobiq/cdk/a11y';\nimport { KBQ_TITLE_TEXT_REF, KbqComponentColors, KbqTitleTextRef } from '@koobiq/components/core';\nimport { KbqIcon } from '@koobiq/components/icon';\nimport { Subject } from 'rxjs';\nimport { KBQ_DROPDOWN_PANEL, KbqDropdownPanel } from './dropdown.types';\n\n/**\n * This directive is intended to be used inside an kbq-dropdown tag.\n * It exists mostly to set the role attribute.\n */\n@Component({\n    selector: 'kbq-dropdown-item, [kbq-dropdown-item]',\n    imports: [\n        KbqIcon\n    ],\n    templateUrl: 'dropdown-item.html',\n    styleUrls: ['dropdown-item.scss'],\n    encapsulation: ViewEncapsulation.None,\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    exportAs: 'kbqDropdownItem',\n    host: {\n        class: 'kbq-dropdown-item',\n        '[class.kbq-dropdown-item_with-icon]': 'icon',\n        '[class.kbq-dropdown-item_highlighted]': 'highlighted',\n        '[class.kbq-disabled]': 'disabled',\n\n        '[attr.disabled]': 'disabled || null',\n        '[attr.tabindex]': 'getTabIndex()'\n    },\n    providers: [\n        { provide: KBQ_TITLE_TEXT_REF, useExisting: KbqDropdownItem }\n    ]\n})\nexport class KbqDropdownItem implements KbqTitleTextRef, IFocusableOption, AfterViewInit, OnDestroy {\n    @ViewChild('kbqTitleText', { static: true }) textElement: ElementRef;\n\n    @ContentChild(KbqIcon) icon: KbqIcon;\n\n    @Input({ transform: booleanAttribute })\n    get disabled(): boolean {\n        return this._disabled;\n    }\n\n    set disabled(value: boolean) {\n        if (value !== this.disabled) {\n            this._disabled = value;\n        }\n    }\n\n    private _disabled: boolean = false;\n\n    /** Stream that emits when the dropdown item is hovered. */\n    readonly hovered = new Subject<KbqDropdownItem>();\n\n    /** Stream that emits when the menu item is focused. */\n    readonly focused = new Subject<KbqDropdownItem>();\n\n    /** Whether the dropdown item is highlighted. */\n    highlighted: boolean = false;\n\n    /** Whether the dropdown item acts as a trigger for a nested dropdown. */\n    isNested: boolean = false;\n\n    /** @docs-private */\n    protected readonly componentColors = KbqComponentColors;\n\n    constructor(\n        private elementRef: ElementRef<HTMLElement>,\n        private focusMonitor: FocusMonitor,\n        @Inject(KBQ_DROPDOWN_PANEL) @Optional() public parentDropdownPanel?: KbqDropdownPanel\n    ) {}\n\n    ngAfterViewInit() {\n        if (this.focusMonitor) {\n            // Start monitoring the element so it gets the appropriate focused classes. We want\n            // to show the focus style for menu items only when the focus was not caused by a\n            // mouse or touch interaction.\n\n            this.focusMonitor.monitor(this.elementRef, false);\n        }\n    }\n\n    ngOnDestroy() {\n        if (this.focusMonitor) {\n            this.focusMonitor.stopMonitoring(this.elementRef);\n        }\n\n        this.hovered.complete();\n        this.focused.complete();\n    }\n\n    resetStyles() {\n        this.getHostElement().classList.remove('cdk-keyboard-focused');\n    }\n\n    /** Focuses the dropdown item. */\n    focus(origin?: FocusOrigin, options?: FocusOptions): void {\n        if (this.disabled) return;\n\n        if (this.focusMonitor && origin) {\n            this.focusMonitor.focusVia(this.getHostElement(), origin, options);\n        } else {\n            this.getHostElement().focus(options);\n        }\n\n        this.focused.next(this);\n    }\n\n    /** Returns the host DOM element. */\n    getHostElement(): HTMLElement {\n        return this.elementRef.nativeElement;\n    }\n\n    /** Used to set the `tabindex`. */\n    getTabIndex(): string {\n        return this.disabled ? '-1' : '0';\n    }\n\n    /** Prevents the default element actions if it is disabled. */\n    // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n    // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n    // ViewEngine they're overwritten.\n    // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n    @HostListener('click', ['$event']) checkDisabled(event: Event): void {\n        if (this.disabled) {\n            event.preventDefault();\n            event.stopPropagation();\n        }\n    }\n\n    /** Emits to the hover stream. */\n    // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n    // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n    // ViewEngine they're overwritten.\n    // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n    @HostListener('mouseenter') handleMouseEnter() {\n        this.hovered.next(this);\n        this.focus('mouse');\n    }\n\n    /** Gets the label to be used when determining whether the option should be focused. */\n    getLabel(): string {\n        const clone = this.getHostElement().cloneNode(true) as HTMLElement;\n        const icons = clone.querySelectorAll('[kbq-icon], .kbq-icon');\n\n        // Strip away icons so they don't show up in the text.\n        for (let i = 0; i < icons.length; i++) {\n            const icon = icons[i];\n\n            icon.parentNode?.removeChild(icon);\n        }\n\n        return clone.textContent?.trim() || '';\n    }\n\n    haltDisabledEvents(event: Event) {\n        if (this.disabled) {\n            event.preventDefault();\n            event.stopImmediatePropagation();\n            event.stopPropagation();\n        }\n    }\n}\n","<ng-content select=\"[kbq-icon]\" />\n\n<div #kbqTitleText class=\"kbq-dropdown-item__text\">\n    <ng-content />\n</div>\n\n@if (isNested) {\n    <i kbq-icon=\"kbq-chevron-right-s_16\" class=\"kbq-dropdown-trigger__icon\" [color]=\"componentColors.ContrastFade\"></i>\n}\n\n<div class=\"kbq-dropdown-item-overlay\" (click)=\"haltDisabledEvents($event)\"></div>\n","import { AnimationEvent } from '@angular/animations';\nimport { FocusOrigin } from '@angular/cdk/a11y';\nimport { Direction } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DOWN_ARROW, UP_ARROW } from '@angular/cdk/keycodes';\nimport { NgClass } from '@angular/common';\nimport {\n    AfterContentInit,\n    ChangeDetectionStrategy,\n    Component,\n    ContentChild,\n    ContentChildren,\n    Directive,\n    ElementRef,\n    EventEmitter,\n    Inject,\n    Input,\n    NgZone,\n    OnDestroy,\n    OnInit,\n    Output,\n    QueryList,\n    TemplateRef,\n    ViewChild,\n    ViewEncapsulation\n} from '@angular/core';\nimport { FocusKeyManager } from '@koobiq/cdk/a11y';\nimport { ESCAPE, LEFT_ARROW, RIGHT_ARROW } from '@koobiq/cdk/keycodes';\nimport { KbqFormField } from '@koobiq/components/form-field';\nimport { Observable, Subject, Subscription, merge } from 'rxjs';\nimport { startWith, switchMap, take } from 'rxjs/operators';\nimport { kbqDropdownAnimations } from './dropdown-animations';\nimport { KbqDropdownContent } from './dropdown-content.directive';\nimport { throwKbqDropdownInvalidPositionX, throwKbqDropdownInvalidPositionY } from './dropdown-errors';\nimport { KbqDropdownItem } from './dropdown-item.component';\nimport {\n    KBQ_DROPDOWN_DEFAULT_OPTIONS,\n    KBQ_DROPDOWN_PANEL,\n    KbqDropdownDefaultOptions,\n    KbqDropdownPanel,\n    KbqDropdownPositionX,\n    KbqDropdownPositionY\n} from './dropdown.types';\n\n@Directive({\n    selector: '[kbqDropdownStaticContent]'\n})\nexport class KbqDropdownStaticContent {}\n\n@Component({\n    selector: 'kbq-dropdown',\n    imports: [\n        NgClass\n    ],\n    templateUrl: 'dropdown.html',\n    /* Component inherits styles from `list`, so `list` variables are imported as the single source of truth. */\n    styleUrls: ['dropdown.scss', 'dropdown-tokens.scss'],\n    encapsulation: ViewEncapsulation.None,\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    exportAs: 'kbqDropdown',\n    animations: [\n        kbqDropdownAnimations.transformDropdown,\n        kbqDropdownAnimations.fadeInItems\n    ],\n    providers: [\n        { provide: KBQ_DROPDOWN_PANEL, useExisting: KbqDropdown }\n    ]\n})\nexport class KbqDropdown implements AfterContentInit, KbqDropdownPanel, OnInit, OnDestroy {\n    @ContentChild(KbqFormField) private search?: KbqFormField;\n\n    @Input() navigationWithWrap: boolean = false;\n\n    /** Position of the dropdown in the X axis. */\n    @Input()\n    get xPosition(): KbqDropdownPositionX {\n        return this._xPosition;\n    }\n\n    set xPosition(value: KbqDropdownPositionX) {\n        if (value !== 'before' && value !== 'after' && value !== 'center') {\n            throwKbqDropdownInvalidPositionX();\n        }\n\n        this._xPosition = value;\n        this.setPositionClasses();\n    }\n\n    /** Position of the dropdown in the Y axis. */\n    @Input()\n    get yPosition(): KbqDropdownPositionY {\n        return this._yPosition;\n    }\n\n    set yPosition(value: KbqDropdownPositionY) {\n        if (value !== 'above' && value !== 'below') {\n            throwKbqDropdownInvalidPositionY();\n        }\n\n        this._yPosition = value;\n        this.setPositionClasses();\n    }\n\n    /** Whether the dropdown should overlap its trigger vertically. */\n    @Input()\n    get overlapTriggerY(): boolean {\n        return this._overlapTriggerY;\n    }\n\n    set overlapTriggerY(value: boolean) {\n        this._overlapTriggerY = coerceBooleanProperty(value);\n    }\n\n    /** Whether the dropdown should overlap its trigger horizontally. */\n    @Input()\n    get overlapTriggerX(): boolean {\n        return this._overlapTriggerX;\n    }\n\n    set overlapTriggerX(value: boolean) {\n        this._overlapTriggerX = coerceBooleanProperty(value);\n    }\n\n    /** Whether the dropdown has a backdrop. */\n    @Input()\n    get hasBackdrop(): boolean {\n        return this._hasBackdrop;\n    }\n\n    set hasBackdrop(value: boolean) {\n        this._hasBackdrop = coerceBooleanProperty(value);\n    }\n\n    /**\n     * This method takes classes set on the host kbq-dropdown element and applies them on the\n     * dropdown template that displays in the overlay container.  Otherwise, it's difficult\n     * to style the containing dropdown from outside the component.\n     * @param classes list of class names\n     */\n    @Input('class')\n    set panelClass(classes: string) {\n        const previousPanelClass = this.previousPanelClass;\n\n        if (previousPanelClass && previousPanelClass.length) {\n            previousPanelClass.split(' ').forEach((className: string) => (this.classList[className] = false));\n        }\n\n        this.previousPanelClass = classes;\n\n        if (classes?.length) {\n            classes.split(' ').forEach((className: string) => (this.classList[className] = true));\n\n            this.elementRef.nativeElement.className = '';\n        }\n    }\n\n    private _xPosition: KbqDropdownPositionX = this.defaultOptions.xPosition;\n    private _yPosition: KbqDropdownPositionY = this.defaultOptions.yPosition;\n    private _overlapTriggerX: boolean = this.defaultOptions.overlapTriggerX;\n    private _overlapTriggerY: boolean = this.defaultOptions.overlapTriggerY;\n    private _hasBackdrop: boolean = this.defaultOptions.hasBackdrop;\n\n    triggerWidth: string;\n    /** Config object to be passed into the dropdown's ngClass */\n    classList: { [key: string]: boolean } = {};\n\n    /** Current state of the panel animation. */\n    panelAnimationState: 'void' | 'enter' = 'void';\n\n    /** Emits whenever an animation on the dropdown completes. */\n    animationDone = new Subject<AnimationEvent>();\n\n    /** Whether the dropdown is animating. */\n    isAnimating: boolean;\n\n    /** Parent dropdown of the current dropdown panel. */\n    parent: KbqDropdownPanel | undefined;\n\n    /** Layout direction of the dropdown. */\n    direction: Direction;\n\n    /** Class to be added to the backdrop element. */\n    @Input() backdropClass: string = this.defaultOptions.backdropClass;\n\n    /** @docs-private */\n    @ViewChild(TemplateRef, { static: false }) templateRef: TemplateRef<any>;\n\n    /**\n     * List of the items inside of a dropdown.\n     */\n    @ContentChildren(KbqDropdownItem, { descendants: true }) items: QueryList<KbqDropdownItem>;\n\n    /**\n     * Dropdown content that will be rendered lazily.\n     * @docs-private\n     */\n    @ContentChild(KbqDropdownContent, { static: false }) lazyContent: KbqDropdownContent;\n\n    /** Event emitted when the dropdown is closed. */\n    @Output() readonly closed = new EventEmitter<void | 'click' | 'keydown' | 'tab'>();\n\n    private previousPanelClass: string;\n\n    private keyManager: FocusKeyManager<KbqDropdownItem>;\n\n    /** Only the direct descendant menu items. */\n    private directDescendantItems = new QueryList<KbqDropdownItem>();\n\n    /** Subscription to tab events on the dropdown panel */\n    private tabSubscription = Subscription.EMPTY;\n\n    constructor(\n        private elementRef: ElementRef<HTMLElement>,\n        private ngZone: NgZone,\n        @Inject(KBQ_DROPDOWN_DEFAULT_OPTIONS) private defaultOptions: KbqDropdownDefaultOptions\n    ) {}\n\n    ngOnInit() {\n        this.setPositionClasses();\n    }\n\n    ngAfterContentInit() {\n        this.updateDirectDescendants();\n\n        this.keyManager = new FocusKeyManager<KbqDropdownItem>(this.directDescendantItems).withTypeAhead();\n\n        if (this.navigationWithWrap) {\n            this.keyManager.withWrap();\n        }\n\n        this.tabSubscription = this.keyManager.tabOut.subscribe(() => this.closed.emit('tab'));\n\n        // If a user manually (programmatically) focuses a menu item, we need to reflect that focus\n        // change back to the key manager. Note that we don't need to unsubscribe here because focused\n        // is internal and we know that it gets completed on destroy.\n        this.directDescendantItems.changes\n            .pipe(\n                startWith(this.directDescendantItems),\n                switchMap((items) => merge(...items.map((item: KbqDropdownItem) => item.focused)))\n            )\n            .subscribe((focusedItem) => this.keyManager.updateActiveItem(focusedItem as KbqDropdownItem));\n\n        this.search?.inOverlay.set(true);\n    }\n\n    ngOnDestroy() {\n        this.directDescendantItems.destroy();\n        this.tabSubscription.unsubscribe();\n        this.closed.complete();\n    }\n\n    /** Stream that emits whenever the hovered dropdown item changes. */\n    hovered(): Observable<KbqDropdownItem> {\n        const itemChanges = this.directDescendantItems.changes as Observable<QueryList<KbqDropdownItem>>;\n\n        return itemChanges.pipe(\n            startWith(this.directDescendantItems),\n            switchMap((items) => merge(...items.map((item: KbqDropdownItem) => item.hovered)))\n        ) as Observable<KbqDropdownItem>;\n    }\n\n    /** Handle a keyboard event from the dropdown, delegating to the appropriate action. */\n    handleKeydown(event: KeyboardEvent) {\n        const keyCode = event.keyCode;\n\n        switch (keyCode) {\n            case ESCAPE:\n                this.closed.emit('keydown');\n                break;\n            case LEFT_ARROW:\n                if (this.parent && this.direction === 'ltr') {\n                    this.closed.emit('keydown');\n                }\n\n                break;\n            case RIGHT_ARROW:\n                if (this.parent && this.direction === 'rtl') {\n                    this.closed.emit('keydown');\n                }\n\n                break;\n            default:\n                if (keyCode === UP_ARROW || keyCode === DOWN_ARROW) {\n                    this.keyManager.setFocusOrigin('keyboard');\n                }\n\n                this.keyManager.onKeydown(event);\n\n                return;\n        }\n\n        // Don't allow the event to propagate if we've already handled it, or it may\n        // end up reaching other overlays that were opened earlier.\n        event.stopPropagation();\n    }\n\n    /**\n     * Focus the first item in the dropdown.\n     * @param origin Action from which the focus originated. Used to set the correct styling.\n     */\n    focusFirstItem(origin: FocusOrigin = 'program'): void {\n        // When the content is rendered lazily, it takes a bit before the items are inside the DOM.\n        if (this.lazyContent) {\n            this.ngZone.onStable.pipe(take(1)).subscribe(() => this.applyInitialFocus(origin));\n        } else {\n            this.applyInitialFocus(origin);\n        }\n    }\n\n    /**\n     * Applies focus when the dropdown is opened. When opened by mouse or touch, the first item\n     * should not be highlighted, so the panel itself is focused instead — keyboard events still\n     * reach the panel and the first arrow key press will highlight the first item.\n     */\n    private applyInitialFocus(origin: FocusOrigin): void {\n        // The origin should be set even when no item gets activated,\n        // since `close` relies on it to emit the correct close reason.\n        this.keyManager.setFocusOrigin(origin);\n\n        if (origin === 'mouse' || origin === 'touch') {\n            this.focusPanel();\n        } else {\n            this.keyManager.setFirstItemActive();\n        }\n    }\n\n    /** Moves DOM focus onto the dropdown panel so that keydown events keep being handled. */\n    private focusPanel(): void {\n        // The panel is rendered into the overlay through a `TemplatePortal`, so it can't be\n        // queried with a `ViewChild`. If there are no rendered items, focus stays on the trigger,\n        // same as `setFirstItemActive` no-ops in that case.\n        const panel = this.directDescendantItems.first?.getHostElement().closest<HTMLElement>('.kbq-dropdown__panel');\n\n        panel?.focus();\n    }\n\n    /**\n     * Resets the active item in the dropdown. This is used when the dropdown is opened, allowing\n     * the user to start from the first option when pressing the down arrow.\n     */\n    resetActiveItem() {\n        this.keyManager.activeItem?.resetStyles();\n        this.keyManager.setActiveItem(-1);\n    }\n\n    /**\n     * Adds classes to the dropdown panel based on its position. Can be used by\n     * consumers to add specific styling based on the position.\n     * @param posX Position of the dropdown along the x axis.\n     * @param posY Position of the dropdown along the y axis.\n     * @docs-private\n     */\n    setPositionClasses(posX: KbqDropdownPositionX = this.xPosition, posY: KbqDropdownPositionY = this.yPosition) {\n        const classes = this.classList;\n\n        classes['kbq-dropdown-before'] = posX === 'before';\n        classes['kbq-dropdown-after'] = posX === 'after';\n        classes['kbq-dropdown-center'] = posX === 'center';\n        classes['kbq-dropdown-above'] = posY === 'above';\n        classes['kbq-dropdown-below'] = posY === 'below';\n    }\n\n    /** Starts the enter animation. */\n    startAnimation() {\n        this.panelAnimationState = 'enter';\n    }\n\n    /** Resets the panel animation to its initial state. */\n    resetAnimation() {\n        this.panelAnimationState = 'void';\n    }\n\n    /** Callback that is invoked when the panel animation completes. */\n    onAnimationDone(event: AnimationEvent) {\n        this.animationDone.next(event);\n        this.isAnimating = false;\n    }\n\n    onAnimationStart(event: AnimationEvent) {\n        this.isAnimating = true;\n\n        // Scroll the content element to the top as soon as the animation starts. This is necessary,\n        // because we move focus to the first item while it's still being animated, which can throw\n        // the browser off when it determines the scroll position. Alternatively we can move focus\n        // when the animation is done, however moving focus asynchronously will interrupt screen\n        // readers which are in the process of reading out the dropdown already. We take the `element`\n        // from the `event` since we can't use a `ViewChild` to access the pane.\n        if (event.toState === 'enter' && this.keyManager.activeItemIndex <= 0) {\n            event.element.scrollTop = 0;\n        }\n    }\n\n    close() {\n        const focusOrigin = this.keyManager.getFocusOrigin() === 'keyboard' ? 'keydown' : 'click';\n\n        this.closed.emit(focusOrigin);\n    }\n\n    /**\n     * Sets up a stream that will keep track of any newly-added menu items and will update the list\n     * of direct descendants. We collect the descendants this way, because `items` can include\n     * items that are part of child menus, and using a custom way of registering items is unreliable\n     * when it comes to maintaining the item order.\n     */\n    private updateDirectDescendants() {\n        this.items.changes.pipe(startWith(this.items)).subscribe((items: QueryList<KbqDropdownItem>) => {\n            this.directDescendantItems.reset(items.filter((item) => item.parentDropdownPanel === this));\n            this.directDescendantItems.notifyOnChanges();\n        });\n    }\n}\n","<ng-template>\n    <div\n        tabindex=\"-1\"\n        class=\"kbq-dropdown__panel\"\n        [class.kbq-dropdown__panel_nested]=\"parent\"\n        [ngClass]=\"classList\"\n        [@transformDropdown]=\"panelAnimationState\"\n        (@transformDropdown.done)=\"onAnimationDone($event)\"\n        (@transformDropdown.start)=\"onAnimationStart($event)\"\n        (click)=\"close()\"\n        (keydown)=\"handleKeydown($event)\"\n    >\n        <div class=\"kbq-dropdown__content\">\n            <ng-content />\n        </div>\n    </div>\n</ng-template>\n\n<ng-content select=\"[kbqDropdownStaticContent]\" />\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport {\n    FlexibleConnectedPositionStrategy,\n    HorizontalConnectionPos,\n    Overlay,\n    OverlayConfig,\n    OverlayContainer,\n    OverlayRef,\n    ScrollStrategy,\n    VerticalConnectionPos\n} from '@angular/cdk/overlay';\nimport { normalizePassiveListenerOptions, Platform } from '@angular/cdk/platform';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n    AfterContentInit,\n    booleanAttribute,\n    ChangeDetectorRef,\n    Directive,\n    ElementRef,\n    EventEmitter,\n    inject,\n    Inject,\n    InjectionToken,\n    Input,\n    numberAttribute,\n    OnDestroy,\n    Optional,\n    Output,\n    Renderer2,\n    Self,\n    ViewContainerRef\n} from '@angular/core';\nimport { DOWN_ARROW, ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE } from '@koobiq/cdk/keycodes';\nimport { defaultOffsetY, KBQ_WINDOW } from '@koobiq/components/core';\nimport { asapScheduler, merge, Observable, of as observableOf, Subscription } from 'rxjs';\nimport { delay, filter, take, takeUntil } from 'rxjs/operators';\nimport { throwKbqDropdownMissingError } from './dropdown-errors';\nimport { KbqDropdownItem } from './dropdown-item.component';\nimport { KbqDropdown } from './dropdown.component';\nimport { DropdownCloseReason, KbqDropdownPanel, KbqDropdownPositionX, KbqDropdownPositionY } from './dropdown.types';\n\n/** Injection token that determines the scroll handling while the dropdown is open. */\nexport const KBQ_DROPDOWN_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>('kbq-dropdown-scroll-strategy');\n\n/** @docs-private */\nexport function KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy {\n    return () => overlay.scrollStrategies.reposition();\n}\n\n/** @docs-private */\nexport const KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER = {\n    provide: KBQ_DROPDOWN_SCROLL_STRATEGY,\n    deps: [Overlay],\n    useFactory: KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY\n};\n\n/**\n * Marker provided by host components that create their own stacking context at\n * the default overlay z-index (e.g. `KbqTopBar`, `KbqNavbar` use\n * `position: sticky` + `z-index: $overlay-z-index`). When this token is\n * available in the injector tree, `KbqDropdownTrigger` defaults `demoteOverlay`\n * to `false` so the dropdown overlay is not lowered below the host.\n *\n * An explicit `[demoteOverlay]` binding on the trigger still wins.\n */\nexport const KBQ_DROPDOWN_HOST = new InjectionToken<unknown>('kbq-dropdown-host');\n\n/** Default top padding of the nested dropdown panel. */\nexport const NESTED_PANEL_TOP_PADDING = 4;\nexport const NESTED_PANEL_LEFT_PADDING = 8;\n\n/** Options for binding a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });\n\nconst positionMap = {\n    /** Maps CDK overlay x-anchor back to a dropdown x-position label. */\n    overlayXToPosX: {\n        start: 'after',\n        center: 'center',\n        end: 'before'\n    } as Record<HorizontalConnectionPos, KbqDropdownPositionX>,\n\n    /** Primary (overlapping) X positions: [originX, originFallbackX, overlayX, overlayFallbackX]. */\n    xPositions: {\n        before: ['end', 'start', 'end', 'start'],\n        center: ['center', 'start', 'center', 'end'],\n        after: ['start', 'end', 'start', 'end']\n    } as Record<\n        KbqDropdownPositionX,\n        [HorizontalConnectionPos, HorizontalConnectionPos, HorizontalConnectionPos, HorizontalConnectionPos]\n    >,\n\n    /** Non-overlapping X positions: [originX, originFallbackX, overlayX, overlayFallbackX]. */\n    nonOverlapXPositions: {\n        before: ['start', 'end', 'end', 'start'],\n        center: ['center', 'start', 'center', 'end'],\n        after: ['end', 'start', 'start', 'end']\n    } as Record<\n        KbqDropdownPositionX,\n        [HorizontalConnectionPos, HorizontalConnectionPos, HorizontalConnectionPos, HorizontalConnectionPos]\n    >\n};\n\n/**\n * This directive is intended to be used in conjunction with an kbq-dropdown tag.  It is\n * responsible for toggling the display of the provided dropdown instance.\n */\n@Directive({\n    selector: `[kbqDropdownTriggerFor]`,\n    exportAs: 'kbqDropdownTrigger',\n    host: {\n        class: 'kbq-dropdown-trigger',\n        '[class.kbq-pressed]': 'opened',\n        '(mousedown)': 'handleMousedown($event)',\n        '(keydown)': 'handleKeydown($event)',\n        '(click)': 'handleClick($event)'\n    }\n})\nexport class KbqDropdownTrigger implements AfterContentInit, OnDestroy {\n    private readonly overlayContainer = inject(OverlayContainer);\n    private readonly renderer = inject(Renderer2);\n\n    protected readonly isBrowser = inject(Platform).isBrowser;\n    private readonly window = inject(KBQ_WINDOW);\n    private readonly host = inject(KBQ_DROPDOWN_HOST, { optional: true });\n\n    lastDestroyReason: DropdownCloseReason;\n\n    /** Position offset of the dropdown in the X axis. */\n    @Input({ transform: numberAttribute }) offsetX: number;\n\n    /** Position offset of the dropdown in the Y axis. */\n    @Input({ transform: numberAttribute }) offsetY: number;\n\n    /** Data to be passed along to any lazily-rendered content. */\n    @Input('kbqDropdownTriggerData') data: any;\n\n    @Input() openByArrowDown: boolean = true;\n\n    /**\n     * Whether to demote the overlay container z-index so that dropdown overlays\n     * sit below sibling overlays (tooltips, modals, etc.). Set to `false` to\n     * keep the dropdown overlay at the default overlay container z-index.\n     */\n    @Input({ transform: booleanAttribute }) demoteOverlay: boolean = true;\n\n    /**\n     * Whether focus should be restored when the menu is closed.\n     * Note that disabling this option can have accessibility implications\n     * and it's up to you to manage focus, if you decide to turn it off.\n     */\n    @Input('kbqDropdownTriggerRestoreFocus') restoreFocus: boolean = true;\n\n    /** References the dropdown instance that the trigger is associated with. */\n    @Input('kbqDropdownTriggerFor')\n    get dropdown() {\n        return this._dropdown;\n    }\n\n    set dropdown(dropdown: KbqDropdownPanel) {\n        if (dropdown === this._dropdown) {\n            return;\n        }\n\n        this._dropdown = dropdown;\n        this.closeSubscription.unsubscribe();\n\n        if (dropdown) {\n            this.closeSubscription = dropdown.closed.asObservable().subscribe((reason) => {\n                this.destroy(reason);\n\n                // If a click closed the dropdown, we should close the entire chain of nested dropdowns.\n                if (['click', 'tab'].includes(reason as string) && this.parent) {\n                    this.parent.closed.emit(reason);\n                }\n            });\n        }\n    }\n\n    private _dropdown: KbqDropdownPanel;\n\n    /** Event emitted when the associated dropdown is opened. */\n    @Output() readonly dropdownOpened: EventEmitter<void> = new EventEmitter<void>();\n\n    /** Event emitted when the associated dropdown is closed. */\n    @Output() readonly dropdownClosed: EventEmitter<void> = new EventEmitter<void>();\n\n    // Tracking input type is necessary so it's possible to only auto-focus\n    // the first item of the list when the dropdown is opened via the keyboard\n    openedBy: Exclude<FocusOrigin, 'program' | null> | undefined;\n\n    /** The text direction of the containing app. */\n    get dir(): Direction {\n        return this._dir?.value === 'rtl' ? 'rtl' : 'ltr';\n    }\n\n    /** Whether the dropdown is open. */\n    get opened(): boolean {\n        return this._opened;\n    }\n\n    private _opened: boolean = false;\n\n    private portal: TemplatePortal;\n\n    private overlayRef: OverlayRef | null = null;\n\n    private closeSubscription = Subscription.EMPTY;\n\n    private hoverSubscription = Subscription.EMPTY;\n\n    private classAddedToOverlayContainer: boolean = false;\n\n    constructor(\n        private overlay: Overlay,\n        private elementRef: ElementRef<HTMLElement>,\n        private viewContainerRef: ViewContainerRef,\n        @Inject(KBQ_DROPDOWN_SCROLL_STRATEGY) private scrollStrategy: any,\n        @Optional() private parent: KbqDropdown,\n        @Optional() @Self() private dropdownItemInstance: KbqDropdownItem,\n        @Optional() private _dir: Directionality,\n        private changeDetectorRef: ChangeDetectorRef,\n        private focusMonitor?: FocusMonitor\n    ) {\n        elementRef.nativeElement.addEventListener('touchstart', this.handleTouchStart, passiveEventListenerOptions);\n\n        if (dropdownItemInstance) {\n            dropdownItemInstance.isNested = this.isNested();\n        }\n\n        if (this.host) {\n            this.demoteOverlay = false;\n        }\n    }\n\n    ngAfterContentInit() {\n        this.check();\n        this.handleHover();\n    }\n\n    ngOnDestroy() {\n        if (this.overlayRef) {\n            this.overlayRef.dispose();\n            this.overlayRef = null;\n        }\n\n        this.elementRef.nativeElement.removeEventListener(\n            'touchstart',\n            this.handleTouchStart,\n            passiveEventListenerOptions\n        );\n\n        this.cleanUpSubscriptions();\n    }\n\n    /** Whether the dropdown triggers a nested dropdown or a top-level one. */\n    isNested(): boolean {\n        return !!(this.dropdownItemInstance && this.parent);\n    }\n\n    /** Toggles the dropdown between the open and closed states. */\n    toggle(): void {\n        return this._opened ? this.close() : this.open();\n    }\n\n    /** Opens the dropdown. */\n    open(): void {\n        if (this._opened) {\n            return;\n        }\n\n        this.check();\n\n        const overlayRef = this.createOverlay();\n        const overlayConfig = overlayRef.getConfig();\n\n        this.setPosition(overlayConfig.positionStrategy as FlexibleConnectedPositionStrategy);\n\n        overlayConfig.hasBackdrop = this.dropdown.hasBackdrop ? !this.isNested() : this.dropdown.hasBackdrop;\n\n        overlayRef.attach(this.getPortal());\n\n        if (this.dropdown.lazyContent) {\n            this.dropdown.lazyContent.detach();\n\n            this.dropdown.lazyContent.attach(this.data);\n        }\n\n        this.closeSubscription = this.closingActions().subscribe(() => this.close());\n\n        this.init();\n\n        if (this.dropdown instanceof KbqDropdown) {\n            this.dropdown.startAnimation();\n        }\n\n        this.addClassToOverlayContainer();\n    }\n\n    /** Closes the dropdown. */\n    close(): void {\n        this.dropdown.closed.emit();\n\n        this.removeClassFromOverlayContainer();\n    }\n\n    /**\n     * Focuses the dropdown trigger.\n     */\n    focus(origin?: FocusOrigin, options?: FocusOptions) {\n        if (this.focusMonitor && origin) {\n            this.focusMonitor.focusVia(this.elementRef.nativeElement, origin, options);\n        } else {\n            this.elementRef.nativeElement.focus();\n        }\n    }\n\n    /** Handles mouse presses on the trigger. */\n    handleMousedown(event: MouseEvent): void {\n        // Since right or middle button clicks won't trigger the `click` event,\n        // we shouldn't consider the dropdown as opened by mouse in those cases.\n        this.openedBy = event.button === 0 ? 'mouse' : undefined;\n\n        // Since clicking on the trigger won't close the dropdown if it opens a nested dropdown,\n        // we should prevent focus from moving onto it via click to avoid the\n        // highlight from lingering on the dropdown item.\n        if (this.isNested()) {\n            event.preventDefault();\n        }\n    }\n\n    /** Handles key presses on the trigger. */\n    handleKeydown(event: KeyboardEvent) {\n        const keyCode = event.keyCode;\n\n        if (keyCode === ENTER || keyCode === SPACE) {\n            this.openedBy = 'keyboard';\n\n            event.preventDefault();\n\n            if (this.isNested()) {\n                // Stop event propagation to avoid closing the parent dropdown.\n                event.stopPropagation();\n\n                this.open();\n            } else {\n                this.toggle();\n            }\n        }\n\n        if (\n            (this.isNested() &&\n                ((keyCode === RIGHT_ARROW && this.dir === 'ltr') || (keyCode === LEFT_ARROW && this.dir === 'rtl'))) ||\n            (!this.isNested() && keyCode === DOWN_ARROW && this.openByArrowDown)\n        ) {\n            event.preventDefault();\n\n            this.openedBy = 'keyboard';\n            this.open();\n        }\n    }\n\n    /** Handles click events on the trigger. */\n    handleClick(event: MouseEvent): void {\n        if (this.isNested()) {\n            // Stop event propagation to avoid closing the parent dropdown.\n            event.stopPropagation();\n\n            this.open();\n        } else {\n            this.toggle();\n        }\n    }\n\n    /**\n     * Handles touch start events on the trigger.\n     * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.\n     */\n    private handleTouchStart = () => (this.openedBy = 'touch');\n\n    /** Closes the dropdown and does the necessary cleanup. */\n    private destroy(reason: DropdownCloseReason) {\n        if (!this.overlayRef || !this.opened) {\n            return;\n        }\n\n        this.lastDestroyReason = reason;\n\n        this.dropdown.resetActiveItem();\n\n        this.closeSubscription.unsubscribe();\n        this.overlayRef.detach();\n\n        if (this.restoreFocus && (reason === 'keydown' || !this.openedBy || !this.isNested())) {\n            this.focus(this.openedBy);\n        }\n\n        this.openedBy = undefined;\n\n        if (this.dropdown instanceof KbqDropdown) {\n            this.dropdown.resetAnimation();\n\n            const animationSubscription = this.dropdown.animationDone.pipe(\n                filter((event) => event.toState === 'void'),\n                take(1)\n            );\n\n            if (this.dropdown.lazyContent) {\n                // Wait for the exit animation to finish before detaching the content.\n                animationSubscription\n                    .pipe(\n                        // Interrupt if the content got re-attached.\n                        takeUntil(this.dropdown.lazyContent.attached)\n                    )\n                    .subscribe({\n                        next: () => this.dropdown.lazyContent!.detach(),\n                        // No matter whether the content got re-attached, reset the this.dropdown.\n                        complete: () => this.setIsOpened(false)\n                    });\n            } else {\n                animationSubscription.subscribe(() => this.setIsOpened(false));\n            }\n        } else {\n            this.setIsOpened(false);\n\n            if (this.dropdown.lazyContent) {\n                this.dropdown.lazyContent.detach();\n            }\n        }\n    }\n\n    /**\n     * This method sets the dropdown state to open and focuses the first item if\n     * the dropdown was opened via the keyboard.\n     */\n    private init(): void {\n        this.dropdown.parent = this.isNested() ? this.parent : undefined;\n        this.dropdown.direction = this.dir;\n\n        // reset submenu items since they can be initialized as children of root menu\n        if (this.parent && !this.dropdown.items.length) {\n            this.dropdown.items.reset(Array.from(this.parent.items));\n            this.dropdown.items.notifyOnChanges();\n        }\n\n        this.dropdown.focusFirstItem(this.openedBy || 'program');\n\n        this.setIsOpened(true);\n    }\n\n    // set state rather than toggle to support triggers sharing a dropdown\n    private setIsOpened(isOpen: boolean): void {\n        if (isOpen !== this._opened) {\n            this.changeDetectorRef.markForCheck();\n        }\n\n        this._opened = isOpen;\n        this._opened ? this.dropdownOpened.emit() : this.dropdownClosed.emit();\n\n        if (this.isNested()) {\n            this.dropdownItemInstance.highlighted = isOpen;\n        }\n    }\n\n    /**\n     * This method checks that a valid instance of KbqDropdown has been passed into\n     * kbqDropdownTriggerFor. If not, an exception is thrown.\n     */\n    private check() {\n        if (!this.dropdown) {\n            throwKbqDropdownMissingError();\n        }\n    }\n\n    /**\n     * This method creates the overlay from the provided dropdown's template and saves its\n     * OverlayRef so that it can be attached to the DOM when open is called.\n     */\n    private createOverlay(): OverlayRef {\n        if (!this.overlayRef) {\n            const config = this.getOverlayConfig();\n\n            this.subscribeToPositions(config.positionStrategy as FlexibleConnectedPositionStrategy);\n            this.overlayRef = this.overlay.create(config);\n\n            // Consume the `keydownEvents` in order to prevent them from going to another overlay.\n            // Ideally we'd also have our keyboard event logic in here, however doing so will\n            // break anybody that may have implemented the `KbqDropdownPanel` themselves.\n            this.overlayRef.keydownEvents().subscribe();\n        }\n\n        return this.overlayRef;\n    }\n\n    /**\n     * This method builds the configuration object needed to create the overlay, the OverlayState.\n     * @returns OverlayConfig\n     */\n    private getOverlayConfig(): OverlayConfig {\n        const isVerticalTrigger = this.dropdown.overlapTriggerY && !this.dropdown.overlapTriggerX;\n\n        return new OverlayConfig({\n            positionStrategy: this.overlay\n                .position()\n                .flexibleConnectedTo(this.elementRef)\n                .withTransformOriginOn('.kbq-dropdown__panel')\n                .withPush(false),\n            backdropClass: this.dropdown.backdropClass || 'cdk-overlay-transparent-backdrop',\n            scrollStrategy: this.scrollStrategy(),\n            direction: this.dir,\n            ...(!this.isNested() && !isVerticalTrigger && { minWidth: this.getWidth() })\n        });\n    }\n\n    /**\n     * Listens to changes in the position of the overlay and sets the correct classes\n     * on the dropdown based on the new position. This ensures the animation origin is always\n     * correct, even if a fallback position is used for the overlay.\n     */\n    private subscribeToPositions(position: FlexibleConnectedPositionStrategy): void {\n        if (this.dropdown.setPositionClasses) {\n            position.positionChanges.subscribe((change) => {\n                const posX = positionMap.overlayXToPosX[change.connectionPair.overlayX];\n                const posY: KbqDropdownPositionY = change.connectionPair.overlayY === 'top' ? 'below' : 'above';\n\n                this.dropdown.setPositionClasses!(posX, posY);\n            });\n        }\n    }\n\n    /**\n     * Sets the appropriate positions on a position strategy\n     * so the overlay connects with the trigger correctly.\n     * @param positionStrategy Strategy whose position to update.\n     */\n    private setPosition(positionStrategy: FlexibleConnectedPositionStrategy) {\n        let [originX, originFallbackX, overlayX, overlayFallbackX] = positionMap.xPositions[this.dropdown.xPosition];\n\n        // eslint-disable-next-line prefer-const\n        let [overlayY, overlayFallbackY, originY, originFallbackY]: VerticalConnectionPos[] =\n            this.dropdown.yPosition === 'above'\n                ? ['bottom', 'top', 'bottom', 'top']\n                : ['top', 'bottom', 'top', 'bottom'];\n\n        let offsetY = 0;\n        let offsetX = 0;\n\n        if (this.isNested()) {\n            // When the dropdown is nested, it should always align itself\n            // to the edges of the trigger, instead of overlapping it,\n            // so 'center' is not applicable for nested panels — falls back to 'after'.\n            const xPosition = this.dropdown.xPosition === 'center' ? 'after' : this.dropdown.xPosition;\n\n            [originX, originFallbackX, overlayX, overlayFallbackX] = positionMap.nonOverlapXPositions[xPosition];\n            offsetY = overlayY === 'bottom' ? NESTED_PANEL_TOP_PADDING : -NESTED_PANEL_TOP_PADDING;\n            offsetX = NESTED_PANEL_LEFT_PADDING;\n        } else {\n            if (!this.dropdown.overlapTriggerY) {\n                offsetY = defaultOffsetY;\n                originY = overlayY === 'top' ? 'bottom' : 'top';\n                originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';\n            }\n\n            if (!this.dropdown.overlapTriggerX) {\n                [originX, originFallbackX, overlayX, overlayFallbackX] =\n                    positionMap.nonOverlapXPositions[this.dropdown.xPosition];\n            }\n        }\n\n        positionStrategy.withPositions([\n            {\n                originX,\n                originY,\n                overlayX,\n                overlayY,\n                offsetY: this.offsetY ?? offsetY,\n                offsetX: this.offsetX ?? -offsetX\n            },\n            {\n                originX: originFallbackX,\n                originY,\n                overlayX: overlayFallbackX,\n                overlayY,\n                offsetY: this.offsetY ?? offsetY,\n                offsetX: this.offsetX ?? offsetX\n            },\n            {\n                originX,\n                originY: originFallbackY,\n                overlayX,\n                overlayY: overlayFallbackY,\n                offsetY: this.offsetY ?? -offsetY,\n                offsetX: this.offsetX ?? -offsetX\n            },\n            {\n                originX: originFallbackX,\n                originY: originFallbackY,\n                overlayX: overlayFallbackX,\n                overlayY: overlayFallbackY,\n                offsetY: this.offsetY ?? -offsetY,\n                offsetX: this.offsetX ?? -offsetX\n            }\n        ]);\n    }\n\n    /** Cleans up the active subscriptions. */\n    private cleanUpSubscriptions(): void {\n        this.closeSubscription.unsubscribe();\n        this.hoverSubscription.unsubscribe();\n    }\n\n    /** Returns a stream that emits whenever an action that should close the dropdown occurs. */\n    private closingActions() {\n        const backdrop = this.overlayRef!.backdropClick();\n        const outsidePointerEvents = this.overlayRef!.outsidePointerEvents();\n        const detachments = this.overlayRef!.detachments();\n        const parentClose = this.parent ? this.parent.closed : observableOf();\n        const hover = this.parent\n            ? this.parent.hovered().pipe(\n                  filter((active) => active !== this.dropdownItemInstance),\n                  filter(() => this._opened)\n              )\n            : observableOf();\n\n        return merge(\n            backdrop,\n            outsidePointerEvents,\n            parentClose as Observable<DropdownCloseReason>,\n            hover,\n            detachments\n        );\n    }\n\n    /** Handles the cases where the user hovers over the trigger. */\n    private handleHover() {\n        // Subscribe to changes in the hovered item in order to toggle the panel.\n        if (!this.isNested()) {\n            return;\n        }\n\n        this.hoverSubscription = this.parent\n            .hovered()\n            // Since we might have multiple competing triggers for the same dropdown (e.g. a nested dropdown\n            // with different data and triggers), we have to delay it by a tick to ensure that\n            // it won't be closed immediately after it is opened.\n            .pipe(\n                filter((active) => active === this.dropdownItemInstance && !active.disabled),\n                delay(0, asapScheduler)\n            )\n            .subscribe(() => {\n                this.openedBy = 'mouse';\n\n                // If the same dropdown is used between multiple triggers, it might still be animating\n                // while the new trigger tries to re-open it. Wait for the animation to finish\n                // before doing so. Also interrupt if the user moves to another item.\n                if (this.dropdown instanceof KbqDropdown && this.dropdown.isAnimating) {\n                    // We need the `delay(0)` here in order to avoid\n                    // 'changed after checked' errors in some cases. See #12194.\n                    this.dropdown.animationDone\n                        .pipe(take(1), delay(0, asapScheduler), takeUntil(this.parent.hovered()))\n                        // eslint-disable-next-line rxjs/no-nested-subscribe\n                        .subscribe(() => this.open());\n                } else {\n                    this.open();\n                }\n            });\n    }\n\n    /** Gets the portal that should be attached to the overlay. */\n    private getPortal(): TemplatePortal {\n        // Note that we can avoid this check by keeping the portal on the dropdown panel.\n        // While it would be cleaner, we'd have to introduce another required method on\n        // `KbqDropdownPanel`, making it harder to consume.\n        if (!this.portal || this.portal.templateRef !== this.dropdown.templateRef) {\n            this.portal = new TemplatePortal(this.dropdown.templateRef, this.viewContainerRef);\n        }\n\n        return this.portal;\n    }\n\n    private getWidth(): string {\n        if (!this.isBrowser) return '';\n\n        const nativeElement = this.elementRef.nativeElement;\n\n        const { width, borderRightWidth, borderLeftWidth } = this.window.getComputedStyle(nativeElement);\n\n        return `${parseInt(width) - parseInt(borderRightWidth) - parseInt(borderLeftWidth)}px`;\n    }\n\n    private addClassToOverlayContainer() {\n        if (!this.demoteOverlay) return;\n\n        const overlayContainer = this.overlayContainer?.getContainerElement();\n\n        if (overlayContainer.childNodes.length === 1) {\n            this.classAddedToOverlayContainer = true;\n\n            this.renderer.addClass(overlayContainer, 'cdk-overlay-container_dropdown');\n        }\n    }\n\n    private removeClassFromOverlayContainer() {\n        if (this.classAddedToOverlayContainer) {\n            this.renderer.removeClass(this.overlayContainer.getContainerElement(), 'cdk-overlay-container_dropdown');\n        }\n    }\n}\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { NgClass } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { KbqIconModule } from '@koobiq/components/icon';\nimport { KbqDropdownContent } from './dropdown-content.directive';\nimport { KbqDropdownItem } from './dropdown-item.component';\nimport { KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER, KbqDropdownTrigger } from './dropdown-trigger.directive';\nimport { KbqDropdown, KbqDropdownStaticContent } from './dropdown.component';\n\n@NgModule({\n    imports: [\n        OverlayModule,\n        KbqIconModule,\n        NgClass,\n        KbqDropdownStaticContent,\n        KbqDropdown,\n        KbqDropdownItem,\n        KbqDropdownTrigger,\n        KbqDropdownContent\n    ],\n    exports: [\n        KbqDropdown,\n        KbqDropdownItem,\n        KbqDropdownTrigger,\n        KbqDropdownContent,\n        KbqDropdownStaticContent\n    ],\n    providers: [KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER]\n})\nexport class KbqDropdownModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DOWN_ARROW","observableOf","i2.KbqDropdown","i3.KbqDropdownItem","i5"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA;;;AAGG;AACI,MAAM,qBAAqB,GAG9B;AACA;;;;;;;AAOG;AACH,IAAA,iBAAiB,EAAE,OAAO,CAAC,mBAAmB,EAAE;AAC5C,QAAA,KAAK,CACD,MAAM,EACN,KAAK,CAAC;AACF,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,SAAS,EAAE;AACd,SAAA,CAAC,CACL;AACD,QAAA,UAAU,CACN,eAAe,EACf,KAAK,CAAC;AACF,YAAA,KAAK,CAAC,wBAAwB,EAAE,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC7E,OAAO,CAAC,gCAAgC,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAC7E,SAAA,CAAC,CACL;AACD,QAAA,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;KAC7E,CAAC;AAEF;;;AAGG;AACH,IAAA,WAAW,EAAE,OAAO,CAAC,aAAa,EAAE;;QAEhC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QACvC,UAAU,CAAC,WAAW,EAAE;AACpB,YAAA,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;YACrB,OAAO,CAAC,0CAA0C;SACrD;KACJ;;AAGE,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAE1C,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;;AC/CvD;;AAEG;MAIU,kBAAkB,CAAA;IAQ3B,WAAA,CACY,QAA0B,EAC1B,wBAAkD,EAClD,MAAsB,EACtB,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