(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ng-zorro-antd/core'), require('rxjs'), require('rxjs/operators'), require('@angular/router'), require('@angular/cdk/overlay'), require('@angular/cdk/platform'), require('@angular/common'), require('ng-zorro-antd/icon')) :
    typeof define === 'function' && define.amd ? define('ng-zorro-antd/menu', ['exports', '@angular/core', 'ng-zorro-antd/core', 'rxjs', 'rxjs/operators', '@angular/router', '@angular/cdk/overlay', '@angular/cdk/platform', '@angular/common', 'ng-zorro-antd/icon'], factory) :
    (global = global || self, factory((global['ng-zorro-antd'] = global['ng-zorro-antd'] || {}, global['ng-zorro-antd'].menu = {}), global.ng.core, global['ng-zorro-antd'].core, global.rxjs, global.rxjs.operators, global.ng.router, global.ng.cdk.overlay, global.ng.cdk.platform, global.ng.common, global['ng-zorro-antd'].icon));
}(this, (function (exports, core, core$1, rxjs, operators, router, overlay, platform, common, icon) { 'use strict';

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */
    /* global Reflect, Promise */

    var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };

    function __extends(d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }

    var __assign = function() {
        __assign = Object.assign || function __assign(t) {
            for (var s, i = 1, n = arguments.length; i < n; i++) {
                s = arguments[i];
                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
            }
            return t;
        };
        return __assign.apply(this, arguments);
    };

    function __rest(s, e) {
        var t = {};
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                    t[p[i]] = s[p[i]];
            }
        return t;
    }

    function __decorate(decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    }

    function __param(paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); }
    }

    function __metadata(metadataKey, metadataValue) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
    }

    function __awaiter(thisArg, _arguments, P, generator) {
        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
        return new (P || (P = Promise))(function (resolve, reject) {
            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
            function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
            step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
    }

    function __generator(thisArg, body) {
        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f) throw new TypeError("Generator is already executing.");
            while (_) try {
                if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
                if (y = 0, t) op = [op[0] & 2, t.value];
                switch (op[0]) {
                    case 0: case 1: t = op; break;
                    case 4: _.label++; return { value: op[1], done: false };
                    case 5: _.label++; y = op[1]; op = [0]; continue;
                    case 7: op = _.ops.pop(); _.trys.pop(); continue;
                    default:
                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                        if (t[2]) _.ops.pop();
                        _.trys.pop(); continue;
                }
                op = body.call(thisArg, _);
            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
        }
    }

    function __exportStar(m, exports) {
        for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
    }

    function __values(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
            next: function () {
                if (o && i >= o.length) o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }

    function __read(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
        }
        catch (error) { e = { error: error }; }
        finally {
            try {
                if (r && !r.done && (m = i["return"])) m.call(i);
            }
            finally { if (e) throw e.error; }
        }
        return ar;
    }

    function __spread() {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    }

    function __spreadArrays() {
        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
        for (var r = Array(s), k = 0, i = 0; i < il; i++)
            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                r[k] = a[j];
        return r;
    };

    function __await(v) {
        return this instanceof __await ? (this.v = v, this) : new __await(v);
    }

    function __asyncGenerator(thisArg, _arguments, generator) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var g = generator.apply(thisArg, _arguments || []), i, q = [];
        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
        function fulfill(value) { resume("next", value); }
        function reject(value) { resume("throw", value); }
        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
    }

    function __asyncDelegator(o) {
        var i, p;
        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
    }

    function __asyncValues(o) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var m = o[Symbol.asyncIterator], i;
        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
    }

    function __makeTemplateObject(cooked, raw) {
        if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
        return cooked;
    };

    function __importStar(mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
        result.default = mod;
        return result;
    }

    function __importDefault(mod) {
        return (mod && mod.__esModule) ? mod : { default: mod };
    }

    function __classPrivateFieldGet(receiver, privateMap) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to get private field on non-instance");
        }
        return privateMap.get(receiver);
    }

    function __classPrivateFieldSet(receiver, privateMap, value) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to set private field on non-instance");
        }
        privateMap.set(receiver, value);
        return value;
    }

    /**
     * @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 rxjs.Subject();
            /** child menu item click **/
            this.childMenuItemClick$ = new rxjs.Subject();
            this.theme$ = new rxjs.BehaviorSubject('light');
            this.mode$ = new rxjs.BehaviorSubject('vertical');
            this.inlineIndent$ = new rxjs.BehaviorSubject(24);
            this.isChildSubMenuOpen$ = new rxjs.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 = core["ɵɵdefineInjectable"]({ token: MenuService, factory: MenuService.ɵfac });
        return MenuService;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](MenuService, [{
            type: core.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 core.InjectionToken('NzIsInDropDownMenuToken');
    var NzMenuServiceLocalToken = new core.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(operators.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 rxjs.BehaviorSubject(false);
            this.isChildSubMenuOpen$ = new rxjs.BehaviorSubject(false);
            /** submenu title & overlay mouse enter status **/
            this.isMouseEnterTitleOrOverlay$ = new rxjs.Subject();
            this.childMenuItemClick$ = new rxjs.Subject();
            if (this.nzHostSubmenuService) {
                this.level = this.nzHostSubmenuService.level + 1;
            }
            /** close if menu item clicked **/
            var isClosedByMenuItemClick = this.childMenuItemClick$.pipe(operators.flatMap(function () { return _this.mode$; }), operators.filter(function (mode) { return mode !== 'inline' || _this.isMenuInsideDropDown; }), operators.mapTo(false));
            var isCurrentSubmenuOpen$ = rxjs.merge(this.isMouseEnterTitleOrOverlay$, isClosedByMenuItemClick);
            /** combine the child submenu status with current submenu status to calculate host submenu open **/
            var isSubMenuOpenWithDebounce$ = rxjs.combineLatest([this.isChildSubMenuOpen$, isCurrentSubmenuOpen$]).pipe(operators.map(function (_a) {
                var _b = __read(_a, 2), isChildSubMenuOpen = _b[0], isCurrentSubmenuOpen = _b[1];
                return isChildSubMenuOpen || isCurrentSubmenuOpen;
            }), operators.auditTime(150), operators.distinctUntilChanged());
            isSubMenuOpenWithDebounce$.pipe(operators.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)(core["ɵɵinject"](NzSubmenuService, 12), core["ɵɵinject"](MenuService), core["ɵɵinject"](NzIsMenuInsideDropDownToken)); };
        /** @nocollapse */ NzSubmenuService.ɵprov = core["ɵɵdefineInjectable"]({ token: NzSubmenuService, factory: NzSubmenuService.ɵfac });
        return NzSubmenuService;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSubmenuService, [{
            type: core.Injectable
        }], function () { return [{ type: NzSubmenuService, decorators: [{
                    type: core.SkipSelf
                }, {
                    type: core.Optional
                }] }, { type: MenuService }, { type: undefined, decorators: [{
                    type: core.Inject,
                    args: [NzIsMenuInsideDropDownToken]
                }] }]; }, null); })();

    var NzMenuItemDirective = /** @class */ (function () {
        function NzMenuItemDirective(nzMenuService, nzSubmenuService, isMenuInsideDropDown, routerLink, routerLinkWithHref, router$1) {
            var _this = this;
            this.nzMenuService = nzMenuService;
            this.nzSubmenuService = nzSubmenuService;
            this.isMenuInsideDropDown = isMenuInsideDropDown;
            this.routerLink = routerLink;
            this.routerLinkWithHref = routerLinkWithHref;
            this.router = router$1;
            this.destroy$ = new rxjs.Subject();
            this.level = this.nzSubmenuService ? this.nzSubmenuService.level + 1 : 1;
            this.selected$ = new rxjs.Subject();
            this.inlinePaddingLeft = null;
            this.nzDisabled = false;
            this.nzSelected = false;
            this.nzMatchRouterExact = false;
            this.nzMatchRouter = false;
            if (router$1) {
                this.router.events.pipe(operators.takeUntil(this.destroy$), operators.filter(function (e) { return e instanceof router.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 */
            rxjs.combineLatest([this.nzMenuService.mode$, this.nzMenuService.inlineIndent$])
                .pipe(operators.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(operators.takeUntil(this.destroy$)).subscribe(function () { return _this.updateRouterActive(); });
            this.listOfRouterLinkWithHref.changes.pipe(operators.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)(core["ɵɵdirectiveInject"](MenuService), core["ɵɵdirectiveInject"](NzSubmenuService, 8), core["ɵɵdirectiveInject"](NzIsMenuInsideDropDownToken), core["ɵɵdirectiveInject"](router.RouterLink, 8), core["ɵɵdirectiveInject"](router.RouterLinkWithHref, 8), core["ɵɵdirectiveInject"](router.Router, 8)); };
        /** @nocollapse */ NzMenuItemDirective.ɵdir = core["ɵɵdefineDirective"]({ type: NzMenuItemDirective, selectors: [["", "nz-menu-item", ""]], contentQueries: function NzMenuItemDirective_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
                core["ɵɵcontentQuery"](dirIndex, router.RouterLink, true);
                core["ɵɵcontentQuery"](dirIndex, router.RouterLinkWithHref, true);
            } if (rf & 2) {
                var _t;
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.listOfRouterLink = _t);
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.listOfRouterLinkWithHref = _t);
            } }, hostVars: 14, hostBindings: function NzMenuItemDirective_HostBindings(rf, ctx) { if (rf & 1) {
                core["ɵɵlistener"]("click", function NzMenuItemDirective_click_HostBindingHandler($event) { return ctx.clickMenuItem($event); });
            } if (rf & 2) {
                core["ɵɵstyleProp"]("padding-left", ctx.nzPaddingLeft || ctx.inlinePaddingLeft, "px");
                core["ɵɵ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: [core["ɵɵNgOnChangesFeature"]] });
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzMenuItemDirective.prototype, "nzDisabled", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzMenuItemDirective.prototype, "nzSelected", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzMenuItemDirective.prototype, "nzMatchRouterExact", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzMenuItemDirective.prototype, "nzMatchRouter", void 0);
        return NzMenuItemDirective;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzMenuItemDirective, [{
            type: core.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: core.Optional
                }] }, { type: undefined, decorators: [{
                    type: core.Inject,
                    args: [NzIsMenuInsideDropDownToken]
                }] }, { type: router.RouterLink, decorators: [{
                    type: core.Optional
                }] }, { type: router.RouterLinkWithHref, decorators: [{
                    type: core.Optional
                }] }, { type: router.Router, decorators: [{
                    type: core.Optional
                }] }]; }, { nzPaddingLeft: [{
                type: core.Input
            }], nzDisabled: [{
                type: core.Input
            }], nzSelected: [{
                type: core.Input
            }], nzMatchRouterExact: [{
                type: core.Input
            }], nzMatchRouter: [{
                type: core.Input
            }], listOfRouterLink: [{
                type: core.ContentChildren,
                args: [router.RouterLink, { descendants: true }]
            }], listOfRouterLinkWithHref: [{
                type: core.ContentChildren,
                args: [router.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) {
        core["ɵɵelement"](0, "i", 4);
    } if (rf & 2) {
        var ctx_r363 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("nzType", ctx_r363.nzIcon);
    } }
    function NzSubMenuTitleComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementContainerStart"](0);
        core["ɵɵelementStart"](1, "span");
        core["ɵɵtext"](2);
        core["ɵɵelementEnd"]();
        core["ɵɵelementContainerEnd"]();
    } if (rf & 2) {
        var ctx_r364 = core["ɵɵnextContext"]();
        core["ɵɵadvance"](2);
        core["ɵɵtextInterpolate"](ctx_r364.nzTitle);
    } }
    function NzSubMenuTitleComponent_span_3_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementStart"](0, "span", 5);
        core["ɵɵelement"](1, "i", 6);
        core["ɵɵelementEnd"]();
    } }
    function NzSubMenuTitleComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵ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 core.EventEmitter();
            this.subMenuMouseState = new core.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 = core["ɵɵdefineComponent"]({ type: NzSubMenuTitleComponent, selectors: [["", "nz-submenu-title", ""]], hostVars: 6, hostBindings: function NzSubMenuTitleComponent_HostBindings(rf, ctx) { if (rf & 1) {
                core["ɵɵ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) {
                core["ɵɵstyleProp"]("padding-left", ctx.paddingLeft, "px");
                core["ɵɵ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) {
                core["ɵɵprojectionDef"]();
                core["ɵɵtemplate"](0, NzSubMenuTitleComponent_i_0_Template, 1, 1, "i", 0);
                core["ɵɵtemplate"](1, NzSubMenuTitleComponent_ng_container_1_Template, 3, 1, "ng-container", 1);
                core["ɵɵprojection"](2);
                core["ɵɵtemplate"](3, NzSubMenuTitleComponent_span_3_Template, 2, 0, "span", 2);
                core["ɵɵtemplate"](4, NzSubMenuTitleComponent_ng_template_4_Template, 1, 0, "ng-template", null, 3, core["ɵɵtemplateRefExtractor"]);
            } if (rf & 2) {
                var _r366 = core["ɵɵreference"](5);
                core["ɵɵproperty"]("ngIf", ctx.nzIcon);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("nzStringTemplateOutlet", ctx.nzTitle);
                core["ɵɵadvance"](2);
                core["ɵɵproperty"]("ngIf", ctx.isMenuInsideDropDown)("ngIfElse", _r366);
            } }, directives: [common.NgIf, core$1.NzStringTemplateOutletDirective, icon.NzIconDirective], encapsulation: 2, changeDetection: 0 });
        return NzSubMenuTitleComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSubMenuTitleComponent, [{
            type: core.Component,
            args: [{
                    selector: '[nz-submenu-title]',
                    exportAs: 'nzSubmenuTitle',
                    encapsulation: core.ViewEncapsulation.None,
                    changeDetection: core.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: core.Input
            }], nzTitle: [{
                type: core.Input
            }], isMenuInsideDropDown: [{
                type: core.Input
            }], nzDisabled: [{
                type: core.Input
            }], paddingLeft: [{
                type: core.Input
            }], mode: [{
                type: core.Input
            }], toggleSubMenu: [{
                type: core.Output
            }], subMenuMouseState: [{
                type: core.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 = core["ɵɵdefineComponent"]({ type: NzSubmenuInlineChildComponent, selectors: [["", "nz-submenu-inline-child", ""]], hostVars: 9, hostBindings: function NzSubmenuInlineChildComponent_HostBindings(rf, ctx) { if (rf & 2) {
                core["ɵɵupdateSyntheticHostBinding"]("@collapseMotion", ctx.expandState);
                core["ɵɵclassMap"](ctx.menuClass);
                core["ɵɵclassProp"]("ant-menu", true)("ant-menu-inline", true)("ant-menu-sub", true);
            } }, inputs: { templateOutlet: "templateOutlet", menuClass: "menuClass", mode: "mode", nzOpen: "nzOpen" }, exportAs: ["nzSubmenuInlineChild"], features: [core["ɵɵNgOnChangesFeature"]], attrs: _c0$1, decls: 1, vars: 1, consts: [[3, "ngTemplateOutlet"]], template: function NzSubmenuInlineChildComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵtemplate"](0, NzSubmenuInlineChildComponent_ng_template_0_Template, 0, 0, "ng-template", 0);
            } if (rf & 2) {
                core["ɵɵproperty"]("ngTemplateOutlet", ctx.templateOutlet);
            } }, directives: [common.NgTemplateOutlet], encapsulation: 2, data: { animation: [core$1.collapseMotion] }, changeDetection: 0 });
        return NzSubmenuInlineChildComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSubmenuInlineChildComponent, [{
            type: core.Component,
            args: [{
                    selector: '[nz-submenu-inline-child]',
                    animations: [core$1.collapseMotion],
                    exportAs: 'nzSubmenuInlineChild',
                    encapsulation: core.ViewEncapsulation.None,
                    changeDetection: core.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: core.Input
            }], menuClass: [{
                type: core.Input
            }], mode: [{
                type: core.Input
            }], nzOpen: [{
                type: core.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 core.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 = core["ɵɵdefineComponent"]({ type: NzSubmenuNoneInlineChildComponent, selectors: [["", "nz-submenu-none-inline-child", ""]], hostVars: 16, hostBindings: function NzSubmenuNoneInlineChildComponent_HostBindings(rf, ctx) { if (rf & 1) {
                core["ɵɵlistener"]("mouseenter", function NzSubmenuNoneInlineChildComponent_mouseenter_HostBindingHandler() { return ctx.setMouseState(true); })("mouseleave", function NzSubmenuNoneInlineChildComponent_mouseleave_HostBindingHandler() { return ctx.setMouseState(false); });
            } if (rf & 2) {
                core["ɵɵupdateSyntheticHostBinding"]("@slideMotion", ctx.expandState)("@zoomBigMotion", ctx.expandState);
                core["ɵɵ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: [core["ɵɵNgOnChangesFeature"]], attrs: _c0$2, decls: 2, vars: 15, consts: [[3, "ngTemplateOutlet"]], template: function NzSubmenuNoneInlineChildComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelementStart"](0, "div");
                core["ɵɵtemplate"](1, NzSubmenuNoneInlineChildComponent_ng_template_1_Template, 0, 0, "ng-template", 0);
                core["ɵɵelementEnd"]();
            } if (rf & 2) {
                core["ɵɵclassMap"](ctx.menuClass);
                core["ɵɵ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);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngTemplateOutlet", ctx.templateOutlet);
            } }, directives: [common.NgTemplateOutlet], encapsulation: 2, data: { animation: [core$1.zoomBigMotion, core$1.slideMotion] }, changeDetection: 0 });
        return NzSubmenuNoneInlineChildComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSubmenuNoneInlineChildComponent, [{
            type: core.Component,
            args: [{
                    selector: '[nz-submenu-none-inline-child]',
                    exportAs: 'nzSubmenuNoneInlineChild',
                    encapsulation: core.ViewEncapsulation.None,
                    animations: [core$1.zoomBigMotion, core$1.slideMotion],
                    changeDetection: core.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: core.Input
            }], theme: [{
                type: core.Input
            }], templateOutlet: [{
                type: core.Input
            }], isMenuInsideDropDown: [{
                type: core.Input
            }], mode: [{
                type: core.Input
            }], position: [{
                type: core.Input
            }], nzDisabled: [{
                type: core.Input
            }], nzOpen: [{
                type: core.Input
            }], subMenuMouseState: [{
                type: core.Output
            }] }); })();

    var _c0$3 = ["nz-submenu", ""];
    function NzSubMenuComponent_2_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵprojection"](0, 0, ["*ngIf", "!nzTitle"]);
    } }
    function NzSubMenuComponent_div_3_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "div", 6);
    } if (rf & 2) {
        var ctx_r350 = core["ɵɵnextContext"]();
        var _r353 = core["ɵɵreference"](7);
        core["ɵɵ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 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "div", 8);
        core["ɵɵlistener"]("subMenuMouseState", function NzSubMenuComponent_ng_template_4_ng_template_0_Template_div_subMenuMouseState_0_listener($event) { core["ɵɵrestoreView"](_r357); var ctx_r356 = core["ɵɵnextContext"](2); return ctx_r356.setMouseEnterState($event); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var ctx_r355 = core["ɵɵnextContext"](2);
        var _r353 = core["ɵɵreference"](7);
        core["ɵɵ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 = core["ɵɵgetCurrentView"]();
        core["ɵɵtemplate"](0, NzSubMenuComponent_ng_template_4_ng_template_0_Template, 1, 10, "ng-template", 7);
        core["ɵɵlistener"]("positionChange", function NzSubMenuComponent_ng_template_4_Template_ng_template_positionChange_0_listener($event) { core["ɵɵrestoreView"](_r359); var ctx_r358 = core["ɵɵnextContext"](); return ctx_r358.onPositionChange($event); });
    } if (rf & 2) {
        var ctx_r352 = core["ɵɵnextContext"]();
        var _r348 = core["ɵɵreference"](1);
        core["ɵɵ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) {
        core["ɵɵprojection"](0, 1);
    } }
    var _c1$1 = [[["", "title", ""]], "*"];
    var _c2 = ["[title]", "*"];
    var listOfVerticalPositions = [core$1.POSITION_MAP.rightTop, core$1.POSITION_MAP.rightBottom, core$1.POSITION_MAP.leftTop, core$1.POSITION_MAP.leftBottom];
    var listOfHorizontalPositions = [core$1.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 core.EventEmitter();
            this.cdkOverlayOrigin = null;
            this.listOfNzSubMenuComponent = null;
            this.listOfNzMenuItemDirective = null;
            this.level = this.nzSubmenuService.level;
            this.destroy$ = new rxjs.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 = core$1.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(operators.takeUntil(this.destroy$)).subscribe(function (theme) {
                _this.theme = theme;
                _this.cdr.markForCheck();
            });
            /** submenu mode update **/
            this.nzSubmenuService.mode$.pipe(operators.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 **/
            rxjs.combineLatest([this.nzSubmenuService.mode$, this.nzMenuService.inlineIndent$])
                .pipe(operators.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(operators.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 = rxjs.merge.apply(void 0, __spread([changes], listOfNzMenuItemDirective.map(function (menu) { return menu.selected$; })));
            changes
                .pipe(operators.startWith(listOfNzMenuItemDirective), operators.switchMap(function () { return mergedObservable; }), operators.startWith(true), operators.map(function () { return listOfNzMenuItemDirective.some(function (e) { return e.nzSelected; }); }), operators.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)(core["ɵɵdirectiveInject"](MenuService), core["ɵɵdirectiveInject"](core.ChangeDetectorRef), core["ɵɵdirectiveInject"](NzSubmenuService), core["ɵɵdirectiveInject"](platform.Platform), core["ɵɵdirectiveInject"](NzIsMenuInsideDropDownToken), core["ɵɵdirectiveInject"](core$1.NzNoAnimationDirective, 9)); };
        /** @nocollapse */ NzSubMenuComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzSubMenuComponent, selectors: [["", "nz-submenu", ""]], contentQueries: function NzSubMenuComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
                core["ɵɵcontentQuery"](dirIndex, NzSubMenuComponent, true);
                core["ɵɵcontentQuery"](dirIndex, NzMenuItemDirective, true);
            } if (rf & 2) {
                var _t;
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.listOfNzSubMenuComponent = _t);
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.listOfNzMenuItemDirective = _t);
            } }, viewQuery: function NzSubMenuComponent_Query(rf, ctx) { if (rf & 1) {
                core["ɵɵstaticViewQuery"](overlay.CdkOverlayOrigin, true, core.ElementRef);
            } if (rf & 2) {
                var _t;
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.cdkOverlayOrigin = _t.first);
            } }, hostVars: 32, hostBindings: function NzSubMenuComponent_HostBindings(rf, ctx) { if (rf & 2) {
                core["ɵɵ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: [core["ɵɵProvidersFeature"]([NzSubmenuService]), core["ɵɵ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) {
                core["ɵɵprojectionDef"](_c1$1);
                core["ɵɵelementStart"](0, "div", 0, 1);
                core["ɵɵ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(); });
                core["ɵɵtemplate"](2, NzSubMenuComponent_2_Template, 1, 0, undefined, 2);
                core["ɵɵelementEnd"]();
                core["ɵɵtemplate"](3, NzSubMenuComponent_div_3_Template, 1, 6, "div", 3);
                core["ɵɵtemplate"](4, NzSubMenuComponent_ng_template_4_Template, 1, 4, "ng-template", null, 4, core["ɵɵtemplateRefExtractor"]);
                core["ɵɵtemplate"](6, NzSubMenuComponent_ng_template_6_Template, 1, 0, "ng-template", null, 5, core["ɵɵtemplateRefExtractor"]);
            } if (rf & 2) {
                var _r351 = core["ɵɵreference"](5);
                core["ɵɵproperty"]("nzIcon", ctx.nzIcon)("nzTitle", ctx.nzTitle)("mode", ctx.mode)("nzDisabled", ctx.nzDisabled)("isMenuInsideDropDown", ctx.isMenuInsideDropDown)("paddingLeft", ctx.nzPaddingLeft || ctx.inlinePaddingLeft);
                core["ɵɵadvance"](2);
                core["ɵɵproperty"]("ngIf", !ctx.nzTitle);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngIf", ctx.mode === "inline")("ngIfElse", _r351);
            } }, directives: [NzSubMenuTitleComponent, overlay.CdkOverlayOrigin, common.NgIf, NzSubmenuInlineChildComponent, core$1.NzNoAnimationDirective, overlay.CdkConnectedOverlay, NzSubmenuNoneInlineChildComponent], encapsulation: 2, changeDetection: 0 });
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSubMenuComponent.prototype, "nzOpen", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSubMenuComponent.prototype, "nzDisabled", void 0);
        return NzSubMenuComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSubMenuComponent, [{
            type: core.Component,
            args: [{
                    selector: '[nz-submenu]',
                    exportAs: 'nzSubmenu',
                    providers: [NzSubmenuService],
                    encapsulation: core.ViewEncapsulation.None,
                    changeDetection: core.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: core.ChangeDetectorRef }, { type: NzSubmenuService }, { type: platform.Platform }, { type: undefined, decorators: [{
                    type: core.Inject,
                    args: [NzIsMenuInsideDropDownToken]
                }] }, { type: core$1.NzNoAnimationDirective, decorators: [{
                    type: core.Host
                }, {
                    type: core.Optional
                }] }]; }, { nzMenuClassName: [{
                type: core.Input
            }], nzPaddingLeft: [{
                type: core.Input
            }], nzTitle: [{
                type: core.Input
            }], nzIcon: [{
                type: core.Input
            }], nzOpen: [{
                type: core.Input
            }], nzDisabled: [{
                type: core.Input
            }], nzOpenChange: [{
                type: core.Output
            }], cdkOverlayOrigin: [{
                type: core.ViewChild,
                args: [overlay.CdkOverlayOrigin, { static: true, read: core.ElementRef }]
            }], listOfNzSubMenuComponent: [{
                type: core.ContentChildren,
                args: [NzSubMenuComponent, { descendants: true }]
            }], listOfNzMenuItemDirective: [{
                type: core.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 core.EventEmitter();
            this.actualMode = 'vertical';
            this.inlineCollapsed$ = new rxjs.BehaviorSubject(this.nzInlineCollapsed);
            this.mode$ = new rxjs.BehaviorSubject(this.nzMode);
            this.destroy$ = new rxjs.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;
            rxjs.combineLatest([this.inlineCollapsed$, this.mode$])
                .pipe(operators.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(operators.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(operators.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)(core["ɵɵdirectiveInject"](MenuService), core["ɵɵdirectiveInject"](NzIsMenuInsideDropDownToken), core["ɵɵdirectiveInject"](core.ChangeDetectorRef)); };
        /** @nocollapse */ NzMenuDirective.ɵdir = core["ɵɵdefineDirective"]({ type: NzMenuDirective, selectors: [["", "nz-menu", ""]], contentQueries: function NzMenuDirective_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
                core["ɵɵcontentQuery"](dirIndex, NzMenuItemDirective, true);
                core["ɵɵcontentQuery"](dirIndex, NzSubMenuComponent, true);
            } if (rf & 2) {
                var _t;
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.listOfNzMenuItemDirective = _t);
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.listOfNzSubMenuComponent = _t);
            } }, hostVars: 32, hostBindings: function NzMenuDirective_HostBindings(rf, ctx) { if (rf & 2) {
                core["ɵɵ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: [core["ɵɵProvidersFeature"]([
                    {
                        provide: NzMenuServiceLocalToken,
                        useClass: MenuService
                    },
                    /** use the top level service **/
                    {
                        provide: MenuService,
                        useFactory: (function (serviceInsideDropDown, serviceOutsideDropDown) {
                            return serviceInsideDropDown ? serviceInsideDropDown : serviceOutsideDropDown;
                        }),
                        deps: [[new core.SkipSelf(), new core.Optional(), MenuService], NzMenuServiceLocalToken]
                    },
                    /** check if menu inside dropdown-menu component **/
                    {
                        provide: NzIsMenuInsideDropDownToken,
                        useFactory: (function (isMenuInsideDropDownToken) {
                            return isMenuInsideDropDownToken ? isMenuInsideDropDownToken : false;
                        }),
                        deps: [[new core.SkipSelf(), new core.Optional(), NzIsMenuInsideDropDownToken]]
                    }
                ]), core["ɵɵNgOnChangesFeature"]] });
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzMenuDirective.prototype, "nzInlineCollapsed", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzMenuDirective.prototype, "nzSelectable", void 0);
        return NzMenuDirective;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzMenuDirective, [{
            type: core.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 core.SkipSelf(), new core.Optional(), MenuService], NzMenuServiceLocalToken]
                        },
                        /** check if menu inside dropdown-menu component **/
                        {
                            provide: NzIsMenuInsideDropDownToken,
                            useFactory: (function (isMenuInsideDropDownToken) {
                                return isMenuInsideDropDownToken ? isMenuInsideDropDownToken : false;
                            }),
                            deps: [[new core.SkipSelf(), new core.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: core.Inject,
                    args: [NzIsMenuInsideDropDownToken]
                }] }, { type: core.ChangeDetectorRef }]; }, { listOfNzMenuItemDirective: [{
                type: core.ContentChildren,
                args: [NzMenuItemDirective, { descendants: true }]
            }], listOfNzSubMenuComponent: [{
                type: core.ContentChildren,
                args: [NzSubMenuComponent, { descendants: true }]
            }], nzInlineIndent: [{
                type: core.Input
            }], nzTheme: [{
                type: core.Input
            }], nzMode: [{
                type: core.Input
            }], nzInlineCollapsed: [{
                type: core.Input
            }], nzSelectable: [{
                type: core.Input
            }], nzClick: [{
                type: core.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) {
        core["ɵɵelementContainerStart"](0);
        core["ɵɵtext"](1);
        core["ɵɵelementContainerEnd"]();
    } if (rf & 2) {
        var ctx_r361 = core["ɵɵnextContext"]();
        core["ɵɵadvance"](1);
        core["ɵɵtextInterpolate"](ctx_r361.nzTitle);
    } }
    function NzMenuGroupComponent_3_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵ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)(core["ɵɵdirectiveInject"](core.ElementRef), core["ɵɵdirectiveInject"](core.Renderer2), core["ɵɵdirectiveInject"](NzIsMenuInsideDropDownToken)); };
        /** @nocollapse */ NzMenuGroupComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzMenuGroupComponent, selectors: [["", "nz-menu-group", ""]], viewQuery: function NzMenuGroupComponent_Query(rf, ctx) { if (rf & 1) {
                core["ɵɵviewQuery"](_c0$4, true);
            } if (rf & 2) {
                var _t;
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.titleElement = _t.first);
            } }, inputs: { nzTitle: "nzTitle" }, exportAs: ["nzMenuGroup"], features: [core["ɵɵProvidersFeature"]([
                    /** check if menu inside dropdown-menu component **/
                    {
                        provide: NzIsMenuInsideDropDownToken,
                        useFactory: (function (isMenuInsideDropDownToken) {
                            return isMenuInsideDropDownToken ? isMenuInsideDropDownToken : false;
                        }),
                        deps: [[new core.SkipSelf(), new core.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) {
                core["ɵɵprojectionDef"](_c2$1);
                core["ɵɵelementStart"](0, "div", null, 0);
                core["ɵɵtemplate"](2, NzMenuGroupComponent_ng_container_2_Template, 2, 1, "ng-container", 1);
                core["ɵɵtemplate"](3, NzMenuGroupComponent_3_Template, 1, 0, undefined, 2);
                core["ɵɵelementEnd"]();
                core["ɵɵprojection"](4);
            } if (rf & 2) {
                core["ɵɵclassProp"]("ant-menu-item-group-title", !ctx.isMenuInsideDropDown)("ant-dropdown-menu-item-group-title", ctx.isMenuInsideDropDown);
                core["ɵɵadvance"](2);
                core["ɵɵproperty"]("nzStringTemplateOutlet", ctx.nzTitle);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngIf", !ctx.nzTitle);
            } }, directives: [core$1.NzStringTemplateOutletDirective, common.NgIf], encapsulation: 2, changeDetection: 0 });
        return NzMenuGroupComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzMenuGroupComponent, [{
            type: core.Component,
            args: [{
                    selector: '[nz-menu-group]',
                    exportAs: 'nzMenuGroup',
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    providers: [
                        /** check if menu inside dropdown-menu component **/
                        {
                            provide: NzIsMenuInsideDropDownToken,
                            useFactory: (function (isMenuInsideDropDownToken) {
                                return isMenuInsideDropDownToken ? isMenuInsideDropDownToken : false;
                            }),
                            deps: [[new core.SkipSelf(), new core.Optional(), NzIsMenuInsideDropDownToken]]
                        }
                    ],
                    encapsulation: core.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: core.ElementRef }, { type: core.Renderer2 }, { type: undefined, decorators: [{
                    type: core.Inject,
                    args: [NzIsMenuInsideDropDownToken]
                }] }]; }, { nzTitle: [{
                type: core.Input
            }], titleElement: [{
                type: core.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)(core["ɵɵdirectiveInject"](core.ElementRef), core["ɵɵdirectiveInject"](core.Renderer2)); };
        /** @nocollapse */ NzMenuDividerDirective.ɵdir = core["ɵɵdefineDirective"]({ type: NzMenuDividerDirective, selectors: [["", "nz-menu-divider", ""]], exportAs: ["nzMenuDivider"] });
        return NzMenuDividerDirective;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzMenuDividerDirective, [{
            type: core.Directive,
            args: [{
                    selector: '[nz-menu-divider]',
                    exportAs: 'nzMenuDivider'
                }]
        }], function () { return [{ type: core.ElementRef }, { type: core.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 = core["ɵɵdefineNgModule"]({ type: NzMenuModule });
        /** @nocollapse */ NzMenuModule.ɵinj = core["ɵɵdefineInjector"]({ factory: function NzMenuModule_Factory(t) { return new (t || NzMenuModule)(); }, imports: [[common.CommonModule, platform.PlatformModule, overlay.OverlayModule, icon.NzIconModule, core$1.NzNoAnimationModule, core$1.NzOutletModule]] });
        return NzMenuModule;
    }());
    (function () { (typeof ngJitMode === "undefined" || ngJitMode) && core["ɵɵsetNgModuleScope"](NzMenuModule, { declarations: [NzMenuDirective,
            NzMenuItemDirective,
            NzSubMenuComponent,
            NzMenuDividerDirective,
            NzMenuGroupComponent,
            NzSubMenuTitleComponent,
            NzSubmenuInlineChildComponent,
            NzSubmenuNoneInlineChildComponent], imports: [common.CommonModule, platform.PlatformModule, overlay.OverlayModule, icon.NzIconModule, core$1.NzNoAnimationModule, core$1.NzOutletModule], exports: [NzMenuDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuDividerDirective, NzMenuGroupComponent] }); })();
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzMenuModule, [{
            type: core.NgModule,
            args: [{
                    imports: [common.CommonModule, platform.PlatformModule, overlay.OverlayModule, icon.NzIconModule, core$1.NzNoAnimationModule, core$1.NzOutletModule],
                    declarations: [
                        NzMenuDirective,
                        NzMenuItemDirective,
                        NzSubMenuComponent,
                        NzMenuDividerDirective,
                        NzMenuGroupComponent,
                        NzSubMenuTitleComponent,
                        NzSubmenuInlineChildComponent,
                        NzSubmenuNoneInlineChildComponent
                    ],
                    exports: [NzMenuDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuDividerDirective, NzMenuGroupComponent]
                }]
        }], null, null); })();

    exports.MenuService = MenuService;
    exports.NzIsMenuInsideDropDownToken = NzIsMenuInsideDropDownToken;
    exports.NzMenuDirective = NzMenuDirective;
    exports.NzMenuDividerDirective = NzMenuDividerDirective;
    exports.NzMenuGroupComponent = NzMenuGroupComponent;
    exports.NzMenuItemDirective = NzMenuItemDirective;
    exports.NzMenuModule = NzMenuModule;
    exports.NzMenuServiceLocalToken = NzMenuServiceLocalToken;
    exports.NzSubMenuComponent = NzSubMenuComponent;
    exports.NzSubMenuTitleComponent = NzSubMenuTitleComponent;
    exports.NzSubmenuInlineChildComponent = NzSubmenuInlineChildComponent;
    exports.NzSubmenuNoneInlineChildComponent = NzSubmenuNoneInlineChildComponent;
    exports.NzSubmenuService = NzSubmenuService;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=ng-zorro-antd-menu.umd.js.map
