!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/animations"),require("@angular/common"),require("primeng/ripple"),require("primeng/dom"),require("primeng/api")):"function"==typeof define&&define.amd?define("primeng/sidebar",["exports","@angular/core","@angular/animations","@angular/common","primeng/ripple","primeng/dom","primeng/api"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.sidebar={}),e.ng.core,e.ng.animations,e.ng.common,e.primeng.ripple,e.primeng.dom,e.primeng.api)}(this,(function(e,t,i,n,s,a,o){"use strict";var r=function(){function e(e,i,n){this.el=e,this.renderer=i,this.cd=n,this.position="left",this.blockScroll=!1,this.autoZIndex=!0,this.baseZIndex=0,this.modal=!0,this.dismissible=!0,this.showCloseIcon=!0,this.closeOnEscape=!0,this.onShow=new t.EventEmitter,this.onHide=new t.EventEmitter,this.visibleChange=new t.EventEmitter}return e.prototype.ngAfterViewInit=function(){this.initialized=!0,this.appendTo&&("body"===this.appendTo?document.body.appendChild(this.containerViewChild.nativeElement):a.DomHandler.appendChild(this.containerViewChild.nativeElement,this.appendTo)),this.visible&&this.show()},e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach((function(t){switch(t.getType()){case"content":default:e.contentTemplate=t.template}}))},Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=e,this.initialized&&this.containerViewChild&&this.containerViewChild.nativeElement&&(this._visible?this.show():this.preventVisibleChangePropagation?this.preventVisibleChangePropagation=!1:this.hide())},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewChecked=function(){this.executePostDisplayActions&&(this.onShow.emit({}),this.executePostDisplayActions=!1)},e.prototype.show=function(){this.executePostDisplayActions=!0,this.autoZIndex&&(this.containerViewChild.nativeElement.style.zIndex=String(this.baseZIndex+ ++a.DomHandler.zindex)),this.modal&&this.enableModality()},e.prototype.hide=function(){this.onHide.emit({}),this.modal&&this.disableModality()},e.prototype.close=function(e){this.preventVisibleChangePropagation=!0,this.hide(),this.visibleChange.emit(!1),e.preventDefault()},e.prototype.enableModality=function(){var e=this;this.mask||(this.mask=document.createElement("div"),this.mask.style.zIndex=String(parseInt(this.containerViewChild.nativeElement.style.zIndex)-1),a.DomHandler.addMultipleClasses(this.mask,"p-component-overlay p-sidebar-mask"),this.dismissible&&(this.maskClickListener=this.renderer.listen(this.mask,"click",(function(t){e.dismissible&&e.close(t)}))),document.body.appendChild(this.mask),this.blockScroll&&a.DomHandler.addClass(document.body,"p-overflow-hidden"))},e.prototype.disableModality=function(){this.mask&&(this.unbindMaskClickListener(),document.body.removeChild(this.mask),this.blockScroll&&a.DomHandler.removeClass(document.body,"p-overflow-hidden"),this.mask=null)},e.prototype.onAnimationStart=function(e){switch(e.toState){case"visible":this.closeOnEscape&&this.bindDocumentEscapeListener();break;case"hidden":this.unbindGlobalListeners()}},e.prototype.bindDocumentEscapeListener=function(){var e=this,t=this.el?this.el.nativeElement.ownerDocument:"document";this.documentEscapeListener=this.renderer.listen(t,"keydown",(function(t){27==t.which&&parseInt(e.containerViewChild.nativeElement.style.zIndex)===a.DomHandler.zindex+e.baseZIndex&&e.close(t)}))},e.prototype.unbindDocumentEscapeListener=function(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)},e.prototype.unbindMaskClickListener=function(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)},e.prototype.unbindGlobalListeners=function(){this.unbindMaskClickListener(),this.unbindDocumentEscapeListener()},e.prototype.ngOnDestroy=function(){this.initialized=!1,this.visible&&this.hide(),this.appendTo&&this.el.nativeElement.appendChild(this.containerViewChild.nativeElement),this.unbindGlobalListeners()},e}();r.decorators=[{type:t.Component,args:[{selector:"p-sidebar",template:'\n