UNPKG

38.8 kBJavaScriptView Raw
1(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("@angular/core"),require("perfect-scrollbar"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):typeof define==="function"&&define.amd?define(["exports","@angular/core","perfect-scrollbar","rxjs","rxjs/operators","@angular/common"],factory):factory((global.zef=global.zef||{},global.zef.ngxPerfectScrollbar={}),global.ng.core,global.PerfectScrollbar,global.Rx,global.Rx.Observable.prototype,global.ng.common)})(this,function(exports,core,PerfectScrollbar,rxjs,operators,common){"use strict";PerfectScrollbar=PerfectScrollbar&&PerfectScrollbar.hasOwnProperty("default")?PerfectScrollbar["default"]:PerfectScrollbar;var MapShim=function(){if(typeof Map!=="undefined"){return Map}function getIndex(arr,key){var result=-1;arr.some(function(entry,index){if(entry[0]===key){result=index;return true}return false});return result}return function(){function anonymous(){this.__entries__=[]}var prototypeAccessors={size:{configurable:true}};prototypeAccessors.size.get=function(){return this.__entries__.length};anonymous.prototype.get=function(key){var index=getIndex(this.__entries__,key);var entry=this.__entries__[index];return entry&&entry[1]};anonymous.prototype.set=function(key,value){var index=getIndex(this.__entries__,key);if(~index){this.__entries__[index][1]=value}else{this.__entries__.push([key,value])}};anonymous.prototype.delete=function(key){var entries=this.__entries__;var index=getIndex(entries,key);if(~index){entries.splice(index,1)}};anonymous.prototype.has=function(key){return!!~getIndex(this.__entries__,key)};anonymous.prototype.clear=function(){this.__entries__.splice(0)};anonymous.prototype.forEach=function(callback,ctx){var this$1=this;if(ctx===void 0)ctx=null;for(var i=0,list=this$1.__entries__;i<list.length;i+=1){var entry=list[i];callback.call(ctx,entry[1],entry[0])}};Object.defineProperties(anonymous.prototype,prototypeAccessors);return anonymous}()}();var isBrowser=typeof window!=="undefined"&&typeof document!=="undefined"&&window.document===document;var global$1=function(){if(typeof global!=="undefined"&&global.Math===Math){return global}if(typeof self!=="undefined"&&self.Math===Math){return self}if(typeof window!=="undefined"&&window.Math===Math){return window}return Function("return this")()}();var requestAnimationFrame$1=function(){if(typeof requestAnimationFrame==="function"){return requestAnimationFrame.bind(global$1)}return function(callback){return setTimeout(function(){return callback(Date.now())},1e3/60)}}();var trailingTimeout=2;var throttle=function(callback,delay){var leadingCall=false,trailingCall=false,lastCallTime=0;function resolvePending(){if(leadingCall){leadingCall=false;callback()}if(trailingCall){proxy()}}function timeoutCallback(){requestAnimationFrame$1(resolvePending)}function proxy(){var timeStamp=Date.now();if(leadingCall){if(timeStamp-lastCallTime<trailingTimeout){return}trailingCall=true}else{leadingCall=true;trailingCall=false;setTimeout(timeoutCallback,delay)}lastCallTime=timeStamp}return proxy};var REFRESH_DELAY=20;var transitionKeys=["top","right","bottom","left","width","height","size","weight"];var mutationObserverSupported=typeof MutationObserver!=="undefined";var ResizeObserverController=function(){this.connected_=false;this.mutationEventsAdded_=false;this.mutationsObserver_=null;this.observers_=[];this.onTransitionEnd_=this.onTransitionEnd_.bind(this);this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)};ResizeObserverController.prototype.addObserver=function(observer){if(!~this.observers_.indexOf(observer)){this.observers_.push(observer)}if(!this.connected_){this.connect_()}};ResizeObserverController.prototype.removeObserver=function(observer){var observers=this.observers_;var index=observers.indexOf(observer);if(~index){observers.splice(index,1)}if(!observers.length&&this.connected_){this.disconnect_()}};ResizeObserverController.prototype.refresh=function(){var changesDetected=this.updateObservers_();if(changesDetected){this.refresh()}};ResizeObserverController.prototype.updateObservers_=function(){var activeObservers=this.observers_.filter(function(observer){return observer.gatherActive(),observer.hasActive()});activeObservers.forEach(function(observer){return observer.broadcastActive()});return activeObservers.length>0};ResizeObserverController.prototype.connect_=function(){if(!isBrowser||this.connected_){return}document.addEventListener("transitionend",this.onTransitionEnd_);window.addEventListener("resize",this.refresh);if(mutationObserverSupported){this.mutationsObserver_=new MutationObserver(this.refresh);this.mutationsObserver_.observe(document,{attributes:true,childList:true,characterData:true,subtree:true})}else{document.addEventListener("DOMSubtreeModified",this.refresh);this.mutationEventsAdded_=true}this.connected_=true};ResizeObserverController.prototype.disconnect_=function(){if(!isBrowser||!this.connected_){return}document.removeEventListener("transitionend",this.onTransitionEnd_);window.removeEventListener("resize",this.refresh);if(this.mutationsObserver_){this.mutationsObserver_.disconnect()}if(this.mutationEventsAdded_){document.removeEventListener("DOMSubtreeModified",this.refresh)}this.mutationsObserver_=null;this.mutationEventsAdded_=false;this.connected_=false};ResizeObserverController.prototype.onTransitionEnd_=function(ref){var propertyName=ref.propertyName;if(propertyName===void 0)propertyName="";var isReflowProperty=transitionKeys.some(function(key){return!!~propertyName.indexOf(key)});if(isReflowProperty){this.refresh()}};ResizeObserverController.getInstance=function(){if(!this.instance_){this.instance_=new ResizeObserverController}return this.instance_};ResizeObserverController.instance_=null;var defineConfigurable=function(target,props){for(var i=0,list=Object.keys(props);i<list.length;i+=1){var key=list[i];Object.defineProperty(target,key,{value:props[key],enumerable:false,writable:false,configurable:true})}return target};var getWindowOf=function(target){var ownerGlobal=target&&target.ownerDocument&&target.ownerDocument.defaultView;return ownerGlobal||global$1};var emptyRect=createRectInit(0,0,0,0);function toFloat(value){return parseFloat(value)||0}function getBordersSize(styles){var positions=[],len=arguments.length-1;while(len-- >0)positions[len]=arguments[len+1];return positions.reduce(function(size,position){var value=styles["border-"+position+"-width"];return size+toFloat(value)},0)}function getPaddings(styles){var positions=["top","right","bottom","left"];var paddings={};for(var i=0,list=positions;i<list.length;i+=1){var position=list[i];var value=styles["padding-"+position];paddings[position]=toFloat(value)}return paddings}function getSVGContentRect(target){var bbox=target.getBBox();return createRectInit(0,0,bbox.width,bbox.height)}function getHTMLElementContentRect(target){var clientWidth=target.clientWidth;var clientHeight=target.clientHeight;if(!clientWidth&&!clientHeight){return emptyRect}var styles=getWindowOf(target).getComputedStyle(target);var paddings=getPaddings(styles);var horizPad=paddings.left+paddings.right;var vertPad=paddings.top+paddings.bottom;var width=toFloat(styles.width),height=toFloat(styles.height);if(styles.boxSizing==="border-box"){if(Math.round(width+horizPad)!==clientWidth){width-=getBordersSize(styles,"left","right")+horizPad}if(Math.round(height+vertPad)!==clientHeight){height-=getBordersSize(styles,"top","bottom")+vertPad}}if(!isDocumentElement(target)){var vertScrollbar=Math.round(width+horizPad)-clientWidth;var horizScrollbar=Math.round(height+vertPad)-clientHeight;if(Math.abs(vertScrollbar)!==1){width-=vertScrollbar}if(Math.abs(horizScrollbar)!==1){height-=horizScrollbar}}return createRectInit(paddings.left,paddings.top,width,height)}var isSVGGraphicsElement=function(){if(typeof SVGGraphicsElement!=="undefined"){return function(target){return target instanceof getWindowOf(target).SVGGraphicsElement}}return function(target){return target instanceof getWindowOf(target).SVGElement&&typeof target.getBBox==="function"}}();function isDocumentElement(target){return target===getWindowOf(target).document.documentElement}function getContentRect(target){if(!isBrowser){return emptyRect}if(isSVGGraphicsElement(target)){return getSVGContentRect(target)}return getHTMLElementContentRect(target)}function createReadOnlyRect(ref){var x=ref.x;var y=ref.y;var width=ref.width;var height=ref.height;var Constr=typeof DOMRectReadOnly!=="undefined"?DOMRectReadOnly:Object;var rect=Object.create(Constr.prototype);defineConfigurable(rect,{x:x,y:y,width:width,height:height,top:y,right:x+width,bottom:height+y,left:x});return rect}function createRectInit(x,y,width,height){return{x:x,y:y,width:width,height:height}}var ResizeObservation=function(target){this.broadcastWidth=0;this.broadcastHeight=0;this.contentRect_=createRectInit(0,0,0,0);this.target=target};ResizeObservation.prototype.isActive=function(){var rect=getContentRect(this.target);this.contentRect_=rect;return rect.width!==this.broadcastWidth||rect.height!==this.broadcastHeight};ResizeObservation.prototype.broadcastRect=function(){var rect=this.contentRect_;this.broadcastWidth=rect.width;this.broadcastHeight=rect.height;return rect};var ResizeObserverEntry=function(target,rectInit){var contentRect=createReadOnlyRect(rectInit);defineConfigurable(this,{target:target,contentRect:contentRect})};var ResizeObserverSPI=function(callback,controller,callbackCtx){this.activeObservations_=[];this.observations_=new MapShim;if(typeof callback!=="function"){throw new TypeError("The callback provided as parameter 1 is not a function.")}this.callback_=callback;this.controller_=controller;this.callbackCtx_=callbackCtx};ResizeObserverSPI.prototype.observe=function(target){if(!arguments.length){throw new TypeError("1 argument required, but only 0 present.")}if(typeof Element==="undefined"||!(Element instanceof Object)){return}if(!(target instanceof getWindowOf(target).Element)){throw new TypeError('parameter 1 is not of type "Element".')}var observations=this.observations_;if(observations.has(target)){return}observations.set(target,new ResizeObservation(target));this.controller_.addObserver(this);this.controller_.refresh()};ResizeObserverSPI.prototype.unobserve=function(target){if(!arguments.length){throw new TypeError("1 argument required, but only 0 present.")}if(typeof Element==="undefined"||!(Element instanceof Object)){return}if(!(target instanceof getWindowOf(target).Element)){throw new TypeError('parameter 1 is not of type "Element".')}var observations=this.observations_;if(!observations.has(target)){return}observations.delete(target);if(!observations.size){this.controller_.removeObserver(this)}};ResizeObserverSPI.prototype.disconnect=function(){this.clearActive();this.observations_.clear();this.controller_.removeObserver(this)};ResizeObserverSPI.prototype.gatherActive=function(){var this$1=this;this.clearActive();this.observations_.forEach(function(observation){if(observation.isActive()){this$1.activeObservations_.push(observation)}})};ResizeObserverSPI.prototype.broadcastActive=function(){if(!this.hasActive()){return}var ctx=this.callbackCtx_;var entries=this.activeObservations_.map(function(observation){return new ResizeObserverEntry(observation.target,observation.broadcastRect())});this.callback_.call(ctx,entries,ctx);this.clearActive()};ResizeObserverSPI.prototype.clearActive=function(){this.activeObservations_.splice(0)};ResizeObserverSPI.prototype.hasActive=function(){return this.activeObservations_.length>0};var observers=typeof WeakMap!=="undefined"?new WeakMap:new MapShim;var ResizeObserver=function(callback){if(!(this instanceof ResizeObserver)){throw new TypeError("Cannot call a class as a function.")}if(!arguments.length){throw new TypeError("1 argument required, but only 0 present.")}var controller=ResizeObserverController.getInstance();var observer=new ResizeObserverSPI(callback,controller,this);observers.set(this,observer)};["observe","unobserve","disconnect"].forEach(function(method){ResizeObserver.prototype[method]=function(){return(ref=observers.get(this))[method].apply(ref,arguments);var ref}});var index=function(){if(typeof global$1.ResizeObserver!=="undefined"){return global$1.ResizeObserver}return ResizeObserver}();var PERFECT_SCROLLBAR_CONFIG=new core.InjectionToken("PERFECT_SCROLLBAR_CONFIG");var Geometry=function(){function Geometry(x,y,w,h){this.x=x;this.y=y;this.w=w;this.h=h}return Geometry}();var Position=function(){function Position(x,y){this.x=x;this.y=y}return Position}();var PerfectScrollbarEvents=["psScrollY","psScrollX","psScrollUp","psScrollDown","psScrollLeft","psScrollRight","psYReachEnd","psYReachStart","psXReachEnd","psXReachStart"];var PerfectScrollbarConfig=function(){function PerfectScrollbarConfig(config){if(config===void 0){config={}}this.assign(config)}PerfectScrollbarConfig.prototype.assign=function(config){if(config===void 0){config={}}for(var key in config){this[key]=config[key]}};return PerfectScrollbarConfig}();var PerfectScrollbarDirective=function(){function PerfectScrollbarDirective(zone,differs,elementRef,platformId,defaults){this.zone=zone;this.differs=differs;this.elementRef=elementRef;this.platformId=platformId;this.defaults=defaults;this.instance=null;this.ro=null;this.timeout=null;this.animation=null;this.configDiff=null;this.ngDestroy=new rxjs.Subject;this.disabled=false;this.psScrollY=new core.EventEmitter;this.psScrollX=new core.EventEmitter;this.psScrollUp=new core.EventEmitter;this.psScrollDown=new core.EventEmitter;this.psScrollLeft=new core.EventEmitter;this.psScrollRight=new core.EventEmitter;this.psYReachEnd=new core.EventEmitter;this.psYReachStart=new core.EventEmitter;this.psXReachEnd=new core.EventEmitter;this.psXReachStart=new core.EventEmitter}PerfectScrollbarDirective.prototype.ngOnInit=function(){var _this=this;if(!this.disabled&&common.isPlatformBrowser(this.platformId)){var config_1=new PerfectScrollbarConfig(this.defaults);config_1.assign(this.config);this.zone.runOutsideAngular(function(){_this.instance=new PerfectScrollbar(_this.elementRef.nativeElement,config_1)});if(!this.configDiff){this.configDiff=this.differs.find(this.config||{}).create();this.configDiff.diff(this.config||{})}this.zone.runOutsideAngular(function(){_this.ro=new index(function(){_this.update()});if(_this.elementRef.nativeElement.children[0]){_this.ro.observe(_this.elementRef.nativeElement.children[0])}_this.ro.observe(_this.elementRef.nativeElement)});this.zone.runOutsideAngular(function(){PerfectScrollbarEvents.forEach(function(eventName){var eventType=eventName.replace(/([A-Z])/g,function(c){return"-"+c.toLowerCase()});rxjs.fromEvent(_this.elementRef.nativeElement,eventType).pipe(operators.debounceTime(20),operators.takeUntil(_this.ngDestroy)).subscribe(function(event){_this[eventName].emit(event)})})})}};PerfectScrollbarDirective.prototype.ngOnDestroy=function(){var _this=this;if(common.isPlatformBrowser(this.platformId)){this.ngDestroy.next();this.ngDestroy.complete();if(this.ro){this.ro.disconnect()}if(this.timeout&&typeof window!=="undefined"){window.clearTimeout(this.timeout)}this.zone.runOutsideAngular(function(){if(_this.instance){_this.instance.destroy()}});this.instance=null}};PerfectScrollbarDirective.prototype.ngDoCheck=function(){if(!this.disabled&&this.configDiff&&common.isPlatformBrowser(this.platformId)){var changes=this.configDiff.diff(this.config||{});if(changes){this.ngOnDestroy();this.ngOnInit()}}};PerfectScrollbarDirective.prototype.ngOnChanges=function(changes){if(changes["disabled"]&&!changes["disabled"].isFirstChange()&&common.isPlatformBrowser(this.platformId)){if(changes["disabled"].currentValue!==changes["disabled"].previousValue){if(changes["disabled"].currentValue===true){this.ngOnDestroy()}else if(changes["disabled"].currentValue===false){this.ngOnInit()}}}};PerfectScrollbarDirective.prototype.ps=function(){return this.instance};PerfectScrollbarDirective.prototype.update=function(){var _this=this;if(typeof window!=="undefined"){if(this.timeout){window.clearTimeout(this.timeout)}this.timeout=window.setTimeout(function(){if(!_this.disabled&&_this.configDiff){try{_this.zone.runOutsideAngular(function(){if(_this.instance){_this.instance.update()}})}catch(error){}}},0)}};PerfectScrollbarDirective.prototype.geometry=function(prefix){if(prefix===void 0){prefix="scroll"}return new Geometry(this.elementRef.nativeElement[prefix+"Left"],this.elementRef.nativeElement[prefix+"Top"],this.elementRef.nativeElement[prefix+"Width"],this.elementRef.nativeElement[prefix+"Height"])};PerfectScrollbarDirective.prototype.position=function(absolute){if(absolute===void 0){absolute=false}if(!absolute&&this.instance){return new Position(this.instance.reach.x||0,this.instance.reach.y||0)}else{return new Position(this.elementRef.nativeElement.scrollLeft,this.elementRef.nativeElement.scrollTop)}};PerfectScrollbarDirective.prototype.scrollable=function(direction){if(direction===void 0){direction="any"}var element=this.elementRef.nativeElement;if(direction==="any"){return element.classList.contains("ps--active-x")||element.classList.contains("ps--active-y")}else if(direction==="both"){return element.classList.contains("ps--active-x")&&element.classList.contains("ps--active-y")}else{return element.classList.contains("ps--active-"+direction)}};PerfectScrollbarDirective.prototype.scrollTo=function(x,y,speed){if(!this.disabled){if(y==null&&speed==null){this.animateScrolling("scrollTop",x,speed)}else{if(x!=null){this.animateScrolling("scrollLeft",x,speed)}if(y!=null){this.animateScrolling("scrollTop",y,speed)}}}};PerfectScrollbarDirective.prototype.scrollToX=function(x,speed){this.animateScrolling("scrollLeft",x,speed)};PerfectScrollbarDirective.prototype.scrollToY=function(y,speed){this.animateScrolling("scrollTop",y,speed)};PerfectScrollbarDirective.prototype.scrollToTop=function(offset,speed){this.animateScrolling("scrollTop",offset||0,speed)};PerfectScrollbarDirective.prototype.scrollToLeft=function(offset,speed){this.animateScrolling("scrollLeft",offset||0,speed)};PerfectScrollbarDirective.prototype.scrollToRight=function(offset,speed){var left=this.elementRef.nativeElement.scrollWidth-this.elementRef.nativeElement.clientWidth;this.animateScrolling("scrollLeft",left-(offset||0),speed)};PerfectScrollbarDirective.prototype.scrollToBottom=function(offset,speed){var top=this.elementRef.nativeElement.scrollHeight-this.elementRef.nativeElement.clientHeight;this.animateScrolling("scrollTop",top-(offset||0),speed)};PerfectScrollbarDirective.prototype.scrollToElement=function(qs,offset,speed){var element=this.elementRef.nativeElement.querySelector(qs);if(element){var elementPos=element.getBoundingClientRect();var scrollerPos=this.elementRef.nativeElement.getBoundingClientRect();if(this.elementRef.nativeElement.classList.contains("ps--active-x")){var currentPos=this.elementRef.nativeElement["scrollLeft"];var position=elementPos.left-scrollerPos.left+currentPos;this.animateScrolling("scrollLeft",position+(offset||0),speed)}if(this.elementRef.nativeElement.classList.contains("ps--active-y")){var currentPos=this.elementRef.nativeElement["scrollTop"];var position=elementPos.top-scrollerPos.top+currentPos;this.animateScrolling("scrollTop",position+(offset||0),speed)}}};PerfectScrollbarDirective.prototype.animateScrolling=function(target,value,speed){var _this=this;if(this.animation){window.cancelAnimationFrame(this.animation);this.animation=null}if(!speed||typeof window==="undefined"){this.elementRef.nativeElement[target]=value}else if(value!==this.elementRef.nativeElement[target]){var newValue_1=0;var scrollCount_1=0;var oldTimestamp_1=performance.now();var oldValue_1=this.elementRef.nativeElement[target];var cosParameter_1=(oldValue_1-value)/2;var step_1=function(newTimestamp){scrollCount_1+=Math.PI/(speed/(newTimestamp-oldTimestamp_1));newValue_1=Math.round(value+cosParameter_1+cosParameter_1*Math.cos(scrollCount_1));if(_this.elementRef.nativeElement[target]===oldValue_1){if(scrollCount_1>=Math.PI){_this.animateScrolling(target,value,0)}else{_this.elementRef.nativeElement[target]=newValue_1;oldValue_1=_this.elementRef.nativeElement[target];oldTimestamp_1=newTimestamp;_this.animation=window.requestAnimationFrame(step_1)}}};window.requestAnimationFrame(step_1)}};PerfectScrollbarDirective.decorators=[{type:core.Directive,args:[{selector:"[perfectScrollbar]",exportAs:"ngxPerfectScrollbar"}]}];PerfectScrollbarDirective.ctorParameters=function(){return[{type:core.NgZone},{type:core.KeyValueDiffers},{type:core.ElementRef},{type:Object,decorators:[{type:core.Inject,args:[core.PLATFORM_ID]}]},{type:undefined,decorators:[{type:core.Optional},{type:core.Inject,args:[PERFECT_SCROLLBAR_CONFIG]}]}]};PerfectScrollbarDirective.propDecorators={disabled:[{type:core.Input}],config:[{type:core.Input,args:["perfectScrollbar"]}],psScrollY:[{type:core.Output}],psScrollX:[{type:core.Output}],psScrollUp:[{type:core.Output}],psScrollDown:[{type:core.Output}],psScrollLeft:[{type:core.Output}],psScrollRight:[{type:core.Output}],psYReachEnd:[{type:core.Output}],psYReachStart:[{type:core.Output}],psXReachEnd:[{type:core.Output}],psXReachStart:[{type:core.Output}]};return PerfectScrollbarDirective}();var PerfectScrollbarComponent=function(){function PerfectScrollbarComponent(zone,cdRef,platformId){this.zone=zone;this.cdRef=cdRef;this.platformId=platformId;this.states={};this.indicatorX=false;this.indicatorY=false;this.interaction=false;this.scrollPositionX=0;this.scrollPositionY=0;this.scrollDirectionX=0;this.scrollDirectionY=0;this.usePropagationX=false;this.usePropagationY=false;this.allowPropagationX=false;this.allowPropagationY=false;this.stateTimeout=null;this.ngDestroy=new rxjs.Subject;this.stateUpdate=new rxjs.Subject;this.disabled=false;this.usePSClass=true;this.autoPropagation=false;this.scrollIndicators=false;this.psScrollY=new core.EventEmitter;this.psScrollX=new core.EventEmitter;this.psScrollUp=new core.EventEmitter;this.psScrollDown=new core.EventEmitter;this.psScrollLeft=new core.EventEmitter;this.psScrollRight=new core.EventEmitter;this.psYReachEnd=new core.EventEmitter;this.psYReachStart=new core.EventEmitter;this.psXReachEnd=new core.EventEmitter;this.psXReachStart=new core.EventEmitter}PerfectScrollbarComponent.prototype.ngOnInit=function(){var _this=this;if(common.isPlatformBrowser(this.platformId)){this.stateUpdate.pipe(operators.takeUntil(this.ngDestroy),operators.distinctUntilChanged(function(a,b){return a===b&&!_this.stateTimeout})).subscribe(function(state){if(_this.stateTimeout&&typeof window!=="undefined"){window.clearTimeout(_this.stateTimeout);_this.stateTimeout=null}if(state==="x"||state==="y"){_this.interaction=false;if(state==="x"){_this.indicatorX=false;_this.states.left=false;_this.states.right=false;if(_this.autoPropagation&&_this.usePropagationX){_this.allowPropagationX=false}}else if(state==="y"){_this.indicatorY=false;_this.states.top=false;_this.states.bottom=false;if(_this.autoPropagation&&_this.usePropagationY){_this.allowPropagationY=false}}}else{if(state==="left"||state==="right"){_this.states.left=false;_this.states.right=false;_this.states[state]=true;if(_this.autoPropagation&&_this.usePropagationX){_this.indicatorX=true}}else if(state==="top"||state==="bottom"){_this.states.top=false;_this.states.bottom=false;_this.states[state]=true;if(_this.autoPropagation&&_this.usePropagationY){_this.indicatorY=true}}if(_this.autoPropagation&&typeof window!=="undefined"){_this.stateTimeout=window.setTimeout(function(){_this.indicatorX=false;_this.indicatorY=false;_this.stateTimeout=null;if(_this.interaction&&(_this.states.left||_this.states.right)){_this.allowPropagationX=true}if(_this.interaction&&(_this.states.top||_this.states.bottom)){_this.allowPropagationY=true}_this.cdRef.markForCheck()},500)}}_this.cdRef.markForCheck();_this.cdRef.detectChanges()});this.zone.runOutsideAngular(function(){if(_this.directiveRef){var element=_this.directiveRef.elementRef.nativeElement;rxjs.fromEvent(element,"wheel").pipe(operators.takeUntil(_this.ngDestroy)).subscribe(function(event){if(!_this.disabled&&_this.autoPropagation){var scrollDeltaX=event.deltaX;var scrollDeltaY=event.deltaY;_this.checkPropagation(event,scrollDeltaX,scrollDeltaY)}});rxjs.fromEvent(element,"touchmove").pipe(operators.takeUntil(_this.ngDestroy)).subscribe(function(event){if(!_this.disabled&&_this.autoPropagation){var scrollPositionX=event.touches[0].clientX;var scrollPositionY=event.touches[0].clientY;var scrollDeltaX=scrollPositionX-_this.scrollPositionX;var scrollDeltaY=scrollPositionY-_this.scrollPositionY;_this.checkPropagation(event,scrollDeltaX,scrollDeltaY);_this.scrollPositionX=scrollPositionX;_this.scrollPositionY=scrollPositionY}});rxjs.merge(rxjs.fromEvent(element,"ps-scroll-x").pipe(operators.mapTo("x")),rxjs.fromEvent(element,"ps-scroll-y").pipe(operators.mapTo("y")),rxjs.fromEvent(element,"ps-x-reach-end").pipe(operators.mapTo("right")),rxjs.fromEvent(element,"ps-y-reach-end").pipe(operators.mapTo("bottom")),rxjs.fromEvent(element,"ps-x-reach-start").pipe(operators.mapTo("left")),rxjs.fromEvent(element,"ps-y-reach-start").pipe(operators.mapTo("top"))).pipe(operators.takeUntil(_this.ngDestroy)).subscribe(function(state){if(!_this.disabled&&(_this.autoPropagation||_this.scrollIndicators)){_this.stateUpdate.next(state)}})}});window.setTimeout(function(){PerfectScrollbarEvents.forEach(function(eventName){if(_this.directiveRef){_this.directiveRef[eventName]=_this[eventName]}})},0)}};PerfectScrollbarComponent.prototype.ngOnDestroy=function(){if(common.isPlatformBrowser(this.platformId)){this.ngDestroy.next();this.ngDestroy.unsubscribe();if(this.stateTimeout&&typeof window!=="undefined"){window.clearTimeout(this.stateTimeout)}}};PerfectScrollbarComponent.prototype.ngDoCheck=function(){if(common.isPlatformBrowser(this.platformId)){if(!this.disabled&&this.autoPropagation&&this.directiveRef){var element=this.directiveRef.elementRef.nativeElement;this.usePropagationX=element.classList.contains("ps--active-x");this.usePropagationY=element.classList.contains("ps--active-y")}}};PerfectScrollbarComponent.prototype.checkPropagation=function(event,deltaX,deltaY){this.interaction=true;var scrollDirectionX=deltaX<0?-1:1;var scrollDirectionY=deltaY<0?-1:1;if(this.usePropagationX&&this.usePropagationY||this.usePropagationX&&(!this.allowPropagationX||this.scrollDirectionX!==scrollDirectionX)||this.usePropagationY&&(!this.allowPropagationY||this.scrollDirectionY!==scrollDirectionY)){event.preventDefault();event.stopPropagation()}if(!!deltaX){this.scrollDirectionX=scrollDirectionX}if(!!deltaY){this.scrollDirectionY=scrollDirectionY}this.stateUpdate.next("interaction");this.cdRef.detectChanges()};PerfectScrollbarComponent.decorators=[{type:core.Component,args:[{selector:"perfect-scrollbar",exportAs:"ngxPerfectScrollbar",template:'<div style="position: static;" [class.ps]="usePSClass" [perfectScrollbar]="config" [disabled]="disabled">\n <div class="ps-content">\n <ng-content></ng-content>\n </div>\n\n <div *ngIf="scrollIndicators" class="ps-overlay" [class.ps-at-top]="states.top" [class.ps-at-left]="states.left" [class.ps-at-right]="states.right" [class.ps-at-bottom]="states.bottom">\n <div class="ps-indicator-top" [class.ps-indicator-show]="indicatorY && interaction"></div>\n <div class="ps-indicator-left" [class.ps-indicator-show]="indicatorX && interaction"></div>\n <div class="ps-indicator-right" [class.ps-indicator-show]="indicatorX && interaction"></div>\n <div class="ps-indicator-bottom" [class.ps-indicator-show]="indicatorY && interaction"></div>\n </div>\n</div>\n',encapsulation:core.ViewEncapsulation.None,styles:["/*\n TODO: Remove important flags after this bug if fixed:\n https://github.com/angular/flex-layout/issues/381\n*/\n\nperfect-scrollbar {\n position: relative;\n\n display: block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n}\n\nperfect-scrollbar[hidden] {\n display: none;\n}\n\nperfect-scrollbar[fxflex] {\n display: flex;\n flex-direction: column;\n height: auto;\n min-width: 0;\n min-height: 0;\n\n -webkit-box-direction: column;\n -webkit-box-orient: column;\n}\n\nperfect-scrollbar[fxflex] > .ps {\n -ms-flex: 1 1 auto;\n\n flex: 1 1 auto;\n width: auto;\n height: auto;\n min-width: 0;\n min-height: 0;\n\n -webkit-box-flex: 1;\n}\n\nperfect-scrollbar[fxlayout] > .ps,\nperfect-scrollbar[fxlayout] > .ps > .ps-content {\n display: flex;\n\n -ms-flex: 1 1 auto;\n\n flex: 1 1 auto;\n flex-direction: inherit;\n align-items: inherit;\n align-content: inherit;\n justify-content: inherit;\n width: 100%;\n height: 100%;\n\n -webkit-box-align: inherit;\n -webkit-box-direction: inherit;\n -webkit-box-flex: 1;\n -webkit-box-orient: inherit;\n -webkit-box-pack: inherit;\n}\n\nperfect-scrollbar[fxlayout='row'] > .ps,\nperfect-scrollbar[fxlayout='row'] > .ps > .ps-content, {\n flex-direction: row !important;\n\n -webkit-box-direction: row !important;\n -webkit-box-orient: row !important;\n}\n\nperfect-scrollbar[fxlayout='column'] > .ps,\nperfect-scrollbar[fxlayout='column'] > .ps > .ps-content {\n flex-direction: column !important;\n\n -webkit-box-direction: column !important;\n -webkit-box-orient: column !important;\n}\n\nperfect-scrollbar > .ps {\n position: static;\n\n display: block;\n width: inherit;\n height: inherit;\n max-width: inherit;\n max-height: inherit;\n}\n\nperfect-scrollbar > .ps > .ps-overlay {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n display: block;\n overflow: hidden;\n\n pointer-events: none;\n}\n\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-top,\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-left,\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-right,\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-bottom {\n position: absolute;\n\n opacity: 0;\n\n transition: opacity 300ms ease-in-out;\n}\n\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-top,\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-bottom {\n left: 0;\n\n min-width: 100%;\n min-height: 24px;\n}\n\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-left,\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-right {\n top: 0;\n\n min-width: 24px;\n min-height: 100%;\n}\n\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-top {\n top: 0;\n}\n\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-left {\n left: 0;\n}\n\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-right {\n right: 0;\n}\n\nperfect-scrollbar > .ps > .ps-overlay .ps-indicator-bottom {\n bottom: 0;\n}\n\nperfect-scrollbar > .ps.ps--active-y > .ps__rail-y {\n top: 0 !important;\n right: 0 !important;\n left: auto !important;\n\n width: 10px;\n\n cursor: default;\n\n transition:\n width 200ms linear,\n opacity 200ms linear,\n background-color 200ms linear;\n}\n\nperfect-scrollbar > .ps.ps--active-y > .ps__rail-y:hover,\nperfect-scrollbar > .ps.ps--active-y > .ps__rail-y.ps--clicking {\n width: 15px;\n}\n\nperfect-scrollbar > .ps.ps--active-x > .ps__rail-x {\n top: auto !important;\n bottom: 0 !important;\n left: 0 !important;\n\n height: 10px;\n\n cursor: default;\n\n transition:\n height 200ms linear,\n opacity 200ms linear,\n background-color 200ms linear;\n}\n\nperfect-scrollbar > .ps.ps--active-x > .ps__rail-x:hover,\nperfect-scrollbar > .ps.ps--active-x > .ps__rail-x.ps--clicking {\n height: 15px;\n}\n\nperfect-scrollbar > .ps.ps--active-x.ps--active-y > .ps__rail-y {\n margin: 0 0 10px;\n}\n\nperfect-scrollbar > .ps.ps--active-x.ps--active-y > .ps__rail-x {\n margin: 0 10px 0 0;\n}\n\nperfect-scrollbar > .ps.ps--scrolling-y > .ps__rail-y,\nperfect-scrollbar > .ps.ps--scrolling-x > .ps__rail-x {\n opacity: 0.9;\n\n background-color: #eee;\n}\n\nperfect-scrollbar.ps-show-always > .ps.ps--active-y > .ps__rail-y,\nperfect-scrollbar.ps-show-always > .ps.ps--active-x > .ps__rail-x {\n opacity: 0.6;\n}\n\nperfect-scrollbar.ps-show-active > .ps.ps--active-y > .ps-overlay:not(.ps-at-top) .ps-indicator-top {\n opacity: 1;\n\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);\n}\n\nperfect-scrollbar.ps-show-active > .ps.ps--active-y > .ps-overlay:not(.ps-at-bottom) .ps-indicator-bottom {\n opacity: 1;\n\n background: linear-gradient(to top, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);\n}\n\nperfect-scrollbar.ps-show-active > .ps.ps--active-x > .ps-overlay:not(.ps-at-left) .ps-indicator-left {\n opacity: 1;\n\n background: linear-gradient(to right, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);\n}\n\nperfect-scrollbar.ps-show-active > .ps.ps--active-x > .ps-overlay:not(.ps-at-right) .ps-indicator-right {\n opacity: 1;\n\n background: linear-gradient(to left, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);\n}\n\nperfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-y > .ps-overlay.ps-at-top .ps-indicator-top {\n background: linear-gradient(to bottom, rgba(170, 170, 170, 0.5) 0%, rgba(170, 170, 170, 0) 100%);\n}\n\nperfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-y > .ps-overlay.ps-at-bottom .ps-indicator-bottom {\n background: linear-gradient(to top, rgba(170, 170, 170, 0.5) 0%, rgba(170, 170, 170, 0) 100%);\n}\n\nperfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-x > .ps-overlay.ps-at-left .ps-indicator-left {\n background: linear-gradient(to right, rgba(170, 170, 170, 0.5) 0%, rgba(170, 170, 170, 0) 100%);\n}\n\nperfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-x > .ps-overlay.ps-at-right .ps-indicator-right {\n background: linear-gradient(to left, rgba(170, 170, 170, 0.5) 0%, rgba(170, 170, 170, 0) 100%);\n}\n\nperfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-y > .ps-overlay.ps-at-top .ps-indicator-top.ps-indicator-show,\nperfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-y > .ps-overlay.ps-at-bottom .ps-indicator-bottom.ps-indicator-show,\nperfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-x > .ps-overlay.ps-at-left .ps-indicator-left.ps-indicator-show,\nperfect-scrollbar.ps-show-active.ps-show-limits > .ps.ps--active-x > .ps-overlay.ps-at-right .ps-indicator-right.ps-indicator-show {\n opacity: 1;\n}\n","/*\n * Container style\n */\n.ps {\n overflow: hidden !important;\n overflow-anchor: none;\n -ms-overflow-style: none;\n touch-action: auto;\n -ms-touch-action: auto;\n}\n\n/*\n * Scrollbar rail styles\n */\n.ps__rail-x {\n display: none;\n opacity: 0;\n transition: background-color .2s linear, opacity .2s linear;\n -webkit-transition: background-color .2s linear, opacity .2s linear;\n height: 15px;\n /* there must be 'bottom' or 'top' for ps__rail-x */\n bottom: 0px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__rail-y {\n display: none;\n opacity: 0;\n transition: background-color .2s linear, opacity .2s linear;\n -webkit-transition: background-color .2s linear, opacity .2s linear;\n width: 15px;\n /* there must be 'right' or 'left' for ps__rail-y */\n right: 0;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps--active-x > .ps__rail-x,\n.ps--active-y > .ps__rail-y {\n display: block;\n background-color: transparent;\n}\n\n.ps:hover > .ps__rail-x,\n.ps:hover > .ps__rail-y,\n.ps--focus > .ps__rail-x,\n.ps--focus > .ps__rail-y,\n.ps--scrolling-x > .ps__rail-x,\n.ps--scrolling-y > .ps__rail-y {\n opacity: 0.6;\n}\n\n.ps .ps__rail-x:hover,\n.ps .ps__rail-y:hover,\n.ps .ps__rail-x:focus,\n.ps .ps__rail-y:focus,\n.ps .ps__rail-x.ps--clicking,\n.ps .ps__rail-y.ps--clicking {\n background-color: #eee;\n opacity: 0.9;\n}\n\n/*\n * Scrollbar thumb styles\n */\n.ps__thumb-x {\n background-color: #aaa;\n border-radius: 6px;\n transition: background-color .2s linear, height .2s ease-in-out;\n -webkit-transition: background-color .2s linear, height .2s ease-in-out;\n height: 6px;\n /* there must be 'bottom' for ps__thumb-x */\n bottom: 2px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__thumb-y {\n background-color: #aaa;\n border-radius: 6px;\n transition: background-color .2s linear, width .2s ease-in-out;\n -webkit-transition: background-color .2s linear, width .2s ease-in-out;\n width: 6px;\n /* there must be 'right' for ps__thumb-y */\n right: 2px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__rail-x:hover > .ps__thumb-x,\n.ps__rail-x:focus > .ps__thumb-x,\n.ps__rail-x.ps--clicking .ps__thumb-x {\n background-color: #999;\n height: 11px;\n}\n\n.ps__rail-y:hover > .ps__thumb-y,\n.ps__rail-y:focus > .ps__thumb-y,\n.ps__rail-y.ps--clicking .ps__thumb-y {\n background-color: #999;\n width: 11px;\n}\n\n/* MS supports */\n@supports (-ms-overflow-style: none) {\n .ps {\n overflow: auto !important;\n }\n}\n\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .ps {\n overflow: auto !important;\n }\n}\n"]}]}];PerfectScrollbarComponent.ctorParameters=function(){return[{type:core.NgZone},{type:core.ChangeDetectorRef},{type:Object,decorators:[{type:core.Inject,args:[core.PLATFORM_ID]}]}]};PerfectScrollbarComponent.propDecorators={disabled:[{type:core.Input}],usePSClass:[{type:core.Input}],autoPropagation:[{type:core.HostBinding,args:["class.ps-show-limits"]},{type:core.Input}],scrollIndicators:[{type:core.HostBinding,args:["class.ps-show-active"]},{type:core.Input}],config:[{type:core.Input}],psScrollY:[{type:core.Output}],psScrollX:[{type:core.Output}],psScrollUp:[{type:core.Output}],psScrollDown:[{type:core.Output}],psScrollLeft:[{type:core.Output}],psScrollRight:[{type:core.Output}],psYReachEnd:[{type:core.Output}],psYReachStart:[{type:core.Output}],psXReachEnd:[{type:core.Output}],psXReachStart:[{type:core.Output}],directiveRef:[{type:core.ViewChild,args:[PerfectScrollbarDirective]}]};return PerfectScrollbarComponent}();var PerfectScrollbarModule=function(){function PerfectScrollbarModule(){}PerfectScrollbarModule.decorators=[{type:core.NgModule,args:[{imports:[common.CommonModule],declarations:[PerfectScrollbarComponent,PerfectScrollbarDirective],exports:[common.CommonModule,PerfectScrollbarComponent,PerfectScrollbarDirective]}]}];return PerfectScrollbarModule}();exports.PerfectScrollbarComponent=PerfectScrollbarComponent;exports.PerfectScrollbarDirective=PerfectScrollbarDirective;exports.Geometry=Geometry;exports.Position=Position;exports.PERFECT_SCROLLBAR_CONFIG=PERFECT_SCROLLBAR_CONFIG;exports.PerfectScrollbarConfig=PerfectScrollbarConfig;exports.PerfectScrollbarModule=PerfectScrollbarModule;Object.defineProperty(exports,"__esModule",{value:true})});
\No newline at end of file