import { __read, __decorate, __metadata, __spread } from 'tslib';
import { ɵɵdefineInjectable, ɵsetClassMetadata, Injectable, InjectionToken, ɵɵinject, SkipSelf, Optional, Inject, ɵɵdirectiveInject, ɵɵdefineDirective, ɵɵcontentQuery, ɵɵqueryRefresh, ɵɵloadQuery, ɵɵlistener, ɵɵstyleProp, ɵɵclassProp, ɵɵNgOnChangesFeature, Directive, Input, ContentChildren, ɵɵelement, ɵɵnextContext, ɵɵproperty, ɵɵelementContainerStart, ɵɵelementStart, ɵɵtext, ɵɵelementEnd, ɵɵelementContainerEnd, ɵɵadvance, ɵɵtextInterpolate, EventEmitter, ɵɵdefineComponent, ɵɵprojectionDef, ɵɵtemplate, ɵɵprojection, ɵɵtemplateRefExtractor, ɵɵreference, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, ɵɵupdateSyntheticHostBinding, ɵɵclassMap, ɵɵgetCurrentView, ɵɵrestoreView, ChangeDetectorRef, ɵɵstaticViewQuery, ElementRef, ɵɵProvidersFeature, Host, ViewChild, Renderer2, ɵɵviewQuery, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, NgModule } from '@angular/core';
import { InputBoolean, NzStringTemplateOutletDirective, collapseMotion, zoomBigMotion, slideMotion, POSITION_MAP, getPlacementName, NzNoAnimationDirective, NzNoAnimationModule, NzOutletModule } from 'ng-zorro-antd/core';
import { Subject, BehaviorSubject, merge, combineLatest } from 'rxjs';
import { map, flatMap, filter, mapTo, auditTime, distinctUntilChanged, takeUntil, startWith, switchMap } from 'rxjs/operators';
import { NavigationEnd, RouterLink, RouterLinkWithHref, Router } from '@angular/router';
import { CdkOverlayOrigin, CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
import { Platform, PlatformModule } from '@angular/cdk/platform';
import { NgIf, NgTemplateOutlet, CommonModule } from '@angular/common';
import { NzIconDirective, NzIconModule } from 'ng-zorro-antd/icon';

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
var MenuService = /** @class */ (function () {
    function MenuService() {
        /** all descendant menu click **/
        this.descendantMenuItemClick$ = new Subject();
        /** child menu item click **/
        this.childMenuItemClick$ = new Subject();
        this.theme$ = new BehaviorSubject('light');
        this.mode$ = new BehaviorSubject('vertical');
        this.inlineIndent$ = new BehaviorSubject(24);
        this.isChildSubMenuOpen$ = new BehaviorSubject(false);
    }
    MenuService.prototype.onDescendantMenuItemClick = function (menu) {
        this.descendantMenuItemClick$.next(menu);
    };
    MenuService.prototype.onChildMenuItemClick = function (menu) {
        this.childMenuItemClick$.next(menu);
    };
    MenuService.prototype.setMode = function (mode) {
        this.mode$.next(mode);
    };
    MenuService.prototype.setTheme = function (theme) {
        this.theme$.next(theme);
    };
    MenuService.prototype.setInlineIndent = function (indent) {
        this.inlineIndent$.next(indent);
    };
    /** @nocollapse */ MenuService.ɵfac = function MenuService_Factory(t) { return new (t || MenuService)(); };
    /** @nocollapse */ MenuService.ɵprov = ɵɵdefineInjectable({ token: MenuService, factory: MenuService.ɵfac });
    return MenuService;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(MenuService, [{
        type: Injectable
    }], null, null); })();

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
var NzIsMenuInsideDropDownToken = new InjectionToken('NzIsInDropDownMenuToken');
var NzMenuServiceLocalToken = new InjectionToken('NzMenuServiceLocalToken');

var NzSubmenuService = /** @class */ (function () {
    function NzSubmenuService(nzHostSubmenuService, nzMenuService, isMenuInsideDropDown) {
        var _this = this;
        this.nzHostSubmenuService = nzHostSubmenuService;
        this.nzMenuService = nzMenuService;
        this.isMenuInsideDropDown = isMenuInsideDropDown;
        this.mode$ = this.nzMenuService.mode$.pipe(map(function (mode) {
            if (mode === 'inline') {
                return 'inline';
                /** if inside another submenu, set the mode to vertical **/
            }
            else if (mode === 'vertical' || _this.nzHostSubmenuService) {
                return 'vertical';
            }
            else {
                return 'horizontal';
            }
        }));
        this.level = 1;
        this.isCurrentSubMenuOpen$ = new BehaviorSubject(false);
        this.isChildSubMenuOpen$ = new BehaviorSubject(false);
        /** submenu title & overlay mouse enter status **/
        this.isMouseEnterTitleOrOverlay$ = new Subject();
        this.childMenuItemClick$ = new Subject();
        if (this.nzHostSubmenuService) {
            this.level = this.nzHostSubmenuService.level + 1;
        }
        /** close if menu item clicked **/
        var isClosedByMenuItemClick = this.childMenuItemClick$.pipe(flatMap(function () { return _this.mode$; }), filter(function (mode) { return mode !== 'inline' || _this.isMenuInsideDropDown; }), mapTo(false));
        var isCurrentSubmenuOpen$ = merge(this.isMouseEnterTitleOrOverlay$, isClosedByMenuItemClick);
        /** combine the child submenu status with current submenu status to calculate host submenu open **/
        var isSubMenuOpenWithDebounce$ = combineLatest([this.isChildSubMenuOpen$, isCurrentSubmenuOpen$]).pipe(map(function (_a) {
            var _b = __read(_a, 2), isChildSubMenuOpen = _b[0], isCurrentSubmenuOpen = _b[1];
            return isChildSubMenuOpen || isCurrentSubmenuOpen;
        }), auditTime(150), distinctUntilChanged());
        isSubMenuOpenWithDebounce$.pipe(distinctUntilChanged()).subscribe(function (data) {
            _this.setOpenStateWithoutDebounce(data);
            if (_this.nzHostSubmenuService) {
                /** set parent submenu's child submenu open status **/
                _this.nzHostSubmenuService.isChildSubMenuOpen$.next(data);
            }
            else {
                _this.nzMenuService.isChildSubMenuOpen$.next(data);
            }
        });
    }
    /**
     * menu item inside submenu clicked
     * @param menu
     */
    NzSubmenuService.prototype.onChildMenuItemClick = function (menu) {
        this.childMenuItemClick$.next(menu);
    };
    NzSubmenuService.prototype.setOpenStateWithoutDebounce = function (value) {
        this.isCurrentSubMenuOpen$.next(value);
    };
    NzSubmenuService.prototype.setMouseEnterTitleOrOverlayState = function (value) {
        this.isMouseEnterTitleOrOverlay$.next(value);
    };
    /** @nocollapse */ NzSubmenuService.ɵfac = function NzSubmenuService_Factory(t) { return new (t || NzSubmenuService)(ɵɵinject(NzSubmenuService, 12), ɵɵinject(MenuService), ɵɵinject(NzIsMenuInsideDropDownToken)); };
    /** @nocollapse */ NzSubmenuService.ɵprov = ɵɵdefineInjectable({ token: NzSubmenuService, factory: NzSubmenuService.ɵfac });
    return NzSubmenuService;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzSubmenuService, [{
        type: Injectable
    }], function () { return [{ type: NzSubmenuService, decorators: [{
                type: SkipSelf
            }, {
                type: Optional
            }] }, { type: MenuService }, { type: undefined, decorators: [{
                type: Inject,
                args: [NzIsMenuInsideDropDownToken]
            }] }]; }, null); })();

