import { PlatformModule } from '@angular/cdk/platform';
import { ɵɵdirectiveInject, ElementRef, Renderer2, ɵɵdefineDirective, ɵɵNgOnChangesFeature, ɵsetClassMetadata, Directive, Input, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, NgModule } from '@angular/core';

/**
 * @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
 */
/**
 * hack the bug
 * angular router change with unexpected transition trigger after calling applicationRef.attachView
 * https://github.com/angular/angular/issues/34718
 */
var NzTransitionPatchDirective = /** @class */ (function () {
    function NzTransitionPatchDirective(elementRef, renderer) {
        this.elementRef = elementRef;
        this.renderer = renderer;
        this.hidden = null;
        this.renderer.setAttribute(this.elementRef.nativeElement, 'hidden', '');
    }
    NzTransitionPatchDirective.prototype.setHiddenAttribute = function () {
        if (this.hidden === true) {
            this.renderer.setAttribute(this.elementRef.nativeElement, 'hidden', '');
        }
        else if (this.hidden === false || this.hidden === null) {
            this.renderer.removeAttribute(this.elementRef.nativeElement, 'hidden');
        }
        else if (typeof this.hidden === 'string') {
            this.renderer.setAttribute(this.elementRef.nativeElement, 'hidden', this.hidden);
        }
    };
    NzTransitionPatchDirective.prototype.ngOnChanges = function () {
        this.setHiddenAttribute();
    };
    NzTransitionPatchDirective.prototype.ngAfterViewInit = function () {
        this.setHiddenAttribute();
    };
    /** @nocollapse */ NzTransitionPatchDirective.ɵfac = function NzTransitionPatchDirective_Factory(t) { return new (t || NzTransitionPatchDirective)(ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2)); };
    /** @nocollapse */ NzTransitionPatchDirective.ɵdir = ɵɵdefineDirective({ type: NzTransitionPatchDirective, selectors: [["", "nz-button", ""], ["nz-button-group"], ["", "nz-icon", ""], ["", "nz-menu-item", ""], ["", "nz-submenu", ""]], inputs: { hidden: "hidden" }, features: [ɵɵNgOnChangesFeature] });
    return NzTransitionPatchDirective;
}());
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzTransitionPatchDirective, [{
        type: Directive,
        args: [{
                selector: '[nz-button],nz-button-group,[nz-icon],[nz-menu-item],[nz-submenu]'
            }]
    }], function () { return [{ type: ElementRef }, { type: Renderer2 }]; }, { hidden: [{
            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 NzTransitionPatchModule = /** @class */ (function () {
    function NzTransitionPatchModule() {
    }
    /** @nocollapse */ NzTransitionPatchModule.ɵmod = ɵɵdefineNgModule({ type: NzTransitionPatchModule });
    /** @nocollapse */ NzTransitionPatchModule.ɵinj = ɵɵdefineInjector({ factory: function NzTransitionPatchModule_Factory(t) { return new (t || NzTransitionPatchModule)(); }, imports: [[PlatformModule]] });
    return NzTransitionPatchModule;
}());
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(NzTransitionPatchModule, { declarations: [NzTransitionPatchDirective], imports: [PlatformModule], exports: [NzTransitionPatchDirective] }); })();
/*@__PURE__*/ (function () { ɵsetClassMetadata(NzTransitionPatchModule, [{
        type: NgModule,
        args: [{
                imports: [PlatformModule],
                exports: [NzTransitionPatchDirective],
                declarations: [NzTransitionPatchDirective]
            }]
    }], 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 { NzTransitionPatchDirective as ɵNzTransitionPatchDirective, NzTransitionPatchModule as ɵNzTransitionPatchModule };
//# sourceMappingURL=ng-zorro-antd-core-transition-patch.js.map
