rxjs
Version:
Reactive Extensions for modern JavaScript
122 lines (120 loc) • 136 kB
JavaScript
/**
@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,l){if(l.get||l.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[d]=l.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,l,h){if(d){l=$jscomp.global;e=e.split(".");for(h=0;h<e.length-1;h++){var x=e[h];x in l||(l[x]={});l=l[x]}e=e[e.length-1];h=l[e];d=d(h);d!=h&&null!=d&&$jscomp.defineProperty(l,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 l=arguments[h];if(l)for(var m in l)$jscomp.owns(l,m)&&(d[m]=l[m])}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 l=$jscomp.global.setTimeout;d.prototype.asyncExecuteFunction=function(d){l(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 n=d[e];delete d[e];try{n()}catch(z){this.asyncThrow_(z)}}}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(n){e.reject(n)}};h.prototype.createResolveAndReject_=function(){function d(d){return function(m){n||(n=!0,d.call(e,m))}}var e=this,n=
!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(n){this.reject_(n);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 x=new d;h.prototype.settleSameAsPromise_=function(d){var e=this.createResolveAndReject_();d.callWhenSettled_(e.resolve,e.reject)};h.prototype.settleSameAsThenable_=function(d,e){var n=this.createResolveAndReject_();try{d.call(e,n.resolve,n.reject)}catch(z){n.reject(z)}};h.prototype.then=function(d,e){function n(d,e){return"function"==typeof d?function(e){try{l(d(e))}catch(I){m(I)}}:e}var l,m,Q=new h(function(d,e){l=d;m=e});this.callWhenSettled_(n(d,l),
n(e,m));return Q};h.prototype.catch=function(d){return this.then(void 0,d)};h.prototype.callWhenSettled_=function(d,e){function n(){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_?x.asyncExecute(n):this.onSettledCallbacks_.push(function(){x.asyncExecute(n)})};h.resolve=function(d){return d instanceof h?d:new h(function(e,n){e(d)})};h.reject=function(d){return new h(function(e,n){n(d)})};
h.race=function(d){return new h(function(e,n){for(var l=$jscomp.makeIterator(d),m=l.next();!m.done;m=l.next())h.resolve(m.value).callWhenSettled_(e,n)})};h.all=function(d){var e=$jscomp.makeIterator(d),n=e.next();return n.done?h.resolve([]):new h(function(d,l){function m(e){return function(n){z[e]=n;N--;0==N&&d(z)}}var z=[],N=0;do z.push(void 0),N++,h.resolve(n.value).callWhenSettled_(m(z.length-1),l),n=e.next();while(!n.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 l(e){var n=Object[e];n&&(Object[e]=function(e){d(e);return n(e)})}if(function(){if(!e||!Object.seal)return!1;try{var d=Object.seal({}),n=Object.seal({}),h=new e([[d,2],[n,3]]);if(2!=h.get(d)||3!=h.get(n))return!1;h.delete(d);h.set(n,4);return!h.has(d)&&4==h.get(n)}catch(N){return!1}}())return e;var h="$jscomp_hidden_"+Math.random().toString().substring(2);l("freeze");l("preventExtensions");
l("seal");var x=0,m=function(d){this.id_=(x+=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])}};m.prototype.set=function(e,n){d(e);if(!$jscomp.owns(e,h))throw Error("WeakMap key fail: "+e);e[h][this.id_]=n;return this};m.prototype.get=function(d){return $jscomp.owns(d,h)?d[h][this.id_]:void 0};m.prototype.has=function(d){return $jscomp.owns(d,h)&&$jscomp.owns(d[h],this.id_)};m.prototype.delete=
function(d){return $jscomp.owns(d,h)&&$jscomp.owns(d[h],this.id_)?delete d[h][this.id_]:!1};return m},"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 l=h.entries(),m=l.next();if(m.done||m.value[0]!=d||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x||"t"!=m.value[1]||!l.next().done?!1:!0}catch(ta){return!1}}())return e;$jscomp.initSymbol();
$jscomp.initSymbolIterator();var d=new WeakMap,l=function(d){this.data_={};this.head_=m();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])}};l.prototype.set=function(d,e){var n=h(this,d);n.list||(n.list=this.data_[n.id]=[]);n.entry?n.entry.value=e:(n.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:d,value:e},n.list.push(n.entry),this.head_.previous.next=n.entry,this.head_.previous=n.entry,this.size++);return this};l.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};l.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=m();this.size=0};l.prototype.has=function(d){return!!h(this,d).entry};l.prototype.get=function(d){return(d=h(this,d).entry)&&d.value};l.prototype.entries=function(){return x(this,function(d){return[d.key,
d.value]})};l.prototype.keys=function(){return x(this,function(d){return d.key})};l.prototype.values=function(){return x(this,function(d){return d.value})};l.prototype.forEach=function(d,e){for(var h=this.entries(),l;!(l=h.next()).done;)l=l.value,d.call(e,l[1],l[0],this)};l.prototype[Symbol.iterator]=l.prototype.entries;var h=function(e,h){var l;l=h&&typeof h;"object"==l||"function"==l?d.has(h)?l=d.get(h):(l=""+ ++Q,d.set(h,l)):l="p_"+h;var m=e.data_[l];if(m&&$jscomp.owns(e.data_,l))for(e=0;e<m.length;e++){var n=
m[e];if(h!==h&&n.key!==n.key||h===n.key)return{id:l,list:m,index:e,entry:n}}return{id:l,list:m,index:-1,entry:void 0}},x=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}})},m=function(){var d={};return d.previous=d.next=d.head=d},Q=0;return l},"es6-impl","es3");$jscomp.array=$jscomp.array||{};
$jscomp.iteratorFromArray=function(e,d){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var l=0,h={next:function(){if(l<e.length){var x=l++;return{value:d(x,e[x]),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 x=h.entries(),m=x.next();if(m.done||m.value[0]!=d||m.value[1]!=d)return!1;m=x.next();return m.done||m.value[0]==d||4!=m.value[0].x||m.value[1]!=m.value[0]?!1:x.next().done}catch(Q){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(l){return d.call(e,l,l,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}Pb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function l(c){return"function"===typeof c}function h(c){setTimeout(function(){throw c;})}function x(){try{return Oa.apply(this,arguments)}catch(c){return p.e=c,p}}function m(c){Oa=c;return x}function Q(c){Error.call(this);
this.message=c?c.length+" errors occurred during unsubscription:\n"+c.map(function(a,b){return b+1+") "+a.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors=c;return this}function n(c){return c.reduce(function(a,b){return a.concat(b instanceof fa?b.errors:b)},[])}function z(){}function N(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return Na(c)}function Na(c){return c?1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}:z}function ta(c){c||
(c=H.Promise||Promise);if(!c)throw Error("no Promise impl found");return c}function J(){Error.call(this);this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}function ua(){return function(c){return c.lift(new Qb(c))}}function I(c){return c?Rb(c):R}function Rb(c){return new r(function(a){return c.schedule(function(){return a.complete()})})}function B(c){return c&&"function"===typeof c.schedule}function K(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(Pa(c))}function va(c){var a=new r(function(b){b.next(c);b.complete()});a._isScalar=!0;a.value=c;return a}function wa(){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?K(c,a):va(c[0]);default:return K(c,a)}}function xa(c,a){return a?new r(function(b){return a.schedule(Sb,0,{error:c,subscriber:b})}):new r(function(b){return b.error(c)})}
function Sb(c){c.subscriber.error(c.error)}function S(c){return c}function T(){Error.call(this);this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}function Qa(){Error.call(this);this.message="no elements in sequence";this.name="EmptyError";return this}function ya(){Error.call(this);this.message="Timeout has occurred";this.name="TimeoutError";return this}function G(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 Tb(c,a))}}function Ra(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 Ra(c,b).apply(void 0,f).pipe(G(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 k=this,d,e={context:k,subject:d,callbackFunc:c,scheduler:b};return new r(function(f){if(b)return b.schedule(Ub,0,{args:a,subscriber:f,params:e});if(!d){d=new aa;try{c.apply(k,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(Aa){d.error(Aa)}}return d.subscribe(f)})}}function Ub(c){var a=this,b=c.args,f=c.subscriber;c=c.params;var g=c.callbackFunc,k=c.context,d=c.scheduler,e=c.subject;if(!e){e=c.subject=new aa;try{g.apply(k,b.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];a.add(d.schedule(Vb,0,{value:1>=b.length?b[0]:b,subject:e}))}]))}catch(U){e.error(U)}}this.add(e.subscribe(f))}function Vb(c){var a=
c.subject;a.next(c.value);a.complete()}function Sa(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 Sa(c,b).apply(void 0,f).pipe(G(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 k={subject:void 0,args:a,callbackFunc:c,scheduler:b,context:this};return new r(function(f){var g=k.context,d=k.subject;if(b)return b.schedule(Wb,0,{params:k,subscriber:f,context:g});
if(!d){d=k.subject=new aa;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(Aa){d.error(Aa)}}return d.subscribe(f)})}}function Wb(c){var a=this,b=c.params,f=c.subscriber;c=c.context;var g=b.callbackFunc,k=b.args,d=b.scheduler,e=b.subject;if(!e){e=b.subject=new aa;try{g.apply(c,k.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];(c=b.shift())?a.add(d.schedule(Ta,
0,{err:c,subject:e})):a.add(d.schedule(Xb,0,{value:1>=b.length?b[0]:b,subject:e}))}]))}catch(U){this.add(d.schedule(Ta,0,{err:U,subject:e}))}}this.add(e.subscribe(f))}function Xb(c){var a=c.subject;a.next(c.value);a.complete()}function Ta(c){c.subject.error(c.err)}function Ua(c){return c&&"function"!==typeof c.subscribe&&"function"===typeof c.then}function u(c,a,b,f,g){void 0===g&&(g=new O(c,b,f));if(!g.closed)return Va(a)(g)}function Yb(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(Wa(c))}function Zb(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[L]();f.add(a.schedule(function(){if(!b.closed){var a,c;try{var f=g.next();a=f.value;c=f.done}catch(U){b.error(U);return}c?b.complete():(b.next(a),this.schedule())}}))}));
return f}):new r(Xa(c))}function $b(c,a){return a?new r(function(b){var f=new w;f.add(a.schedule(function(){var g=c[ba]();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(Ya(c))}function M(c,a){if(!a)return c instanceof r?c:new r(Va(c));if(null!=c){if(c&&"function"===typeof c[ba])return $b(c,a);if(Ua(c))return Yb(c,
a);if(Za(c))return K(c,a);if(c&&"function"===typeof c[L]||"string"===typeof c)return Zb(c,a)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");}function V(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(f){return f.pipe(V(function(b,f){return M(c(b,f)).pipe(G(function(c,g){return a(b,c,f,g)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new ac(c,b))}}function Ba(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return V(S,c)}
function $a(){return Ba(1)}function P(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return 1===c.length||2===c.length&&B(c[1])?M(c[0]):$a()(wa.apply(void 0,c))}function Ca(c){return new r(function(a){var b;try{b=c()}catch(f){a.error(f);return}return(b?M(b):I()).subscribe(a)})}function ab(){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?R:b?ab(c).pipe(G(function(a){return b.apply(void 0,
a)})):new r(function(b){return new bc(b,c)})}function bb(c,a,b,f){l(b)&&(f=b,b=void 0);return f?bb(c,a,b).pipe(G(function(b){return D(b)?f.apply(void 0,b):f(b)})):new r(function(f){cb(c,a,function(b){1<arguments.length?f.next(Array.prototype.slice.call(arguments)):f.next(b)},f,b)})}function cb(c,a,b,f,g){var k;if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(a,b,g),k=function(){return c.removeEventListener(a,b,g)};else if(c&&"function"===typeof c.on&&
"function"===typeof c.off)c.on(a,b),k=function(){return c.off(a,b)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(a,b),k=function(){return c.removeListener(a,b)};else if(c&&c.length)for(var d=0,e=c.length;d<e;d++)cb(c[d],a,b,f,g);else throw new TypeError("Invalid event target");f.add(k)}function db(c,a,b){return b?db(c,a).pipe(G(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)},k;try{k=c(f)}catch(E){b.error(E);return}if(l(a))return function(){return a(f,k)}})}function cc(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=c.iterate(c.state)}catch(k){a.error(k);return}else c.needIterate=!0;if(b){var f=void 0;try{f=b(c.state)}catch(k){a.error(k);return}if(!f){a.complete();return}if(a.closed)return}var g;try{g=c.resultSelector(c.state)}catch(k){a.error(k);return}if(!a.closed&&(a.next(g),!a.closed))return this.schedule(c)}}
function ca(c){return!D(c)&&0<=c-parseFloat(c)+1}function dc(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 eb(){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]:Ba(a)(K(c,b))}function Da(){for(var c=[],a=0;a<
arguments.length;a++)c[a]=arguments[a];if(0===c.length)return R;var b=c[0],f=c.slice(1);return 1===c.length&&D(b)?Da.apply(void 0,b):new r(function(a){var c=function(){return a.add(Da.apply(void 0,f).subscribe(a))};return M(b).subscribe({next:function(b){a.next(b)},error:c,complete:c})})}function ec(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 k=a[b];f.next([k,c[k]]);g.add(this.schedule({keys:a,index:b+1,subscriber:f,subscription:g,obj:c}))}else f.complete()}
function fb(){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 K(c,void 0).lift(new fc)}function gc(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 gb(c,a,b){void 0===c&&(c=0);var f=-1;ca(a)?f=1>Number(a)&&1||Number(a):B(a)&&(b=a);B(b)||(b=C);return new r(function(a){var g=ca(c)?c:+c-b.now();return b.schedule(hc,g,{index:0,period:f,subscriber:a})})}
function hc(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 hb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];"function"===typeof a&&c.pop();return K(c,void 0).lift(new ib(a))}function jb(c){return function(a){return a.lift(new ic(c))}}function kb(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 jc(c){var a=c.bufferCreationInterval,b=c.bufferTimeSpan,f=c.subscriber,g=c.scheduler,k=f.openContext();f.closed||(f.add(k.closeAction=g.schedule(lb,b,{subscriber:f,context:k})),this.schedule(c,a))}function lb(c){c.subscriber.closeContext(c.context)}function mb(c,a){return V(c,a,1)}function kc(c){c.debouncedNext()}function ga(c){void 0===c&&(c=null);return function(a){return a.lift(new lc(c))}}function nb(c,a){return function(b){return b.lift(new mc(c,a))}}function da(c,a){return function(b){return b.lift(new nc(c,
a))}}function ob(c,a,b){return function(f){return f.lift(new oc(c,a,b))}}function pc(){return new ha}function Ea(c){return function(a){return 0===c?I():a.lift(new qc(c))}}function pb(c,a){return a?function(b){return b.pipe(pb(function(b,g){return M(c(b,g)).pipe(G(function(c,f){return a(b,c,g,f)}))}))}:function(b){return b.lift(new rc(c))}}function ma(c){return function(a){return 0===c?I():a.lift(new sc(c))}}function na(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(f){return f.lift(new tc(c,
a,b))}}function oa(c,a){return 2<=arguments.length?function(b){return N(na(c,a),ma(1),ga(a))(b)}:function(b){return N(na(function(b,a,k){return c(b,a,k+1)}),ma(1))(b)}}function W(c,a){return function(b){var f;f="function"===typeof c?c:function(){return c};if("function"===typeof a)return b.lift(new uc(f,a));var g=Object.create(b,vc);g.source=b;g.subjectFactory=f;return g}}function wc(c,a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function xc(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 yc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function zc(){return new y}function Ac(c,a,b){var f,g=0,k,d=!1,e=!1;return function(E){g++;if(!f||d)d=!1,f=new X(c,a,b),k=E.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();k&&0===g&&e&&k.unsubscribe()}}}function ia(c,a){return"function"===
typeof a?function(b){return b.pipe(ia(function(b,g){return M(c(b,g)).pipe(G(function(c,f){return a(b,c,g,f)}))}))}:function(b){return b.lift(new Bc(c))}}function Cc(c){c.subscriber.clearThrottle()}function qb(c,a,b){void 0===b&&(b=C);return function(f){var g=c instanceof Date&&!isNaN(+c),k=g?+c-b.now():Math.abs(c);return f.lift(new Dc(k,g,a,b))}}function Ec(c,a,b){if(0===b)return[a];c.push(a);return c}function Fc(c){var a=c.subscriber,b=c.windowTimeSpan,f=c.window;f&&a.closeWindow(f);c.window=a.openWindow();
this.schedule(c,b)}function Gc(c){var a=c.windowTimeSpan,b=c.subscriber,f=c.scheduler,g=c.windowCreationInterval,k=b.openWindow(),d={action:this,subscription:null};d.subscription=f.schedule(rb,a,{subscriber:b,window:k,context:d});this.add(d.subscription);this.schedule(c,g)}function rb(c){var a=c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function sb(c,a){for(var b=0,f=a.length;b<f;b++)for(var g=a[b],k=Object.getOwnPropertyNames(g.prototype),
d=0,e=k.length;d<e;d++){var h=k[d];c.prototype[h]=g.prototype[h]}}function Hc(c,a){void 0===a&&(a=null);return new Y({method:"GET",url:c,headers:a})}function Ic(c,a,b){return new Y({method:"POST",url:c,body:a,headers:b})}function Jc(c,a){return new Y({method:"DELETE",url:c,headers:a})}function Kc(c,a,b){return new Y({method:"PUT",url:c,body:a,headers:b})}function Lc(c,a,b){return new Y({method:"PATCH",url:c,body:a,headers:b})}function Mc(c,a){return Nc(new Y({method:"GET",url:c,responseType:"json",
headers:a}))}function tb(c,a,b){Error.call(this);this.message=c;this.name="AjaxError";this.xhr=a;this.request=b;this.status=a.status;this.responseType=a.responseType||b.responseType;this.response=ub(this.responseType,a);return this}function Oc(c){return"response"in c?c.responseType?c.response:JSON.parse(c.response||c.responseText||"null"):JSON.parse(c.responseText||"null")}function ub(c,a){switch(c){case "json":return m(Oc)(a);case "xml":return a.responseXML;default:return"response"in a?a.response:
a.responseText}}var Pb=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])},Pc=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},Fa=!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):Fa&&console.log("RxJS: Back to a better error behavior. Thank you. \x3c3");Fa=c},get useDeprecatedSynchronousErrorHandling(){return Fa}},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},p={e:{}},Oa;Q.prototype=Object.create(Error.prototype);var fa=Q,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,k=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;l(k)&&(c=m(k).call(this),c===p&&(a=!0,b=b||(p.e instanceof fa?n(p.e.errors):[p.e])));if(D(d))for(e=-1,h=d.length;++e<h;)c=d[e],null!=c&&"object"===typeof c&&(c=m(c.unsubscribe).call(c),c===p&&(a=!0,
b=b||[],c=p.e,c instanceof fa?b=b.concat(n(c.errors)):b.push(c)));if(a)throw new fa(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}(),ea="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("rxSubscriber"):"@@rxSubscriber",q=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;f._parentSubscription=null;switch(arguments.length){case 0:f.destination=pa;break;case 1:if(!b){f.destination=pa;break}if("object"===typeof b){if(b instanceof q||"_addParentTeardownLogic"in b&&b[ea]){var d=b[ea]();f.syncErrorThrowable=d.syncErrorThrowable;f.destination=d;d._addParentTeardownLogic(f)}else f.syncErrorThrowable=!0,f.destination=new vb(f,b);break}default:f.syncErrorThrowable=
!0,f.destination=new vb(f,b,a,g)}return f}d(a,c);a.prototype[ea]=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),this._unsubscribeParentSubscription())};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete(),this._unsubscribeParentSubscription())};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._addParentTeardownLogic=function(b){b!==this&&(this._parentSubscription=this.add(b))};a.prototype._unsubscribeParentSubscription=function(){null!==this._parentSubscription&&this._parentSubscription.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;this._parentSubscription=null;return this};return a}(w),vb=function(c){function a(b,a,g,k){var f=c.call(this)||this;f._parentSubscriber=b;var d;b=f;l(a)?d=a:a&&(d=a.next,g=a.error,k=a.complete,a!==pa&&(b=Object.create(a),l(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=
k;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(k){return H.useDeprecatedSynchronousErrorHandling?(b.syncErrorValue=k,b.syncErrorThrown=!0):h(k),!0}return!1};a.prototype._unsubscribe=function(){var b=this._parentSubscriber;this._parentSubscriber=this._context=null;b.unsubscribe()};return a}(q),ba="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 q)break a;if(a[ea]){a=a[ea]();break a}}a=a||b||c?new q(a,b,c):new q(pa)}f?f.call(a,this.source):a._addParentTeardownLogic(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=ta(b);return new b(function(b,f){var g;g=c.subscribe(function(b){try{a(b)}catch(U){f(U),g&&g.unsubscribe()}},f,b)})};c.prototype._subscribe=
function(a){var b=this.source;return b&&b.subscribe(a)};c.prototype[ba]=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:Na(a)(this)};c.prototype.toPromise=function(a){var b=this;a=ta(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}();J.prototype=Object.create(Error.prototype);var wb=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),xb=function(c){function a(b){var a=c.call(this,b)||this;a.destination=b;return a}d(a,c);return a}(q),y=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[ea]=function(){return new xb(this)};a.prototype.lift=function(b){var a=new Ga(this,this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new J;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(),k=0;k<c;k++)a[k].next(b)};a.prototype.error=function(b){if(this.closed)throw new J;this.hasError=!0;this.thrownError=b;this.isStopped=!0;for(var a=this.observers,c=a.length,a=a.slice(),k=0;k<c;k++)a[k].error(b);
this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new J;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 J;return c.prototype._trySubscribe.call(this,b)};a.prototype._subscribe=function(b){if(this.closed)throw new J;if(this.hasError)return b.error(this.thrownError),
w.EMPTY;if(this.isStopped)return b.complete(),w.EMPTY;this.observers.push(b);return new wb(this,b)};a.prototype.asObservable=function(){var b=new r;b.source=this;return b};a.create=function(b,a){return new Ga(b,a)};return a}(r),Ga=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}(y),Qb=function(){function c(a){this.connectable=a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Qc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(),Qc=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}(q),yb=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 Rc(this.getSubject(),this))),b.closed?(this._connection=null,b=w.EMPTY):this._connection=b);return b};a.prototype.refCount=function(){return ua()(this)};return a}(r),ja=yb.prototype,vc={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,
writable:!0},_subscribe:{value:ja._subscribe},_isComplete:{value:ja._isComplete,writable:!0},getSubject:{value:ja.getSubject},connect:{value:ja.connect},refCount:{value:ja.refCount}},Rc=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}(xb);(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})(q);var Tc=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 Sc(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Sc=function(c){function a(b,a,g,k,d){b=c.call(this,b)||this;b.keySelector=a;b.elementSelector=g;b.durationSelector=k;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(za){this.error(za)}else d=b;if(!f&&(f=this.subjectSelector?this.subjectSelector():new y,c.set(a,f),b=new Ha(a,f,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b=this.durationSelector(new Ha(a,f))}catch(za){this.error(za);
return}this.add(b.subscribe(new Uc(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}(q),Uc=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}(q),Ha=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,k=this.groupSubject;
c&&!c.closed&&a.add(new Vc(c));a.add(k.subscribe(b));return a};return a}(r),Vc=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),zb=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 J;return this._value};a.prototype.next=function(b){c.prototype.next.call(this,this._value=b)};return a}(y),ka=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);if(null!==c&&this.delay===c&&!1===this.pending)return a;clearInterval(a)};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(k){a=!0,c=!!k&&k||Error(k)}if(a)return this.unsubscribe(),c};a.prototype._unsubscribe=function(){var b=this.id,a=this.scheduler,c=a.actions,k=c.indexOf(this);this.state=this.work=null;this.pending=!1;this.scheduler=null;
-1!==k&&c.splice(k,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)),Wc=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}(ka),Ia=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}(),Z=function(c){function a(b,f){void 0===f&&(f=Ia.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}(Ia),Ab=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}d(a,c);return a}(Z))(Wc),R=new r(function(c){return c.complete()}),Pa=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 wa(this.value);case "E":return xa(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}(),Xc=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 Bb(a,this.scheduler,this.delay))};return c}(),Bb=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 Yc(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}(q),Yc=function(){return function(c,a){this.notification=c;this.destination=a}}(),X=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 Zc(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(),k=this.scheduler,d=c.length,e;if(this.closed)throw new J;this.isStopped||this.hasError?e=w.EMPTY:(this.observers.push(b),e=new wb(this,b));k&&b.add(b=
new Bb(b,k));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||Ab).now()};a.prototype._trimBufferThenGetEvents=function(){for(var b=this._getNow(),a=this._bufferSize,c=this._windowTime,k=this._events,d=k.length,e=0;e<d&&!(b-k[e].time<c);)e++;d>a&&(e=Math.max(e,d-a));0<e&&k.splice(0,e);return k};return a}(y),Zc=function(){return function(c,
a){this.time=c;this.value=a}}(),aa=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}(y),$c=1,Ja={},Cb={setImmediate:function(c){var a=$c++;Ja[a]=c;Promise.resolve().then(function(){var b=Ja[a];b&&b()});return a},clearImmediate:function(c){delete Ja[c]}},ad=function(c){function a(b,a){var f=c.call(