var NzMenuItemDirective = /** @class */ (function () {
    function NzMenuItemDirective(nzMenuService, nzSubmenuService, isMenuInsideDropDown, routerLink, routerLinkWithHref, router) {
        var _this = this;
        this.nzMenuService = nzMenuService;
        this.nzSubmenuService = nzSubmenuService;
        this.isMenuInsideDropDown = isMenuInsideDropDown;
        this.routerLink = routerLink;
        this.routerLinkWithHref = routerLinkWithHref;
        this.router = router;
        this.destroy$ = new Subject();
        this.level = this.nzSubmenuService ? this.nzSubmenuService.level + 1 : 1;
        this.selected$ = new Subject();
        this.inlinePaddingLeft = null;
        this.nzDisabled = false;
        this.nzSelected = false;
        this.nzMatchRouterExact = false;
        this.nzMatchRouter = false;
        if (router) {
            this.router.events.pipe(takeUntil(this.destroy$), filter(function (e) { return e instanceof NavigationEnd; })).subscribe(function () {
                _this.updateRouterActive();
            });
        }
    }
    /** clear all item selected status except this */
    NzMenuItemDirective.prototype.clickMenuItem = function (e) {
        if (this.nzDisabled) {
            e.preventDefault();
            e.stopPropagation();
        }
        else {
            this.nzMenuService.onDescendantMenuItemClick(this);
            if (this.nzSubmenuService) {
                /** menu item inside the submenu **/
                this.nzSubmenuService.onChildMenuItemClick(this);
            }
            else {
                /** menu item inside the root menu **/
                this.nzMenuService.onChildMenuItemClick(this);
            }
        }
    };
    NzMenuItemDirective.prototype.setSelectedState = function (value) {
        this.nzSelected = value;
        this.selected$.next(value);
    };
    NzMenuItemDirective.prototype.updateRouterActive = function () {
        var _this = this;
        if (!this.listOfRouterLink || !this.listOfRouterLinkWithHref || !this.router || !this.router.navigated || !this.nzMatchRouter) {
            return;
        }
        Promise.resolve().then(function () {
            var hasActiveLinks = _this.hasActiveLinks();
            if (_this.nzSelected !== hasActiveLinks) {
                _this.nzSelected = hasActiveLinks;
                _this.setSelectedState(_this.nzSelected);
            }
        });
    };
    NzMenuItemDirective.prototype.hasActiveLinks = function () {
        var isActiveCheckFn = this.isLinkActive(this.router);
        return ((this.routerLink && isActiveCheckFn(this.routerLink)) ||
            (this.routerLinkWithHref && isActiveCheckFn(this.routerLinkWithHref)) ||
            this.listOfRouterLink.some(isActiveCheckFn) ||
            this.listOfRouterLinkWithHref.some(isActiveCheckFn));
    };
    NzMenuItemDirective.prototype.isLinkActive = function (router) {
        var _this = this;
        return function (link) { return router.isActive(link.urlTree, _this.nzMatchRouterExact); };
    };
    NzMenuItemDirective.prototype.ngOnInit = function () {
        var _this = this;
        /** store origin padding in padding */
        combineLatest([this.nzMenuService.mode$, this.nzMenuService.inlineIndent$])
            .pipe(takeUntil(this.destroy$))
            .subscribe(function (_a) {
            var _b = __read(_a, 2), mode = _b[0], inlineIndent = _b[1];
            _this.inlinePaddingLeft = mode === 'inline' ? _this.level * inlineIndent : null;
        });
    };
    NzMenuItemDirective.prototype.ngAfterContentInit = function () {
        var _this = this;
        this.listOfRouterLink.changes.pipe(takeUntil(this.destroy$)).subscribe(function () { return _this.updateRouterActive(); });
        this.listOfRouterLinkWithHref.changes.pipe(takeUntil(this.destroy$)).subscribe(function () { return _this.updateRouterActive(); });
        this.updateRouterActive();
    };
    NzMenuItemDirective.prototype.ngOnChanges = function (changes) {
        if (changes.nzSelected) {
            this.setSelectedState(this.nzSelected);
        }
    };
    NzMenuItemDirective.prototype.ngOnDestroy = function () {
        this.destroy$.next();
        this.destroy$.complete();
    };
    /** @nocollapse */ NzMenuItemDirective.ɵfac = function NzMenuItemDirective_Factory(t) { return new (t || NzMenuItemDirective)(ɵɵdirectiveInject(MenuService), ɵɵdirectiveInject(NzSubmenuService, 8), ɵɵdirectiveInject(NzIsMenuInsideDropDownToken), ɵɵdirectiveInject(RouterLink, 8), ɵɵdirectiveInject(RouterLinkWithHref, 8), ɵɵdirectiveInject(Router, 8)); };
    /** @nocollapse */ NzMenuItemDirective.ɵdir = ɵɵdefineDirective({ type: NzMenuItemDirective, selectors: [["", "nz-menu-item", ""]], contentQueries: function NzMenuItemDirective_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
            ɵɵcontentQuery(dirIndex, RouterLink, true);
            ɵɵcontentQuery(dirIndex, RouterLinkWithHref, true);
        } if (rf & 2) {
            var _t;
            ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.listOfRouterLink = _t);
            ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.listOfRouterLinkWithHref = _t);
        } }, hostVars: 14, hostBindings: function NzMenuItemDirective_HostBindings(rf, ctx) { if (rf & 1) {
            ɵɵlistener("click", function NzMenuItemDirective_click_HostBindingHandler($event) { return ctx.clickMenuItem($event); });
        } if (rf & 2) {
            ɵɵstyleProp("padding-left", ctx.nzPaddingLeft || ctx.inlinePaddingLeft, "px");
            ɵɵclassProp("ant-dropdown-menu-item", ctx.isMenuInsideDropDown)("ant-dropdown-menu-item-selected", ctx.isMenuInsideDropDown && ctx.nzSelected)("ant-dropdown-menu-item-disabled", ctx.isMenuInsideDropDown && ctx.nzDisabled)("ant-menu-item", !ctx.isMenuInsideDropDown)("ant-menu-item-selected", !ctx.isMenuInsideDropDown && ctx.nzSelected)("ant-menu-item-disabled", !ctx.isMenuInsideDropDown && ctx.nzDisabled);
        } }, inputs: { nzPaddingLeft: "nzPaddingLeft", nzDisabled: "nzDisabled", nzSelected: "nzSelected", nzMatchRouterExact: "nzMatchRouterExact", nzMatchRouter: "nzMatchRouter" }, exportAs: ["nzMenuItem"], features: [ɵɵNgOnChangesFeature] });
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzMenuItemDirective.prototype, "nzDisabled", void 0);
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzMenuItemDirective.prototype, "nzSelected", void 0);
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzMenuItemDirective.prototype, "nzMatchRouterExact", void 0);
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzMenuItemDirective.prototype, "nzMatchRouter", void 0);
    return NzMenuItemDirective;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzMenuItemDirective, [{
        type: Directive,
        args: [{
                selector: '[nz-menu-item]',
                exportAs: 'nzMenuItem',
                host: {
                    '[class.ant-dropdown-menu-item]': "isMenuInsideDropDown",
                    '[class.ant-dropdown-menu-item-selected]': "isMenuInsideDropDown && nzSelected",
                    '[class.ant-dropdown-menu-item-disabled]': "isMenuInsideDropDown && nzDisabled",
                    '[class.ant-menu-item]': "!isMenuInsideDropDown",
                    '[class.ant-menu-item-selected]': "!isMenuInsideDropDown && nzSelected",
                    '[class.ant-menu-item-disabled]': "!isMenuInsideDropDown && nzDisabled",
                    '[style.paddingLeft.px]': 'nzPaddingLeft || inlinePaddingLeft',
                    '(click)': 'clickMenuItem($event)'
                }
            }]
    }], function () { return [{ type: MenuService }, { type: NzSubmenuService, decorators: [{
                type: Optional
            }] }, { type: undefined, decorators: [{
                type: Inject,
                args: [NzIsMenuInsideDropDownToken]
            }] }, { type: RouterLink, decorators: [{
                type: Optional
            }] }, { type: RouterLinkWithHref, decorators: [{
                type: Optional
            }] }, { type: Router, decorators: [{
                type: Optional
            }] }]; }, { nzPaddingLeft: [{
            type: Input
        }], nzDisabled: [{
            type: Input
        }], nzSelected: [{
            type: Input
        }], nzMatchRouterExact: [{
            type: Input
        }], nzMatchRouter: [{
            type: Input
        }], listOfRouterLink: [{
            type: ContentChildren,
            args: [RouterLink, { descendants: true }]
        }], listOfRouterLinkWithHref: [{
            type: ContentChildren,
            args: [RouterLinkWithHref, { descendants: true }]
        }] }); })();

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
var _c0 = ["nz-submenu-title", ""];
function NzSubMenuTitleComponent_i_0_Template(rf, ctx) { if (rf & 1) {
    ɵɵelement(0, "i", 4);
} if (rf & 2) {
    var ctx_r363 = ɵɵnextContext();
    ɵɵproperty("nzType", ctx_r363.nzIcon);
} }
function NzSubMenuTitleComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementContainerStart(0);
    ɵɵelementStart(1, "span");
    ɵɵtext(2);
    ɵɵelementEnd();
    ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r364 = ɵɵnextContext();
    ɵɵadvance(2);
    ɵɵtextInterpolate(ctx_r364.nzTitle);
} }
function NzSubMenuTitleComponent_span_3_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementStart(0, "span", 5);
    ɵɵelement(1, "i", 6);
    ɵɵelementEnd();
} }
function NzSubMenuTitleComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
    ɵɵelement(0, "i", 7);
} }
var _c1 = ["*"];
var NzSubMenuTitleComponent = /** @class */ (function () {
    function NzSubMenuTitleComponent() {
        this.nzIcon = null;
        this.nzTitle = null;
        this.isMenuInsideDropDown = false;
        this.nzDisabled = false;
        this.paddingLeft = null;
        this.mode = 'vertical';
        this.toggleSubMenu = new EventEmitter();
        this.subMenuMouseState = new EventEmitter();
    }
    NzSubMenuTitleComponent.prototype.setMouseState = function (state) {
        if (!this.nzDisabled) {
            this.subMenuMouseState.next(state);
        }
    };
    NzSubMenuTitleComponent.prototype.clickTitle = function () {
        if (this.mode === 'inline' && !this.nzDisabled) {
            this.toggleSubMenu.emit();
        }
    };
    /** @nocollapse */ NzSubMenuTitleComponent.ɵfac = function NzSubMenuTitleComponent_Factory(t) { return new (t || NzSubMenuTitleComponent)(); };
    /** @nocollapse */ NzSubMenuTitleComponent.ɵcmp = ɵɵdefineComponent({ type: NzSubMenuTitleComponent, selectors: [["", "nz-submenu-title", ""]], hostVars: 6, hostBindings: function NzSubMenuTitleComponent_HostBindings(rf, ctx) { if (rf & 1) {
            ɵɵlistener("click", function NzSubMenuTitleComponent_click_HostBindingHandler() { return ctx.clickTitle(); })("mouseenter", function NzSubMenuTitleComponent_mouseenter_HostBindingHandler() { return ctx.setMouseState(true); })("mouseleave", function NzSubMenuTitleComponent_mouseleave_HostBindingHandler() { return ctx.setMouseState(false); });
        } if (rf & 2) {
            ɵɵstyleProp("padding-left", ctx.paddingLeft, "px");
            ɵɵclassProp("ant-dropdown-menu-submenu-title", ctx.isMenuInsideDropDown)("ant-menu-submenu-title", !ctx.isMenuInsideDropDown);
        } }, inputs: { nzIcon: "nzIcon", nzTitle: "nzTitle", isMenuInsideDropDown: "isMenuInsideDropDown", nzDisabled: "nzDisabled", paddingLeft: "paddingLeft", mode: "mode" }, outputs: { toggleSubMenu: "toggleSubMenu", subMenuMouseState: "subMenuMouseState" }, exportAs: ["nzSubmenuTitle"], attrs: _c0, ngContentSelectors: _c1, decls: 6, vars: 4, consts: [["nz-icon", "", 3, "nzType", 4, "ngIf"], [4, "nzStringTemplateOutlet"], ["class", "ant-dropdown-menu-submenu-arrow", 4, "ngIf", "ngIfElse"], ["notDropdownTpl", ""], ["nz-icon", "", 3, "nzType"], [1, "ant-dropdown-menu-submenu-arrow"], ["nz-icon", "", "nzType", "right", 1, "ant-dropdown-menu-submenu-arrow-icon"], [1, "ant-menu-submenu-arrow"]], template: function NzSubMenuTitleComponent_Template(rf, ctx) { if (rf & 1) {
            ɵɵprojectionDef();
            ɵɵtemplate(0, NzSubMenuTitleComponent_i_0_Template, 1, 1, "i", 0);
            ɵɵtemplate(1, NzSubMenuTitleComponent_ng_container_1_Template, 3, 1, "ng-container", 1);
            ɵɵprojection(2);
            ɵɵtemplate(3, NzSubMenuTitleComponent_span_3_Template, 2, 0, "span", 2);
            ɵɵtemplate(4, NzSubMenuTitleComponent_ng_template_4_Template, 1, 0, "ng-template", null, 3, ɵɵtemplateRefExtractor);
        } if (rf & 2) {
            var _r366 = ɵɵreference(5);
            ɵɵproperty("ngIf", ctx.nzIcon);
            ɵɵadvance(1);
            ɵɵproperty("nzStringTemplateOutlet", ctx.nzTitle);
            ɵɵadvance(2);
            ɵɵproperty("ngIf", ctx.isMenuInsideDropDown)("ngIfElse", _r366);
        } }, directives: [NgIf, NzStringTemplateOutletDirective, NzIconDirective], encapsulation: 2, changeDetection: 0 });
    return NzSubMenuTitleComponent;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzSubMenuTitleComponent, [{
        type: Component,
        args: [{
                selector: '[nz-submenu-title]',
                exportAs: 'nzSubmenuTitle',
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                template: "\n    <i nz-icon [nzType]=\"nzIcon\" *ngIf=\"nzIcon\"></i>\n    <ng-container *nzStringTemplateOutlet=\"nzTitle\">\n      <span>{{ nzTitle }}</span>\n    </ng-container>\n    <ng-content></ng-content>\n    <span *ngIf=\"isMenuInsideDropDown; else notDropdownTpl\" class=\"ant-dropdown-menu-submenu-arrow\">\n      <i nz-icon nzType=\"right\" class=\"ant-dropdown-menu-submenu-arrow-icon\"></i>\n    </span>\n    <ng-template #notDropdownTpl>\n      <i class=\"ant-menu-submenu-arrow\"></i>\n    </ng-template>\n  ",
                host: {
                    '[class.ant-dropdown-menu-submenu-title]': 'isMenuInsideDropDown',
                    '[class.ant-menu-submenu-title]': '!isMenuInsideDropDown',
                    '[style.paddingLeft.px]': 'paddingLeft',
                    '(click)': 'clickTitle()',
                    '(mouseenter)': 'setMouseState(true)',
                    '(mouseleave)': 'setMouseState(false)'
                }
            }]
    }], null, { nzIcon: [{
            type: Input
        }], nzTitle: [{
            type: Input
        }], isMenuInsideDropDown: [{
            type: Input
        }], nzDisabled: [{
            type: Input
        }], paddingLeft: [{
            type: Input
        }], mode: [{
            type: Input
        }], toggleSubMenu: [{
            type: Output
        }], subMenuMouseState: [{
            type: Output
        }] }); })();

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
var _c0$1 = ["nz-submenu-inline-child", ""];
function NzSubmenuInlineChildComponent_ng_template_0_Template(rf, ctx) { }
var NzSubmenuInlineChildComponent = /** @class */ (function () {
    function NzSubmenuInlineChildComponent() {
        this.templateOutlet = null;
        this.menuClass = null;
        this.mode = 'vertical';
        this.nzOpen = false;
        this.expandState = 'collapsed';
    }
    NzSubmenuInlineChildComponent.prototype.calcMotionState = function () {
        if (this.nzOpen) {
            this.expandState = 'expanded';
        }
        else {
            this.expandState = 'collapsed';
        }
    };
    NzSubmenuInlineChildComponent.prototype.ngOnInit = function () {
        this.calcMotionState();
    };
    NzSubmenuInlineChildComponent.prototype.ngOnChanges = function (changes) {
        var mode = changes.mode, nzOpen = changes.nzOpen;
        if (mode || nzOpen) {
            this.calcMotionState();
        }
    };
    /** @nocollapse */ NzSubmenuInlineChildComponent.ɵfac = function NzSubmenuInlineChildComponent_Factory(t) { return new (t || NzSubmenuInlineChildComponent)(); };
    /** @nocollapse */ NzSubmenuInlineChildComponent.ɵcmp = ɵɵdefineComponent({ type: NzSubmenuInlineChildComponent, selectors: [["", "nz-submenu-inline-child", ""]], hostVars: 9, hostBindings: function NzSubmenuInlineChildComponent_HostBindings(rf, ctx) { if (rf & 2) {
            ɵɵupdateSyntheticHostBinding("@collapseMotion", ctx.expandState);
            ɵɵclassMap(ctx.menuClass);
            ɵɵclassProp("ant-menu", true)("ant-menu-inline", true)("ant-menu-sub", true);
        } }, inputs: { templateOutlet: "templateOutlet", menuClass: "menuClass", mode: "mode", nzOpen: "nzOpen" }, exportAs: ["nzSubmenuInlineChild"], features: [ɵɵNgOnChangesFeature], attrs: _c0$1, decls: 1, vars: 1, consts: [[3, "ngTemplateOutlet"]], template: function NzSubmenuInlineChildComponent_Template(rf, ctx) { if (rf & 1) {
            ɵɵtemplate(0, NzSubmenuInlineChildComponent_ng_template_0_Template, 0, 0, "ng-template", 0);
        } if (rf & 2) {
            ɵɵproperty("ngTemplateOutlet", ctx.templateOutlet);
        } }, directives: [NgTemplateOutlet], encapsulation: 2, data: { animation: [collapseMotion] }, changeDetection: 0 });
    return NzSubmenuInlineChildComponent;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzSubmenuInlineChildComponent, [{
        type: Component,
        args: [{
                selector: '[nz-submenu-inline-child]',
                animations: [collapseMotion],
                exportAs: 'nzSubmenuInlineChild',
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                template: "\n    <ng-template [ngTemplateOutlet]=\"templateOutlet\"></ng-template>\n  ",
                host: {
                    '[class.ant-menu]': 'true',
                    '[class.ant-menu-inline]': 'true',
                    '[class.ant-menu-sub]': 'true',
                    '[class]': 'menuClass',
                    '[@collapseMotion]': 'expandState'
                }
            }]
    }], null, { templateOutlet: [{
            type: Input
        }], menuClass: [{
            type: Input
        }], mode: [{
            type: Input
        }], nzOpen: [{
            type: Input
        }] }); })();

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
var _c0$2 = ["nz-submenu-none-inline-child", ""];
function NzSubmenuNoneInlineChildComponent_ng_template_1_Template(rf, ctx) { }
var NzSubmenuNoneInlineChildComponent = /** @class */ (function () {
    function NzSubmenuNoneInlineChildComponent() {
        this.menuClass = null;
        this.theme = 'light';
        this.templateOutlet = null;
        this.isMenuInsideDropDown = false;
        this.mode = 'vertical';
        this.position = 'right';
        this.nzDisabled = false;
        this.nzOpen = false;
        this.subMenuMouseState = new EventEmitter();
        this.expandState = 'collapsed';
    }
    NzSubmenuNoneInlineChildComponent.prototype.setMouseState = function (state) {
        if (!this.nzDisabled) {
            this.subMenuMouseState.next(state);
        }
    };
    NzSubmenuNoneInlineChildComponent.prototype.calcMotionState = function () {
        if (this.nzOpen) {
            if (this.mode === 'horizontal') {
                this.expandState = 'bottom';
            }
            else if (this.mode === 'vertical') {
                this.expandState = 'active';
            }
        }
        else {
            this.expandState = 'collapsed';
        }
    };
    NzSubmenuNoneInlineChildComponent.prototype.ngOnInit = function () {
        this.calcMotionState();
    };
    NzSubmenuNoneInlineChildComponent.prototype.ngOnChanges = function (changes) {
        var mode = changes.mode, nzOpen = changes.nzOpen;
        if (mode || nzOpen) {
            this.calcMotionState();
        }
    };
    /** @nocollapse */ NzSubmenuNoneInlineChildComponent.ɵfac = function NzSubmenuNoneInlineChildComponent_Factory(t) { return new (t || NzSubmenuNoneInlineChildComponent)(); };
    /** @nocollapse */ NzSubmenuNoneInlineChildComponent.ɵcmp = ɵɵdefineComponent({ type: NzSubmenuNoneInlineChildComponent, selectors: [["", "nz-submenu-none-inline-child", ""]], hostVars: 16, hostBindings: function NzSubmenuNoneInlineChildComponent_HostBindings(rf, ctx) { if (rf & 1) {
            ɵɵlistener("mouseenter", function NzSubmenuNoneInlineChildComponent_mouseenter_HostBindingHandler() { return ctx.setMouseState(true); })("mouseleave", function NzSubmenuNoneInlineChildComponent_mouseleave_HostBindingHandler() { return ctx.setMouseState(false); });
        } if (rf & 2) {
            ɵɵupdateSyntheticHostBinding("@slideMotion", ctx.expandState)("@zoomBigMotion", ctx.expandState);
            ɵɵclassProp("ant-menu-submenu", true)("ant-menu-submenu-popup", true)("ant-menu-light", ctx.theme === "light")("ant-menu-dark", ctx.theme === "dark")("ant-menu-submenu-placement-bottom", ctx.mode === "horizontal")("ant-menu-submenu-placement-right", ctx.mode === "vertical" && ctx.position === "right")("ant-menu-submenu-placement-left", ctx.mode === "vertical" && ctx.position === "left");
        } }, inputs: { menuClass: "menuClass", theme: "theme", templateOutlet: "templateOutlet", isMenuInsideDropDown: "isMenuInsideDropDown", mode: "mode", position: "position", nzDisabled: "nzDisabled", nzOpen: "nzOpen" }, outputs: { subMenuMouseState: "subMenuMouseState" }, exportAs: ["nzSubmenuNoneInlineChild"], features: [ɵɵNgOnChangesFeature], attrs: _c0$2, decls: 2, vars: 15, consts: [[3, "ngTemplateOutlet"]], template: function NzSubmenuNoneInlineChildComponent_Template(rf, ctx) { if (rf & 1) {
            ɵɵelementStart(0, "div");
            ɵɵtemplate(1, NzSubmenuNoneInlineChildComponent_ng_template_1_Template, 0, 0, "ng-template", 0);
            ɵɵelementEnd();
        } if (rf & 2) {
            ɵɵclassMap(ctx.menuClass);
            ɵɵclassProp("ant-dropdown-menu", ctx.isMenuInsideDropDown)("ant-menu", !ctx.isMenuInsideDropDown)("ant-dropdown-menu-vertical", ctx.isMenuInsideDropDown)("ant-menu-vertical", !ctx.isMenuInsideDropDown)("ant-dropdown-menu-sub", ctx.isMenuInsideDropDown)("ant-menu-sub", !ctx.isMenuInsideDropDown);
            ɵɵadvance(1);
            ɵɵproperty("ngTemplateOutlet", ctx.templateOutlet);
        } }, directives: [NgTemplateOutlet], encapsulation: 2, data: { animation: [zoomBigMotion, slideMotion] }, changeDetection: 0 });
    return NzSubmenuNoneInlineChildComponent;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzSubmenuNoneInlineChildComponent, [{
        type: Component,
        args: [{
                selector: '[nz-submenu-none-inline-child]',
                exportAs: 'nzSubmenuNoneInlineChild',
                encapsulation: ViewEncapsulation.None,
                animations: [zoomBigMotion, slideMotion],
                changeDetection: ChangeDetectionStrategy.OnPush,
                template: "\n    <div\n      [class.ant-dropdown-menu]=\"isMenuInsideDropDown\"\n      [class.ant-menu]=\"!isMenuInsideDropDown\"\n      [class.ant-dropdown-menu-vertical]=\"isMenuInsideDropDown\"\n      [class.ant-menu-vertical]=\"!isMenuInsideDropDown\"\n      [class.ant-dropdown-menu-sub]=\"isMenuInsideDropDown\"\n      [class.ant-menu-sub]=\"!isMenuInsideDropDown\"\n      [class]=\"menuClass\"\n    >\n      <ng-template [ngTemplateOutlet]=\"templateOutlet\"></ng-template>\n    </div>\n  ",
                host: {
                    '[class.ant-menu-submenu]': 'true',
                    '[class.ant-menu-submenu-popup]': 'true',
                    '[class.ant-menu-light]': "theme === 'light'",
                    '[class.ant-menu-dark]': "theme === 'dark'",
                    '[class.ant-menu-submenu-placement-bottom]': "mode === 'horizontal'",
                    '[class.ant-menu-submenu-placement-right]': "mode === 'vertical' && position === 'right'",
                    '[class.ant-menu-submenu-placement-left]': "mode === 'vertical' && position === 'left'",
                    '[@slideMotion]': 'expandState',
                    '[@zoomBigMotion]': 'expandState',
                    '(mouseenter)': 'setMouseState(true)',
                    '(mouseleave)': 'setMouseState(false)'
                }
            }]
    }], null, { menuClass: [{
            type: Input
        }], theme: [{
            type: Input
        }], templateOutlet: [{
            type: Input
        }], isMenuInsideDropDown: [{
            type: Input
        }], mode: [{
            type: Input
        }], position: [{
            type: Input
        }], nzDisabled: [{
            type: Input
        }], nzOpen: [{
            type: Input
        }], subMenuMouseState: [{
            type: Output
        }] }); })();

