UNPKG

lightfold

Version:

lightweight scaffolding and archiving utility CLI.

119 lines (117 loc) 126 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. *****************************************************************************/ (function(k,h){"object"===typeof exports&&"undefined"!==typeof module?h(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],h):h(k.rxjs={})})(this,function(k){function h(c,a){function b(){this.constructor=c}Kb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function P(c){return"function"===typeof c}function Q(c){setTimeout(function(){throw c;},0)}function ra(c){return null!==c&&"object"===typeof c}function Ka(c){return c.reduce(function(a,b){return a.concat(b instanceof Y?b.errors:b)},[])}function sa(c){for(;c;){var a=c.destination,b=c.isStopped;if(c.closed||b)return!1;c=a&&a instanceof l?a:null}return!0}function G(c){return c}function ta(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return La(c)}function La(c){return 0===c.length?G:1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}}function Ma(c){c||(c=C.Promise||Promise);if(!c)throw Error("no Promise impl found");return c}function ua(){return function(c){return c.lift(new Lb(c))}} function R(c){return c?Mb(c):S}function Mb(c){return new n(function(a){return c.schedule(function(){return a.complete()})})}function A(c){return c&&"function"===typeof c.schedule}function va(c,a){return new n(function(b){var d=new p,e=0;d.add(a.schedule(function(){e===c.length?b.complete():(b.next(c[e++]),b.closed||d.add(this.schedule()))}));return d})}function Z(c,a){return a?va(c,a):new n(Na(c))}function ga(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];return A(a)? (c.pop(),va(c,a)):Z(c)}function wa(c,a){return a?new n(function(b){return a.schedule(Nb,0,{error:c,subscriber:b})}):new n(function(b){return b.error(c)})}function Nb(c){c.subscriber.error(c.error)}function Oa(c){return c in xa?(delete xa[c],!0):!1}function D(){}function B(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 Ob(c,a))}}function Pa(c,a,b){if(a)if(A(a))b=a;else return function(){for(var d= [],e=0;e<arguments.length;e++)d[e]=arguments[e];return Pa(c,b).apply(void 0,d).pipe(B(function(b){return x(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var f=this,g,m={context:f,subject:g,callbackFunc:c,scheduler:b};return new n(function(d){if(b)return b.schedule(Pb,0,{args:a,subscriber:d,params:m});if(!g){g=new T;try{c.apply(f,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];g.next(1>=b.length?b[0]:b);g.complete()}]))}catch(K){sa(g)? g.error(K):console.warn(K)}}return g.subscribe(d)})}}function Pb(c){var a=this,b=c.args,d=c.subscriber;c=c.params;var e=c.callbackFunc,f=c.context,g=c.scheduler,m=c.subject;if(!m){m=c.subject=new T;try{e.apply(f,b.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];a.add(g.schedule(Qb,0,{value:1>=b.length?b[0]:b,subject:m}))}]))}catch(u){m.error(u)}}this.add(m.subscribe(d))}function Qb(c){var a=c.subject;a.next(c.value);a.complete()}function Qa(c,a,b){if(a)if(A(a))b=a;else return function(){for(var d= [],e=0;e<arguments.length;e++)d[e]=arguments[e];return Qa(c,b).apply(void 0,d).pipe(B(function(b){return x(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var f={subject:void 0,args:a,callbackFunc:c,scheduler:b,context:this};return new n(function(d){var e=f.context,g=f.subject;if(b)return b.schedule(Rb,0,{params:f,subscriber:d,context:e});if(!g){g=f.subject=new T;try{c.apply(e,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]= arguments[a];(a=b.shift())?g.error(a):(g.next(1>=b.length?b[0]:b),g.complete())}]))}catch(K){sa(g)?g.error(K):console.warn(K)}}return g.subscribe(d)})}}function Rb(c){var a=this,b=c.params,d=c.subscriber;c=c.context;var e=b.callbackFunc,f=b.args,g=b.scheduler,m=b.subject;if(!m){m=b.subject=new T;try{e.apply(c,f.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];(c=b.shift())?a.add(g.schedule(Ra,0,{err:c,subject:m})):a.add(g.schedule(Sb,0,{value:1>=b.length?b[0]:b,subject:m}))}]))}catch(u){this.add(g.schedule(Ra, 0,{err:u,subject:m}))}}this.add(m.subscribe(d))}function Sb(c){var a=c.subject;a.next(c.value);a.complete()}function Ra(c){c.subject.error(c.err)}function Sa(c){return!!c&&"function"!==typeof c.subscribe&&"function"===typeof c.then}function q(c,a,b,d,e){void 0===e&&(e=new H(c,b,d));if(!e.closed)return a instanceof n?a.subscribe(e):ha(a)(e)}function Tb(c,a){return new n(function(b){var d=new p;d.add(a.schedule(function(){var e=c[U]();d.add(e.subscribe({next:function(c){d.add(a.schedule(function(){return b.next(c)}))}, error:function(c){d.add(a.schedule(function(){return b.error(c)}))},complete:function(){d.add(a.schedule(function(){return b.complete()}))}}))}));return d})}function Ub(c,a){return new n(function(b){var d=new p;d.add(a.schedule(function(){return c.then(function(c){d.add(a.schedule(function(){b.next(c);d.add(a.schedule(function(){return b.complete()}))}))},function(c){d.add(a.schedule(function(){return b.error(c)}))})}));return d})}function Vb(c,a){if(!c)throw Error("Iterable cannot be null");return new n(function(b){var d= new p,e;d.add(function(){e&&"function"===typeof e.return&&e.return()});d.add(a.schedule(function(){e=c[E]();d.add(a.schedule(function(){if(!b.closed){var a,c;try{var d=e.next();a=d.value;c=d.done}catch(u){b.error(u);return}c?b.complete():(b.next(a),this.schedule())}}))}));return d})}function Ta(c,a){if(null!=c){if(c&&"function"===typeof c[U])return Tb(c,a);if(Sa(c))return Ub(c,a);if(Ua(c))return va(c,a);if(c&&"function"===typeof c[E]||"string"===typeof c)return Vb(c,a)}throw new TypeError((null!== c&&typeof c||c)+" is not observable");}function F(c,a){return a?Ta(c,a):c instanceof n?c:new n(ha(c))}function L(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(d){return d.pipe(L(function(b,d){return F(c(b,d)).pipe(B(function(c,e){return a(b,c,d,e)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new Wb(c,b))}}function ya(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return L(G,c)}function Va(){return ya(1)}function aa(){for(var c=[],a=0;a< arguments.length;a++)c[a]=arguments[a];return Va()(ga.apply(void 0,c))}function za(c){return new n(function(a){var b;try{b=c()}catch(d){a.error(d);return}return(b?F(b):R()).subscribe(a)})}function ia(c,a){return new n(function(b){var d=c.length;if(0===d)b.complete();else for(var e=Array(d),f=0,g=0,m=function(m){var h=F(c[m]),u=!1;b.add(h.subscribe({next:function(b){u||(u=!0,g++);e[m]=b},error:function(a){return b.error(a)},complete:function(){f++;f!==d&&u||(g===d&&b.next(a?a.reduce(function(b,a,c){return b[a]= e[c],b},{}):e),b.complete())}}))},h=0;h<d;h++)m(h)})}function Wa(c,a,b,d){P(b)&&(d=b,b=void 0);return d?Wa(c,a,b).pipe(B(function(b){return x(b)?d.apply(void 0,b):d(b)})):new n(function(d){Xa(c,a,function(b){1<arguments.length?d.next(Array.prototype.slice.call(arguments)):d.next(b)},d,b)})}function Xa(c,a,b,d,e){var f;if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(a,b,e),f=function(){return c.removeEventListener(a,b,e)};else if(c&&"function"=== typeof c.on&&"function"===typeof c.off)c.on(a,b),f=function(){return c.off(a,b)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(a,b),f=function(){return c.removeListener(a,b)};else if(c&&c.length)for(var g=0,m=c.length;g<m;g++)Xa(c[g],a,b,d,e);else throw new TypeError("Invalid event target");d.add(f)}function Ya(c,a,b){return b?Ya(c,a).pipe(B(function(a){return x(a)?b.apply(void 0,a):b(a)})):new n(function(b){var d=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]= arguments[c];return b.next(1===a.length?a[0]:a)},f;try{f=c(d)}catch(g){b.error(g);return}if(P(a))return function(){return a(d,f)}})}function $b(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=c.iterate(c.state)}catch(f){a.error(f);return}else c.needIterate=!0;if(b){var d=void 0;try{d=b(c.state)}catch(f){a.error(f);return}if(!d){a.complete();return}if(a.closed)return}var e;try{e=c.resultSelector(c.state)}catch(f){a.error(f);return}if(!a.closed&&(a.next(e),!a.closed))return this.schedule(c)}} function V(c){return!x(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 Za(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var a=Number.POSITIVE_INFINITY,b=null,d=c[c.length-1];A(d)?(b=c.pop(),1<c.length&&"number"===typeof c[c.length-1]&&(a=c.pop())):"number"===typeof d&&(a=c.pop());return null===b&&1===c.length&&c[0]instanceof n?c[0]:ya(a)(Z(c,b))}function Aa(){for(var c=[],a=0;a< arguments.length;a++)c[a]=arguments[a];if(0===c.length)return S;var b=c[0],d=c.slice(1);return 1===c.length&&x(b)?Aa.apply(void 0,b):new n(function(a){var c=function(){return a.add(Aa.apply(void 0,d).subscribe(a))};return F(b).subscribe({next:function(b){a.next(b)},error:c,complete:c})})}function bc(c){var a=c.keys,b=c.index,d=c.subscriber,e=c.subscription;c=c.obj;if(!d.closed)if(b<a.length){var f=a[b];d.next([f,c[f]]);e.add(this.schedule({keys:a,index:b+1,subscriber:d,subscription:e,obj:c}))}else d.complete()} function $a(c,a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function I(c,a){return function(b){return b.lift(new cc(c,a))}}function ab(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(x(c[0]))c=c[0];else return c[0];return Z(c,void 0).lift(new dc)}function ec(c){var a=c.start,b=c.index,d=c.subscriber;b>=c.count?d.complete():(d.next(a),d.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))}function bb(c,a,b){void 0===c&&(c=0);var d= -1;V(a)?d=1>Number(a)&&1||Number(a):A(a)&&(b=a);A(b)||(b=y);return new n(function(a){var e=V(c)?c:+c-b.now();return b.schedule(fc,e,{index:0,period:d,subscriber:a})})}function fc(c){var a=c.index,b=c.period,d=c.subscriber;d.next(a);if(!d.closed){if(-1===b)return d.complete();c.index=a+1;this.schedule(c,b)}}function cb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];"function"===typeof a&&c.pop();return Z(c,void 0).lift(new db(a))}function eb(c){return function(a){return a.lift(new gc(c))}} function fb(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 hc(c){var a=c.bufferCreationInterval,b=c.bufferTimeSpan,d=c.subscriber,e=c.scheduler,f=d.openContext();d.closed||(d.add(f.closeAction=e.schedule(gb,b,{subscriber:d,context:f})),this.schedule(c,a))}function gb(c){c.subscriber.closeContext(c.context)}function hb(c,a){return L(c,a,1)}function ic(c){c.debouncedNext()}function ba(c){void 0=== c&&(c=null);return function(a){return a.lift(new jc(c))}}function ib(c,a){return function(b){return b.lift(new kc(c,a))}}function ja(c){void 0===c&&(c=lc);return function(a){return a.lift(new mc(c))}}function lc(){return new ca}function Ba(c){return function(a){return 0===c?R():a.lift(new nc(c))}}function jb(c,a){return a?function(b){return b.pipe(jb(function(b,e){return F(c(b,e)).pipe(B(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new oc(c))}}function ka(c){return function(a){return 0=== c?R():a.lift(new pc(c))}}function la(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(d){return d.lift(new qc(c,a,b))}}function ma(c,a){return 2<=arguments.length?function(b){return ta(la(c,a),ka(1),ba(a))(b)}:function(b){return ta(la(function(b,a,f){return c(b,a,f+1)}),ka(1))(b)}}function M(c,a){return function(b){var d;d="function"===typeof c?c:function(){return c};if("function"===typeof a)return b.lift(new rc(d,a));var e=Object.create(b,sc);e.source=b;e.subjectFactory=d;return e}}function tc(c, a){return function(b){var d=b;for(b=0;b<a;b++)if(d=d[c[b]],"undefined"===typeof d)return;return d}}function uc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function vc(){return new v}function wc(c){var a=c.bufferSize,b=void 0===a?Number.POSITIVE_INFINITY:a,a=c.windowTime,d=void 0===a?Number.POSITIVE_INFINITY:a,e=c.refCount,f=c.scheduler,g,m=0,h,k=!1,r=!1;return function(a){m++;if(!g||k)k=!1,g=new W(b,d,f),h=a.subscribe({next:function(b){g.next(b)},error:function(b){k=!0;g.error(b)}, complete:function(){r=!0;h=void 0;g.complete()}});var c=g.subscribe(this);this.add(function(){m--;c.unsubscribe();h&&!r&&e&&0===m&&(h.unsubscribe(),g=h=void 0)})}}function da(c,a){return"function"===typeof a?function(b){return b.pipe(da(function(b,e){return F(c(b,e)).pipe(B(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new xc(c))}}function yc(c){c.subscriber.clearThrottle()}function kb(c,a,b){void 0===b&&(b=y);return function(d){var e=c instanceof Date&&!isNaN(+c),f=e?+c-b.now(): Math.abs(c);return d.lift(new zc(f,e,a,b))}}function Ac(c,a,b){if(0===b)return[a];c.push(a);return c}function Bc(c){var a=c.subscriber,b=c.windowTimeSpan,d=c.window;d&&a.closeWindow(d);c.window=a.openWindow();this.schedule(c,b)}function Cc(c){var a=c.windowTimeSpan,b=c.subscriber,d=c.scheduler,e=c.windowCreationInterval,f=b.openWindow(),g={action:this,subscription:null};g.subscription=d.schedule(lb,a,{subscriber:b,window:f,context:g});this.add(g.subscription);this.schedule(c,e)}function lb(c){var a= c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function mb(c,a){for(var b=0,d=a.length;b<d;b++)for(var e=a[b],f=Object.getOwnPropertyNames(e.prototype),g=0,m=f.length;g<m;g++){var h=f[g];c.prototype[h]=e.prototype[h]}}function Dc(c,a){void 0===a&&(a=null);return new N({method:"GET",url:c,headers:a})}function Ec(c,a,b){return new N({method:"POST",url:c,body:a,headers:b})}function Fc(c,a){return new N({method:"DELETE",url:c,headers:a})} function Gc(c,a,b){return new N({method:"PUT",url:c,body:a,headers:b})}function Hc(c,a,b){return new N({method:"PATCH",url:c,body:a,headers:b})}function Ic(c,a){return Jc(new N({method:"GET",url:c,responseType:"json",headers:a}))}function nb(c,a){switch(c){case "json":return c="response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null"),c;case "xml":return a.responseXML;default:return"response"in a?a.response:a.responseText}}var Kb=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])},ob=Object.assign||function(c){for(var a,b=1,d=arguments.length;b<d;b++){a=arguments[b];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(c[e]=a[e])}return c},Ca=!1,C={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}},na={closed:!0,next:function(c){},error:function(c){if(C.useDeprecatedSynchronousErrorHandling)throw c;Q(c)},complete:function(){}},x=function(){return Array.isArray||function(c){return c&&"number"===typeof c.length}}(),Y=function(){function c(a){Error.call(this);this.message=a?a.length+" errors occurred during unsubscription:\n"+a.map(function(b,a){return a+1+") "+b.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors= a;return this}c.prototype=Object.create(Error.prototype);return c}(),p=function(){function c(a){this.closed=!1;this._subscriptions=this._parentOrParents=null;a&&(this._unsubscribe=a)}c.prototype.unsubscribe=function(){var a;if(!this.closed){var b=this._parentOrParents,d=this._unsubscribe,e=this._subscriptions;this.closed=!0;this._subscriptions=this._parentOrParents=null;if(b instanceof c)b.remove(this);else if(null!==b)for(var f=0;f<b.length;++f)b[f].remove(this);if(P(d))try{d.call(this)}catch(g){a= g instanceof Y?Ka(g.errors):[g]}if(x(e))for(f=-1,b=e.length;++f<b;)if(d=e[f],ra(d))try{d.unsubscribe()}catch(g){a=a||[],g instanceof Y?a=a.concat(Ka(g.errors)):a.push(g)}if(a)throw new Y(a);}};c.prototype.add=function(a){var b=a;if(!a)return c.EMPTY;switch(typeof a){case "function":b=new c(a);case "object":if(b===this||b.closed||"function"!==typeof b.unsubscribe)return b;if(this.closed)return b.unsubscribe(),b;b instanceof c||(a=b,b=new c,b._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+ a+" added to Subscription.");}a=b._parentOrParents;if(null===a)b._parentOrParents=this;else if(a instanceof c){if(a===this)return b;b._parentOrParents=[a,this]}else if(-1===a.indexOf(this))a.push(this);else return b;a=this._subscriptions;null===a?this._subscriptions=[b]:a.push(b);return b};c.prototype.remove=function(a){var b=this._subscriptions;b&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))};c.EMPTY=function(a){a.closed=!0;return a}(new c);return c}(),oa="function"===typeof Symbol?Symbol("rxSubscriber"): "@@rxSubscriber_"+Math.random(),l=function(c){function a(b,d,e){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=na;break;case 1:if(!b){f.destination=na;break}if("object"===typeof b){b instanceof a?(f.syncErrorThrowable=b.syncErrorThrowable,f.destination=b,b.add(f)):(f.syncErrorThrowable=!0,f.destination=new pb(f,b));break}default:f.syncErrorThrowable=!0,f.destination=new pb(f,b,d,e)}return f}h(a, c);a.prototype[oa]=function(){return this};a.create=function(b,c,e){b=new a(b,c,e);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._parentOrParents;this._parentOrParents=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parentOrParents=b;return this};return a}(p),pb=function(c){function a(b,a,e,f){var d=c.call(this)||this;d._parentSubscriber=b;var m;b=d;P(a)?m=a:a&&(m=a.next,e=a.error,f=a.complete,a!==na&& (b=Object.create(a),P(b.unsubscribe)&&d.add(b.unsubscribe.bind(b)),b.unsubscribe=d.unsubscribe.bind(d)));d._context=b;d._next=m;d._error=e;d._complete=f;return d}h(a,c);a.prototype.next=function(b){if(!this.isStopped&&this._next){var a=this._parentSubscriber;C.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=C.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):Q(b),this.unsubscribe();else{this.unsubscribe();if(c)throw b;Q(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)};C.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(e){this.unsubscribe();if(C.useDeprecatedSynchronousErrorHandling)throw e;Q(e)}};a.prototype.__tryOrSetError=function(b,a,c){if(!C.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{a.call(this._context,c)}catch(f){return C.useDeprecatedSynchronousErrorHandling?(b.syncErrorValue=f,b.syncErrorThrown=!0):Q(f),!0}return!1};a.prototype._unsubscribe=function(){var b=this._parentSubscriber; this._parentSubscriber=this._context=null;b.unsubscribe()};return a}(l),U="function"===typeof Symbol&&Symbol.observable||"@@observable",n=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 d=this.operator;a:{if(a){if(a instanceof l)break a;if(a[oa]){a=a[oa]();break a}}a=a||b||c?new l(a,b,c):new l(na)}d?a.add(d.call(a,this.source)):a.add(this.source||C.useDeprecatedSynchronousErrorHandling&& !a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a));if(C.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){C.useDeprecatedSynchronousErrorHandling&&(a.syncErrorThrown=!0,a.syncErrorValue=b),sa(a)?a.error(b):console.warn(b)}};c.prototype.forEach=function(a,b){var c=this;b=Ma(b);return new b(function(b,d){var e;e=c.subscribe(function(b){try{a(b)}catch(u){d(u), e&&e.unsubscribe()}},d,b)})};c.prototype._subscribe=function(a){var b=this.source;return b&&b.subscribe(a)};c.prototype[U]=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:La(a)(this)};c.prototype.toPromise=function(a){var b=this;a=Ma(a);return new a(function(a,c){var d;b.subscribe(function(b){return d=b},function(b){return c(b)},function(){return a(d)})})};c.create=function(a){return new c(a)};return c}(),J=function(){function c(){Error.call(this); this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}c.prototype=Object.create(Error.prototype);return c}(),qb=function(c){function a(b,a){var d=c.call(this)||this;d.subject=b;d.subscriber=a;d.closed=!1;return d}h(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}(p),rb=function(c){function a(b){var a= c.call(this,b)||this;a.destination=b;return a}h(a,c);return a}(l),v=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}h(a,c);a.prototype[oa]=function(){return new rb(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 J;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(),f=0;f<c;f++)a[f].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(),f=0;f<c;f++)a[f].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),p.EMPTY;if(this.isStopped)return b.complete(),p.EMPTY;this.observers.push(b);return new qb(this,b)};a.prototype.asObservable=function(){var b=new n;b.source=this;return b};a.create=function(b,a){return new Da(b,a)};return a}(n),Da=function(c){function a(b,a){var d=c.call(this)||this;d.destination=b;d.source=a;return d}h(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):p.EMPTY};return a}(v),Lb=function(){function c(a){this.connectable=a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Kc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(), Kc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(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}(l),sb=function(c){function a(b,a){var d=c.call(this)||this;d.source=b;d.subjectFactory=a;d._refCount=0;d._isComplete= !1;return d}h(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 p,b.add(this.source.subscribe(new Lc(this.getSubject(),this))),b.closed&&(this._connection=null,b=p.EMPTY));return b};a.prototype.refCount=function(){return ua()(this)};return a}(n), sc=function(){var c=sb.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:c._subscribe},_isComplete:{value:c._isComplete,writable:!0},getSubject:{value:c.getSubject},connect:{value:c.connect},refCount:{value:c.refCount}}}(),Lc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(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}(rb);(function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(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})(l);var Nc=function(){function c(a,b,c,e){this.keySelector=a;this.elementSelector=b;this.durationSelector=c;this.subjectSelector=e}c.prototype.call=function(a,b){return b.subscribe(new Mc(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Mc=function(c){function a(b, a,e,f,g){b=c.call(this,b)||this;b.keySelector=a;b.elementSelector=e;b.durationSelector=f;b.subjectSelector=g;b.groups=null;b.attemptedToUnsubscribe=!1;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.keySelector(b)}catch(e){this.error(e);return}this._group(b,a)};a.prototype._group=function(b,a){var c=this.groups;c||(c=this.groups=new Map);var d=c.get(a),g;if(this.elementSelector)try{g=this.elementSelector(b)}catch(m){this.error(m)}else g=b;if(!d&&(d=this.subjectSelector?this.subjectSelector(): new v,c.set(a,d),b=new Ea(a,d,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b=this.durationSelector(new Ea(a,d))}catch(m){this.error(m);return}this.add(b.subscribe(new Oc(a,d,this)))}d.closed||d.next(g)};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}(l),Oc=function(c){function a(b,a,e){var d=c.call(this,a)||this;d.key=b;d.group=a;d.parent=e;return d}h(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}(l),Ea=function(c){function a(b,a,e){var d=c.call(this)|| this;d.key=b;d.groupSubject=a;d.refCountSubscription=e;return d}h(a,c);a.prototype._subscribe=function(b){var a=new p,c=this.refCountSubscription,f=this.groupSubject;c&&!c.closed&&a.add(new Pc(c));a.add(f.subscribe(b));return a};return a}(n),Pc=function(c){function a(b){var a=c.call(this)||this;a.parent=b;b.count++;return a}h(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}(p),tb=function(c){function a(b){var a=c.call(this)||this;a._value=b;return a}h(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}(v),ea=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;d.pending=!1;return d}h(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(f){a=!0,c=!!f&&f||Error(f)}if(a)return this.unsubscribe(), c};a.prototype._unsubscribe=function(){var b=this.id,a=this.scheduler,c=a.actions,f=c.indexOf(this);this.state=this.work=null;this.pending=!1;this.scheduler=null;-1!==f&&c.splice(f,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}h(a,c);a.prototype.schedule=function(b,a){return this};return a}(p)),Qc=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(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,e){void 0===e&&(e=0);return null!==e&&0<e||null===e&&0<this.delay?c.prototype.requestAsyncId.call(this,b,a,e):b.flush(this)};return a}(ea),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}(),O=function(c){function a(b,d){void 0===d&&(d=Fa.now);var e=c.call(this,b,function(){return a.delegate&&a.delegate!==e?a.delegate.now():d()})||this;e.actions=[];e.active=!1;e.scheduled=void 0;return e}h(a,c);a.prototype.schedule=function(b,d,e){void 0===d&&(d=0);return a.delegate&&a.delegate!==this?a.delegate.schedule(b,d,e):c.prototype.schedule.call(this, b,d,e)};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),ub=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);return a}(O))(Qc),S=new n(function(c){return c.complete()}),Na=function(c){return function(a){for(var b=0,d=c.length;b<d&&!a.closed;b++)a.next(c[b]);a.complete()}};(function(c){c.NEXT= "N";c.ERROR="E";c.COMPLETE="C"})(k.NotificationKind||(k.NotificationKind={}));var w=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 ga(this.value);case "E":return wa(this.error);case "C":return R()}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}(),Rc=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 vb(a,this.scheduler,this.delay))};return c}(),vb=function(c){function a(b,a,e){void 0===e&&(e=0);b=c.call(this,b)||this;b.scheduler=a;b.delay=e;return b}h(a,c);a.dispatch=function(b){b.notification.observe(b.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(b){this.destination.add(this.scheduler.schedule(a.dispatch, this.delay,new Sc(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(w.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(w.createError(b));this.unsubscribe()};a.prototype._complete=function(){this.scheduleMessage(w.createComplete());this.unsubscribe()};return a}(l),Sc=function(){return function(c,a){this.notification=c;this.destination=a}}(),W=function(c){function a(b,a,e){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);var d= c.call(this)||this;d.scheduler=e;d._events=[];d._infiniteTimeWindow=!1;d._bufferSize=1>b?1:b;d._windowTime=1>a?1:a;a===Number.POSITIVE_INFINITY?(d._infiniteTimeWindow=!0,d.next=d.nextInfiniteTimeWindow):d.next=d.nextTimeWindow;return d}h(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 Tc(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(),f=this.scheduler,g=c.length,m;if(this.closed)throw new J;this.isStopped||this.hasError?m=p.EMPTY:(this.observers.push(b),m=new qb(this,b));f&&b.add(b=new vb(b,f));if(a)for(a=0;a<g&&!b.closed;a++)b.next(c[a]);else for(a=0;a<g&&!b.closed;a++)b.next(c[a].value);this.hasError?b.error(this.thrownError):this.isStopped&&b.complete();return m};a.prototype._getNow= function(){return(this.scheduler||ub).now()};a.prototype._trimBufferThenGetEvents=function(){for(var b=this._getNow(),a=this._bufferSize,c=this._windowTime,f=this._events,g=f.length,m=0;m<g&&!(b-f[m].time<c);)m++;g>a&&(m=Math.max(m,g-a));0<m&&f.splice(0,m);return f};return a}(v),Tc=function(){return function(c,a){this.time=c;this.value=a}}(),T=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}h(a,c);a.prototype._subscribe=function(b){return this.hasError? (b.error(this.thrownError),p.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),p.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}(v),Uc=1,Vc=Promise.resolve(),xa={},wb={setImmediate:function(c){var a= Uc++;xa[a]=!0;Vc.then(function(){return Oa(a)&&c()});return a},clearImmediate:function(c){Oa(c)}},Wc=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(a,c);a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e)return c.prototype.requestAsyncId.call(this,b,a,e);b.actions.push(this);return b.scheduled||(b.scheduled=wb.setImmediate(b.flush.bind(b,null)))};a.prototype.recycleAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e||null=== e&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a,e);0===b.actions.length&&(wb.clearImmediate(a),b.scheduled=void 0)};return a}(ea),pa=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.flush=function(b){this.active=!0;this.scheduled=void 0;var a=this.actions,c,f=-1,g=a.length;b=b||a.shift();do if(c=b.execute(b.state,b.delay))break;while(++f<g&&(b=a.shift()));this.active=!1;if(c){for(;++f<g&&(b=a.shift());)b.unsubscribe();throw c;}};return a}(O))(Wc), y=new O(ea),Xc=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(a,c);a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e)return c.prototype.requestAsyncId.call(this,b,a,e);b.actions.push(this);return b.scheduled||(b.scheduled=requestAnimationFrame(function(){return b.flush(null)}))};a.prototype.recycleAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e||null===e&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a, e);0===b.actions.length&&(cancelAnimationFrame(a),b.scheduled=void 0)};return a}(ea),Yc=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.flush=function(b){this.active=!0;this.scheduled=void 0;var a=this.actions,c,f=-1,g=a.length;b=b||a.shift();do if(c=b.execute(b.state,b.delay))break;while(++f<g&&(b=a.shift()));this.active=!1;if(c){for(;++f<g&&(b=a.shift());)b.unsubscribe();throw c;}};return a}(O))(Xc),xb=function(c){function a(b,a){void 0===b&&(b=Ga); void 0===a&&(a=Number.POSITIVE_INFINITY);var d=c.call(this,b,function(){return d.frame})||this;d.maxFrames=a;d.frame=0;d.index=-1;return d}h(a,c);a.prototype.flush=function(){for(var b=this.actions,a=this.maxFrames,c,f;(f=b[0])&&f.delay<=a&&!(b.shift(),this.frame=f.delay,c=f.execute(f.state,f.delay)););if(c){for(;f=b.shift();)f.unsubscribe();throw c;}};a.frameTimeFactor=10;return a}(O),Ga=function(c){function a(b,a,e){void 0===e&&(e=b.index+=1);var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a; d.index=e;d.active=!0;d.index=b.index=e;return d}h(a,c);a.prototype.schedule=function(b,d){void 0===d&&(d=0);if(!this.id)return c.prototype.schedule.call(this,b,d);this.active=!1;var e=new a(this.scheduler,this.work);this.add(e);return e.schedule(b,d)};a.prototype.requestAsyncId=function(b,c,e){void 0===e&&(e=0);this.delay=b.frame+e;b=b.actions;b.push(this);b.sort(a.sortActions);return!0};a.prototype.recycleAsyncId=function(b,a,c){};a.prototype._execute=function(b,a){if(!0===this.active)return c.prototype._execute.call(this, b,a)};a.sortActions=function(b,a){return b.delay===a.delay?b.index===a.index?0:b.index>a.index?1:-1:b.delay>a.delay?1:-1};return a}(ea),X=function(){function c(){Error.call(this);this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}c.prototype=Object.create(Error.prototype);return c}(),ca=function(){function c(){Error.call(this);this.message="no elements in sequence";this.name="EmptyError";return this}c.prototype=Object.create(Error.prototype);return c}(),yb=function(){function c(){Error.call(this); this.message="Timeout has occurred";this.name="TimeoutError";return this}c.prototype=Object.create(Error.prototype);return c}(),Ob=function(){function c(a,b){this.project=a;this.thisArg=b}c.prototype.call=function(a,b){return b.subscribe(new Zc(a,this.project,this.thisArg))};return c}(),Zc=function(c){function a(b,a,e){b=c.call(this,b)||this;b.project=a;b.count=0;b.thisArg=e||b;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.project.call(this.thisArg,b,this.count++)}catch(e){this.destination.error(e); return}this.destination.next(a)};return a}(l),t=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyError=function(b,a){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.complete()};return a}(l),H=function(c){function a(b,a,e){var d=c.call(this)||this;d.parent=b;d.outerValue=a;d.outerIndex=e;d.index=0;return d}h(a,c);a.prototype._next=function(b){this.parent.notifyNext(this.outerValue, b,this.outerIndex,this.index++,this)};a.prototype._error=function(b){this.parent.notifyError(b,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(l),$c=function(c){return function(a){c.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,Q);return a}},E;E="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var ad=function(c){return function(a){var b=c[E]();do{var d= b.next();if(d.done){a.complete();break}a.next(d.value);if(a.closed)break}while(1);"function"===typeof b.return&&a.add(function(){b.return&&b.return()});return a}},bd=function(c){return function(a){var b=c[U]();if("function"!==typeof b.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return b.subscribe(a)}},Ua=function(c){return c&&"number"===typeof c.length&&"function"!==typeof c},ha=function(c){if(c&&"function"===typeof c[U])return bd(c);if(Ua(c))return Na(c); if(Sa(c))return $c(c);if(c&&"function"===typeof c[E])return ad(c);c=ra(c)?"an invalid object":"'"+c+"'";throw new TypeError("You provided "+c+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.");},zb={},Ha=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new cd(a,this.resultSelector))};return c}(),cd=function(c){function a(b,a){b=c.call(this,b)||this;b.resultSelector=a;b.active=0;b.values=[];b.observables=[];return b} h(a,c);a.prototype._next=function(b){this.values.push(zb);this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var c=0;c<a;c++){var f=b[c];this.add(q(this,f,f,c))}}};a.prototype.notifyComplete=function(b){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,g){b=this.values;f=b[c];f=this.toRespond?f===zb?--this.toRespond:this.toRespond:0;b[c]=a;0=== f&&(this.resultSelector?this._tryResultSelector(b):this.destination.next(b.slice()))};a.prototype._tryResultSelector=function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(t),Wb=function(){function c(a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=a;this.concurrent=b}c.prototype.call=function(a,b){return b.subscribe(new dd(a,this.project,this.concurrent))};return c}(),dd=function(c){function a(b,a,e){void 0=== e&&(e=Number.POSITIVE_INFINITY);b=c.call(this,b)||this;b.project=a;b.concurrent=e;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.active<this.concurrent?this._tryNext(b):this.buffer.push(b)};a.prototype._tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(a,b,c)};a.prototype._innerSub=function(b,a,c){a=new H(this,a,c);c=this.destination;c.add(a);b=q(this,b,void 0, void 0,a);b!==a&&c.add(b)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyComplete=function(b){var a=this.buffer;this.remove(b);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(t),Ab=new n(D),cc=function(){function c(a,b){this.predicate=a;this.thisArg= b}c.prototype.call=function(a,b){return b.subscribe(new ed(a,this.predicate,this.thisArg))};return c}(),ed=function(c){function a(b,a,e){b=c.call(this,b)||this;b.predicate=a;b.thisArg=e;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.predicate.call(this.thisArg,b,this.count++)}catch(e){this.destination.error(e);return}a&&this.destination.next(b)};return a}(l),dc=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new fd(a))};return c}(),fd=function(c){function a(b){b= c.call(this,b)||this;b.hasFirst=!1;b.observables=[];b.subscriptions=[];return b}h(a,c);a.prototype._next=function(b){this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{for(var c=0;c<a&&!this.hasFirst;c++){var f=b[c],f=q(this,f,f,c);this.subscriptions&&this.subscriptions.push(f);this.add(f)}this.observables=null}};a.prototype.notifyNext=function(b,a,c,f,g){if(!this.hasFirst){this.hasFirst=!0;for(b=0;b<this.subscriptions.length;b++)b!== c&&(f=this.subscriptions[b],f.unsubscribe(),this.remove(f));this.subscriptions=null}this.destination.next(a)};return a}(t),db=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new gd(a,this.resultSelector))};return c}(),gd=function(c){function a(b,a,e){void 0===e&&(e=Object.create(null));b=c.call(this,b)||this;b.iterators=[];b.active=0;b.resultSelector="function"===typeof a?a:null;b.values=e;return b}h(a,c);a.prototype._next=function(b){var a=this.iterators; x(b)?a.push(new hd(b)):"function"===typeof b[E]?a.push(new id(b[E]())):a.push(new jd(this.destination,this,b))};a.prototype._complete=function(){var b=this.iterators,a=b.length;this.unsubscribe();if(0===a)this.destination.complete();else{this.active=a;for(var c=0;c<a;c++){var f=b[c];f.stillUnsubscribed?this.destination.add(f.subscribe(f,c)):this.active--}}};a.prototype.notifyInactive=function(){this.active--;0===this.active&&this.destination.complete()};a.prototype.checkIterators=function(){for(var b= this.iterators,a=b.length,c=this.destination,f=0;f<a;f++){var g=b[f];if("function"===typeof g.hasValue&&!g.hasValue())return}for(var m=!1,h=[],f=0;f<a;f++){var g=b[f],k=g.next();g.hasCompleted()&&(m=!0);if(k.done){c.complete();return}h.push(k.value)}this.resultSelector?this._tryresultSelector(h):c.next(h);m&&c.complete()};a.prototype._tryresultSelector=function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(l),id=function(){function c(a){this.iterator= a;this.nextResult=a.next()}c.prototype.hasValue=function(){return!0};c.prototype.next=function(){var a=this.nextResult;this.nextResult=this.iterator.next();return a};c.prototype.hasCompleted=function(){var a=this.nextResult;return a&&a.done};return c}(),hd=function(){function c(a){this.array=a;this.length=this.index=0;this.length=a.length}c.prototype[E]=function(){return this};c.prototype.next=function(a){a=this.index++;var b=this.array;return a<this.length?{value:b[a],done:!1}:{value:null,done:!0}}; c.prototype.hasValue=function(){return this.array.length>this.index};c.prototype.hasCompleted=function(){return this.array.length===this.index};return c}(),jd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.parent=a;b.observable=e;b.stillUnsubscribed=!0;b.buffer=[];b.isComplete=!1;return b}h(a,c);a.prototype[E]=function(){return this};a.prototype.next=function(){var b=this.buffer;return 0===b.length&&this.isComplete?{value:null,done:!0}:{value:b.shift(),done:!1}};a.prototype.hasValue=function(){return 0< this.buffer.length};a.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete};a.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,g){this.buffer.push(a);this.parent.checkIterators()};a.prototype.subscribe=function(b,a){return q(this,this.observable,this,a)};return a}(t),gc=function(){function c(a){this.durationSelector=a}c.prototype.call=function(a, b){return