UNPKG

rxjs

Version:

Reactive Extensions for modern JavaScript

122 lines (120 loc) 135 kB
/** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /* ***************************************************************************** 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. *****************************************************************************/ var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,d,k){if(k.get||k.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[d]=k.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this); $jscomp.polyfill=function(e,d,k,h){if(d){k=$jscomp.global;e=e.split(".");for(h=0;h<e.length-1;h++){var y=e[h];y in k||(k[y]={});k=k[y]}e=e[e.length-1];h=k[e];d=d(h);d!=h&&null!=d&&$jscomp.defineProperty(k,e,{configurable:!0,writable:!0,value:d})}};$jscomp.polyfill("Object.setPrototypeOf",function(e){return e?e:"object"!=typeof"".__proto__?null:function(d,e){d.__proto__=e;if(d.__proto__!==e)throw new TypeError(d+" is not extensible");return d}},"es6","es5"); $jscomp.owns=function(e,d){return Object.prototype.hasOwnProperty.call(e,d)};$jscomp.polyfill("Object.assign",function(e){return e?e:function(d,e){for(var h=1;h<arguments.length;h++){var k=arguments[h];if(k)for(var n in k)$jscomp.owns(k,n)&&(d[n]=k[n])}return d}},"es6-impl","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0; $jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++};$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}}; $jscomp.arrayIterator=function(e){var d=0;return $jscomp.iteratorPrototype(function(){return d<e.length?{done:!1,value:e[d++]}:{done:!0}})};$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.makeIterator=function(e){$jscomp.initSymbolIterator();var d=e[Symbol.iterator];return d?d.call(e):$jscomp.arrayIterator(e)};$jscomp.EXPOSE_ASYNC_EXECUTOR=!0;$jscomp.FORCE_POLYFILL_PROMISE=!1; $jscomp.polyfill("Promise",function(e){function d(){this.batch_=null}if(e&&!$jscomp.FORCE_POLYFILL_PROMISE)return e;d.prototype.asyncExecute=function(d){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(d);return this};d.prototype.asyncExecuteBatch_=function(){var d=this;this.asyncExecuteFunction(function(){d.executeBatch_()})};var k=$jscomp.global.setTimeout;d.prototype.asyncExecuteFunction=function(d){k(d,0)};d.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var d= this.batch_;this.batch_=[];for(var e=0;e<d.length;++e){var m=d[e];delete d[e];try{m()}catch(G){this.asyncThrow_(G)}}}this.batch_=null};d.prototype.asyncThrow_=function(d){this.asyncExecuteFunction(function(){throw d;})};var h=function(d){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var e=this.createResolveAndReject_();try{d(e.resolve,e.reject)}catch(m){e.reject(m)}};h.prototype.createResolveAndReject_=function(){function d(d){return function(n){m||(m=!0,d.call(e,n))}}var e=this,m= !1;return{resolve:d(this.resolveTo_),reject:d(this.reject_)}};h.prototype.resolveTo_=function(d){if(d===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(d instanceof h)this.settleSameAsPromise_(d);else{var e;a:switch(typeof d){case "object":e=null!=d;break a;case "function":e=!0;break a;default:e=!1}e?this.resolveToNonPromiseObj_(d):this.fulfill_(d)}};h.prototype.resolveToNonPromiseObj_=function(d){var e=void 0;try{e=d.then}catch(m){this.reject_(m);return}"function"== typeof e?this.settleSameAsThenable_(e,d):this.fulfill_(d)};h.prototype.reject_=function(d){this.settle_(2,d)};h.prototype.fulfill_=function(d){this.settle_(1,d)};h.prototype.settle_=function(d,e){if(0!=this.state_)throw Error("Cannot settle("+d+", "+e|"): Promise already settled in state"+this.state_);this.state_=d;this.result_=e;this.executeOnSettledCallbacks_()};h.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var d=this.onSettledCallbacks_,e=0;e<d.length;++e)d[e].call(), d[e]=null;this.onSettledCallbacks_=null}};var y=new d;h.prototype.settleSameAsPromise_=function(d){var e=this.createResolveAndReject_();d.callWhenSettled_(e.resolve,e.reject)};h.prototype.settleSameAsThenable_=function(d,e){var m=this.createResolveAndReject_();try{d.call(e,m.resolve,m.reject)}catch(G){m.reject(G)}};h.prototype.then=function(d,e){function m(d,e){return"function"==typeof d?function(e){try{k(d(e))}catch(B){n(B)}}:e}var k,n,O=new h(function(d,e){k=d;n=e});this.callWhenSettled_(m(d,k), m(e,n));return O};h.prototype.catch=function(d){return this.then(void 0,d)};h.prototype.callWhenSettled_=function(d,e){function m(){switch(h.state_){case 1:d(h.result_);break;case 2:e(h.result_);break;default:throw Error("Unexpected state: "+h.state_);}}var h=this;null==this.onSettledCallbacks_?y.asyncExecute(m):this.onSettledCallbacks_.push(function(){y.asyncExecute(m)})};h.resolve=function(d){return d instanceof h?d:new h(function(e,m){e(d)})};h.reject=function(d){return new h(function(e,m){m(d)})}; h.race=function(d){return new h(function(e,m){for(var k=$jscomp.makeIterator(d),n=k.next();!n.done;n=k.next())h.resolve(n.value).callWhenSettled_(e,m)})};h.all=function(d){var e=$jscomp.makeIterator(d),m=e.next();return m.done?h.resolve([]):new h(function(d,k){function n(e){return function(m){G[e]=m;P--;0==P&&d(G)}}var G=[],P=0;do G.push(void 0),P++,h.resolve(m.value).callWhenSettled_(n(G.length-1),k),m=e.next();while(!m.done)})};$jscomp.EXPOSE_ASYNC_EXECUTOR&&(h.$jscomp$new$AsyncExecutor=function(){return new d}); return h},"es6-impl","es3"); $jscomp.polyfill("WeakMap",function(e){function d(d){$jscomp.owns(d,h)||$jscomp.defineProperty(d,h,{value:{}})}function k(e){var m=Object[e];m&&(Object[e]=function(e){d(e);return m(e)})}if(function(){if(!e||!Object.seal)return!1;try{var d=Object.seal({}),m=Object.seal({}),h=new e([[d,2],[m,3]]);if(2!=h.get(d)||3!=h.get(m))return!1;h.delete(d);h.set(m,4);return!h.has(d)&&4==h.get(m)}catch(P){return!1}}())return e;var h="$jscomp_hidden_"+Math.random().toString().substring(2);k("freeze");k("preventExtensions"); k("seal");var y=0,n=function(d){this.id_=(y+=Math.random()+1).toString();if(d){$jscomp.initSymbol();$jscomp.initSymbolIterator();d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)e=e.value,this.set(e[0],e[1])}};n.prototype.set=function(e,m){d(e);if(!$jscomp.owns(e,h))throw Error("WeakMap key fail: "+e);e[h][this.id_]=m;return this};n.prototype.get=function(d){return $jscomp.owns(d,h)?d[h][this.id_]:void 0};n.prototype.has=function(d){return $jscomp.owns(d,h)&&$jscomp.owns(d[h],this.id_)};n.prototype.delete= function(d){return $jscomp.owns(d,h)&&$jscomp.owns(d[h],this.id_)?delete d[h][this.id_]:!1};return n},"es6-impl","es3");$jscomp.ASSUME_NO_NATIVE_MAP=!1; $jscomp.polyfill("Map",function(e){if(!$jscomp.ASSUME_NO_NATIVE_MAP&&function(){if(!e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var d=Object.seal({x:4}),h=new e($jscomp.makeIterator([[d,"s"]]));if("s"!=h.get(d)||1!=h.size||h.get({x:4})||h.set({x:4},"t")!=h||2!=h.size)return!1;var k=h.entries(),n=k.next();if(n.done||n.value[0]!=d||"s"!=n.value[1])return!1;n=k.next();return n.done||4!=n.value[0].x||"t"!=n.value[1]||!k.next().done?!1:!0}catch(la){return!1}}())return e;$jscomp.initSymbol(); $jscomp.initSymbolIterator();var d=new WeakMap,k=function(d){this.data_={};this.head_=n();this.size=0;if(d){d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)e=e.value,this.set(e[0],e[1])}};k.prototype.set=function(d,e){var m=h(this,d);m.list||(m.list=this.data_[m.id]=[]);m.entry?m.entry.value=e:(m.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:d,value:e},m.list.push(m.entry),this.head_.previous.next=m.entry,this.head_.previous=m.entry,this.size++);return this};k.prototype.delete= function(d){d=h(this,d);return d.entry&&d.list?(d.list.splice(d.index,1),d.list.length||delete this.data_[d.id],d.entry.previous.next=d.entry.next,d.entry.next.previous=d.entry.previous,d.entry.head=null,this.size--,!0):!1};k.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=n();this.size=0};k.prototype.has=function(d){return!!h(this,d).entry};k.prototype.get=function(d){return(d=h(this,d).entry)&&d.value};k.prototype.entries=function(){return y(this,function(d){return[d.key, d.value]})};k.prototype.keys=function(){return y(this,function(d){return d.key})};k.prototype.values=function(){return y(this,function(d){return d.value})};k.prototype.forEach=function(d,e){for(var h=this.entries(),k;!(k=h.next()).done;)k=k.value,d.call(e,k[1],k[0],this)};k.prototype[Symbol.iterator]=k.prototype.entries;var h=function(e,h){var k;k=h&&typeof h;"object"==k||"function"==k?d.has(h)?k=d.get(h):(k=""+ ++O,d.set(h,k)):k="p_"+h;var m=e.data_[k];if(m&&$jscomp.owns(e.data_,k))for(e=0;e<m.length;e++){var n= m[e];if(h!==h&&n.key!==n.key||h===n.key)return{id:k,list:m,index:e,entry:n}}return{id:k,list:m,index:-1,entry:void 0}},y=function(d,e){var h=d.head_;return $jscomp.iteratorPrototype(function(){if(h){for(;h.head!=d.head_;)h=h.previous;for(;h.next!=h.head;)return h=h.next,{done:!1,value:e(h)};h=null}return{done:!0,value:void 0}})},n=function(){var d={};return d.previous=d.next=d.head=d},O=0;return k},"es6-impl","es3");$jscomp.array=$jscomp.array||{}; $jscomp.iteratorFromArray=function(e,d){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var k=0,h={next:function(){if(k<e.length){var y=k++;return{value:d(y,e[y]),done:!1}}h.next=function(){return{done:!0,value:void 0}};return h.next()}};h[Symbol.iterator]=function(){return h};return h};$jscomp.polyfill("Array.prototype.values",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(d,e){return e})}},"es6","es3"); $jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6-impl","es3");$jscomp.ASSUME_NO_NATIVE_SET=!1; $jscomp.polyfill("Set",function(e){if(!$jscomp.ASSUME_NO_NATIVE_SET&&function(){if(!e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var d=Object.seal({x:4}),h=new e($jscomp.makeIterator([d]));if(!h.has(d)||1!=h.size||h.add(d)!=h||1!=h.size||h.add({x:4})!=h||2!=h.size)return!1;var y=h.entries(),n=y.next();if(n.done||n.value[0]!=d||n.value[1]!=d)return!1;n=y.next();return n.done||n.value[0]==d||4!=n.value[0].x||n.value[1]!=n.value[0]?!1:y.next().done}catch(O){return!1}}())return e; $jscomp.initSymbol();$jscomp.initSymbolIterator();var d=function(d){this.map_=new Map;if(d){d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)this.add(e.value)}this.size=this.map_.size};d.prototype.add=function(d){this.map_.set(d,d);this.size=this.map_.size;return this};d.prototype.delete=function(d){d=this.map_.delete(d);this.size=this.map_.size;return d};d.prototype.clear=function(){this.map_.clear();this.size=0};d.prototype.has=function(d){return this.map_.has(d)};d.prototype.entries=function(){return this.map_.entries()}; d.prototype.values=function(){return this.map_.values()};d.prototype.keys=d.prototype.values;d.prototype[Symbol.iterator]=d.prototype.values;d.prototype.forEach=function(d,e){var h=this;this.map_.forEach(function(k){return d.call(e,k,k,h)})};return d},"es6-impl","es3"); (function(e,d){"object"===typeof exports&&"undefined"!==typeof module?d(exports):"function"===typeof define&&define.amd?define(["exports"],d):d(e.rxjs=e.rxjs||{})})(this,function(e){function d(c,a){function b(){this.constructor=c}Mb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function k(c){return"function"===typeof c}function h(c){setTimeout(function(){throw c;})}function y(){try{return La.apply(this,arguments)}catch(c){return q.e=c,q}}function n(c){La=c;return y}function O(c){return c.reduce(function(a, b){return a.concat(b instanceof ea?b.errors:b)},[])}function m(){}function G(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return P(c)}function P(c){return c?1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}:m}function Ka(c){c||(c=H.Promise||Promise);if(!c)throw Error("no Promise impl found");return c}function la(){return function(c){return c.lift(new Nb(c))}}function I(c){return c?Lb(c):Q}function Lb(c){return new r(function(a){return c.schedule(function(){return a.complete()})})} function B(c){return c&&"function"===typeof c.schedule}function J(c,a){return a?new r(function(b){var f=new w,g=0;f.add(a.schedule(function(){g===c.length?b.complete():(b.next(c[g++]),b.closed||f.add(this.schedule()))}));return f}):new r(Ma(c))}function ta(c){var a=new r(function(b){b.next(c);b.complete()});a._isScalar=!0;a.value=c;return a}function ua(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];B(a)?c.pop():a=void 0;switch(c.length){case 0:return I(a);case 1:return a? J(c,a):ta(c[0]);default:return J(c,a)}}function va(c,a){return a?new r(function(b){return a.schedule(Ob,0,{error:c,subscriber:b})}):new r(function(b){return b.error(c)})}function Ob(c){c.subscriber.error(c.error)}function R(c){return c}function F(c,a){return function(b){if("function"!==typeof c)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return b.lift(new Pb(c,a))}}function Na(c,a,b){if(a)if(B(a))b=a;else return function(){for(var f=[],g=0;g<arguments.length;g++)f[g]= arguments[g];return Na(c,b).apply(void 0,f).pipe(F(function(b){return D(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];var l=this,d,e={context:l,subject:d,callbackFunc:c,scheduler:b};return new r(function(f){if(b)return b.schedule(Qb,0,{args:a,subscriber:f,params:e});if(!d){d=new Y;try{c.apply(l,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];d.next(1>=b.length?b[0]:b);d.complete()}]))}catch(xa){d.error(xa)}}return d.subscribe(f)})}} function Qb(c){var a=this,b=c.args,f=c.subscriber;c=c.params;var g=c.callbackFunc,l=c.context,d=c.scheduler,e=c.subject;if(!e){e=c.subject=new Y;try{g.apply(l,b.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];a.add(d.schedule(Rb,0,{value:1>=b.length?b[0]:b,subject:e}))}]))}catch(S){e.error(S)}}this.add(e.subscribe(f))}function Rb(c){var a=c.subject;a.next(c.value);a.complete()}function Oa(c,a,b){if(a)if(B(a))b=a;else return function(){for(var f=[],g=0;g<arguments.length;g++)f[g]= arguments[g];return Oa(c,b).apply(void 0,f).pipe(F(function(b){return D(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];var l={subject:void 0,args:a,callbackFunc:c,scheduler:b,context:this};return new r(function(f){var g=l.context,d=l.subject;if(b)return b.schedule(Sb,0,{params:l,subscriber:f,context:g});if(!d){d=l.subject=new Y;try{c.apply(g,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];(a=b.shift())?d.error(a): (d.next(1>=b.length?b[0]:b),d.complete())}]))}catch(xa){d.error(xa)}}return d.subscribe(f)})}}function Sb(c){var a=this,b=c.params,f=c.subscriber;c=c.context;var g=b.callbackFunc,l=b.args,d=b.scheduler,e=b.subject;if(!e){e=b.subject=new Y;try{g.apply(c,l.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];(c=b.shift())?a.add(d.schedule(Pa,0,{err:c,subject:e})):a.add(d.schedule(Tb,0,{value:1>=b.length?b[0]:b,subject:e}))}]))}catch(S){this.add(d.schedule(Pa,0,{err:S,subject:e}))}}this.add(e.subscribe(f))} function Tb(c){var a=c.subject;a.next(c.value);a.complete()}function Pa(c){c.subject.error(c.err)}function Qa(c){return c&&"function"!==typeof c.subscribe&&"function"===typeof c.then}function u(c,a,b,f){c=new Ub(c,b,f);return Ra(a)(c)}function Vb(c,a){return a?new r(function(b){var f=new w;f.add(a.schedule(function(){return c.then(function(c){f.add(a.schedule(function(){b.next(c);f.add(a.schedule(function(){return b.complete()}))}))},function(c){f.add(a.schedule(function(){return b.error(c)}))})})); return f}):new r(Sa(c))}function Wb(c,a){if(!c)throw Error("Iterable cannot be null");return a?new r(function(b){var f=new w,g;f.add(function(){g&&"function"===typeof g.return&&g.return()});f.add(a.schedule(function(){g=c[K]();f.add(a.schedule(function(){if(!b.closed){var a,c;try{var f=g.next();a=f.value;c=f.done}catch(S){b.error(S);return}c?b.complete():(b.next(a),this.schedule())}}))}));return f}):new r(Ta(c))}function Xb(c,a){return a?new r(function(b){var f=new w;f.add(a.schedule(function(){var g= c[Z]();f.add(g.subscribe({next:function(c){f.add(a.schedule(function(){return b.next(c)}))},error:function(c){f.add(a.schedule(function(){return b.error(c)}))},complete:function(){f.add(a.schedule(function(){return b.complete()}))}}))}));return f}):new r(Ua(c))}function L(c,a){if(!a)return c instanceof r?c:new r(Ra(c));if(null!=c){if(c&&"function"===typeof c[Z])return Xb(c,a);if(Qa(c))return Vb(c,a);if(Va(c))return J(c,a);if(c&&"function"===typeof c[K]||"string"===typeof c)return Wb(c,a)}throw new TypeError((null!== c&&typeof c||c)+" is not observable");}function T(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(f){return f.pipe(T(function(b,f){return L(c(b,f)).pipe(F(function(c,g){return a(b,c,f,g)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new Yb(c,b))}}function ya(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return T(R,c)}function Wa(){return ya(1)}function M(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return 1===c.length||2=== c.length&&B(c[1])?L(c[0]):Wa()(ua.apply(void 0,c))}function za(c){return new r(function(a){var b;try{b=c()}catch(f){a.error(f);return}return(b?L(b):I()).subscribe(a)})}function Xa(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b;"function"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&D(c[0])&&(c=c[0]);return 0===c.length?Q:b?Xa(c).pipe(F(function(a){return b.apply(void 0,a)})):new r(function(b){return new Zb(b,c)})}function Ya(c,a,b,f){k(b)&&(f=b,b=void 0);return f?Ya(c,a,b).pipe(F(function(b){return D(b)? f.apply(void 0,b):f(b)})):new r(function(f){Za(c,a,function(b){1<arguments.length?f.next(Array.prototype.slice.call(arguments)):f.next(b)},f,b)})}function Za(c,a,b,f,g){var l;if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(a,b,g),l=function(){return c.removeEventListener(a,b,g)};else if(c&&"function"===typeof c.on&&"function"===typeof c.off)c.on(a,b),l=function(){return c.off(a,b)};else if(c&&"function"===typeof c.addListener&&"function"=== typeof c.removeListener)c.addListener(a,b),l=function(){return c.removeListener(a,b)};else if(c&&c.length)for(var d=0,e=c.length;d<e;d++)Za(c[d],a,b,f,g);else throw new TypeError("Invalid event target");f.add(l)}function $a(c,a,b){return b?$a(c,a).pipe(F(function(a){return D(a)?b.apply(void 0,a):b(a)})):new r(function(b){var f=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return b.next(1===a.length?a[0]:a)},l;try{l=c(f)}catch(x){b.error(x);return}if(k(a))return function(){return a(f, l)}})}function $b(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=c.iterate(c.state)}catch(l){a.error(l);return}else c.needIterate=!0;if(b){var f=void 0;try{f=b(c.state)}catch(l){a.error(l);return}if(!f){a.complete();return}if(a.closed)return}var g;try{g=c.resultSelector(c.state)}catch(l){a.error(l);return}if(!a.closed&&(a.next(g),!a.closed))return this.schedule(c)}}function aa(c){return!D(c)&&0<=c-parseFloat(c)+1}function ac(c){var a=c.subscriber,b=c.counter;c=c.period; a.next(b);this.schedule({subscriber:a,counter:b+1,period:c},c)}function ab(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var a=Number.POSITIVE_INFINITY,b=null,f=c[c.length-1];B(f)?(b=c.pop(),1<c.length&&"number"===typeof c[c.length-1]&&(a=c.pop())):"number"===typeof f&&(a=c.pop());return null===b&&1===c.length&&c[0]instanceof r?c[0]:ya(a)(J(c,b))}function Aa(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(0===c.length)return Q;var b=c[0],f=c.slice(1);return 1===c.length&& D(b)?Aa.apply(void 0,b):new r(function(a){var c=function(){return a.add(Aa.apply(void 0,f).subscribe(a))};return L(b).subscribe({next:function(b){a.next(b)},error:c,complete:c})})}function bc(c){var a=c.keys,b=c.index,f=c.subscriber,g=c.subscription;c=c.obj;if(!f.closed)if(b<a.length){var l=a[b];f.next([l,c[l]]);g.add(this.schedule({keys:a,index:b+1,subscriber:f,subscription:g,obj:c}))}else f.complete()}function bb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(D(c[0]))c= c[0];else return c[0];return J(c,void 0).lift(new cc)}function dc(c){var a=c.start,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a),f.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))}function cb(c,a,b){void 0===c&&(c=0);var f=-1;aa(a)?f=1>Number(a)&&1||Number(a):B(a)&&(b=a);B(b)||(b=C);return new r(function(a){var g=aa(c)?c:+c-b.now();return b.schedule(ec,g,{index:0,period:f,subscriber:a})})}function ec(c){var a=c.index,b=c.period,f=c.subscriber;f.next(a);if(!f.closed){if(-1===b)return f.complete(); c.index=a+1;this.schedule(c,b)}}function db(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];"function"===typeof a&&c.pop();return J(c,void 0).lift(new eb(a))}function fb(c){return function(a){return a.lift(new fc(c))}}function gb(c){var a=c.subscriber,b=c.context;b&&a.closeContext(b);a.closed||(c.context=a.openContext(),c.context.closeAction=this.schedule(c,c.bufferTimeSpan))}function gc(c){var a=c.bufferCreationInterval,b=c.bufferTimeSpan,f=c.subscriber,g=c.scheduler, l=f.openContext();f.closed||(f.add(l.closeAction=g.schedule(hb,b,{subscriber:f,context:l})),this.schedule(c,a))}function hb(c){c.subscriber.closeContext(c.context)}function ib(c,a){return T(c,a,1)}function hc(c){c.debouncedNext()}function fa(c){void 0===c&&(c=null);return function(a){return a.lift(new ic(c))}}function jb(c,a){return function(b){return b.lift(new jc(c,a))}}function ba(c,a){return function(b){return b.lift(new kc(c,a))}}function kb(c,a,b){return function(f){return f.lift(new lc(c,a, b))}}function mc(){return new ga}function Ba(c){return function(a){return 0===c?I():a.lift(new nc(c))}}function lb(c,a){return a?function(b){return b.pipe(lb(function(b,g){return L(c(b,g)).pipe(F(function(c,f){return a(b,c,g,f)}))}))}:function(b){return b.lift(new oc(c))}}function ma(c){return function(a){return 0===c?I():a.lift(new pc(c))}}function na(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(f){return f.lift(new qc(c,a,b))}}function oa(c,a){return 2<=arguments.length?function(b){return G(na(c, a),ma(1),fa(a))(b)}:function(b){return G(na(function(b,a,l){return c(b,a,l+1)}),ma(1))(b)}}function U(c,a){return function(b){var f;f="function"===typeof c?c:function(){return c};if("function"===typeof a)return b.lift(new rc(f,a));var g=Object.create(b,sc);g.source=b;g.subjectFactory=f;return g}}function tc(c,a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function uc(c,a){return function(b){var f=b;for(b=0;b<a;b++)if(f=f[c[b]],"undefined"===typeof f)return; return f}}function vc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function wc(){return new z}function xc(c,a,b){var f,g=0,l,d=!1,e=!1;return function(x){g++;if(!f||d)d=!1,f=new V(c,a,b),l=x.subscribe({next:function(b){f.next(b)},error:function(b){d=!0;f.error(b)},complete:function(){e=!0;f.complete()}});var h=f.subscribe(this);return function(){g--;h.unsubscribe();l&&0===g&&e&&l.unsubscribe()}}}function ha(c,a){return"function"===typeof a?function(b){return b.pipe(ha(function(b, g){return L(c(b,g)).pipe(F(function(c,f){return a(b,c,g,f)}))}))}:function(b){return b.lift(new yc(c))}}function zc(c){c.subscriber.clearThrottle()}function mb(c,a,b){void 0===b&&(b=C);return function(f){var g=c instanceof Date&&!isNaN(+c),l=g?+c-b.now():Math.abs(c);return f.lift(new Ac(l,g,a,b))}}function Bc(c,a,b){if(0===b)return[a];c.push(a);return c}function Cc(c){var a=c.subscriber,b=c.windowTimeSpan,f=c.window;f&&a.closeWindow(f);c.window=a.openWindow();this.schedule(c,b)}function Dc(c){var a= c.windowTimeSpan,b=c.subscriber,f=c.scheduler,g=c.windowCreationInterval,l=b.openWindow(),d={action:this,subscription:null};d.subscription=f.schedule(nb,a,{subscriber:b,window:l,context:d});this.add(d.subscription);this.schedule(c,g)}function nb(c){var a=c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function ob(c,a){for(var b=0,f=a.length;b<f;b++)for(var g=a[b],l=Object.getOwnPropertyNames(g.prototype),d=0,e=l.length;d<e;d++){var h= l[d];c.prototype[h]=g.prototype[h]}}function Ec(c,a){void 0===a&&(a=null);return new W({method:"GET",url:c,headers:a})}function Fc(c,a,b){return new W({method:"POST",url:c,body:a,headers:b})}function Gc(c,a){return new W({method:"DELETE",url:c,headers:a})}function Hc(c,a,b){return new W({method:"PUT",url:c,body:a,headers:b})}function Ic(c,a,b){return new W({method:"PATCH",url:c,body:a,headers:b})}function Jc(c,a){return Kc(new W({method:"GET",url:c,responseType:"json",headers:a}))}function pb(c,a){switch(c){case "json":return"response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null");case "xml":return a.responseXML;default:return"response"in a?a.response:a.responseText}}var Mb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},Lc=Object.assign||function(c){for(var a,b=1,f=arguments.length;b<f;b++){a=arguments[b];for(var g in a)Object.prototype.hasOwnProperty.call(a,g)&&(c[g]= a[g])}return c},Ca=!1,H={Promise:void 0,set useDeprecatedSynchronousErrorHandling(c){c?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):Ca&&console.log("RxJS: Back to a better error behavior. Thank you. \x3c3");Ca=c},get useDeprecatedSynchronousErrorHandling(){return Ca}},pa={closed:!0,next:function(c){},error:function(c){if(H.useDeprecatedSynchronousErrorHandling)throw c;h(c)},complete:function(){}},D=Array.isArray||function(c){return c&& "number"===typeof c.length},q={e:{}},La,ea=function(c){function a(b){var f=c.call(this,b?b.length+" errors occurred during unsubscription:\n "+b.map(function(b,a){return a+1+") "+b.toString()}).join("\n "):"")||this;f.errors=b;f.name="UnsubscriptionError";Object.setPrototypeOf(f,a.prototype);return f}d(a,c);return a}(Error),w=function(){function c(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}c.prototype.unsubscribe=function(){var a=!1,b;if(!this.closed){var c= this._parent,g=this._parents,l=this._unsubscribe,d=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var e=-1,h=g?g.length:0;c;)c.remove(this),c=++e<h&&g[e]||null;k(l)&&(c=n(l).call(this),c===q&&(a=!0,b=b||(q.e instanceof ea?O(q.e.errors):[q.e])));if(D(d))for(e=-1,h=d.length;++e<h;)c=d[e],null!=c&&"object"===typeof c&&(c=n(c.unsubscribe).call(c),c===q&&(a=!0,b=b||[],c=q.e,c instanceof ea?b=b.concat(O(c.errors)):b.push(c)));if(a)throw new ea(b);}};c.prototype.add= function(a){if(!a||a===c.EMPTY)return c.EMPTY;if(a===this)return this;var b=a;switch(typeof a){case "function":b=new c(a);case "object":if(b.closed||"function"!==typeof b.unsubscribe)return b;if(this.closed)return b.unsubscribe(),b;"function"!==typeof b._addParent&&(a=b,b=new c,b._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}(this._subscriptions||(this._subscriptions=[])).push(b);b._addParent(this);return b};c.prototype.remove=function(a){var b= this._subscriptions;b&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))};c.prototype._addParent=function(a){var b=this._parent,c=this._parents;b&&b!==a?c?-1===c.indexOf(a)&&c.push(a):this._parents=[a]:this._parent=a};c.EMPTY=function(a){a.closed=!0;return a}(new c);return c}(),ca="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("rxSubscriber"):"@@rxSubscriber",p=function(c){function a(b,a,g){var f=c.call(this)||this;f.syncErrorValue=null;f.syncErrorThrown=!1;f.syncErrorThrowable=!1;f.isStopped= !1;switch(arguments.length){case 0:f.destination=pa;break;case 1:if(!b){f.destination=pa;break}if("object"===typeof b){if(b instanceof p||"syncErrorThrowable"in b&&b[ca]){var d=b[ca]();f.syncErrorThrowable=d.syncErrorThrowable;f.destination=d;d.add(f)}else f.syncErrorThrowable=!0,f.destination=new qb(f,b);break}default:f.syncErrorThrowable=!0,f.destination=new qb(f,b,a,g)}return f}d(a,c);a.prototype[ca]=function(){return this};a.create=function(b,c,g){b=new a(b,c,g);b.syncErrorThrowable=!1;return b}; a.prototype.next=function(b){this.isStopped||this._next(b)};a.prototype.error=function(b){this.isStopped||(this.isStopped=!0,this._error(b))};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,c.prototype.unsubscribe.call(this))};a.prototype._next=function(b){this.destination.next(b)};a.prototype._error=function(b){this.destination.error(b);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete(); this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var b=this._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=b;this._parents=a;return this};return a}(w),qb=function(c){function a(b,a,g,l){var f=c.call(this)||this;f._parentSubscriber=b;var d;b=f;k(a)?d=a:a&&(d=a.next,g=a.error,l=a.complete,a!==pa&&(b=Object.create(a),k(b.unsubscribe)&&f.add(b.unsubscribe.bind(b)),b.unsubscribe=f.unsubscribe.bind(f)));f._context=b; f._next=d;f._error=g;f._complete=l;return f}d(a,c);a.prototype.next=function(b){if(!this.isStopped&&this._next){var a=this._parentSubscriber;H.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,this._next,b)&&this.unsubscribe():this.__tryOrUnsub(this._next,b)}};a.prototype.error=function(b){if(!this.isStopped){var a=this._parentSubscriber,c=H.useDeprecatedSynchronousErrorHandling;if(this._error)c&&a.syncErrorThrowable?this.__tryOrSetError(a,this._error,b):this.__tryOrUnsub(this._error, b),this.unsubscribe();else if(a.syncErrorThrowable)c?(a.syncErrorValue=b,a.syncErrorThrown=!0):h(b),this.unsubscribe();else{this.unsubscribe();if(c)throw b;h(b)}}};a.prototype.complete=function(){var b=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var c=function(){return b._complete.call(b._context)};H.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,c):this.__tryOrUnsub(c)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(b,a){try{b.call(this._context, a)}catch(g){this.unsubscribe();if(H.useDeprecatedSynchronousErrorHandling)throw g;h(g)}};a.prototype.__tryOrSetError=function(b,a,c){if(!H.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{a.call(this._context,c)}catch(l){return H.useDeprecatedSynchronousErrorHandling?(b.syncErrorValue=l,b.syncErrorThrown=!0):h(l),!0}return!1};a.prototype._unsubscribe=function(){var b=this._parentSubscriber;this._parentSubscriber=this._context=null;b.unsubscribe()};return a}(p),Z="function"===typeof Symbol&& Symbol.observable||"@@observable",r=function(){function c(a){this._isScalar=!1;a&&(this._subscribe=a)}c.prototype.lift=function(a){var b=new c;b.source=this;b.operator=a;return b};c.prototype.subscribe=function(a,b,c){var f=this.operator;a:{if(a){if(a instanceof p)break a;if(a[ca]){a=a[ca]();break a}}a=a||b||c?new p(a,b,c):new p(pa)}f?f.call(a,this.source):a.add(this.source||H.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a));if(H.useDeprecatedSynchronousErrorHandling&& a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};c.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(b){H.useDeprecatedSynchronousErrorHandling&&(a.syncErrorThrown=!0,a.syncErrorValue=b),a.error(b)}};c.prototype.forEach=function(a,b){var c=this;b=Ka(b);return new b(function(b,f){var g;g=c.subscribe(function(b){try{a(b)}catch(S){f(S),g&&g.unsubscribe()}},f,b)})};c.prototype._subscribe=function(a){var b=this.source;return b&&b.subscribe(a)}; c.prototype[Z]=function(){return this};c.prototype.pipe=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return 0===a.length?this:P(a)(this)};c.prototype.toPromise=function(a){var b=this;a=Ka(a);return new a(function(a,c){var f;b.subscribe(function(b){return f=b},function(b){return c(b)},function(){return a(f)})})};c.create=function(a){return new c(a)};return c}(),N=function(c){function a(){var b=c.call(this,"object unsubscribed")||this;b.name="ObjectUnsubscribedError";Object.setPrototypeOf(b, a.prototype);return b}d(a,c);return a}(Error),rb=function(c){function a(b,a){var f=c.call(this)||this;f.subject=b;f.subscriber=a;f.closed=!1;return f}d(a,c);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var b=this.subject,a=b.observers;this.subject=null;!a||0===a.length||b.isStopped||b.closed||(b=a.indexOf(this.subscriber),-1!==b&&a.splice(b,1))}};return a}(w),sb=function(c){function a(b){var a=c.call(this,b)||this;a.destination=b;return a}d(a,c);return a}(p),z=function(c){function a(){var b= c.call(this)||this;b.observers=[];b.closed=!1;b.isStopped=!1;b.hasError=!1;b.thrownError=null;return b}d(a,c);a.prototype[ca]=function(){return new sb(this)};a.prototype.lift=function(b){var a=new Da(this,this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new N;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(),l=0;l<c;l++)a[l].next(b)};a.prototype.error=function(b){if(this.closed)throw new N;this.hasError=!0;this.thrownError=b;this.isStopped=!0;for(var a= this.observers,c=a.length,a=a.slice(),l=0;l<c;l++)a[l].error(b);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new N;this.isStopped=!0;for(var b=this.observers,a=b.length,b=b.slice(),c=0;c<a;c++)b[c].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(b){if(this.closed)throw new N;return c.prototype._trySubscribe.call(this,b)};a.prototype._subscribe=function(b){if(this.closed)throw new N; if(this.hasError)return b.error(this.thrownError),w.EMPTY;if(this.isStopped)return b.complete(),w.EMPTY;this.observers.push(b);return new rb(this,b)};a.prototype.asObservable=function(){var b=new r;b.source=this;return b};a.create=function(b,a){return new Da(b,a)};return a}(r),Da=function(c){function a(b,a){var f=c.call(this)||this;f.destination=b;f.source=a;return f}d(a,c);a.prototype.next=function(b){var a=this.destination;a&&a.next&&a.next(b)};a.prototype.error=function(b){var a=this.destination; a&&a.error&&this.destination.error(b)};a.prototype.complete=function(){var b=this.destination;b&&b.complete&&this.destination.complete()};a.prototype._subscribe=function(b){return this.source?this.source.subscribe(b):w.EMPTY};return a}(z),Nb=function(){function c(a){this.connectable=a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Mc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(),Mc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable= a;return b}d(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a}(p),tb=function(c){function a(b,a){var f=c.call(this)||this;f.source=b;f.subjectFactory=a;f._refCount=0;f._isComplete=!1;return f}d(a,c);a.prototype._subscribe=function(b){return this.getSubject().subscribe(b)}; a.prototype.getSubject=function(){var b=this._subject;if(!b||b.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect=function(){var b=this._connection;b||(this._isComplete=!1,b=this._connection=new w,b.add(this.source.subscribe(new Nc(this.getSubject(),this))),b.closed?(this._connection=null,b=w.EMPTY):this._connection=b);return b};a.prototype.refCount=function(){return la()(this)};return a}(r),ia=tb.prototype,sc={operator:{value:null},_refCount:{value:0,writable:!0}, _subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:ia._subscribe},_isComplete:{value:ia._isComplete,writable:!0},getSubject:{value:ia.getSubject},connect:{value:ia.connect},refCount:{value:ia.refCount}},Nc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}d(a,c);a.prototype._error=function(b){this._unsubscribe();c.prototype._error.call(this,b)};a.prototype._complete=function(){this.connectable._isComplete=!0;this._unsubscribe();c.prototype._complete.call(this)}; a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._connection;b._refCount=0;b._subject=null;b._connection=null;a&&a.unsubscribe()}};return a}(sb);(function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}d(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null, !b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a})(p);var Pc=function(){function c(a,b,c,g){this.keySelector=a;this.elementSelector=b;this.durationSelector=c;this.subjectSelector=g}c.prototype.call=function(a,b){return b.subscribe(new Oc(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Oc=function(c){function a(b,a,g,l,d){b=c.call(this,b)||this;b.keySelector=a;b.elementSelector=g;b.durationSelector=l;b.subjectSelector=d;b.groups= null;b.attemptedToUnsubscribe=!1;b.count=0;return b}d(a,c);a.prototype._next=function(b){var a;try{a=this.keySelector(b)}catch(g){this.error(g);return}this._group(b,a)};a.prototype._group=function(b,a){var c=this.groups;c||(c=this.groups=new Map);var f=c.get(a),d;if(this.elementSelector)try{d=this.elementSelector(b)}catch(wa){this.error(wa)}else d=b;if(!f&&(f=this.subjectSelector?this.subjectSelector():new z,c.set(a,f),b=new Ea(a,f,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b= this.durationSelector(new Ea(a,f))}catch(wa){this.error(wa);return}this.add(b.subscribe(new Qc(a,f,this)))}f.closed||f.next(d)};a.prototype._error=function(b){var a=this.groups;a&&(a.forEach(function(a,c){a.error(b)}),a.clear());this.destination.error(b)};a.prototype._complete=function(){var b=this.groups;b&&(b.forEach(function(b,a){b.complete()}),b.clear());this.destination.complete()};a.prototype.removeGroup=function(b){this.groups.delete(b)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe= !0,0===this.count&&c.prototype.unsubscribe.call(this))};return a}(p),Qc=function(c){function a(b,a,g){var f=c.call(this,a)||this;f.key=b;f.group=a;f.parent=g;return f}d(a,c);a.prototype._next=function(b){this.complete()};a.prototype._unsubscribe=function(){var b=this.parent,a=this.key;this.key=this.parent=null;b&&b.removeGroup(a)};return a}(p),Ea=function(c){function a(b,a,g){var f=c.call(this)||this;f.key=b;f.groupSubject=a;f.refCountSubscription=g;return f}d(a,c);a.prototype._subscribe=function(b){var a= new w,c=this.refCountSubscription,l=this.groupSubject;c&&!c.closed&&a.add(new Rc(c));a.add(l.subscribe(b));return a};return a}(r),Rc=function(c){function a(b){var a=c.call(this)||this;a.parent=b;b.count++;return a}d(a,c);a.prototype.unsubscribe=function(){var b=this.parent;b.closed||this.closed||(c.prototype.unsubscribe.call(this),--b.count,0===b.count&&b.attemptedToUnsubscribe&&b.unsubscribe())};return a}(w),ub=function(c){function a(b){var a=c.call(this)||this;a._value=b;return a}d(a,c);Object.defineProperty(a.prototype, "value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe=function(b){var a=c.prototype._subscribe.call(this,b);a&&!a.closed&&b.next(this._value);return a};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new N;return this._value};a.prototype.next=function(b){c.prototype.next.call(this,this._value=b)};return a}(z),ja=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;f.pending=!1; return f}d(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(this.closed)return this;this.state=b;b=this.id;var c=this.scheduler;null!=b&&(this.id=this.recycleAsyncId(c,b,a));this.pending=!0;this.delay=a;this.id=this.id||this.requestAsyncId(c,this.id,a);return this};a.prototype.requestAsyncId=function(b,a,c){void 0===c&&(c=0);return setInterval(b.flush.bind(b,this),c)};a.prototype.recycleAsyncId=function(b,a,c){void 0===c&&(c=0);return null!==c&&this.delay===c&&!1===this.pending?a:(clearInterval(a), void 0)};a.prototype.execute=function(b,a){if(this.closed)return Error("executing a cancelled action");this.pending=!1;if(b=this._execute(b,a))return b;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(b,a){a=!1;var c=void 0;try{this.work(b)}catch(l){a=!0,c=!!l&&l||Error(l)}if(a)return this.unsubscribe(),c};a.prototype._unsubscribe=function(){var b=this.id,a=this.scheduler,c=a.actions,l=c.indexOf(this);this.state=this.work= null;this.pending=!1;this.scheduler=null;-1!==l&&c.splice(l,1);null!=b&&(this.id=this.recycleAsyncId(a,b,null));this.delay=null};return a}(function(c){function a(b,a){return c.call(this)||this}d(a,c);a.prototype.schedule=function(b,a){return this};return a}(w)),Sc=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;return f}d(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(0<a)return c.prototype.schedule.call(this,b,a);this.delay=a;this.state=b;this.scheduler.flush(this); return this};a.prototype.execute=function(b,a){return 0<a||this.closed?c.prototype.execute.call(this,b,a):this._execute(b,a)};a.prototype.requestAsyncId=function(b,a,g){void 0===g&&(g=0);return null!==g&&0<g||null===g&&0<this.delay?c.prototype.requestAsyncId.call(this,b,a,g):b.flush(this)};return a}(ja),Fa=function(){function c(a,b){void 0===b&&(b=c.now);this.SchedulerAction=a;this.now=b}c.prototype.schedule=function(a,b,c){void 0===b&&(b=0);return(new this.SchedulerAction(this,a)).schedule(c,b)}; c.now=function(){return Date.now()};return c}(),X=function(c){function a(b,f){void 0===f&&(f=Fa.now);var g=c.call(this,b,function(){return a.delegate&&a.delegate!==g?a.delegate.now():f()})||this;g.actions=[];g.active=!1;g.scheduled=void 0;return g}d(a,c);a.prototype.schedule=function(b,f,g){void 0===f&&(f=0);return a.delegate&&a.delegate!==this?a.delegate.schedule(b,f,g):c.prototype.schedule.call(this,b,f,g)};a.prototype.flush=function(b){var a=this.actions;if(this.active)a.push(b);else{var c;this.active= !0;do if(c=b.execute(b.state,b.delay))break;while(b=a.shift());this.active=!1;if(c){for(;b=a.shift();)b.unsubscribe();throw c;}}};return a}(Fa),vb=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}d(a,c);return a}(X))(Sc),Q=new r(function(c){return c.complete()}),Ma=function(c){return function(a){for(var b=0,f=c.length;b<f&&!a.closed;b++)a.next(c[b]);a.closed||a.complete()}},A=function(){function c(a,b,c){this.kind=a;this.value=b;this.error=c;this.hasValue="N"===a}c.prototype.observe= function(a){switch(this.kind){case "N":return a.next&&a.next(this.value);case "E":return a.error&&a.error(this.error);case "C":return a.complete&&a.complete()}};c.prototype.do=function(a,b,c){switch(this.kind){case "N":return a&&a(this.value);case "E":return b&&b(this.error);case "C":return c&&c()}};c.prototype.accept=function(a,b,c){return a&&"function"===typeof a.next?this.observe(a):this.do(a,b,c)};c.prototype.toObservable=function(){switch(this.kind){case "N":return ua(this.value);case "E":return va(this.error); case "C":return I()}throw Error("unexpected notification kind value");};c.createNext=function(a){return"undefined"!==typeof a?new c("N",a):c.undefinedValueNotification};c.createError=function(a){return new c("E",void 0,a)};c.createComplete=function(){return c.completeNotification};c.completeNotification=new c("C");c.undefinedValueNotification=new c("N",void 0);return c}(),Tc=function(){function c(a,b){void 0===b&&(b=0);this.scheduler=a;this.delay=b}c.prototype.call=function(a,b){return b.subscribe(new wb(a, this.scheduler,this.delay))};return c}(),wb=function(c){function a(b,a,g){void 0===g&&(g=0);b=c.call(this,b)||this;b.scheduler=a;b.delay=g;return b}d(a,c);a.dispatch=function(b){b.notification.observe(b.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(b){this.add(this.scheduler.schedule(a.dispatch,this.delay,new Uc(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(A.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(A.createError(b))}; a.prototype._complete=function(){this.scheduleMessage(A.createComplete())};return a}(p),Uc=function(){return function(c,a){this.notification=c;this.destination=a}}(),V=function(c){function a(b,a,g){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);var f=c.call(this)||this;f.scheduler=g;f._events=[];f._infiniteTimeWindow=!1;f._bufferSize=1>b?1:b;f._windowTime=1>a?1:a;a===Number.POSITIVE_INFINITY?(f._infiniteTimeWindow=!0,f.next=f.nextInfiniteTimeWindow):f.next=f.nextTimeWindow; return f}d(a,c);a.prototype.nextInfiniteTimeWindow=function(b){var a=this._events;a.push(b);a.length>this._bufferSize&&a.shift();c.prototype.next.call(this,b)};a.prototype.nextTimeWindow=function(b){this._events.push(new Vc(this._getNow(),b));this._trimBufferThenGetEvents();c.prototype.next.call(this,b)};a.prototype._subscribe=function(b){var a=this._infiniteTimeWindow,c=a?this._events:this._trimBufferThenGetEvents(),l=this.scheduler,d=c.length,e;if(this.closed)throw new N;this.isStopped||this.hasError? e=w.EMPTY:(this.observers.push(b),e=new rb(this,b));l&&b.add(b=new wb(b,l));if(a)for(a=0;a<d&&!b.closed;a++)b.next(c[a]);else for(a=0;a<d&&!b.closed;a++)b.next(c[a].value);this.hasError?b.error(this.thrownError):this.isStopped&&b.complete();return e};a.prototype._getNow=function(){return(this.scheduler||vb).now()};a.prototype._trimBufferThenGetEvents=function(){for(var b=this._getNow(),a=this._bufferSize,c=this._windowTime,l=this._events,d=l.length,e=0;e<d&&!(b-l[e].time<c);)e++;d>a&&(e=Math.max(e, d-a));0<e&&l.splice(0,e);return l};return a}(z),Vc=function(){return function(c,a){this.time=c;this.value=a}}(),Y=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}d(a,c);a.prototype._subscribe=function(b){return this.hasError?(b.error(this.thrownError),w.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),w.EMPTY):c.prototype._subscribe.call(this,b)};a.prototype.next=function(b){this.hasCompleted||(this.value= b,this.hasNext=!0)};a.prototype.error=function(b){this.hasCompleted||c.prototype.error.call(this,b)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&c.prototype.next.call(this,this.value);c.prototype.complete.call(this)};return a}(z),Wc=1,Ga={},xb={setImmediate:function(c){var a=Wc++;Ga[a]=c;Promise.resolve().then(function(){var b=Ga[a];b&&b()});return a},clearImmediate:function(c){delete Ga[c]}},Xc=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a; return f}d(a,c);a.prototype.requestAsyncId=function(b,a,g){void 0===g&&(g=0);if(null!==g&&0<g)return c.prototype.requestAsyncId.call(this,b,a,g);b.actions.push(this);return b.scheduled||(b.scheduled=xb.setImmediate(b.flush.bind(b,null)))};a.prototype.recycleAsyncId=function(b,a,g){void 0===g&&(g=0);if(null!==g&&0<g||null===g&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a,g);0===b.actions.length&&(xb.clearImmediate(a),b.scheduled=void 0)};return a}(ja),qa=new (function(c){function a(){return null!== c&&c.apply(this,arguments)||this}d(a,c);a.prototype.flush=function(b){this.active=!0;this.scheduled=void 0;var a=this.actions,c,l=-1,d=a.length;b=b||a.shift();do if(c=b.execute(b.state,b.delay))break;while(++l<d&&(b=a.shift()));this.active=!1;if(c){for(;++l<d&&(b=a.shift());)b.unsubscribe();throw c;}};return a}(X))(Xc),C=new X(ja),Yc=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;return f}d