var _c0$3 = ["nz-submenu", ""];
function NzSubMenuComponent_2_Template(rf, ctx) { if (rf & 1) {
    ɵɵprojection(0, 0, ["*ngIf", "!nzTitle"]);
} }
function NzSubMenuComponent_div_3_Template(rf, ctx) { if (rf & 1) {
    ɵɵelement(0, "div", 6);
} if (rf & 2) {
    var ctx_r350 = ɵɵnextContext();
    var _r353 = ɵɵreference(7);
    ɵɵproperty("mode", ctx_r350.mode)("nzOpen", ctx_r350.nzOpen)("@.disabled", ctx_r350.noAnimation == null ? null : ctx_r350.noAnimation.nzNoAnimation)("nzNoAnimation", ctx_r350.noAnimation == null ? null : ctx_r350.noAnimation.nzNoAnimation)("menuClass", ctx_r350.nzMenuClassName)("templateOutlet", _r353);
} }
function NzSubMenuComponent_ng_template_4_ng_template_0_Template(rf, ctx) { if (rf & 1) {
    var _r357 = ɵɵgetCurrentView();
    ɵɵelementStart(0, "div", 8);
    ɵɵlistener("subMenuMouseState", function NzSubMenuComponent_ng_template_4_ng_template_0_Template_div_subMenuMouseState_0_listener($event) { ɵɵrestoreView(_r357); var ctx_r356 = ɵɵnextContext(2); return ctx_r356.setMouseEnterState($event); });
    ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r355 = ɵɵnextContext(2);
    var _r353 = ɵɵreference(7);
    ɵɵproperty("theme", ctx_r355.theme)("mode", ctx_r355.mode)("nzOpen", ctx_r355.nzOpen)("position", ctx_r355.position)("nzDisabled", ctx_r355.nzDisabled)("isMenuInsideDropDown", ctx_r355.isMenuInsideDropDown)("templateOutlet", _r353)("menuClass", ctx_r355.nzMenuClassName)("@.disabled", ctx_r355.noAnimation == null ? null : ctx_r355.noAnimation.nzNoAnimation)("nzNoAnimation", ctx_r355.noAnimation == null ? null : ctx_r355.noAnimation.nzNoAnimation);
} }
function NzSubMenuComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
    var _r359 = ɵɵgetCurrentView();
    ɵɵtemplate(0, NzSubMenuComponent_ng_template_4_ng_template_0_Template, 1, 10, "ng-template", 7);
    ɵɵlistener("positionChange", function NzSubMenuComponent_ng_template_4_Template_ng_template_positionChange_0_listener($event) { ɵɵrestoreView(_r359); var ctx_r358 = ɵɵnextContext(); return ctx_r358.onPositionChange($event); });
} if (rf & 2) {
    var ctx_r352 = ɵɵnextContext();
    var _r348 = ɵɵreference(1);
    ɵɵproperty("cdkConnectedOverlayPositions", ctx_r352.overlayPositions)("cdkConnectedOverlayOrigin", _r348)("cdkConnectedOverlayWidth", ctx_r352.triggerWidth)("cdkConnectedOverlayOpen", ctx_r352.nzOpen);
} }
function NzSubMenuComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
    ɵɵprojection(0, 1);
} }
var _c1$1 = [[["", "title", ""]], "*"];
var _c2 = ["[title]", "*"];
var listOfVerticalPositions = [POSITION_MAP.rightTop, POSITION_MAP.rightBottom, POSITION_MAP.leftTop, POSITION_MAP.leftBottom];
var listOfHorizontalPositions = [POSITION_MAP.bottomLeft];
var NzSubMenuComponent = /** @class */ (function () {
    function NzSubMenuComponent(nzMenuService, cdr, nzSubmenuService, platform, isMenuInsideDropDown, noAnimation) {
        this.nzMenuService = nzMenuService;
        this.cdr = cdr;
        this.nzSubmenuService = nzSubmenuService;
        this.platform = platform;
        this.isMenuInsideDropDown = isMenuInsideDropDown;
        this.noAnimation = noAnimation;
        this.nzMenuClassName = null;
        this.nzPaddingLeft = null;
        this.nzTitle = null;
        this.nzIcon = null;
        this.nzOpen = false;
        this.nzDisabled = false;
        this.nzOpenChange = new EventEmitter();
        this.cdkOverlayOrigin = null;
        this.listOfNzSubMenuComponent = null;
        this.listOfNzMenuItemDirective = null;
        this.level = this.nzSubmenuService.level;
        this.destroy$ = new Subject();
        this.position = 'right';
        this.triggerWidth = null;
        this.theme = 'light';
        this.mode = 'vertical';
        this.inlinePaddingLeft = null;
        this.overlayPositions = listOfVerticalPositions;
        this.isSelected = false;
        this.isActive = false;
    }
    /** set the submenu host open status directly **/
    NzSubMenuComponent.prototype.setOpenStateWithoutDebounce = function (open) {
        this.nzSubmenuService.setOpenStateWithoutDebounce(open);
    };
    NzSubMenuComponent.prototype.toggleSubMenu = function () {
        this.setOpenStateWithoutDebounce(!this.nzOpen);
    };
    NzSubMenuComponent.prototype.setMouseEnterState = function (value) {
        this.isActive = value;
        if (this.mode !== 'inline') {
            this.nzSubmenuService.setMouseEnterTitleOrOverlayState(value);
        }
    };
    NzSubMenuComponent.prototype.setTriggerWidth = function () {
        if (this.mode === 'horizontal' && this.platform.isBrowser && this.cdkOverlayOrigin) {
            /** TODO: fast dom **/
            this.triggerWidth = this.cdkOverlayOrigin.nativeElement.getBoundingClientRect().width;
        }
    };
    NzSubMenuComponent.prototype.onPositionChange = function (position) {
        var placement = getPlacementName(position);
        if (placement === 'rightTop' || placement === 'rightBottom') {
            this.position = 'right';
        }
        else if (placement === 'leftTop' || placement === 'leftBottom') {
            this.position = 'left';
        }
        this.cdr.markForCheck();
    };
    NzSubMenuComponent.prototype.ngOnInit = function () {
        var _this = this;
        /** submenu theme update **/
        this.nzMenuService.theme$.pipe(takeUntil(this.destroy$)).subscribe(function (theme) {
            _this.theme = theme;
            _this.cdr.markForCheck();
        });
        /** submenu mode update **/
        this.nzSubmenuService.mode$.pipe(takeUntil(this.destroy$)).subscribe(function (mode) {
            _this.mode = mode;
            if (mode === 'horizontal') {
                _this.overlayPositions = listOfHorizontalPositions;
            }
            else if (mode === 'vertical') {
                _this.overlayPositions = listOfVerticalPositions;
            }
            _this.cdr.markForCheck();
        });
        /** inlineIndent update **/
        combineLatest([this.nzSubmenuService.mode$, this.nzMenuService.inlineIndent$])
            .pipe(takeUntil(this.destroy$))
            .subscribe(function (_a) {
            var _b = __read(_a, 2), mode = _b[0], inlineIndent = _b[1];
            _this.inlinePaddingLeft = mode === 'inline' ? _this.level * inlineIndent : null;
            _this.cdr.markForCheck();
        });
        /** current submenu open status **/
        this.nzSubmenuService.isCurrentSubMenuOpen$.pipe(takeUntil(this.destroy$)).subscribe(function (open) {
            _this.isActive = open;
            if (open !== _this.nzOpen) {
                _this.setTriggerWidth();
                _this.nzOpen = open;
                _this.nzOpenChange.emit(_this.nzOpen);
                _this.cdr.markForCheck();
            }
        });
    };
    NzSubMenuComponent.prototype.ngAfterContentInit = function () {
        var _this = this;
        this.setTriggerWidth();
        var listOfNzMenuItemDirective = this.listOfNzMenuItemDirective;
        var changes = listOfNzMenuItemDirective.changes;
        var mergedObservable = merge.apply(void 0, __spread([changes], listOfNzMenuItemDirective.map(function (menu) { return menu.selected$; })));
        changes
            .pipe(startWith(listOfNzMenuItemDirective), switchMap(function () { return mergedObservable; }), startWith(true), map(function () { return listOfNzMenuItemDirective.some(function (e) { return e.nzSelected; }); }), takeUntil(this.destroy$))
            .subscribe(function (selected) {
            _this.isSelected = selected;
            _this.cdr.markForCheck();
        });
    };
    NzSubMenuComponent.prototype.ngOnChanges = function (changes) {
        var nzOpen = changes.nzOpen;
        if (nzOpen) {
            this.nzSubmenuService.setOpenStateWithoutDebounce(this.nzOpen);
            this.setTriggerWidth();
        }
    };
    NzSubMenuComponent.prototype.ngOnDestroy = function () {
        this.destroy$.next();
        this.destroy$.complete();
    };
    /** @nocollapse */ NzSubMenuComponent.ɵfac = function NzSubMenuComponent_Factory(t) { return new (t || NzSubMenuComponent)(ɵɵdirectiveInject(MenuService), ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(NzSubmenuService), ɵɵdirectiveInject(Platform), ɵɵdirectiveInject(NzIsMenuInsideDropDownToken), ɵɵdirectiveInject(NzNoAnimationDirective, 9)); };
    /** @nocollapse */ NzSubMenuComponent.ɵcmp = ɵɵdefineComponent({ type: NzSubMenuComponent, selectors: [["", "nz-submenu", ""]], contentQueries: function NzSubMenuComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
            ɵɵcontentQuery(dirIndex, NzSubMenuComponent, true);
            ɵɵcontentQuery(dirIndex, NzMenuItemDirective, true);
        } if (rf & 2) {
            var _t;
            ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.listOfNzSubMenuComponent = _t);
            ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.listOfNzMenuItemDirective = _t);
        } }, viewQuery: function NzSubMenuComponent_Query(rf, ctx) { if (rf & 1) {
            ɵɵstaticViewQuery(CdkOverlayOrigin, true, ElementRef);
        } if (rf & 2) {
            var _t;
            ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.cdkOverlayOrigin = _t.first);
        } }, hostVars: 32, hostBindings: function NzSubMenuComponent_HostBindings(rf, ctx) { if (rf & 2) {
            ɵɵclassProp("ant-dropdown-menu-submenu", ctx.isMenuInsideDropDown)("ant-dropdown-menu-submenu-disabled", ctx.isMenuInsideDropDown && ctx.nzDisabled)("ant-dropdown-menu-submenu-open", ctx.isMenuInsideDropDown && ctx.nzOpen)("ant-dropdown-menu-submenu-selected", ctx.isMenuInsideDropDown && ctx.isSelected)("ant-dropdown-menu-submenu-vertical", ctx.isMenuInsideDropDown && ctx.mode === "vertical")("ant-dropdown-menu-submenu-horizontal", ctx.isMenuInsideDropDown && ctx.mode === "horizontal")("ant-dropdown-menu-submenu-inline", ctx.isMenuInsideDropDown && ctx.mode === "inline")("ant-dropdown-menu-submenu-active", ctx.isMenuInsideDropDown && ctx.isActive)("ant-menu-submenu", !ctx.isMenuInsideDropDown)("ant-menu-submenu-disabled", !ctx.isMenuInsideDropDown && ctx.nzDisabled)("ant-menu-submenu-open", !ctx.isMenuInsideDropDown && ctx.nzOpen)("ant-menu-submenu-selected", !ctx.isMenuInsideDropDown && ctx.isSelected)("ant-menu-submenu-vertical", !ctx.isMenuInsideDropDown && ctx.mode === "vertical")("ant-menu-submenu-horizontal", !ctx.isMenuInsideDropDown && ctx.mode === "horizontal")("ant-menu-submenu-inline", !ctx.isMenuInsideDropDown && ctx.mode === "inline")("ant-menu-submenu-active", !ctx.isMenuInsideDropDown && ctx.isActive);
        } }, inputs: { nzMenuClassName: "nzMenuClassName", nzPaddingLeft: "nzPaddingLeft", nzTitle: "nzTitle", nzIcon: "nzIcon", nzOpen: "nzOpen", nzDisabled: "nzDisabled" }, outputs: { nzOpenChange: "nzOpenChange" }, exportAs: ["nzSubmenu"], features: [ɵɵProvidersFeature([NzSubmenuService]), ɵɵNgOnChangesFeature], attrs: _c0$3, ngContentSelectors: _c2, decls: 8, vars: 9, consts: [["nz-submenu-title", "", "cdkOverlayOrigin", "", 3, "nzIcon", "nzTitle", "mode", "nzDisabled", "isMenuInsideDropDown", "paddingLeft", "subMenuMouseState", "toggleSubMenu"], ["origin", "cdkOverlayOrigin"], [4, "ngIf"], ["nz-submenu-inline-child", "", 3, "mode", "nzOpen", "nzNoAnimation", "menuClass", "templateOutlet", 4, "ngIf", "ngIfElse"], ["nonInlineTemplate", ""], ["subMenuTemplate", ""], ["nz-submenu-inline-child", "", 3, "mode", "nzOpen", "nzNoAnimation", "menuClass", "templateOutlet"], ["cdkConnectedOverlay", "", 3, "cdkConnectedOverlayPositions", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayWidth", "cdkConnectedOverlayOpen", "positionChange"], ["nz-submenu-none-inline-child", "", 3, "theme", "mode", "nzOpen", "position", "nzDisabled", "isMenuInsideDropDown", "templateOutlet", "menuClass", "nzNoAnimation", "subMenuMouseState"]], template: function NzSubMenuComponent_Template(rf, ctx) { if (rf & 1) {
            ɵɵprojectionDef(_c1$1);
            ɵɵelementStart(0, "div", 0, 1);
            ɵɵlistener("subMenuMouseState", function NzSubMenuComponent_Template_div_subMenuMouseState_0_listener($event) { return ctx.setMouseEnterState($event); })("toggleSubMenu", function NzSubMenuComponent_Template_div_toggleSubMenu_0_listener() { return ctx.toggleSubMenu(); });
            ɵɵtemplate(2, NzSubMenuComponent_2_Template, 1, 0, undefined, 2);
            ɵɵelementEnd();
            ɵɵtemplate(3, NzSubMenuComponent_div_3_Template, 1, 6, "div", 3);
            ɵɵtemplate(4, NzSubMenuComponent_ng_template_4_Template, 1, 4, "ng-template", null, 4, ɵɵtemplateRefExtractor);
            ɵɵtemplate(6, NzSubMenuComponent_ng_template_6_Template, 1, 0, "ng-template", null, 5, ɵɵtemplateRefExtractor);
        } if (rf & 2) {
            var _r351 = ɵɵreference(5);
            ɵɵproperty("nzIcon", ctx.nzIcon)("nzTitle", ctx.nzTitle)("mode", ctx.mode)("nzDisabled", ctx.nzDisabled)("isMenuInsideDropDown", ctx.isMenuInsideDropDown)("paddingLeft", ctx.nzPaddingLeft || ctx.inlinePaddingLeft);
            ɵɵadvance(2);
            ɵɵproperty("ngIf", !ctx.nzTitle);
            ɵɵadvance(1);
            ɵɵproperty("ngIf", ctx.mode === "inline")("ngIfElse", _r351);
        } }, directives: [NzSubMenuTitleComponent, CdkOverlayOrigin, NgIf, NzSubmenuInlineChildComponent, NzNoAnimationDirective, CdkConnectedOverlay, NzSubmenuNoneInlineChildComponent], encapsulation: 2, changeDetection: 0 });
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzSubMenuComponent.prototype, "nzOpen", void 0);
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzSubMenuComponent.prototype, "nzDisabled", void 0);
    return NzSubMenuComponent;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzSubMenuComponent, [{
        type: Component,
        args: [{
                selector: '[nz-submenu]',
                exportAs: 'nzSubmenu',
                providers: [NzSubmenuService],
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                preserveWhitespaces: false,
                template: "\n    <div\n      nz-submenu-title\n      cdkOverlayOrigin\n      #origin=\"cdkOverlayOrigin\"\n      [nzIcon]=\"nzIcon\"\n      [nzTitle]=\"nzTitle\"\n      [mode]=\"mode\"\n      [nzDisabled]=\"nzDisabled\"\n      [isMenuInsideDropDown]=\"isMenuInsideDropDown\"\n      [paddingLeft]=\"nzPaddingLeft || inlinePaddingLeft\"\n      (subMenuMouseState)=\"setMouseEnterState($event)\"\n      (toggleSubMenu)=\"toggleSubMenu()\"\n    >\n      <ng-content select=\"[title]\" *ngIf=\"!nzTitle\"></ng-content>\n    </div>\n    <div\n      *ngIf=\"mode === 'inline'; else nonInlineTemplate\"\n      nz-submenu-inline-child\n      [mode]=\"mode\"\n      [nzOpen]=\"nzOpen\"\n      [@.disabled]=\"noAnimation?.nzNoAnimation\"\n      [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n      [menuClass]=\"nzMenuClassName\"\n      [templateOutlet]=\"subMenuTemplate\"\n    ></div>\n    <ng-template #nonInlineTemplate>\n      <ng-template\n        cdkConnectedOverlay\n        (positionChange)=\"onPositionChange($event)\"\n        [cdkConnectedOverlayPositions]=\"overlayPositions\"\n        [cdkConnectedOverlayOrigin]=\"origin\"\n        [cdkConnectedOverlayWidth]=\"triggerWidth\"\n        [cdkConnectedOverlayOpen]=\"nzOpen\"\n      >\n        <div\n          nz-submenu-none-inline-child\n          [theme]=\"theme\"\n          [mode]=\"mode\"\n          [nzOpen]=\"nzOpen\"\n          [position]=\"position\"\n          [nzDisabled]=\"nzDisabled\"\n          [isMenuInsideDropDown]=\"isMenuInsideDropDown\"\n          [templateOutlet]=\"subMenuTemplate\"\n          [menuClass]=\"nzMenuClassName\"\n          [@.disabled]=\"noAnimation?.nzNoAnimation\"\n          [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n          (subMenuMouseState)=\"setMouseEnterState($event)\"\n        ></div>\n      </ng-template>\n    </ng-template>\n\n    <ng-template #subMenuTemplate>\n      <ng-content></ng-content>\n    </ng-template>\n  ",
                host: {
                    '[class.ant-dropdown-menu-submenu]': "isMenuInsideDropDown",
                    '[class.ant-dropdown-menu-submenu-disabled]': "isMenuInsideDropDown && nzDisabled",
                    '[class.ant-dropdown-menu-submenu-open]': "isMenuInsideDropDown && nzOpen",
                    '[class.ant-dropdown-menu-submenu-selected]': "isMenuInsideDropDown && isSelected",
                    '[class.ant-dropdown-menu-submenu-vertical]': "isMenuInsideDropDown && mode === 'vertical'",
                    '[class.ant-dropdown-menu-submenu-horizontal]': "isMenuInsideDropDown && mode === 'horizontal'",
                    '[class.ant-dropdown-menu-submenu-inline]': "isMenuInsideDropDown && mode === 'inline'",
                    '[class.ant-dropdown-menu-submenu-active]': "isMenuInsideDropDown && isActive",
                    '[class.ant-menu-submenu]': "!isMenuInsideDropDown",
                    '[class.ant-menu-submenu-disabled]': "!isMenuInsideDropDown && nzDisabled",
                    '[class.ant-menu-submenu-open]': "!isMenuInsideDropDown && nzOpen",
                    '[class.ant-menu-submenu-selected]': "!isMenuInsideDropDown && isSelected",
                    '[class.ant-menu-submenu-vertical]': "!isMenuInsideDropDown && mode === 'vertical'",
                    '[class.ant-menu-submenu-horizontal]': "!isMenuInsideDropDown && mode === 'horizontal'",
                    '[class.ant-menu-submenu-inline]': "!isMenuInsideDropDown && mode === 'inline'",
                    '[class.ant-menu-submenu-active]': "!isMenuInsideDropDown && isActive"
                }
            }]
    }], function () { return [{ type: MenuService }, { type: ChangeDetectorRef }, { type: NzSubmenuService }, { type: Platform }, { type: undefined, decorators: [{
                type: Inject,
                args: [NzIsMenuInsideDropDownToken]
            }] }, { type: NzNoAnimationDirective, decorators: [{
                type: Host
            }, {
                type: Optional
            }] }]; }, { nzMenuClassName: [{
            type: Input
        }], nzPaddingLeft: [{
            type: Input
        }], nzTitle: [{
            type: Input
        }], nzIcon: [{
            type: Input
        }], nzOpen: [{
            type: Input
        }], nzDisabled: [{
            type: Input
        }], nzOpenChange: [{
            type: Output
        }], cdkOverlayOrigin: [{
            type: ViewChild,
            args: [CdkOverlayOrigin, { static: true, read: ElementRef }]
        }], listOfNzSubMenuComponent: [{
            type: ContentChildren,
            args: [NzSubMenuComponent, { descendants: true }]
        }], listOfNzMenuItemDirective: [{
            type: ContentChildren,
            args: [NzMenuItemDirective, { descendants: true }]
        }] }); })();

