blob: 163f8983e0038d051f9f9a3a5cbc702725c23aaa [file] [log] [blame]
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/coercion"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/cdk/observers",["exports","@angular/cdk/coercion","@angular/core","rxjs","rxjs/operators"],t):t(((e=e||self).ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.observers={}),e.ng.cdk.coercion,e.ng.core,e.rxjs,e.rxjs.operators)}(this,(function(e,t,r,n,o){"use strict";
/**
* @license
* Copyright Google LLC 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://angular.io/license
*/var s=function(){function e(){}return e.prototype.create=function(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)},e}();sprov=r.ɵɵdefineInjectable({factory:function e(){return new s},token:s,providedIn:"root"}),s.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}];var i=function(){function e(e){this._mutationObserverFactory=e,this._observedElements=new Map}return e.prototype.ngOnDestroy=function(){var e=this;this._observedElements.forEach((function(t,r){return e._cleanupObserver(r)}))},e.prototype.observe=function(e){var r=this,o=t.coerceElement(e);return new n.Observable((function(e){var t=r._observeElement(o).subscribe(e);return function(){t.unsubscribe(),r._unobserveElement(o)}}))},e.prototype._observeElement=function(e){if(this._observedElements.has(e))this._observedElements.get(e).count++;else{var t=new n.Subject,r=this._mutationObserverFactory.create((function(e){return t.next(e)}));r&&r.observe(e,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(e,{observer:r,stream:t,count:1})}return this._observedElements.get(e).stream},e.prototype._unobserveElement=function(e){this._observedElements.has(e)&&(this._observedElements.get(e).count--,this._observedElements.get(e).count||this._cleanupObserver(e))},e.prototype._cleanupObserver=function(e){if(this._observedElements.has(e)){var t=this._observedElements.get(e),r=t.observer,n=t.stream;r&&r.disconnect(),n.complete(),this._observedElements.delete(e)}},e}();iprov=r.ɵɵdefineInjectable({factory:function e(){return new i(r.ɵɵinject(s))},token:i,providedIn:"root"}),i.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],i.ctorParameters=function(){return[{type:s}]};var c,u=function(){function e(e,t,n){this._contentObserver=e,this._elementRef=t,this._ngZone=n,this.event=new r.EventEmitter,this._disabled=!1,this._currentSubscription=null}return Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=t.coerceBooleanProperty(e),this._disabled?this._unsubscribe():this._subscribe()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"debounce",{get:function(){return this._debounce},set:function(e){this._debounce=t.coerceNumberProperty(e),this._subscribe()},enumerable:!1,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._currentSubscription||this.disabled||this._subscribe()},e.prototype.ngOnDestroy=function(){this._unsubscribe()},e.prototype._subscribe=function(){var e=this;this._unsubscribe();var t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular((function(){e._currentSubscription=(e.debounce?t.pipe(o.debounceTime(e.debounce)):t).subscribe(e.event)}))},e.prototype._unsubscribe=function(){var e;null===(e=this._currentSubscription)||void 0===e||e.unsubscribe()},e}();u.decorators=[{type:r.Directive,args:[{selector:"[cdkObserveContent]",exportAs:"cdkObserveContent"}]}],u.ctorParameters=function(){return[{type:i},{type:r.ElementRef},{type:r.NgZone}]},u.propDecorators={event:[{type:r.Output,args:["cdkObserveContent"]}],disabled:[{type:r.Input,args:["cdkObserveContentDisabled"]}],debounce:[{type:r.Input}]},(c=function c(){}).decorators=[{type:r.NgModule,args:[{exports:[u],declarations:[u],providers:[s]}]}],
/**
* @license
* Copyright Google LLC 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://angular.io/license
*/
e.CdkObserveContent=u,e.ContentObserver=i,e.MutationObserverFactory=s,e.ObserversModule=c,Object.defineProperty(e,"__esModule",{value:!0})}));