Repository navigation
Expand file tree
/
Copy pathrx.all.min.js
More file actions
6 lines (6 loc) · 112 KB
/
Copy pathrx.all.min.js
File metadata and controls
6 lines (6 loc) · 112 KB
1
2
3
4
5
6
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(){try{return xa.apply(this,arguments)}catch(a){return Pa.e=a,Pa}}function d(a){if(!Oa(a))throw new TypeError("fn must be a function");return xa=a,c}function e(a){throw a}function f(a,b){if(Qa&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Ua)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+Ua+"\n");a.stack=g(e)}}function g(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];h(f)||i(f)||!f||c.push(f)}return c.join("\n")}function h(a){var b=k(a);if(!b)return!1;var c=b[0],d=b[1];return c===Sa&&d>=Ta&&Yd>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if(Qa)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=k(c);if(!d)return;return Sa=d[0],d[1]}}function k(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function l(a){var b=[];if(!Cb(a))return b;Bb.nonEnumArgs&&a.length&&Db(a)&&(a=Fb.call(a));var c=Bb.enumPrototypes&&"function"==typeof a,d=Bb.enumErrorProps&&(a===vb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Bb.nonEnumShadows&&a!==wb){var f=a.constructor,g=-1,h=hb;if(a===(f&&f.prototype))var i=a===xb?rb:a===vb?mb:sb.call(a),j=Ab[i];for(;++g<h;)e=gb[g],j&&j[e]||!tb.call(a,e)||b.push(e)}return b}function m(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function n(a,b){return m(a,b,l)}function o(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function p(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=sb.call(a),h=sb.call(b);if(g==ib&&(g=pb),h==ib&&(h=pb),g!=h)return!1;switch(g){case kb:case lb:return+a==+b;case ob:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case qb:case rb:return a==String(b)}var i=g==jb;if(!i){if(g!=pb||!Bb.nodeClass&&(o(a)||o(b)))return!1;var j=!Bb.argsObject&&Db(a)?Object:a.constructor,k=!Bb.argsObject&&Db(b)?Object:b.constructor;if(!(j==k||tb.call(a,"constructor")&&tb.call(b,"constructor")||Oa(j)&&j instanceof j&&Oa(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var m=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,m=b.length,q=m==l)for(;m--;){var r=b[m];if(!(q=p(a[m],r,c,d)))break}}else n(b,function(b,e,f){return tb.call(f,e)?(m++,q=tb.call(a,e)&&p(a[e],b,c,d)):void 0}),q&&n(a,function(a,b,c){return tb.call(c,b)?q=--m>-1:void 0});return c.pop(),d.pop(),q}function q(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function r(a,b){this.id=a,this.value=b}function s(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function u(a){this._s=a}function v(a){this._s=a,this._l=a.length,this._i=0}function w(a){this._a=a}function x(a){this._a=a,this._l=B(a),this._i=0}function y(a){return"number"==typeof a&&Fa.isFinite(a)}function z(b){var c,d=b[ab];if(!d&&"string"==typeof b)return c=new u(b),c[ab]();if(!d&&b.length!==a)return c=new w(b),c[ab]();if(!d)throw new TypeError("Object is not iterable");return b[ab]()}function A(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function B(a){var b=+a.length;return isNaN(b)?0:0!==b&&y(b)?(b=A(b)*Math.floor(Math.abs(b)),0>=b?0:b>Mc?Mc:b):b}function C(a,b){this.observer=a,this.parent=b}function D(a,b){return Yb(a)||(a=bc),new Oc(b,a)}function E(a,b){this.observer=a,this.parent=b}function F(a,b){this.observer=a,this.parent=b}function G(a,b){return a.amb(b)}function H(a,b){return new Sd(function(c){var d=new Sb,e=new Tb;return e.setDisposable(d),d.setDisposable(a.subscribe(new $c(c,e,b))),e},a)}function I(){return!1}function J(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function I(){return!1}function I(){return!1}function K(){return[]}function J(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function I(){return!1}function K(){return[]}function J(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function L(a){return function(b){return a.subscribe(b)}}function M(a){return a.toArray()}function N(a){return a.length>0}function O(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function P(a,b,c){var d=fb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Na(e)&&(e=Ec(e)),(db(e)||cb(e))&&(e=Nc(e)),e}).concatAll()}function Q(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function R(a){this.comparer=a,this.set=[]}function S(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}function T(a,b,c){return new Sd(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},function(a){d.onError(a)},function(){d.onNext(g),d.onCompleted()})},a)}function U(a){if(0===a.length)throw new Va;return a[0]}function V(b,c,d,e){var f=fb(c,d,3);return new Sd(function(c){var d=0;return b.subscribe(function(a){var g;try{g=f(a,d,b)}catch(h){return void c.onError(h)}g?(c.onNext(e?d:a),c.onCompleted()):d++},function(a){c.onError(a)},function(){c.onNext(e?-1:a),c.onCompleted()})},b)}function W(a){return a?tc.isObservable(a)?a:Na(a)?tc.fromPromise(a):_(a)||$(a)?zd.call(this,a):Oa(a)?Z.call(this,a):db(a)||cb(a)?X.call(this,a):Cb(a)?Y.call(this,a):a:a}function X(a){return tc.from(a).flatMap(W).toArray()}function Y(b){function c(b,c){d[c]=a,f.push(b.map(function(a){d[c]=a}))}for(var d=new b.constructor,e=Object.keys(b),f=[],g=0,h=e.length;h>g;g++){var i=e[g],j=W.call(this,b[i]);j&&tc.isObservable(j)?c(j,i):d[i]=b[i]}return tc.forkJoin.apply(tc,f).map(function(){return d})}function Z(a){var b=this;return new Sd(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function $(a){return Oa(a.next)&&Oa(a["throw"])}function _(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:$(b.prototype):!1}function aa(a,b,c,d){var e=new Wd;return d.push(ba(e,b,c)),a.apply(b,d),e.asObservable()}function ba(a,b,c){return function(){for(var e=arguments.length,f=new Array(e),g=0;e>g;g++)f[g]=arguments[g];if(Oa(c)){if(f=d(c).apply(b,f),f===Pa)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function ca(a,b,c,d){var e=new Wd;return d.push(da(e,b,c)),a.apply(b,d),e.asObservable()}function da(a,b,c){return function(){var e=arguments[0];if(e)return a.onError(e);for(var f=arguments.length,g=[],h=1;f>h;h++)g[h-1]=arguments[h];if(Oa(c)){var g=d(c).apply(b,g);if(g===Pa)return a.onError(g.e);a.onNext(g)}else g.length<=1?a.onNext(g[0]):a.onNext(g);a.onCompleted()}}function ea(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function fa(a,b,c){var d=new Lb,e=Object.prototype.toString.call(a);if("[object NodeList]"===e||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(fa(a.item(f),b,c));else a&&d.add(new ea(a,b,c));return d}function ga(a,b){return function(){var c=arguments[0];return Oa(b)&&(c=d(b).apply(null,arguments),c===Pa)?a.onError(c.e):void a.onNext(c)}}function ha(a,b,c){return new Sd(function(e){function f(a,b){if(k[b]=a,h[b]=!0,i||(i=h.every(Ia))){if(g)return e.onError(g);var f=d(c).apply(null,k);if(f===Pa)return e.onError(f.e);e.onNext(f)}j&&k[1]&&e.onCompleted()}var g,h=[!1,!1],i=!1,j=!1,k=new Array(2);return new Lb(a.subscribe(function(a){f(a,0)},function(a){k[1]?e.onError(a):g=a},function(){j=!0,k[1]&&e.onCompleted()}),b.subscribe(function(a){f(a,1)},function(a){e.onError(a)},function(){j=!0,f(!0,1)}))},a)}function M(a){return a.toArray()}function ia(a,b){return a.groupJoin(this,b,Jc,function(a,b){return b})}function ja(a){var b=this;return new Sd(function(c){var d=new Vd,e=new Lb,f=new Ub(e);return c.onNext(Ib(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Na(a)&&(a=Ec(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new Vd,c.onNext(Ib(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ka(a){var b=this;return new Sd(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Na(b)&&(b=Ec(b));var i=new Sb;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Ha,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Vd,c.onNext(Ib(h,g)),d()}))}var e=new Tb,f=new Lb(e),g=new Ub(f),h=new Vd;return c.onNext(Ib(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function la(a,b){return new Md(a,b)}function ma(a){this.patterns=a}function na(a,b){this.expression=a,this.selector=b}function oa(a,b,c){var d=a.get(b);if(!d){var e=new Qd(b,c);return a.set(b,e),e}return d}function pa(a,b,c){this.joinObserverArray=a,this. Pd;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function qa(a,b){return new Sd(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function ra(a,b,c){return new Sd(function(d){var e=a,f=Xb(b);return c.scheduleRecursive
8000
WithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function sa(a,b){return new Sd(function(c){return b.scheduleWithRelative(Xb(a),function(){c.onNext(0),c.onCompleted()})})}function ta(a,b,c){return a===b?new Sd(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Gc(function(){return ra(c.now()+a,b,c)})}function ua(a,b,c){return new Sd(function(d){var e,f=!1,g=new Tb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Sb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Lb(e,g)},a)}function va(a,b,c){return Gc(function(){return ua(a,b-c.now(),c)})}function M(a){return a.toArray()}function M(a){return a.toArray()}function wa(a,b){return new Sd(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new Sb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new Lb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}var xa,ya={"function":!0,object:!0},za=ya[typeof exports]&&exports&&!exports.nodeType&&exports,Aa=ya[typeof self]&&self.Object&&self,Ba=ya[typeof window]&&window&&window.Object&&window,Ca=ya[typeof module]&&module&&!module.nodeType&&module,Da=Ca&&Ca.exports===za&&za,Ea=za&&Ca&&"object"==typeof global&&global&&global.Object&&global,Fa=Fa=Ea||Ba!==(this&&this.window)&&Ba||Aa||this,Ga={internals:{},config:{Promise:Fa.Promise},helpers:{}},Ha=Ga.helpers.noop=function(){},Ia=Ga.helpers.identity=function(a){return a},Ja=Ga.helpers.defaultNow=Date.now,Ka=Ga.helpers.defaultComparer=function(a,b){return Eb(a,b)},La=Ga.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Ma=(Ga.helpers.defaultKeySerializer=function(a){return a.toString()},Ga.helpers.defaultError=function(a){throw a}),Na=Ga.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Oa=Ga.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==sb.call(a)}),a}(),Pa={e:{}};Ga.config.longStackSupport=!1;var Qa=!1,Ra=d(function(){throw new Error})();Qa=!!Ra.e&&!!Ra.e.stack;var Sa,Ta=j(),Ua="From previous event:",Va=Ga.EmptyError=function(){this.message="Sequence contains no elements.",this.name="EmptyError",Error.call(this)};Va.prototype=Error.prototype;var Wa=Ga.ObjectDisposedError=function(){this.message="Object has been disposed",this.name="ObjectDisposedError",Error.call(this)};Wa.prototype=Error.prototype;var Xa=Ga.ArgumentOutOfRangeError=function(){this.message="Argument out of range",this.name="ArgumentOutOfRangeError",Error.call(this)};Xa.prototype=Error.prototype;var Ya=Ga.NotSupportedError=function(a){this.message=a||"This operation is not supported",this.name="NotSupportedError",Error.call(this)};Ya.prototype=Error.prototype;var Za=Ga.NotImplementedError=function(a){this.message=a||"This operation is not implemented",this.name="NotImplementedError",Error.call(this)};Za.prototype=Error.prototype;var $a=Ga.helpers.notImplemented=function(){throw new Za},_a=Ga.helpers.notSupported=function(){throw new Ya},ab="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Fa.Set&&"function"==typeof(new Fa.Set)["@@iterator"]&&(ab="@@iterator");var bb=Ga.doneEnumerator={done:!0,value:a},cb=Ga.helpers.isIterable=function(b){return b[ab]!==a},db=Ga.helpers.isArrayLike=function(b){return b&&b.length!==a};Ga.helpers.iterator=ab;var eb,fb=Ga.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},gb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],hb=gb.length,ib="[object Arguments]",jb="[object Array]",kb="[object Boolean]",lb="[object Date]",mb="[object Error]",nb="[object Function]",ob="[object Number]",pb="[object Object]",qb="[object RegExp]",rb="[object String]",sb=Object.prototype.toString,tb=Object.prototype.hasOwnProperty,ub=sb.call(arguments)==ib,vb=Error.prototype,wb=Object.prototype,xb=String.prototype,yb=wb.propertyIsEnumerable;try{eb=!(sb.call(document)==pb&&!({toString:0}+""))}catch(zb){eb=!0}var Ab={};Ab[jb]=Ab[lb]=Ab[ob]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ab[kb]=Ab[rb]={constructor:!0,toString:!0,valueOf:!0},Ab[mb]=Ab[nb]=Ab[qb]={constructor:!0,toString:!0},Ab[pb]={constructor:!0};var Bb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Bb.enumErrorProps=yb.call(vb,"message")||yb.call(vb,"name"),Bb.enumPrototypes=yb.call(a,"prototype"),Bb.nonEnumArgs=0!=c,Bb.nonEnumShadows=!/valueOf/.test(b)}(1);var Cb=Ga.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Db=function(a){return a&&"object"==typeof a?sb.call(a)==ib:!1};ub||(Db=function(a){return a&&"object"==typeof a?tb.call(a,"callee"):!1});var Eb=Ga.internals.isEqual=function(a,b){return p(a,b,[],[])},Fb=({}.hasOwnProperty,Array.prototype.slice),Gb=Ga.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Hb=Ga.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Ib=Ga.internals.addRef=function(a,b){return new Sd(function(c){return new Lb(b.getDisposable(),a.subscribe(c))})};r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Jb=Ga.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Kb=Jb.prototype;Kb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Kb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Kb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Kb.peek=function(){return this.items[0].value},Kb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Kb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Kb.enqueue=function(a){var b=this.length++;this.items[b]=new r(Jb.count++,a),this.percolate(b)},Kb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Jb.count=0;var Lb=Ga.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!Qb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},Mb=Lb.prototype;Mb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Mb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Mb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var Nb=Ga.Disposable=function(a){this.isDisposed=!1,this.action=a||Ha};Nb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Ob=Nb.create=function(a){return new Nb(a)},Pb=Nb.empty={dispose:Ha},Qb=Nb.isDisposable=function(a){return a&&Oa(a.dispose)},Rb=Nb.checkDisposed=function(a){if(a.isDisposed)throw new Wa},Sb=Ga.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};Sb.prototype.getDisposable=function(){return this.current},Sb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},Sb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Tb=Ga.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Tb.prototype.getDisposable=function(){return this.current},Tb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Tb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Ub=Ga.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Pb:new a(this)},b}();s.prototype.dispose=function(){this.scheduler.scheduleWithState(this,t)};var Vb=Ga.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||La,this.disposable=new Sb};Vb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Vb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Vb.prototype.isCancelled=function(){return this.disposable.isDisposed},Vb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Wb=Ga.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Pb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=Ja,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Xb=Wb.normalize,Yb=Wb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),Pb}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new Lb;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),Pb}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new Lb;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}(Wb.prototype),function(a){Wb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Wb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Fa.setInterval)throw new Ya;b=Xb(b);var d=a,e=Fa.setInterval(function(){d=c(d)},b);return Ob(function(){Fa.clearInterval(e)})}}(Wb.prototype),function(a){a.catchError=a["catch"]=function(a){return new gc(this,a)}}(Wb.prototype);var Zb,$b,_b=Ga.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Sb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),ac=Wb.immediate=function(){function a(a,b){return b(this,a)}return new Wb(Ja,a,_a,_a)}(),bc=Wb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,f){var g=new Vb(this,b,f,this.now());if(c)c.push(g);else{c=[g];var h=d(a)();if(c=null,h===Pa)return e(h.e)}return g.disposable}var c,f=new Wb(Ja,b,_a,_a);return f.scheduleRequired=function(){return!c},f}(),cc=function(){var a,b=Ha;if(Fa.setTimeout)a=Fa.setTimeout,b=Fa.clearTimeout;else{if(!Fa.WScript)throw new Ya;a=function(a,b){Fa.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),dc=cc.setTimeout,ec=cc.clearTimeout;!function(){function a(b){if(h)dc(function(){a(b)},0);else{var c=g[b];if(c){h=!0;var f=d(c)();if($b(b),h=!1,f===Pa)return e(f.e)}}}function b(){if(!Fa.postMessage||Fa.importScripts)return!1;var a=!1,b=Fa.onmessage;return Fa. c(b){"string"==typeof b.data&&b.data.substring(0,k.length)===k&&a(b.data.substring(k.length))}var f=1,g={},h=!1;$b=function(a){delete g[a]};var i=RegExp("^"+String(sb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),j="function"==typeof(j=Ea&&Da&&Ea.setImmediate)&&!i.test(j)&&j;if(Oa(j))Zb=function(b){var c=f++;return g[c]=b,j(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Zb=function(b){var c=f++;return g[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var k="ms.rx.schedule"+Math.random();Fa.addEventListener?Fa.addEventListener("message",c,!1):Fa.attachEvent?Fa.attachEvent("onmessage",c):Fa. b=f++;return g[b]=a,Fa.postMessage(k+currentId,"*"),b}}else if(Fa.MessageChannel){var l=new Fa.MessageChannel;l.port1. b=f++;return g[b]=a,l.port2.postMessage(b),b}}else Zb="document"in Fa&&"onreadystatechange"in Fa.document.createElement("script")?function(b){var c=Fa.document.createElement("script"),d=f++;return g[d]=b,c. c=f++;return g[c]=b,dc(function(){a(c)},0),c}}();var fc=Wb.timeout=Wb["default"]=function(){function a(a,b){var c=this,d=new Sb,e=Zb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new Lb(d,Ob(function(){$b(e)}))}function b(a,b,c){var d=this,e=Wb.normalize(b),f=new Sb;if(0===e)return d.scheduleWithState(a,c);var g=dc(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new Lb(f,Ob(function(){ec(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Wb(Ja,a,b,c)}(),gc=function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Gb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Pb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Sb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Wb),hc=Ga.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return Yb(a)||(a=ac),new Sd(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),ic=hc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new hc("N",d,null,a,b,c)}}(),jc=hc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new hc("E",null,d,a,b,c)}}(),kc=hc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new hc("C",null,null,a,b,c)}}(),lc=Ga.Observer=function(){};lc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},lc.prototype.asObserver=function(){var a=this;return new pc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},lc.prototype.checked=function(){return new qc(this)};var mc=lc.create=function(a,b,c){return a||(a=Ha),b||(b=Ma),c||(c=Ha),new pc(a,b,c)};lc.fromNotifier=function(a,b){var c=fb(a,b,1);return new pc(function(a){return c(ic(a))},function(a){return c(jc(a))},function(){return c(kc())})},lc.prototype.notifyOn=function(a){return new sc(a,this)},lc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var nc,oc=Ga.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return Gb(b,a),b.prototype.next=$a,b.prototype.error=$a,b.prototype.completed=$a,b.prototype. this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(lc),pc=Ga.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Gb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(oc),qc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Gb(b,a);var c=b.prototype;return c. b=d(this._observer.onNext).call(this._observer,a);this._state=0,b===Pa&&e(b.e)},c. b=d(this._observer.onError).call(this._observer,a);this._state=2,b===Pa&&e(b.e)},c. a=d(this._observer.onCompleted).call(this._observer);this._state=2,a===Pa&&e(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(lc),rc=Ga.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Tb}return Gb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var f=d(c)();return f===Pa?(a.queue=[],a.hasFaulted=!0,e(f.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(oc),sc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Gb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(rc),tc=Ga.Observable=function(){function a(a,b){
return function(c){var d=c.onError;return c. b(b){if(Ga.config.longStackSupport&&Qa){var c=d(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return nc=b.prototype,b.isObservable=function(a){return a&&Oa(a.subscribe)},nc.subscribe=nc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:mc(a,b,c))},nc.subscribeOnNext=function(a,b){return this._subscribe(mc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},nc.subscribeOnError=function(a,b){return this._subscribe(mc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},nc.subscribeOnCompleted=function(a,b){return this._subscribe(mc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),uc=Ga.ObservableBase=function(a){function b(a){return a&&Oa(a.dispose)?a:Oa(a)?Ob(a):Pb}function c(a,c){var f=c[0],g=c[1],h=d(g.subscribeCore).call(g,f);return h!==Pa||f.fail(Pa.e)?void f.setDisposable(b(h)):e(Pa.e)}function f(a){var b=new Td(a),d=[b,this];return bc.scheduleRequired()?bc.scheduleWithState(d,c):c(null,d),b}function g(){a.call(this,f)}return Gb(g,a),g.prototype.subscribeCore=$a,g}(tc),vc=function(a){function b(b,c,d,e){this.resultSelector=Ga.helpers.isFunction(d)?d:null,this.selector=Ga.internals.bindCallback(Ga.helpers.isFunction(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.isStopped=!1,this.o=a}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype. b=this.i++,c=d(this.selector)(a,b,this.source);if(c===Pa)return this.o.onError(c.e);Ga.helpers.isPromise(c)&&(c=Ga.Observable.fromPromise(c)),(Ga.helpers.isArrayLike(c)||Ga.helpers.isIterable(c))&&(c=Ga.Observable.from(c)),this.o.onNext(this._wrapResult(c,a,b))}},c.prototype. b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){var b,e=new Tb,f=ac.scheduleRecursiveWithState(this.sources[ab](),function(f,g){if(!b){var h=d(f.next).call(f);if(h===Pa)return a.onError(h.e);if(h.done)return a.onCompleted();var i=h.value;Na(i)&&(i=Ec(i));var j=new Sb;e.setDisposable(j),j.setDisposable(i.subscribe(new c(a,g,f)))}});return new Lb(e,f,Ob(function(){b=!0}))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(uc);wc.prototype.concat=function(){return new xc(this)};var yc=function(a){function b(b){this.sources=b,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[ab](),e=new Tb,f=ac.scheduleRecursiveWithState(null,function(f,g){if(!b){var h=d(c.next).call(c);if(h===Pa)return a.onError(h.e);if(h.done)return null!==f?a.onError(f):a.onCompleted();var i=h.value;Na(i)&&(i=Ec(i));var j=new Sb;e.setDisposable(j),j.setDisposable(i.subscribe(function(b){a.onNext(b)},g,function(){a.onCompleted()}))}});return new Lb(e,f,Ob(function(){b=!0}))},b}(uc);wc.prototype.catchError=function(){return new yc(this)},wc.prototype.catchErrorWhen=function(a){var b=this;return new Sd(function(c){var e,f,g=new Vd,h=new Vd,i=a(g),j=i.subscribe(h),k=b[ab](),l=new Tb,m=ac.scheduleRecursive(function(a){if(!e){var b=d(k.next).call(k);if(b===Pa)return c.onError(b.e);if(b.done)return void(f?c.onError(f):c.onCompleted());var i=b.value;Na(i)&&(i=Ec(i));var j=new Sb,m=new Sb;l.setDisposable(new Lb(m,j)),j.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(h.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),g.onNext(b)},function(){c.onCompleted()}))}});return new Lb(j,l,m,Ob(function(){e=!0}))})};var zc=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return Gb(b,a),b.prototype[ab]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?bb:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(wc),Ac=wc.repeat=function(a,b){return new zc(a,b)},Bc=function(a){function b(a,b,c){this.s=a,this.fn=b?fb(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Gb(b,a),b.prototype[ab]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:bb},b}(wc),Cc=wc.of=function(a,b,c){return new Bc(a,b,c)};nc.observeOn=function(a){var b=this;return new Sd(function(c){return b.subscribe(new sc(a,c))},b)},nc.subscribeOn=function(a){var b=this;return new Sd(function(c){var d=new Sb,e=new Tb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new s(a,b.subscribe(c)))})),e},b)};var Dc=function(a){function b(b){this.p=b,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),Pb},b}(uc),Ec=tc.fromPromise=function(a){return new Dc(a)};nc.toPromise=function(a){if(a||(a=Ga.config.Promise),!a)throw new Ya("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Fc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(uc);nc.toArray=function(){return new Fc(this)},tc.create=function(a,b){return new Sd(a,b)};var Gc=tc.defer=function(a){return new Sd(function(b){var c;try{c=a()}catch(d){return Zc(d).subscribe(b)}return Na(c)&&(c=Ec(c)),c.subscribe(b)})},Hc=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.scheduler=b}function d(a,b){return b.onCompleted(),Pb}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){return this.scheduler.scheduleWithState(this.observer,d)},b}(uc),Ic=new Hc(ac),Jc=tc.empty=function(a){return Yb(a)||(a=ac),a===ac?Ic:new Hc(a)},Kc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new Lc(a,this);return b.run()},b}(uc),Lc=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var g=d(c.next).call(c);if(g===Pa)return e.onError(g.e);if(g.done)return e.onCompleted();var h=g.value;return Oa(f)&&(h=d(f)(h,a),h===Pa)?e.onError(h.e):(e.onNext(h),void b(a+1))}var b=Object(this.parent.iterable),c=z(b),e=this.o,f=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Mc=Math.pow(2,53)-1;u.prototype[ab]=function(){return new v(this._s)},v.prototype[ab]=function(){return this},v.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:bb},w.prototype[ab]=function(){return new x(this._a)},x.prototype[ab]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:bb};var Nc=tc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Oa(b))throw new Error("mapFn when provided must be a function");if(b)var e=fb(b,c,2);return Yb(d)||(d=bc),new Kc(a,e,d)},Oc=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new C(a,this);return b.run()},b}(uc);C.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,
8000
d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Pc=tc.fromArray=function(a,b){return Yb(b)||(b=bc),new Oc(a,b)};tc.generate=function(a,b,c,d,e){return Yb(e)||(e=bc),new Sd(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},tc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Oc(b,bc)},tc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Oc(c,a)},tc.ofArrayChanges=function(a){if(!Array.isArray(a))throw new TypeError("Array.observe only accepts arrays.");if("function"!=typeof Array.observe&&"function"!=typeof Array.unobserve)throw new TypeError("Array.observe is not supported on your platform");return new Sd(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Array.observe(a,c),function(){Array.unobserve(a,c)}})},tc.ofObjectChanges=function(a){if(null==a)throw new TypeError("object must not be null or undefined.");if("function"!=typeof Object.observe&&"function"!=typeof Object.unobserve)throw new TypeError("Object.observe is not supported on your platform");return new Sd(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Object.observe(a,c),function(){Object.unobserve(a,c)}})};var Qc=function(a){function b(){a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){return Pb},b}(uc),Rc=new Qc,Sc=tc.never=function(){return Rc},Tc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(uc);E.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},tc.pairs=function(a,b){return b||(b=bc),new Tc(a,b)};var Uc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new Vc(a,this);return b.run()},b}(uc),Vc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();tc.range=function(a,b,c){return Yb(c)||(c=bc),new Uc(a,b,c)};var Wc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new F(a,this);return b.run()},b}(uc);F.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},tc.repeat=function(a,b,c){return Yb(c)||(c=bc),new Wc(a,b,c)};var Xc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b,c){this.observer=a,this.value=b,this.scheduler=c}function d(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),Pb}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.value,this.scheduler);return b.run()},c.prototype.run=function(){var a=[this.value,this.observer];return this.scheduler===ac?d(null,a):this.scheduler.scheduleWithState(a,d)},b}(uc),Yc=(tc["return"]=tc.just=function(a,b){return Yb(b)||(b=ac),new Xc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(uc)),Zc=tc["throw"]=function(a,b){return Yb(b)||(b=ac),new Yc(a,b)};tc.using=function(a,b){return new Sd(function(c){var e=Pb,f=d(a)();if(f===Pa)return new Lb(Zc(f.e).subscribe(c),e);f&&(e=f);var g=d(b)(f);return g===Pa?new Lb(Zc(g.e).subscribe(c),e):new Lb(g.subscribe(c),e)})},nc.amb=function(a){var b=this;return new Sd(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Sb,j=new Sb;Na(a)&&(a=Ec(a));var k=mc(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=mc(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new Lb(i,j)})},tc.amb=function(){var a,b=Sc();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=G(b,a[d]);return b};var $c=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return Gb(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=d(this._fn)(a);if(b===Pa)return this._o.onError(b.e);Na(b)&&(b=Ec(b));var c=new Sb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(oc);nc["catch"]=function(a){return Oa(a)?H(this,a):_c([this,a])};var _c=tc["catch"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return Cc(a).catchError()};nc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),ad.apply(this,b)};var ad=tc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Oa(b[a-1])?b.pop():J;return Array.isArray(b[0])&&(b=b[0]),new Sd(function(a){function c(b){if(g[b]=!0,h||(h=g.every(Ia))){try{var c=d.apply(null,j)}catch(e){return a.onError(e)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(Ia)&&a.onCompleted()}function e(b){i[b]=!0,i.every(Ia)&&a.onCompleted()}for(var f=b.length,g=q(f,I),h=!1,i=q(f,I),j=new Array(f),k=new Array(f),l=0;f>l;l++)!function(d){var f=b[d],g=new Sb;Na(f)&&(f=Ec(f)),g.setDisposable(f.subscribe(function(a){j[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),k[d]=g}(l);return new Lb(k)},this)};nc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),cd.apply(null,a)};var bd=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new Tb,c=this.sources,d=c.length,e=this.o,f=ac.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];Na(h)&&(h=Ec(h));var i=new Sb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new Lb(b,f,Ob(function(){a=!0}))},b}(uc),cd=tc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new bd(a)};nc.concatAll=function(){return this.merge(1)};var dd=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new Lb;return b.add(this.source.subscribe(new ed(a,this.maxConcurrent,b))),b},b}(uc),ed=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new Sb;this.g.add(c),Na(a)&&(a=Ec(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype. a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();nc.merge=function(a){return"number"!=typeof a?fd(this,a):new dd(this,a)};var fd=tc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Yb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=ac,b=0;d>b;b++)c.push(arguments[b]);else for(a=ac,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),D(a,c).mergeAll()},gd=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new Lb,d=new Sb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype. b=new Sb;this.g.add(b),Na(a)&&(a=Ec(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype. a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(uc);nc.mergeAll=function(){return new gd(this)};var hd=Ga.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};hd.prototype=Error.prototype,tc.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=D(null,a);return new Sd(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new hd(g))}var c=new Lb,e=new Sb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new Sb;c.add(e),Na(d)&&(d=Ec(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},nc. new Error("Second observable is required");return id([this,a])};var id=tc. a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Sd(function(b){var c=0,d=new Tb,e=ac.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Na(f)&&(f=Ec(f)),g=new Sb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Lb(d,e)})};nc.skipUntil=function(a){var b=this;return new Sd(function(c){var d=!1,e=new Lb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));Na(a)&&(a=Ec(a));var f=new Sb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var jd=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){var b=new Tb,d=this.source.subscribe(new c(a,b));return new Lb(d,b)},c.prototype. b=new Sb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),Na(a)&&(a=Ec(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype. this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(uc);nc["switch"]=nc.switchLatest=function(){return new jd(this)};var kd=function(a){function b(b,c){this.source=b,this.other=Na(c)?Ec(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){return new Lb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(uc);nc.takeUntil=function(a){return new kd(this,a)},nc.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=b.pop(),f=this;return Array.isArray(b[0])&&(b=b[0]),new Sd(function(a){for(var c=b.length,g=q(c,I),h=!1,i=new Array(c),j=new Array(c+1),k=0;c>k;k++)!function(c){var d=b[c],e=new Sb;Na(d)&&(d=Ec(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Ia)},function(b){a.onError(b)},Ha)),j[c]=e}(k);var l=new Sb;return l.setDisposable(f.subscribe(function(b){var c=[b].concat(i);if(h){var f=d(e).apply(null,c);return f===Pa?a.onError(f.e):void a.onNext(f)}},function(b){a.onError(b)},function(){a.onCompleted()})),j[c]=l,new Lb(j)},this)},nc.zip=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=Oa(b[a-1])?b.pop():J;Array.isArray(b[0])&&(b=b[0]);var f=this;return b.unshift(f),new Sd(function(a){for(var c=b.length,g=q(c,K),h=q(c,I),i=new Array(c),j=0;c>j;j++)!function(c){var j=b[c],k=new Sb;Na(j)&&(j=Ec(j)),k.setDisposable(j.subscribe(function(b){if(g[c].push(b),g.every(function(a){return a.length>0})){var i=g.map(function(a){return a.shift()}),j=d(e).apply(f,i);if(j===Pa)return a.onError(j.e);a.onNext(j)}else h.filter(function(a,b){return b!==c}).every(Ia)&&a.onCompleted()},function(b){a.onError(b)},function(){h[c]=!0,h.every(Ia)&&a.onCompleted()})),i[c]=k}(j);return new Lb(i)},f)},tc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},nc.zipIterable=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=Oa(b[a-1])?b.pop():J,f=this;return b.unshift(f),new Sd(function(a){for(var c=b.length,g=q(c,K),h=q(c,I),i=new Array(c),j=0;c>j;j++)!function(c){var j=b[c],k=new Sb;(db(j)||cb(j))&&(j=Nc(j)),k.setDisposable(j.subscribe(function(b){if(g[c].push(b),g.every(function(a){return a.length>0})){var i=g.map(function(a){return a.shift()}),j=d(e).apply(f,i);if(j===Pa)return a.onError(j.e);a.onNext(j)}else h.filter(function(a,b){return b!==c}).every(Ia)&&a.onCompleted()},function(b){a.onError(b)},function(){h[c]=!0,h.every(Ia)&&a.onCompleted()})),i[c]=k}(j);return new Lb(i)},f)},nc.asObservable=function(){return new Sd(L(this),this)},nc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(M).filter(N)},nc.dematerialize=function(){var a=this;return new Sd(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var ld=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new md(a,this.keyFn,this.comparer))},b}(uc),md=function(a){function b(b,c,d){this.o=b,this.keyFn=c,this.comparer=d,this.hasCurrentKey=!1,this.currentKey=null,a.call(this)}return Gb(b,a),b.prototype.next=function(a){var b,c=a;return Oa(this.keyFn)&&(c=d(this.keyFn)(a),c===Pa)?this.o.onError(c.e):this.hasCurrentKey&&(b=d(this.comparer)(this.currentKey,c),b===Pa)?this.o.onError(b.e):void(this.hasCurrentKey&&b||(this.hasCurrentKey=!0,this.currentKey=c,this.o.onNext(a)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.o.onCompleted()},b}(oc);nc.distinctUntilChanged=function(a,b){return b||(b=Ka),new ld(this,a,b)};var nd=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||Oa(b._oN)?mc(b._oN||Ha,b._oE||Ha,b._oC||Ha):b._oN,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype. b=d(this.t.onNext).call(this.t,a);b===Pa&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype. b=d(this.t.onError).call(this.t,a);if(b===Pa)return this.o.onError(b.e);this.o.onError(a)}},c.prototype. a=d(this.t.onCompleted).call(this.t);if(a===Pa)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(uc);nc["do"]=nc.tap=nc.doAction=function(a,b,c){return new nd(this,a,b,c)},nc.doOnNext=nc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},nc.doOnError=nc.tapOnError=function(a,b){return this.tap(Ha,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},nc.doOnCompleted=nc.tapOnCompleted=function(a,b){return this.tap(Ha,null,"undefined"!=typeof b?function(){a.call(b)}:a)},nc["finally"]=function(a){var b=this;return new Sd(function(c){var f=d(b.subscribe).call(b,c);return f===Pa?(a(),e(f.e)):Ob(function(){var b=d(f.dispose).call(f);a(),b===Pa&&e(b.e)})},this)};var od=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(uc);nc.ignoreElements=function(){return new od(this)},nc.materialize=function(){var a=this;return new Sd(function(b){return a.subscribe(function(a){b.onNext(ic(a))},function(a){b.onNext(jc(a)),b.onCompleted()},function(){b.onNext(kc()),b.onCompleted()})},a)},nc.repeat=function(a){return Ac(this,a).concat()},nc.retry=function(a){return Ac(this,a).catchError()},nc.retryWhen=function(a){return Ac(this).catchErrorWhen(a)};var pd=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new O(a,this))},b}(uc);O.prototype={onNext:function(a){return this.isStopped?void 0:(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.accumulation=d(this.accumulator)(this.accumulation,a):(this.accumulation=this.hasSeed?d(this.accumulator)(this.seed,a):a,this.hasAccumulation=!0),this.accumulation===Pa?this.o.onError(this.accumulation.e):void this.o.onNext(this.accumulation))},onError:function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},onCompleted:function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)}},nc.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new pd(this,c,b,a)},nc.skipLast=function(a){if(0>a)throw new Xa;var b=this;return new Sd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},nc.startWith=function(){var a,b=0;arguments.length&&Yb(arguments[0])?(a=arguments[0],b=1):a=ac;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Cc([Pc(c,a),this]).concat()},nc.takeLast=function(a){if(0>a)throw new Xa;var b=this;return new Sd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},nc.takeLastBuffer=function(a){var b=this;return new Sd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},nc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new Xa;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new Xa;return new Sd(function(d){function e(){var a=new Vd;i.push(a),d.onNext(Ib(a,g))}var f=new Sb,g=new Ub(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},nc.selectConcat=nc.concatMap=function(a,b,c){return Oa(a)&&Oa(b)?this.concatMap(function(c,d){var e=a(c,d);return Na(e)&&(e=Ec(e)),
(db(e)||cb(e))&&(e=Nc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Oa(a)?P(this,a,c):P(this,function(){return a})},nc.concatMapObserver=nc.selectConcatObserver=function(a,b,c,d){var e=this,f=fb(a,d,2),g=fb(b,d,1),h=fb(c,d,0);return new Sd(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Na(d)&&(d=Ec(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Na(c)&&(c=Ec(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Na(b)&&(b=Ec(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},nc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Sd(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},R.prototype.push=function(a){var b=-1===Q(this.set,a,this.comparer);return b&&this.set.push(a),b},nc.distinct=function(a,b){var c=this;return b||(b=Ka),new Sd(function(d){var e=new R(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},nc.groupBy=function(a,b){return this.groupByUntil(a,b,Sc)},nc.groupByUntil=function(b,c,e){var f=this;return new Sd(function(g){var h=new Pd,i=new Lb,j=new Ub(i),k=function(a){return function(b){b.onError(a)}};return i.add(f.subscribe(function(f){var l=d(b)(f);if(l===Pa)return h.forEach(k(l.e)),g.onError(l.e);var m=!1,n=h.get(l);if(n===a&&(n=new Vd,h.set(l,n),m=!0),m){var o=new Ud(l,n,j),p=new Ud(l,n),q=d(e)(p);if(q===Pa)return h.forEach(k(q.e)),g.onError(q.e);g.onNext(o);var r=new Sb;i.add(r),r.setDisposable(q.take(1).subscribe(Ha,function(a){h.forEach(k(a)),g.onError(a)},function(){h["delete"](l)&&n.onCompleted(),i.remove(r)}))}var s=f;return Oa(c)&&(s=d(c)(f),s===Pa)?(h.forEach(k(s.e)),g.onError(s.e)):void n.onNext(s)},function(a){h.forEach(k(a)),g.onError(a)},function(){h.forEach(function(a){a.onCompleted()}),g.onCompleted()})),j},f)};var qd=function(a){function b(b,c,d){this.source=b,this.selector=fb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function e(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return Gb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new e(a,this.selector,this))},e.prototype. b=d(this.selector)(a,this.i++,this.source);return b===Pa?this.o.onError(b.e):void this.o.onNext(b)}},e.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(uc);nc.map=nc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof qd?this.internalMap(c,b):new qd(this,c,b)},nc.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error("List of properties cannot be empty.");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(S(b,a))},nc.flatMap=nc.selectMany=function(a,b,c){return new vc(this,a,b,c).mergeAll()},nc.flatMapObserver=nc.selectManyObserver=function(a,b,c,d){var e=this;return new Sd(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Na(c)&&(c=Ec(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Na(c)&&(c=Ec(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Na(a)&&(a=Ec(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Ga.Observable.prototype.flatMapLatest=function(a,b,c){return new vc(this,a,b,c).switchLatest()};var rd=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(uc);nc.skip=function(a){if(0>a)throw new Xa;return new rd(this,a)},nc.skipWhile=function(a,b){var c=this,d=fb(a,b,3);return new Sd(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},nc.take=function(a,b){if(0>a)throw new Xa;if(0===a)return Jc(b);var c=this;return new Sd(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},nc.takeWhile=function(a,b){var c=this,d=fb(a,b,3);return new Sd(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var sd=function(a){function b(b,c,d){this.source=b,this.predicate=fb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function e(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new e(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},e.prototype. b=d(this.predicate)(a,this.i++,this.source);return b===Pa?this.o.onError(b.e):void(b&&this.o.onNext(a))}},e.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(uc);nc.filter=nc.where=function(a,b){return this instanceof sd?this.internalFilter(a,b):new sd(this,a,b)};var td=function(a){function b(b,c,d,e){this.source=b,this.acc=c,this.hasSeed=d,this.seed=e,a.call(this)}function c(a,b){this.o=a,this.acc=b.acc,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.result=null,this.hasValue=!1,this.isStopped=!1}return Gb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype. Va),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(uc);nc.reduce=function(a){var b=!1;if(2===arguments.length){b=!0;var c=arguments[1]}return new td(this,a,b,c)};var ud=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Gb(b,a),b.prototype.next=function(a){var b=d(this._fn)(a,this._i++,this._s);return b===Pa?this._o.onError(b.e):void(Boolean(b)&&(this._o.onNext(!0),this._o.
8000
onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(oc);nc.some=function(a,b){var c=this,d=fb(a,b,3);return new Sd(function(a){return c.subscribe(new ud(a,d,c))})};var vd=function(a){function b(b){this._o=b,a.call(this)}return Gb(b,a),b.prototype.next=function(){this._o.onNext(!1),this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(oc);nc.isEmpty=function(){var a=this;return new Sd(function(b){return a.subscribe(new vd(b))},a)};var wd=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Gb(b,a),b.prototype.next=function(a){var b=d(this._fn)(a,this._i++,this._s);return b===Pa?this._o.onError(b.e):void(Boolean(b)||(this._o.onNext(!1),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(oc);nc.every=function(a,b){var c=this,d=fb(a,b,3);return new Sd(function(a){return c.subscribe(new wd(a,d,c))},this)},nc.includes=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new Sd(function(e){var f=0,g=+b||0;return Math.abs(g)===1/0&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),Pb):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},function(a){e.onError(a)},function(){e.onNext(!1),e.onCompleted()})},this)},nc.contains=function(a,b){nc.includes(a,b)},nc.count=function(a,b){return a?this.filter(a,b).count():this.reduce(function(a){return a+1},0)},nc.indexOf=function(a,b){var c=this;return new Sd(function(d){var e=0,f=+b||0;return Math.abs(f)===1/0&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),Pb):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},function(a){d.onError(a)},function(){d.onNext(-1),d.onCompleted()})},c)},nc.sum=function(a,b){return a&&Oa(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},nc.minBy=function(a,b){return b||(b=La),T(this,a,function(a,c){return-1*b(a,c)})},nc.min=function(a){return this.minBy(Ia,a).map(function(a){return U(a)})},nc.maxBy=function(a,b){return b||(b=La),T(this,a,b)},nc.max=function(a){return this.maxBy(Ia,a).map(function(a){return U(a)})};var xd=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._c=0,this._t=0,a.call(this)}return Gb(b,a),b.prototype.next=function(a){if(this._fn){var b=d(this._fn)(a,this._c++,this._s);if(b===Pa)return this._o.onError(b.e);this._t+=b}else this._c++,this._t+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){return 0===this._c?this._o.onError(new Va):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(oc);nc.average=function(a,b){var c,d=this;return Oa(a)&&(c=fb(a,b,3)),new Sd(function(a){return d.subscribe(new xd(a,c,d))},d)},nc.sequenceEqual=function(a,b){var c=this;return b||(b=Ka),new Sd(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(db(a)||cb(a))&&(a=Nc(a)),Na(a)&&(a=Ec(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new Lb(i,j)},c)},nc.elementAt=function(b,c){if(0>b)throw new Xa;var d=this;return new Sd(function(e){var f=b;return d.subscribe(function(a){0===f--&&(e.onNext(a),e.onCompleted())},function(a){e.onError(a)},function(){c===a?e.onError(new Xa):(e.onNext(c),e.onCompleted())})},d)},nc.single=function(a,b){if(Oa(a))return this.filter(a,b).single();var c=this;return new Sd(function(a){var b,d=!1;return c.subscribe(function(c){d?a.onError(new Error("Sequence contains more than one element")):(b=c,d=!0)},function(b){a.onError(b)},function(){a.onNext(b),a.onCompleted()})},c)};var yd=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,b.call(this)}return Gb(c,b),c.prototype.next=function(a){if(this._obj.predicate){var b=d(this._obj.predicate)(a,this._i++,this._s);if(b===Pa)return this._o.onError(b.e);Boolean(b)&&(this._o.onNext(a),this._o.onCompleted())}else this._obj.predicate||(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._obj.defaultValue===a?this._o.onError(new Va):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(oc);nc.first=function(){var a={},b=this;if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Oa(a.predicate)){var c=a.predicate;a.predicate=fb(c,a.thisArg,3)}return new Sd(function(c){return b.subscribe(new yd(c,a,b))},b)},nc.last=function(){var b={},c=this;if(b="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Oa(b.predicate)){var e=b.predicate;b.predicate=fb(e,b.thisArg,3)}return new Sd(function(e){var f,g=!1,h=0;return c.subscribe(function(a){if(b.predicate){var i=d(b.predicate)(a,h++,c);if(i===Pa)return e.onError(i.e);i&&(g=!0,f=a)}else b.predicate||(g=!0,f=a)},function(a){e.onError(a)},function(){g?(e.onNext(f),e.onCompleted()):b.defaultValue===a?e.onError(new Va):(e.onNext(b.defaultValue),e.onCompleted())})},c)},nc.find=function(a,b){return V(this,a,b,!1)},nc.findIndex=function(a,b){return V(this,a,b,!0)},nc.toSet=function(){if("undefined"==typeof Fa.Set)throw new TypeError;var a=this;return new Sd(function(b){var c=new Fa.Set;return a.subscribe(function(a){c.add(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},nc.toMap=function(a,b){if("undefined"==typeof Fa.Map)throw new TypeError;var c=this;return new Sd(function(d){var e=new Fa.Map;return c.subscribe(function(c){var f;try{f=a(c)}catch(g){return void d.onError(g)}var h=c;if(b)try{h=b(c)}catch(g){return void d.onError(g)}e.set(f,h)},function(a){d.onError(a)},function(){d.onNext(e),d.onCompleted()})},c)},tc.wrap=function(a){function b(){return tc.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var zd=tc.spawn=function(){for(var a=arguments[0],b=this,c=[],e=1,f=arguments.length;f>e;e++)c.push(arguments[e]);return new Sd(function(e){function f(b){var c=d(a.next).call(a,b);return c===Pa?e.onError(c.e):void h(c)}function g(b){var c=d(a.next).call(a,b);return c===Pa?e.onError(c.e):void h(c)}function h(a){if(a.done)return e.onNext(a.value),void e.onCompleted();var c=W.call(b,a.value);tc.isObservable(c)?i.add(c.subscribe(f,g)):g(new TypeError("type not supported"))}var i=new Lb;return Oa(a)&&(a=a.apply(b,c)),a&&Oa(a.next)?(f(),i):(e.onNext(a),e.onCompleted())})};tc.start=function(a,b,c){return Ad(a,b,c)()};var Ad=tc.toAsync=function(a,b,c){return Yb(c)||(c=fc),function(){var d=arguments,e=new Wd;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};tc.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return aa(a,b,c,e)}},tc.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return ca(a,b,c,e)}},ea.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},Ga.config.useNativeEvents=!1,tc.fromEvent=function(a,b,c){return a.addListener?Bd(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Ga.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Sd(function(d){return fa(a,b,ga(d,c))}).publish().refCount():Bd(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Bd=tc.fromEventPattern=function(a,b,c,e){return Yb(e)||(e=ac),new Sd(function(e){function f(){var a=arguments[0];return Oa(c)&&(a=d(c).apply(null,arguments),a===Pa)?e.onError(a.e):void e.onNext(a)}var g=a(f);return Ob(function(){Oa(b)&&b(f,g)})}).publish().refCount()};tc.startAsync=function(a){var b;try{b=a()}catch(c){return Zc(c)}return Ec(b)};var Cd=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Pb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Pb)});return new Lb(c,d,e)}function c(c,d){this.source=c,this.controller=new Vd,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return Gb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(tc);nc.pausable=function(a){return new Cd(this,a)};var Dd=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=ha(this.source,this.pauser.startWith(!1).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!=d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f}function d(a,d){this.source=a,this.controller=new Vd,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return Gb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(tc);nc.pausableBuffered=function(a){return new Dd(this,a)};var Ed=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new Fd(d,e),this.source=c.multicast(this.subject).refCount()}return Gb(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(tc),Fd=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new Vd,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||bc}return Gb(c,a),Hb(c.prototype,lc,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(hc.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(hc.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(hc.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||"N"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,Ob(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),c}(tc);nc.controlled=function(a,b){return a&&Yb(a)&&(b=a,a=!0),null==a&&(a=!0),new Ed(this,a,b)};var Gd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return fc.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}Gb(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}Gb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;fc.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(oc);return c}(tc);Ed.prototype.stopAndWait=function(){return new Gd(this)};var Hd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return fc.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}Gb(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}Gb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;fc.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(oc);return c}(tc);Ed.prototype.windowed=function(a){return new Hd(this,a)},nc.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},nc.multicast=function(a,b){var c=this;return"function"==typeof a?new Sd(function(d){var e=c.multicast(a());return new Lb(b(e).subscribe(d),e.connect())},c):new Ld(c,a)},nc.publish=function(a){return a&&Oa(a)?this.multicast(function(){return new Vd},a):this.multicast(new Vd)},nc.share=function(){return this.publish().refCount()},nc.publishLast=function(a){return a&&Oa(a)?this.multicast(function(){return new Wd},a):this.multicast(new Wd)},nc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Jd(b)},a):this.multicast(new Jd(a))},nc.shareValue=function(a){return this.publishValue(a).refCount()},nc.replay=function(a,b,c,d){return a&&Oa(a)?this.multicast(function(){return new Kd(b,c,d)},a):this.multicast(new Kd(b,c,d))},nc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Id=function(a,b){this.subject=a,this.observer=b};Id.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Jd=Ga.BehaviorSubject=function(a){function c(a){return Rb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Pb):(this.observers.push(a),a.onNext(this.value),new Id(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Gb(d,a),Hb(d.prototype,lc,{getValue:function(){if(Rb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Rb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Rb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Rb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(tc),Kd=Ga.ReplaySubject=function(a){function c(a,b){return Ob(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new rc(this.scheduler,a),d=c(this,b);Rb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||bc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return Gb(e,a),Hb(e.prototype,lc.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(Rb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(Rb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(Rb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(tc),Ld=Ga.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Lb(f.subscribe(c),Ob(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return Gb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Sd(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(tc);nc.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new Sd(function(b){return a().subscribe(b)})},nc.join=function(a,b,c,e){var f=this;return new Sd(function(g){var h=new Lb,i=!1,j=!1,k=0,l=0,m=new Pd,n=new Pd,o=function(a){g.onError(a)};return h.add(f.subscribe(function(a){var c=k++,f=new Sb;m.set(c,a),h.add(f);var j=d(b)(a);return j===Pa?g.onError(j.e):(f.setDisposable(j.take(1).subscribe(Ha,o,function(){m["delete"](c)&&0===m.size&&i&&g.onCompleted(),h.remove(f)})),void n.forEach(function(b){var c=d(e)(a,b);return c===Pa?g.onError(c.e):void g.onNext(c)}))},o,function(){i=!0,(j||0===m.size)&&g.onCompleted()})),h.add(a.subscribe(function(a){var b=l++,f=new Sb;n.set(b,a),h.add(f);var i=d(c)(a);return i===Pa?g.onError(i.e):(f.setDisposable(i.take(1).subscribe(Ha,o,function(){n["delete"](b)&&0===n.size&&j&&g.onCompleted(),h.remove(f)})),void m.forEach(function(b){var c=d(e)(b,a);return c===Pa?g.onError(c.e):void g.onNext(c)}))},o,function(){j=!0,(i||0===n.size)&&g.onCompleted()})),h},f)},nc.groupJoin=function(a,b,c,e){var f=this;return new Sd(function(g){function h(a){}var i=new Lb,j=new Ub(i),k=new Pd,l=new Pd,m=0,n=0,h=function(a){return function(b){b.onError(a)}};return i.add(f.subscribe(function(a){var c=new Vd,f=m++;k.set(f,c);var n=d(e)(a,Ib(c,j));if(n===Pa)return k.forEach(h(n.e)),g.onError(n.e);g.onNext(n),l.forEach(function(a){c.onNext(a)});var o=new Sb;i.add(o);var p=d(b)(a);return p===Pa?(k.forEach(h(p.e)),g.onError(p.e)):void o.setDisposable(p.take(1).subscribe(Ha,function(a){k.forEach(h(a)),g.onError(a)},function(){k["delete"](f)&&c.onCompleted(),i.remove(o)}))},function(a){k.forEach(h(a)),g.onError(a)},function(){g.onCompleted()})),i.add(a.subscribe(function(a){var b=n++;l.set(b,a);var e=new Sb;i.add(e);var f=d(c)(a);return f===Pa?(k.forEach(h(f.e)),g.onError(f.e)):(e.setDisposable(f.take(1).subscribe(Ha,function(a){k.forEach(h(a)),g.onError(a)},function(){l["delete"](b),i.remove(e)})),void k.forEach(function(b){b.onNext(a)}))},function(a){k.forEach(h(a)),g.onError(a)})),j},f)},nc.buffer=function(){return this.window.apply(this,arguments).flatMap(M)},nc.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?ja.call(this,a):"function"==typeof a?ka.call(this,a):ia.call(this,a,b)},nc.pairwise=function(){var a=this;return new Sd(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},nc.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]};var Md=function(a){function b(a,b){this.c=a,this.s=b}return Gb(b,a),b.prototype[ab]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(wc);nc.letBind=nc.let=function(a){return a(this)},tc["if"]=function(a,b,c){return Gc(function(){return c||(c=Jc()),Na(b)&&(b=Ec(b)),Na(c)&&(c=Ec(c)),"function"==typeof c.now&&(c=Jc(c)),a()?b:c})},tc["for"]=tc.forIn=function(a,b,c){return Cc(a,b,c).concat()};var Nd=tc["while"]=tc.whileDo=function(a,b){return Na(b)&&(b=Ec(b)),la(a,b).concat()};nc.doWhile=function(a){return cd([this,Nd(a,this)])},tc["case"]=function(a,b,c){return Gc(function(){Na(c)&&(c=Ec(c)),c||(c=Jc()),Yb(c)&&(c=Jc(c));var d=b[a()];return Na(d)&&(d=Ec(d)),d||c})},nc.expand=function(a,b){Yb(b)||(b=ac);var c=this;return new Sd(function(d){var e=[],f=new Tb,g=new Lb(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new Sb;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},tc.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Sd(function(b){var c=a.length;if(0===c)return b.onCompleted(),Pb;for(var d=new Lb,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];Na(j)&&(j=Ec(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},nc.forkJoin=function(a,b){var c=this;return new Sd(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new Sb,l=new Sb;return Na(a)&&(a=Ec(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new Lb(k,l)},c)},nc.manySelect=nc.extend=function(a,b){Yb(b)||(b=ac);var c=this;return Gc(function(){var d;return c.map(function(a){var b=new Od(a);return d&&d.onNext(a),d=b,b}).tap(Ha,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var Od=function(a){function b(a){var b=this,c=new Lb;return c.add(bc.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new Wd}return Gb(c,a),Hb(c.prototype,lc,{onCompleted:function(){this.onNext(tc.empty())},onError:function(a){this.onNext(tc["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(tc),Pd=Fa.Map||function(){function b(){this.size=0,this._values=[],this._keys=[]}return b.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},b.prototype.get=function(b){
var c=this._keys.indexOf(b);return-1===c?a:this._values[c]},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},b.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},b}();ma.prototype.and=function(a){return new ma(this.patterns.concat(a))},ma.prototype.thenDo=function(a){return new na(this,a)},na.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,g=this.expression.patterns.length;g>f;f++)e.push(oa(a,this.expression.patterns[f],b.onError.bind(b)));var h=new pa(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(h);c(h)});for(f=0,g=e.length;g>f;f++)e[f].addActivePlan(h);return h},pa.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},pa.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var Qd=function(a){function b(b,c){a.call(this),this.source=b,this. Sb,this.isDisposed=!1}Gb(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Ha,c.completed=Ha,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(oc);nc.and=function(a){return new ma([this,a])},nc.thenDo=function(a){return new ma([this]).thenDo(a)},tc.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Sd(function(b){var c=[],d=new Pd,e=mc(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){Zc(h).subscribe(b)}var i=new Lb;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};var Rd=tc.interval=function(a,b){return ta(a,a,Yb(b)?b:fc)};tc.timer=function(b,c,d){var e;return Yb(d)||(d=fc),null!=c&&"number"==typeof c?e=c:Yb(c)&&(d=c),b instanceof Date&&e===a?qa(b.getTime(),d):b instanceof Date&&e!==a?ra(b.getTime(),c,d):e===a?sa(b,d):ta(b,e,d)};nc.delay=function(a,b){return Yb(b)||(b=fc),a instanceof Date?va(this,a.getTime(),b):ua(this,a,b)},nc.debounce=function(a,b){Yb(b)||(b=fc);var c=this;return new Sd(function(d){var e,f=new Tb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Sb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Lb(i,f)},this)},nc.throttle=function(a,b){return this.debounce(a,b)},nc.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),Yb(c)||(c=fc),"number"==typeof b?d=b:Yb(b)&&(d=a,c=b),new Sd(function(b){function f(){var a=new Sb,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleWithRelative(o,function(){if(g){var a=new Vd;k.push(a),b.onNext(Ib(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new Tb,m=0;return g=new Lb(l),h=new Ub(g),k.push(new Vd),b.onNext(Ib(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},nc.windowWithTimeOrCount=function(a,b,c){var d=this;return Yb(c)||(c=fc),new Sd(function(e){function f(b){var d=new Sb;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new Vd,e.onNext(Ib(l,i)),f(a)}}))}var g=new Tb,h=new Lb(g),i=new Ub(h),j=0,k=0,l=new Vd;return e.onNext(Ib(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new Vd,e.onNext(Ib(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},nc.bufferWithTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(M)},nc.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(M)},nc.timeInterval=function(a){var b=this;return Yb(a)||(a=fc),Gc(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},nc.timestamp=function(a){return Yb(a)||(a=fc),this.map(function(b){return{value:b,timestamp:a.now()}})},nc.sample=nc.throttleLatest=function(a,b){return Yb(b)||(b=fc),"number"==typeof a?wa(this,Rd(a,b)):wa(this,a)},nc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Zc(new Error(b||"Timeout"))),Yb(c)||(c=fc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Sd(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Na(b)&&(b=Ec(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Sb,j=new Tb,k=!1,l=new Tb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Lb(j,l)},d)},tc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return Yb(f)||(f=fc),new Sd(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithAbsoluteAndState(a,f.now(),function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},tc.generateWithRelativeTime=function(a,b,c,d,e,f){return Yb(f)||(f=fc),new Sd(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithRelativeAndState(a,0,function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},nc.delaySubscription=function(a,b){var c=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative",d=this;return Yb(b)||(b=fc),new Sd(function(e){var f=new Tb;return f.setDisposable(b[c](a,function(){f.setDisposable(d.subscribe(e))})),f},this)},nc.delayWithSelector=function(a,b){var c,e,f=this;return Oa(a)?e=a:(c=a,e=b),new Sd(function(a){function b(){j.setDisposable(f.subscribe(function(b){var c=d(e)(b);if(c===Pa)return a.onError(c.e);var
5D5E
f=new Sb;h.add(f),f.setDisposable(c.subscribe(function(){a.onNext(b),h.remove(f),g()},function(b){a.onError(b)},function(){a.onNext(b),h.remove(f),g()}))},function(b){a.onError(b)},function(){i=!0,j.dispose(),g()}))}function g(){i&&0===h.length&&a.onCompleted()}var h=new Lb,i=!1,j=new Tb;return c?j.setDisposable(c.subscribe(b,function(b){a.onError(b)},b)):b(),new Lb(j,h)},this)},nc.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=Sc()),c||(c=Zc(new Error("Timeout")));var d=this;return new Sd(function(e){function f(a){function b(){return k===d}var d=k,f=new Sb;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(c.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(c.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new Tb,i=new Tb,j=new Sb;h.setDisposable(j);var k=0,l=!1;return f(a),j.setDisposable(d.subscribe(function(a){if(g()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}f(Na(c)?Ec(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new Lb(h,i)},d)},nc.debounceWithSelector=function(a){var b=this;return new Sd(function(c){var e,f=!1,g=new Tb,h=0,i=b.subscribe(function(b){var i=d(a)(b);if(i===Pa)return c.onError(i.e);Na(i)&&(i=Ec(i)),f=!0,e=b,h++;var j=h,k=new Sb;g.setDisposable(k),k.setDisposable(i.subscribe(function(){f&&h===j&&c.onNext(e),f=!1,k.dispose()},function(a){c.onError(a)},function(){f&&h===j&&c.onNext(e),f=!1,k.dispose()}))},function(a){g.dispose(),c.onError(a),f=!1,h++},function(){g.dispose(),f&&c.onNext(e),c.onCompleted(),f=!1,h++});return new Lb(i,g)},b)},nc.skipLastWithTime=function(a,b){Yb(b)||(b=fc);var c=this;return new Sd(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},nc.takeLastWithTime=function(a,b){var c=this;return Yb(b)||(b=fc),new Sd(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},nc.takeLastBufferWithTime=function(a,b){var c=this;return Yb(b)||(b=fc),new Sd(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)},nc.takeWithTime=function(a,b){var c=this;return Yb(b)||(b=fc),new Sd(function(d){return new Lb(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},nc.skipWithTime=function(a,b){var c=this;return Yb(b)||(b=fc),new Sd(function(d){var e=!1;return new Lb(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},nc.skipUntilWithTime=function(a,b){Yb(b)||(b=fc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Sd(function(e){var f=!1;return new Lb(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},nc.takeUntilWithTime=function(a,b){Yb(b)||(b=fc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Sd(function(e){return new Lb(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},nc.throttleFirst=function(a,b){Yb(b)||(b=fc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Sd(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)},nc.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Sd(function(e){var f=a(b(e));return c.subscribe(function(a){var b=d(f["@@transducer/step"]).call(f,e,a);b===Pa&&e.onError(b.e)},function(a){e.onError(a)},function(){f["@@transducer/result"](e)})},c)},nc.switchFirst=function(){var a=this;return new Sd(function(b){var c=!1,d=!1,e=new Sb,f=new Lb;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,Na(a)&&(a=Ec(a));var e=new Sb;f.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},function(a){b.onError(a)},function(){d=!0,!c&&1===f.length&&b.onCompleted()})),f},this)},nc.flatMapFirst=nc.selectManyFirst=function(a,b,c){return new vc(this,a,b,c).switchFirst()},Ga.Observable.prototype.flatMapWithMaxConcurrent=function(a,b,c,d){return new vc(this,b,c,d).merge(a)};Ga.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function f(a,b){return b(),Pb}function g(f,g){this.clock=f,this.comparer=g,this.isEnabled=!1,this.queue=new Jb(1024),a.call(this,b,c,d,e)}Gb(g,a);var h=g.prototype;return h.add=$a,h.toDateTimeOffset=$a,h.toRelative=$a,h.schedulePeriodicWithState=function(a,b,c){var d=new _b(this,a,b,c);return d.start()},h.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},h.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,f)},h.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},h.stop=function(){this.isEnabled=!1},h.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new Xa;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},h.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new Xa;0!==c&&this.advanceTo(b)},h.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new Xa;this.clock=b},h.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},h.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,f)},h.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new Vb(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},g}(Wb);Ga.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||La;a.call(this,d,e)}Gb(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toDateTimeOffset=function(a){return new Date(a).getTime()},c.toRelative=function(a){return a},b}(Ga.VirtualTimeScheduler);var Sd=Ga.AnonymousObservable=function(a){function b(a){return a&&Oa(a.dispose)?a:Oa(a)?Ob(a):Pb}function c(a,c){var f=c[0],g=c[1],h=d(g.__subscribe).call(g,f);return h!==Pa||f.fail(Pa.e)?void f.setDisposable(b(h)):e(Pa.e)}function f(a){var b=new Td(a),d=[b,this];return bc.scheduleRequired()?bc.scheduleWithState(d,c):c(null,d),b}function g(b,c){this.source=c,this.__subscribe=b,a.call(this,f)}return Gb(g,a),g}(tc),Td=function(a){function b(b){a.call(this),this.observer=b,this.m=new Sb}Gb(b,a);var c=b.prototype;return c.next=function(a){var b=d(this.observer.onNext).call(this.observer,a);b===Pa&&(this.dispose(),e(b.e))},c.error=function(a){var b=d(this.observer.onError).call(this.observer,a);this.dispose(),b===Pa&&e(b.e)},c.completed=function(){var a=d(this.observer.onCompleted).call(this.observer);this.dispose(),a===Pa&&e(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(oc),Ud=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Sd(function(a){return new Lb(e.getDisposable(),d.subscribe(a))}):d}return Gb(c,a),c}(tc),Vd=Ga.Subject=function(a){function c(a){return Rb(this),this.isStopped?this.hasError?(a.onError(this.error),Pb):(a.onCompleted(),Pb):(this.observers.push(a),new Id(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Gb(d,a),Hb(d.prototype,lc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Rb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Rb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Rb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Xd(a,b)},d}(tc),Wd=Ga.AsyncSubject=function(a){function c(a){return Rb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Pb):(this.observers.push(a),new Id(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Gb(d,a),Hb(d.prototype,lc,{hasObservers:function(){return Rb(this),this.observers.length>0},onCompleted:function(){var a,c;if(Rb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(Rb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){Rb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(tc),Xd=Ga.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Gb(c,a),Hb(c.prototype,lc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(tc);Ga.Pauser=function(a){function b(){a.call(this)}return Gb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Vd),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Fa.Rx=Ga,define(function(){return Ga})):za&&Ca?Da?(Ca.exports=Ga).Rx=Ga:za.Rx=Ga:Fa.Rx=Ga;var Yd=j()}).call(this);
//# sourceMappingURL=rx.all.map