var NzMenuDirective = /** @class */ (function () {
    function NzMenuDirective(nzMenuService, isMenuInsideDropDown, cdr) {
        this.nzMenuService = nzMenuService;
        this.isMenuInsideDropDown = isMenuInsideDropDown;
        this.cdr = cdr;
        this.nzInlineIndent = 24;
        this.nzTheme = 'light';
        this.nzMode = 'vertical';
        this.nzInlineCollapsed = false;
        this.nzSelectable = !this.isMenuInsideDropDown;
        this.nzClick = new EventEmitter();
        this.actualMode = 'vertical';
        this.inlineCollapsed$ = new BehaviorSubject(this.nzInlineCollapsed);
        this.mode$ = new BehaviorSubject(this.nzMode);
        this.destroy$ = new Subject();
        this.listOfOpenedNzSubMenuComponent = [];
    }
    NzMenuDirective.prototype.setInlineCollapsed = function (inlineCollapsed) {
        this.nzInlineCollapsed = inlineCollapsed;
        this.inlineCollapsed$.next(inlineCollapsed);
    };
    NzMenuDirective.prototype.updateInlineCollapse = function () {
        if (this.listOfNzMenuItemDirective) {
            if (this.nzInlineCollapsed) {
                this.listOfOpenedNzSubMenuComponent = this.listOfNzSubMenuComponent.filter(function (submenu) { return submenu.nzOpen; });
                this.listOfNzSubMenuComponent.forEach(function (submenu) { return submenu.setOpenStateWithoutDebounce(false); });
            }
            else {
                this.listOfOpenedNzSubMenuComponent.forEach(function (submenu) { return submenu.setOpenStateWithoutDebounce(true); });
                this.listOfOpenedNzSubMenuComponent = [];
            }
        }
    };
    NzMenuDirective.prototype.ngOnInit = function () {
        var _this = this;
        combineLatest([this.inlineCollapsed$, this.mode$])
            .pipe(takeUntil(this.destroy$))
            .subscribe(function (_a) {
            var _b = __read(_a, 2), inlineCollapsed = _b[0], mode = _b[1];
            _this.actualMode = inlineCollapsed ? 'vertical' : mode;
            _this.nzMenuService.setMode(_this.actualMode);
            _this.cdr.markForCheck();
        });
        this.nzMenuService.descendantMenuItemClick$.pipe(takeUntil(this.destroy$)).subscribe(function (menu) {
            _this.nzClick.emit(menu);
            if (_this.nzSelectable && !menu.nzMatchRouter) {
                _this.listOfNzMenuItemDirective.forEach(function (item) { return item.setSelectedState(item === menu); });
            }
        });
    };
    NzMenuDirective.prototype.ngAfterContentInit = function () {
        var _this = this;
        this.inlineCollapsed$.pipe(takeUntil(this.destroy$)).subscribe(function () {
            _this.updateInlineCollapse();
            _this.cdr.markForCheck();
        });
    };
    NzMenuDirective.prototype.ngOnChanges = function (changes) {
        var nzInlineCollapsed = changes.nzInlineCollapsed, nzInlineIndent = changes.nzInlineIndent, nzTheme = changes.nzTheme, nzMode = changes.nzMode;
        if (nzInlineCollapsed) {
            this.inlineCollapsed$.next(this.nzInlineCollapsed);
        }
        if (nzInlineIndent) {
            this.nzMenuService.setInlineIndent(this.nzInlineIndent);
        }
        if (nzTheme) {
            this.nzMenuService.setTheme(this.nzTheme);
        }
        if (nzMode) {
            this.mode$.next(this.nzMode);
            if (!changes.nzMode.isFirstChange() && this.listOfNzSubMenuComponent) {
                this.listOfNzSubMenuComponent.forEach(function (submenu) { return submenu.setOpenStateWithoutDebounce(false); });
            }
        }
    };
    NzMenuDirective.prototype.ngOnDestroy = function () {
        this.destroy$.next();
        this.destroy$.complete();
    };
    /** @nocollapse */ NzMenuDirective.ɵfac = function NzMenuDirective_Factory(t) { return new (t || NzMenuDirective)(ɵɵdirectiveInject(MenuService), ɵɵdirectiveInject(NzIsMenuInsideDropDownToken), ɵɵdirectiveInject(ChangeDetectorRef)); };
    /** @nocollapse */ NzMenuDirective.ɵdir = ɵɵdefineDirective({ type: NzMenuDirective, selectors: [["", "nz-menu", ""]], contentQueries: function NzMenuDirective_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
            ɵɵcontentQuery(dirIndex, NzMenuItemDirective, true);
            ɵɵcontentQuery(dirIndex, NzSubMenuComponent, true);
        } if (rf & 2) {
            var _t;
            ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.listOfNzMenuItemDirective = _t);
            ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.listOfNzSubMenuComponent = _t);
        } }, hostVars: 32, hostBindings: function NzMenuDirective_HostBindings(rf, ctx) { if (rf & 2) {
            ɵɵclassProp("ant-dropdown-menu", ctx.isMenuInsideDropDown)("ant-dropdown-menu-root", ctx.isMenuInsideDropDown)("ant-dropdown-menu-light", ctx.isMenuInsideDropDown && ctx.nzTheme === "light")("ant-dropdown-menu-dark", ctx.isMenuInsideDropDown && ctx.nzTheme === "dark")("ant-dropdown-menu-vertical", ctx.isMenuInsideDropDown && ctx.actualMode === "vertical")("ant-dropdown-menu-horizontal", ctx.isMenuInsideDropDown && ctx.actualMode === "horizontal")("ant-dropdown-menu-inline", ctx.isMenuInsideDropDown && ctx.actualMode === "inline")("ant-dropdown-menu-inline-collapsed", ctx.isMenuInsideDropDown && ctx.nzInlineCollapsed)("ant-menu", !ctx.isMenuInsideDropDown)("ant-menu-root", !ctx.isMenuInsideDropDown)("ant-menu-light", !ctx.isMenuInsideDropDown && ctx.nzTheme === "light")("ant-menu-dark", !ctx.isMenuInsideDropDown && ctx.nzTheme === "dark")("ant-menu-vertical", !ctx.isMenuInsideDropDown && ctx.actualMode === "vertical")("ant-menu-horizontal", !ctx.isMenuInsideDropDown && ctx.actualMode === "horizontal")("ant-menu-inline", !ctx.isMenuInsideDropDown && ctx.actualMode === "inline")("ant-menu-inline-collapsed", !ctx.isMenuInsideDropDown && ctx.nzInlineCollapsed);
        } }, inputs: { nzInlineIndent: "nzInlineIndent", nzTheme: "nzTheme", nzMode: "nzMode", nzInlineCollapsed: "nzInlineCollapsed", nzSelectable: "nzSelectable" }, outputs: { nzClick: "nzClick" }, exportAs: ["nzMenu"], features: [ɵɵProvidersFeature([
                {
                    provide: NzMenuServiceLocalToken,
                    useClass: MenuService
                },
                /** use the top level service **/
                {
                    provide: MenuService,
                    useFactory: (function (serviceInsideDropDown, serviceOutsideDropDown) {
                        return serviceInsideDropDown ? serviceInsideDropDown : serviceOutsideDropDown;
                    }),
                    deps: [[new SkipSelf(), new Optional(), MenuService], NzMenuServiceLocalToken]
                },
                /** check if menu inside dropdown-menu component **/
                {
                    provide: NzIsMenuInsideDropDownToken,
                    useFactory: (function (isMenuInsideDropDownToken) {
                        return isMenuInsideDropDownToken ? isMenuInsideDropDownToken : false;
                    }),
                    deps: [[new SkipSelf(), new Optional(), NzIsMenuInsideDropDownToken]]
                }
            ]), ɵɵNgOnChangesFeature] });
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzMenuDirective.prototype, "nzInlineCollapsed", void 0);
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzMenuDirective.prototype, "nzSelectable", void 0);
    return NzMenuDirective;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzMenuDirective, [{
        type: Directive,
        args: [{
                selector: '[nz-menu]',
                exportAs: 'nzMenu',
                providers: [
                    {
                        provide: NzMenuServiceLocalToken,
                        useClass: MenuService
                    },
                    /** use the top level service **/
                    {
                        provide: MenuService,
                        useFactory: (function (serviceInsideDropDown, serviceOutsideDropDown) {
                            return serviceInsideDropDown ? serviceInsideDropDown : serviceOutsideDropDown;
                        }),
                        deps: [[new SkipSelf(), new Optional(), MenuService], NzMenuServiceLocalToken]
                    },
                    /** check if menu inside dropdown-menu component **/
                    {
                        provide: NzIsMenuInsideDropDownToken,
                        useFactory: (function (isMenuInsideDropDownToken) {
                            return isMenuInsideDropDownToken ? isMenuInsideDropDownToken : false;
                        }),
                        deps: [[new SkipSelf(), new Optional(), NzIsMenuInsideDropDownToken]]
                    }
                ],
                host: {
                    '[class.ant-dropdown-menu]': "isMenuInsideDropDown",
                    '[class.ant-dropdown-menu-root]': "isMenuInsideDropDown",
                    '[class.ant-dropdown-menu-light]': "isMenuInsideDropDown && nzTheme === 'light'",
                    '[class.ant-dropdown-menu-dark]': "isMenuInsideDropDown && nzTheme === 'dark'",
                    '[class.ant-dropdown-menu-vertical]': "isMenuInsideDropDown && actualMode === 'vertical'",
                    '[class.ant-dropdown-menu-horizontal]': "isMenuInsideDropDown && actualMode === 'horizontal'",
                    '[class.ant-dropdown-menu-inline]': "isMenuInsideDropDown && actualMode === 'inline'",
                    '[class.ant-dropdown-menu-inline-collapsed]': "isMenuInsideDropDown && nzInlineCollapsed",
                    '[class.ant-menu]': "!isMenuInsideDropDown",
                    '[class.ant-menu-root]': "!isMenuInsideDropDown",
                    '[class.ant-menu-light]': "!isMenuInsideDropDown && nzTheme === 'light'",
                    '[class.ant-menu-dark]': "!isMenuInsideDropDown && nzTheme === 'dark'",
                    '[class.ant-menu-vertical]': "!isMenuInsideDropDown && actualMode === 'vertical'",
                    '[class.ant-menu-horizontal]': "!isMenuInsideDropDown && actualMode === 'horizontal'",
                    '[class.ant-menu-inline]': "!isMenuInsideDropDown && actualMode === 'inline'",
                    '[class.ant-menu-inline-collapsed]': "!isMenuInsideDropDown && nzInlineCollapsed"
                }
            }]
    }], function () { return [{ type: MenuService }, { type: undefined, decorators: [{
                type: Inject,
                args: [NzIsMenuInsideDropDownToken]
            }] }, { type: ChangeDetectorRef }]; }, { listOfNzMenuItemDirective: [{
            type: ContentChildren,
            args: [NzMenuItemDirective, { descendants: true }]
        }], listOfNzSubMenuComponent: [{
            type: ContentChildren,
            args: [NzSubMenuComponent, { descendants: true }]
        }], nzInlineIndent: [{
            type: Input
        }], nzTheme: [{
            type: Input
        }], nzMode: [{
            type: Input
        }], nzInlineCollapsed: [{
            type: Input
        }], nzSelectable: [{
            type: Input
        }], nzClick: [{
            type: Output
        }] }); })();

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
var _c0$4 = ["titleElement"];
var _c1$2 = ["nz-menu-group", ""];
function NzMenuGroupComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    ɵɵelementContainerStart(0);
    ɵɵtext(1);
    ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r361 = ɵɵnextContext();
    ɵɵadvance(1);
    ɵɵtextInterpolate(ctx_r361.nzTitle);
} }
function NzMenuGroupComponent_3_Template(rf, ctx) { if (rf & 1) {
    ɵɵprojection(0, 1, ["*ngIf", "!nzTitle"]);
} }
var _c2$1 = ["*", [["", "title", ""]]];
var _c3 = ["*", "[title]"];
var NzMenuGroupComponent = /** @class */ (function () {
    function NzMenuGroupComponent(elementRef, renderer, isMenuInsideDropDown) {
        this.elementRef = elementRef;
        this.renderer = renderer;
        this.isMenuInsideDropDown = isMenuInsideDropDown;
        var className = this.isMenuInsideDropDown ? 'ant-dropdown-menu-item-group' : 'ant-menu-item-group';
        this.renderer.addClass(elementRef.nativeElement, className);
    }
    NzMenuGroupComponent.prototype.ngAfterViewInit = function () {
        var ulElement = this.renderer.nextSibling(this.titleElement.nativeElement);
        if (ulElement) {
            /** add classname to ul **/
            var className = this.isMenuInsideDropDown ? 'ant-dropdown-menu-item-group-list' : 'ant-menu-item-group-list';
            this.renderer.addClass(ulElement, className);
        }
    };
    /** @nocollapse */ NzMenuGroupComponent.ɵfac = function NzMenuGroupComponent_Factory(t) { return new (t || NzMenuGroupComponent)(ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(NzIsMenuInsideDropDownToken)); };
    /** @nocollapse */ NzMenuGroupComponent.ɵcmp = ɵɵdefineComponent({ type: NzMenuGroupComponent, selectors: [["", "nz-menu-group", ""]], viewQuery: function NzMenuGroupComponent_Query(rf, ctx) { if (rf & 1) {
            ɵɵviewQuery(_c0$4, true);
        } if (rf & 2) {
            var _t;
            ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.titleElement = _t.first);
        } }, inputs: { nzTitle: "nzTitle" }, exportAs: ["nzMenuGroup"], features: [ɵɵProvidersFeature([
                /** check if menu inside dropdown-menu component **/
                {
                    provide: NzIsMenuInsideDropDownToken,
                    useFactory: (function (isMenuInsideDropDownToken) {
                        return isMenuInsideDropDownToken ? isMenuInsideDropDownToken : false;
                    }),
                    deps: [[new SkipSelf(), new Optional(), NzIsMenuInsideDropDownToken]]
                }
            ])], attrs: _c1$2, ngContentSelectors: _c3, decls: 5, vars: 6, consts: [["titleElement", ""], [4, "nzStringTemplateOutlet"], [4, "ngIf"]], template: function NzMenuGroupComponent_Template(rf, ctx) { if (rf & 1) {
            ɵɵprojectionDef(_c2$1);
            ɵɵelementStart(0, "div", null, 0);
            ɵɵtemplate(2, NzMenuGroupComponent_ng_container_2_Template, 2, 1, "ng-container", 1);
            ɵɵtemplate(3, NzMenuGroupComponent_3_Template, 1, 0, undefined, 2);
            ɵɵelementEnd();
            ɵɵprojection(4);
        } if (rf & 2) {
            ɵɵclassProp("ant-menu-item-group-title", !ctx.isMenuInsideDropDown)("ant-dropdown-menu-item-group-title", ctx.isMenuInsideDropDown);
            ɵɵadvance(2);
            ɵɵproperty("nzStringTemplateOutlet", ctx.nzTitle);
            ɵɵadvance(1);
            ɵɵproperty("ngIf", !ctx.nzTitle);
        } }, directives: [NzStringTemplateOutletDirective, NgIf], encapsulation: 2, changeDetection: 0 });
    return NzMenuGroupComponent;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzMenuGroupComponent, [{
        type: Component,
        args: [{
                selector: '[nz-menu-group]',
                exportAs: 'nzMenuGroup',
                changeDetection: ChangeDetectionStrategy.OnPush,
                providers: [
                    /** check if menu inside dropdown-menu component **/
                    {
                        provide: NzIsMenuInsideDropDownToken,
                        useFactory: (function (isMenuInsideDropDownToken) {
                            return isMenuInsideDropDownToken ? isMenuInsideDropDownToken : false;
                        }),
                        deps: [[new SkipSelf(), new Optional(), NzIsMenuInsideDropDownToken]]
                    }
                ],
                encapsulation: ViewEncapsulation.None,
                template: "\n    <div\n      [class.ant-menu-item-group-title]=\"!isMenuInsideDropDown\"\n      [class.ant-dropdown-menu-item-group-title]=\"isMenuInsideDropDown\"\n      #titleElement\n    >\n      <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n      <ng-content select=\"[title]\" *ngIf=\"!nzTitle\"></ng-content>\n    </div>\n    <ng-content></ng-content>\n  ",
                preserveWhitespaces: false
            }]
    }], function () { return [{ type: ElementRef }, { type: Renderer2 }, { type: undefined, decorators: [{
                type: Inject,
                args: [NzIsMenuInsideDropDownToken]
            }] }]; }, { nzTitle: [{
            type: Input
        }], titleElement: [{
            type: ViewChild,
            args: ['titleElement']
        }] }); })();

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
var NzMenuDividerDirective = /** @class */ (function () {
    function NzMenuDividerDirective(elementRef, renderer) {
        this.elementRef = elementRef;
        this.renderer = renderer;
        this.renderer.addClass(elementRef.nativeElement, 'ant-dropdown-menu-item-divider');
    }
    /** @nocollapse */ NzMenuDividerDirective.ɵfac = function NzMenuDividerDirective_Factory(t) { return new (t || NzMenuDividerDirective)(ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2)); };
    /** @nocollapse */ NzMenuDividerDirective.ɵdir = ɵɵdefineDirective({ type: NzMenuDividerDirective, selectors: [["", "nz-menu-divider", ""]], exportAs: ["nzMenuDivider"] });
    return NzMenuDividerDirective;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzMenuDividerDirective, [{
        type: Directive,
        args: [{
                selector: '[nz-menu-divider]',
                exportAs: 'nzMenuDivider'
            }]
    }], function () { return [{ type: ElementRef }, { type: Renderer2 }]; }, null); })();

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
var NzMenuModule = /** @class */ (function () {
    function NzMenuModule() {
    }
    /** @nocollapse */ NzMenuModule.ɵmod = ɵɵdefineNgModule({ type: NzMenuModule });
    /** @nocollapse */ NzMenuModule.ɵinj = ɵɵdefineInjector({ factory: function NzMenuModule_Factory(t) { return new (t || NzMenuModule)(); }, imports: [[CommonModule, PlatformModule, OverlayModule, NzIconModule, NzNoAnimationModule, NzOutletModule]] });
    return NzMenuModule;
}());
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(NzMenuModule, { declarations: [NzMenuDirective,
        NzMenuItemDirective,
        NzSubMenuComponent,
        NzMenuDividerDirective,
        NzMenuGroupComponent,
        NzSubMenuTitleComponent,
        NzSubmenuInlineChildComponent,
        NzSubmenuNoneInlineChildComponent], imports: [CommonModule, PlatformModule, OverlayModule, NzIconModule, NzNoAnimationModule, NzOutletModule], exports: [NzMenuDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuDividerDirective, NzMenuGroupComponent] }); })();
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzMenuModule, [{
        type: NgModule,
        args: [{
                imports: [CommonModule, PlatformModule, OverlayModule, NzIconModule, NzNoAnimationModule, NzOutletModule],
                declarations: [
                    NzMenuDirective,
                    NzMenuItemDirective,
                    NzSubMenuComponent,
                    NzMenuDividerDirective,
                    NzMenuGroupComponent,
                    NzSubMenuTitleComponent,
                    NzSubmenuInlineChildComponent,
                    NzSubmenuNoneInlineChildComponent
                ],
                exports: [NzMenuDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuDividerDirective, NzMenuGroupComponent]
            }]
    }], null, null); })();

/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

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

export { MenuService, NzIsMenuInsideDropDownToken, NzMenuDirective, NzMenuDividerDirective, NzMenuGroupComponent, NzMenuItemDirective, NzMenuModule, NzMenuServiceLocalToken, NzSubMenuComponent, NzSubMenuTitleComponent, NzSubmenuInlineChildComponent, NzSubmenuNoneInlineChildComponent, NzSubmenuService };
//# sourceMappingURL=ng-zorro-antd-menu.js.map
