Repository navigation
Expand file tree
/
Copy pathrx.all.min.js
More file actions
7 lines (7 loc) · 134 KB
/
Copy pathrx.all.min.js
File metadata and controls
7 lines (7 loc) · 134 KB
1
2
3
4
5
6
7
/* 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(a){return function(){try{return a.apply(this,arguments)}catch(b){return Ta.e=b,Ta}}}function d(a){throw a}function e(a,b){if(Va&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Za)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+Za+"\n");a.stack=f(e)}}function f(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];g(f)||h(f)||!f||c.push(f)}return c.join("\n")}function g(a){var b=j(a);if(!b)return!1;var c=b[0],d=b[1];return c===Xa&&d>=Ya&&Zf>=d}function h(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function i(){if(Va)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=j(c);if(!d)return;return Xa=d[0],d[1]}}function j(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 k(a){var b=[];if(!Z(a))return b;Fb.nonEnumArgs&&a.length&&Gb(a)&&(a=Ib.call(a));var c=Fb.enumPrototypes&&"function"==typeof a,d=Fb.enumErrorProps&&(a===zb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Fb.nonEnumShadows&&a!==Ab){var f=a.constructor,g=-1,h=lb;if(a===(f&&f.prototype))var i=a===Bb?vb:a===zb?qb:wb.call(a),j=Eb[i];for(;++g<h;)e=kb[g],j&&j[e]||!xb.call(a,e)||b.push(e)}return b}function l(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 m(a,b){return l(a,b,k)}function n(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function o(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=wb.call(a),h=wb.call(b);if(g==mb&&(g=tb),h==mb&&(h=tb),g!=h)return!1;switch(g){case ob:case pb:return+a==+b;case sb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ub:case vb:return a==String(b)}var i=g==nb;if(!i){if(g!=tb||!Fb.nodeClass&&(n(a)||n(b)))return!1;var j=!Fb.argsObject&&Gb(a)?Object:a.constructor,k=!Fb.argsObject&&Gb(b)?Object:b.constructor;if(!(j==k||xb.call(a,"constructor")&&xb.call(b,"constructor")||Sa(j)&&j instanceof j&&Sa(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 p=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,p=b.length,q=p==l)for(;p--;){var r=b[p];if(!(q=o(a[p],r,c,d)))break}}else m(b,function(b,e,f){return xb.call(f,e)?(p++,q=xb.call(a,e)&&o(a[e],b,c,d)):void 0}),q&&m(a,function(a,b,c){return xb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function s(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function t(a){this._s=a,this.isDisposed=!1}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&&Ja.isFinite(a)}function z(b){var c,d=b[eb];if(!d&&"string"==typeof b)return c=new u(b),c[eb]();if(!d&&b.length!==a)return c=new w(b),c[eb]();if(!d)throw new TypeError("Object is not iterable");return b[eb]()}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>_c?_c:b):b}function C(a,b){this.observer=a,this.parent=b}function D(a,b){return cc(a)||(a=jc),new bd(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(){return!1}function I(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function H(){return!1}function I(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function H(){return!1}function J(){return[]}function H(){return!1}function J(){return[]}function I(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(a){return function(b){return a.subscribe(b)}}function L(a){return a.toArray()}function M(a){return a.length>0}function N(a,b,c){var d=jb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Ra(e)&&(e=Sc(e)),(hb(e)||gb(e))&&(e=ad(e)),e}).concatAll()}function O(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function P(a){this.comparer=a,this.set=[]}function Q(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 R(a){if(0===a.length)throw new $a;return a[0]}function S(a,b,c,d){var e=jb(b,c,3);return new Sf(function(b){return a.subscribe(new Me(b,a,e,d))},a)}function T(a){return a?Fc.isObservable(a)?a:Ra(a)?Fc.fromPromise(a):Y(a)||X(a)?Ve.call(this,a):Sa(a)?W.call(this,a):hb(a)||gb(a)?U.call(this,a):Z(a)?V.call(this,a):a:a}function U(a){return Fc.from(a).flatMap(T).toArray()}function V(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=T.call(this,b[i]);j&&Fc.isObservable(j)?c(j,i):d[i]=b[i]}return Fc.forkJoin.apply(Fc,f).map(function(){return d})}function W(a){var b=this;return new Sf(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 X(a){return Sa(a.next)&&Sa(a["throw"])}function Y(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:X(b.prototype):!1}function Z(a){return Object==a.constructor}function $(a,b,c,d){var e=new Xf;return d.push(_(e,b,c)),a.apply(b,d),e.asObservable()}function _(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(Sa(c)){if(e=Ua(c).apply(b,e),e===Ta)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function aa(a,b,c,d){var e=new Xf;return d.push(ba(e,b,c)),a.apply(b,d),e.asObservable()}function ba(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(Sa(c)){var f=Ua(c).apply(b,f);if(f===Ta)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){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function da(a,b,c){var d=new Ob,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(da(a.item(f),b,c));else a&&d.add(new ca(a,b,c));return d}function ea(a,b){return function(){var c=arguments[0];return Sa(b)&&(c=Ua(b).apply(null,arguments),c===Ta)?a.onError(c.e):void a.onNext(c)}}function fa(a,b,c){return new Sf(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(Ma))){if(f)return d.onError(f);var e=Ua(c).apply(null,j);if(e===Ta)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Yb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function L(a){return a.toArray()}function ga(a,b){return a.groupJoin(this,b,Yc,function(a,b){return b})}function ha(a){var b=this;return new Sf(function(c){var d=new Wf,e=new Ob,f=new $b(e);return c.onNext(Lb(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Ra(a)&&(a=Sc(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new Wf,c.onNext(Lb(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ia(a){var b=this;return new Sf(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Ra(b)&&(b=Sc(b));var i=new Wb;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(La,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Wf,c.onNext(Lb(h,g)),d()}))}var e=new Xb,f=new Ob(e),g=new $b(f),h=new Wf;return c.onNext(Lb(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 ja(a,b){return new jf(a,b)}function ka(a){this.patterns=a}function la(a,b){this.expression=a,this.selector=b}function ma(a,b,c){var d=a.get(b);if(!d){var e=new nf(b,c);return a.set(b,e),e}return d}function na(a,b,c){this.joinObserverArray=a,this. mf;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function oa(a,b){return new of(a,b)}function pa(a,b,c){return new Sf(function(d){var e=a,f=bc(b);return c.scheduleRecursiveFuture(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,new Date(e))})})}function qa(a,b,c){return a===b?new Sf(function(a){return c.schedulePeriodic(0,b,function(b){return a.onNext(b),b+1})}):Vc(function(){return pa(new Date(c.now()+a),b,c)})}function ra(a,b,c){return new Sf(function(d){var e,f=!1,g=new Xb,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.error,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Wb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveFuture(null,b,function(a,b){var e,g,k,l;if(null===h){j=!0;do k=null,i.length>0&&i[0].timestamp-c.now()<=0&&(k=i.shift().value),null!==k&&k.accept(d);while(null!==k);l=!1,g=0,i.length>0?(l=!0,g=Math.max(0,i[0].timestamp-c.now())):f=!1,e=h,j=!1,null!==e?d.onError(e):l&&b(null,g)}}))))}),new Yb(e,g)},a)}function sa(a,b,c){return Vc(function(){return ra(a,b-c.now(),c)})}function ta(a,b,c){var d,e;return Sa(b)?e=b:(d=b,e=c),new Sf(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=Ua(e)(a);if(c===Ta)return b.onError(c.e);var d=new Wb;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new Ob,h=!1,i=new Xb;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new Yb(i,g)},this)}function ua(a,b){return new Sf(function(c){var d,e=!1,f=new Xb,g=0,h=a.subscribe(function(a){var h=Ua(b)(a);if(h===Ta)return c.onError(h.e);Ra(h)&&(h=Sc(h)),e=!0,d=a,g++;var i=g,j=new Wb;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new Yb(h,f)},a)}function L(a){return a.toArray()}function L(a){return a.toArray()}function va(a,b){return new Sf(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new Wb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new Yb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function wa(a,b,c,d){return Sa(b)&&(d=c,c=b,b=gd()),d||(d=nd(new wf)),new Sf(function(e){function f(a){function b(){return l=c===k}var c=k,f=new Wb;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(d.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new Xb,i=new Xb,j=new Wb;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=Ua(c)(a);if(b===Ta)return e.onError(b.e);f(Ra(b)?Sc(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new Yb(h,i)},a)}function xa(a,b,c,d){return cc(c)&&(d=c,c=nd(new wf)),c instanceof Error&&(c=nd(c)),cc(d)||(d=oc),new Sf(function(e){function f(){var a=g;k.setDisposable(d.scheduleFuture(null,b,function(){j=g===a,j&&(Ra(c)&&(c=Sc(c)),i.setDisposable(c.subscribe(e)))}))}var g=0,h=new Wb,i=new Xb,j=!1,k=new Xb;return i.setDisposable(h),f(),h.setDisposable(a.subscribe(function(a){j||(g++,e.onNext(a),f())},function(a){j||(g++,e.onError(a))},function(){j||(g++,e.onCompleted())})),new Yb(i,k)},a)}function ya(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}function za(a){this.predicate=a}function Aa(a){this.predicate=a}function Ba(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return Sb})}(g)}}var Ca={"function":!0,object:!0},Da=Ca[typeof exports]&&exports&&!exports.nodeType&&exports,Ea=Ca[typeof self]&&self.Object&&self,Fa=Ca[typeof window]&&window&&window.Object&&window,Ga=Ca[typeof module]&&module&&!module.nodeType&&module,Ha=Ga&&Ga.exports===Da&&Da,Ia=Da&&Ga&&"object"==typeof global&&global&&global.Object&&global,Ja=Ja=Ia||Fa!==(this&&this.window)&&Fa||Ea||this,Ka={internals:{},config:{Promise:Ja.Promise},helpers:{}},La=Ka.helpers.noop=function(){},Ma=Ka.helpers.identity=function(a){return a},Na=Ka.helpers.defaultNow=Date.now,Oa=Ka.helpers.defaultComparer=function(a,b){return Hb(a,b)},Pa=Ka.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Qa=(Ka.helpers.defaultKeySerializer=function(a){return a.toString()},Ka.helpers.defaultError=function(a){throw a}),Ra=Ka.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Sa=Ka.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==wb.call(a)}),a}(),Ta={e:{}},Ua=Ka.internals.tryCatch=function(a){if(!Sa(a))throw new TypeError("fn must be a function");return c(a)};Ka.config.longStackSupport=!1;var Va=!1,Wa=Ua(function(){throw new Error})();Va=!!Wa.e&&!!Wa.e.stack;var Xa,Ya=i(),Za="From previous event:",$a=Ka.EmptyError=function(){this.message="Sequence contains no elements.",this.name="EmptyError",Error.call(this)};$a.prototype=Object.create(Error.prototype);var _a=Ka.ObjectDisposedError=function(){this.message="Object has been disposed",this.name="ObjectDisposedError",Error.call(this)};_a.prototype=Object.create(Error.prototype);var ab=Ka.ArgumentOutOfRangeError=function(){this.message="Argument out of range",this.name="ArgumentOutOfRangeError",Error.call(this)};ab.prototype=Object.create(Error.prototype);var bb=Ka.NotSupportedError=function(a){this.message=a||"This operation is not supported",this.name="NotSupportedError",Error.call(this)};bb.prototype=Object.create(Error.prototype);var cb=Ka.NotImplementedError=function(a){this.message=a||"This operation is not implemented",this.name="NotImplementedError",Error.call(this)};cb.prototype=Object.create(Error.prototype);var db=Ka.helpers.notImplemented=function(){throw new cb},eb=(Ka.helpers.notSupported=function(){throw new bb},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");Ja.Set&&"function"==typeof(new Ja.Set)["@@iterator"]&&(eb="@@iterator");var fb=Ka.doneEnumerator={done:!0,value:a},gb=Ka.helpers.isIterable=function(b){return b[eb]!==a},hb=Ka.helpers.isArrayLike=function(b){return b&&b.length!==a};Ka.helpers.iterator=eb;var ib,jb=Ka.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)}},kb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],lb=kb.length,mb="[object Arguments]",nb="[object Array]",ob="[object Boolean]",pb="[object Date]",qb="[object Error]",rb="[object Function]",sb="[object Number]",tb="[object Object]",ub="[object RegExp]",vb="[object String]",wb=Object.prototype.toString,xb=Object.prototype.hasOwnProperty,yb=wb.call(arguments)==mb,zb=Error.prototype,Ab=Object.prototype,Bb=String.prototype,Cb=Ab.propertyIsEnumerable;try{ib=!(wb.call(document)==tb&&!({toString:0}+""))}catch(Db){ib=!0}var Eb={};Eb[nb]=Eb[pb]=Eb[sb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Eb[ob]=Eb[vb]={constructor:!0,toString:!0,valueOf:!0},Eb[qb]=Eb[rb]=Eb[ub]={constructor:!0,toString:!0},Eb[tb]={constructor:!0};var Fb={};!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);Fb.enumErrorProps=Cb.call(zb,"message")||Cb.call(zb,"name"),Fb.enumPrototypes=Cb.call(a,"prototype"),Fb.nonEnumArgs=0!=c,Fb.nonEnumShadows=!/valueOf/.test(b)}(1);var Z=Ka.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Gb=function(a){return a&&"object"==typeof a?wb.call(a)==mb:!1};yb||(Gb=function(a){return a&&"object"==typeof a?xb.call(a,"callee"):!1});var Hb=Ka.internals.isEqual=function(a,b){return o(a,b,[],[])},Ib=({}.hasOwnProperty,Array.prototype.slice),Jb=Ka.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Kb=Ka.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]}},Lb=Ka.internals.addRef=function(a,b){return new Sf(function(c){return new Yb(b.getDisposable(),a.subscribe(c))})};q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Mb=Ka.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Nb=Mb.prototype;Nb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Nb.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)}}},Nb.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[
8000
d],this.items[d]=e,this.heapify(d)}}},Nb.peek=function(){return this.items[0].value},Nb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Nb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Nb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Mb.count++,a),this.percolate(b)},Nb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Mb.count=0;var Ob=Ka.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];this.disposables=c,this.isDisposed=!1,this.length=c.length},Pb=Ob.prototype;Pb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Pb.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},Pb.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 Qb=Ka.Disposable=function(a){this.isDisposed=!1,this.action=a||La};Qb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Rb=Qb.create=function(a){return new Qb(a)},Sb=Qb.empty={dispose:La},Tb=Qb.isDisposable=function(a){return a&&Sa(a.dispose)},Ub=Qb.checkDisposed=function(a){if(a.isDisposed)throw new _a},Vb=Qb._fixup=function(a){return Tb(a)?a:Sb},Wb=Ka.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};Wb.prototype.getDisposable=function(){return this.current},Wb.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()},Wb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var Xb=Ka.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Xb.prototype.getDisposable=function(){return this.current},Xb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Xb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Yb=Ka.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};Yb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this._first;this._first=null,a&&a.dispose();var b=this._second;this._second=null,b&&b.dispose()}};var Zb=Ka.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};Zb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=0,b=this._disposables.length;b>a;a++)this._disposables[a].dispose();this._disposables.length=0}};var $b=Ka.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?Sb:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.schedule(this,s)};var _b=Ka.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Pa,this.disposable=new Wb};_b.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},_b.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},_b.prototype.isCancelled=function(){return this.disposable.isDisposed},_b.prototype.invokeCore=function(){return Vb(this.action(this.scheduler,this.state))};var ac=Ka.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new cb},b.scheduleFuture=function(b,c,d){var e=c;return e instanceof Date&&(e-=this.now()),e=a.normalize(e),0===e?this.schedule(b,d):this._scheduleFuture(b,e,d)},b._scheduleFuture=function(a,b,c){throw new cb},a.now=Na,a.prototype.now=Na,a.normalize=function(a){return 0>a&&(a=0),a},a}(),bc=ac.normalize,cc=ac.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),Sb}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new Ob;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),Sb}var h=!1,i=!1,j=a.scheduleFuture(b,d,g);i||(f.add(j),h=!0)}var d=b[0],e=b[1],f=new Ob;return e(d,c),f}a.scheduleRecursive=function(a,c){return this.schedule([a,c],b)},a.scheduleRecursiveFuture=function(a,b,d){return this.scheduleFuture([a,d],b,c)}}(ac.prototype),function(a){ac.prototype.schedulePeriodic=function(a,b,c){if("undefined"==typeof Ja.setInterval)throw new bb;b=bc(b);var d=a,e=Ja.setInterval(function(){d=c(d)},b);return Rb(function(){Ja.clearInterval(e)})}}(ac.prototype),function(a){a.catchError=a["catch"]=function(a){return new pc(this,a)}}(ac.prototype);var dc,ec,fc=Ka.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 Wb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a.bind(this))),b},b}(),gc=function(a){function b(){a.call(this)}return Jb(b,a),b.prototype.schedule=function(a,b){return Vb(b(this,a))},b}(ac),hc=ac.immediate=new gc,ic=function(a){function b(){for(;e.length>0;){var a=e.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var e;return Jb(c,a),c.prototype.schedule=function(a,c){var f=new _b(this,a,c,this.now());if(e)e.enqueue(f);else{e=new Mb(4),e.enqueue(f);var g=Ua(b)();e=null,g===Ta&&d(g.e)}return f.disposable},c.prototype.scheduleRequired=function(){return!e},c}(ac),jc=ac.currentThread=new ic,kc=function(){var a,b=La;if(Ja.setTimeout)a=Ja.setTimeout,b=Ja.clearTimeout;else{if(!Ja.WScript)throw new bb;a=function(a,b){Ja.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),lc=kc.setTimeout,mc=kc.clearTimeout;!function(){function a(b){if(g)lc(function(){a(b)},0);else{var c=f[b];if(c){g=!0;var e=Ua(c)();ec(b),g=!1,e===Ta&&d(e.e)}}}function b(){if(!Ja.postMessage||Ja.importScripts)return!1;var a=!1,b=Ja.onmessage;return Ja. c(b){"string"==typeof b.data&&b.data.substring(0,j.length)===j&&a(b.data.substring(j.length))}var e=1,f={},g=!1;ec=function(a){delete f[a]};var h=new RegExp("^"+String(wb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=Ia&&Ha&&Ia.setImmediate)&&!h.test(i)&&i;if(Sa(i))dc=function(b){var c=e++;return f[c]=b,i(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))dc=function(b){var c=e++;return f[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var j="ms.rx.schedule"+Math.random();Ja.addEventListener?Ja.addEventListener("message",c,!1):Ja.attachEvent?Ja.attachEvent("onmessage",c):Ja. b=e++;return f[b]=a,Ja.postMessage(j+currentId,"*"),b}}else if(Ja.MessageChannel){var k=new Ja.MessageChannel;k.port1. b=e++;return f[b]=a,k.port2.postMessage(b),b}}else dc="document"in Ja&&"onreadystatechange"in Ja.document.createElement("script")?function(b){var c=Ja.document.createElement("script"),d=e++;return f[d]=b,c. c=e++;return f[c]=b,lc(function(){a(c)},0),c}}();var nc=function(a){function b(){a.call(this)}function c(a){this._id=a,this.isDisposed=!1}return Jb(b,a),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,mc(this._id))},b.prototype.schedule=function(a,b){var d=this,e=new Wb,f=dc(function(){!e.isDisposed&&e.setDisposable(Vb(b(d,a)))});return new Yb(e,new c(f))},b.prototype._scheduleFuture=function(a,b,d){var e=this,f=ac.normalize(b),g=new Wb;if(0===f)return e.schedule(a,d);var h=lc(function(){!g.isDisposed&&g.setDisposable(Vb(d(e,a)))},f);return new Yb(g,new c(h))},b}(ac),oc=ac["default"]=ac.async=new nc,pc=function(a){function b(b,c){this._scheduler=b,this._handler=c,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this)}return Jb(b,a),b.prototype.schedule=function(a,b){return this._scheduler.schedule(a,this._wrap(b))},b.prototype._scheduleFuture=function(a,b,c){return this._scheduler.schedule(a,b,this._wrap(c))},b.prototype.now=function(){return this._scheduler.now()},b.prototype._clone=function(a){return new b(a,this._handler)},b.prototype._wrap=function(a){var b=this;return function(c,e){var f=Ua(a)(b._getRecursiveWrapper(c),e);return f===Ta?(b._handler(f.e)||d(f.e),Sb):Vb(ret)}},b.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},b.prototype.schedulePeriodic=function(a,b,c){var e=this,f=!1,g=new Wb;return g.setDisposable(this._scheduler.schedulePeriodic(a,b,function(a){if(f)return null;var b=Ua(c)(a);return b===Ta?(f=!0,e._handler(b.e)||d(b.e),g.dispose(),null):ret})),g},b}(ac),qc=Ka.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new cb},a.prototype._acceptObservable=function(a,b,c){throw new cb},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 cc(a)||(a=hc),new Sf(function(c){return a.schedule(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),rc=function(a){function b(a){this.value=a,this.kind="N"}return Jb(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObservable=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return"OnNext("+this.value+")"},b}(qc),sc=function(a){function b(a){this.error=a,this.kind="E"}return Jb(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObservable=function(a){return a.onError(this.error)},b.prototype.toString=function(){return"OnError("+this.error+")"},b}(qc),tc=function(a){function b(){this.kind="C"}return Jb(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObservable=function(a){return a.onCompleted()},b.prototype.toString=function(){return"OnCompleted()"},b}(qc),uc=qc.createOnNext=function(a){return new rc(a)},vc=qc.createOnError=function(a){return new sc(a)},wc=qc.createOnCompleted=function(){return new tc},xc=Ka.Observer=function(){};xc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},xc.prototype.asObserver=function(){var a=this;return new Bc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},xc.prototype.checked=function(){return new Cc(this)};var yc=xc.create=function(a,b,c){return a||(a=La),b||(b=Qa),c||(c=La),new Bc(a,b,c)};xc.fromNotifier=function(a,b){var c=jb(a,b,1);return new Bc(function(a){return c(uc(a))},function(a){return c(vc(a))},function(){return c(wc())})},xc.prototype.notifyOn=function(a){return new Ec(a,this)},xc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var zc,Ac=Ka.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return Jb(b,a),b.prototype.next=db,b.prototype.error=db,b.prototype.completed=db,b.prototype. this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(xc),Bc=Ka.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Jb(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}(Ac),Cc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Jb(b,a);var c=b.prototype;return c. b=Ua(this._observer.onNext).call(this._observer,a);this._state=0,b===Ta&&d(b.e);
},c. b=Ua(this._observer.onError).call(this._observer,a);this._state=2,b===Ta&&d(b.e)},c. a=Ua(this._observer.onCompleted).call(this._observer);this._state=2,a===Ta&&d(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}(xc),Dc=Ka.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 Xb}return Jb(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.scheduleRecursive(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var e=Ua(c)();return e===Ta?(a.queue=[],a.hasFaulted=!0,d(e.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Ac),Ec=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Jb(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}(Dc),Fc=Ka.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c. b(){if(Ka.config.longStackSupport&&Va){var b=this._subscribe,c=Ua(d)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}}return zc=b.prototype,b.isObservable=function(a){return a&&Sa(a.subscribe)},zc.subscribe=zc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:yc(a,b,c))},zc.subscribeOnNext=function(a,b){return this._subscribe(yc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},zc.subscribeOnError=function(a,b){return this._subscribe(yc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},zc.subscribeOnCompleted=function(a,b){return this._subscribe(yc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Gc=Ka.ObservableBase=function(a){function b(a){return a&&Sa(a.dispose)?a:Sa(a)?Rb(a):Sb}function c(a,c){var e=c[0],f=c[1],g=Ua(f.subscribeCore).call(f,e);g!==Ta||e.fail(Ta.e)||d(Ta.e),e.setDisposable(b(g))}function e(){a.call(this)}return Jb(e,a),e.prototype._subscribe=function(a){var b=new Tf(a),d=[b,this];return jc.scheduleRequired()?jc.schedule(d,c):c(null,d),b},e.prototype.subscribeCore=db,e}(Fc),Hc=Ka.FlatMapObservable=function(a){function b(b,c,d,e){this.resultSelector=Sa(d)?d:null,this.selector=jb(Sa(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.o=a,Ac.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},Jb(c,Ac),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.next=function(a){var b=this.i++,c=Ua(this.selector)(a,b,this.source);return c===Ta?this.o.onError(c.e):(Ra(c)&&(c=Sc(c)),(hb(c)||gb(c))&&(c=Fc.from(c)),void this.o.onNext(this._wrapResult(c,a,b)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype. Jc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this._o=a,this._s=b,this._e=c,Ac.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b={isDisposed:!1},d=new Xb,e=jc.scheduleRecursive(this.sources[eb](),function(e,f){if(!b.isDisposed){var g=Ua(e.next).call(e);if(g===Ta)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;Ra(h)&&(h=Sc(h));var i=new Wb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new Zb([d,e,new t(b)])},Jb(c,Ac),c.prototype. new Jc(this)};var Kc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this._o=a,this._recurse=b,Ac.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=this.sources[eb](),d={isDisposed:!1},e=new Xb,f=jc.scheduleRecursive(null,function(f,g){if(!d.isDisposed){var h=Ua(b.next).call(b);if(h===Ta)return a.onError(h.e);if(h.done)return null!==f?a.onError(f):a.onCompleted();var i=h.value;Ra(i)&&(i=Sc(i));var j=new Wb;e.setDisposable(j),j.setDisposable(i.subscribe(new c(a,g)))}});return new Zb([e,f,new t(d)])},Jb(c,Ac),c.prototype.next=function(a){this._o.onNext(a)},c.prototype.error=function(a){this._recurse(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(Gc);Ic.prototype.catchError=function(){return new Kc(this)},Ic.prototype.catchErrorWhen=function(a){var b=this;return new Sf(function(c){var d,e=new Wf,f=new Wf,g=a(e),h=g.subscribe(f),i=b[eb](),j={isDisposed:!1},k=new Xb,l=jc.scheduleRecursive(null,function(a,b){if(!j.isDisposed){var g=Ua(i.next).call(i);if(g===Ta)return c.onError(g.e);if(g.done)return void(d?c.onError(d):c.onCompleted());var h=g.value;Ra(h)&&(h=Sc(h));var l=new Wb,m=new Wb;k.setDisposable(new Yb(m,l)),l.setDisposable(h.subscribe(function(a){c.onNext(a)},function(a){m.setDisposable(f.subscribe(b,function(a){c.onError(a)},function(){c.onCompleted()})),e.onNext(a)},function(){c.onCompleted()}))}});return new Zb([h,k,l,new t(j)])})};var Lc=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 Jb(b,a),b.prototype[eb]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?fb:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Ic),Mc=Ic.repeat=function(a,b){return new Lc(a,b)},Nc=function(a){function b(a,b,c){this.s=a,this.fn=b?jb(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Jb(b,a),b.prototype[eb]=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]}:fb},b}(Ic),Oc=Ic.of=function(a,b,c){return new Nc(a,b,c)},Pc=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ec(this._s,a))},b}(Gc);zc.observeOn=function(a){return new Pc(this,a)};var Qc=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new r(a,c.subscribe(e)))}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new Wb,d=new Xb;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(Gc);zc.subscribeOn=function(a){return new Qc(this,a)};var Rc=function(a){function b(b){this.p=b,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),Sb},b}(Gc),Sc=Fc.fromPromise=function(a){return new Rc(a)};zc.toPromise=function(a){if(a||(a=Ka.config.Promise),!a)throw new bb("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d;b.subscribe(function(a){d=a},c,function(){a(d)})})};var Tc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],Ac.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},Jb(c,Ac),c.prototype.next=function(a){this.a.push(a)},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onNext(this.a),this.o.onCompleted()},b}(Gc);zc.toArray=function(){return new Tc(this)},Fc.create=function(a,b){return new Sf(a,b)};var Uc=function(a){function b(b){this._f=b,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=Ua(this._f)();return b===Ta?nd(b.e).subscribe(a):(Ra(b)&&(b=Sc(b)),b.subscribe(a))},b}(Gc),Vc=Fc.defer=function(a){return new Uc(a)},Wc=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(),Sb}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){var a=this.observer;return this.scheduler===hc?d(null,a):this.scheduler.schedule(a,d)},b}(Gc),Xc=new Wc(hc),Yc=Fc.empty=function(a){return cc(a)||(a=hc),a===hc?Xc:new Wc(a)},Zc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new $c(a,this);return b.run()},b}(Gc),$c=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var f=Ua(c.next).call(c);if(f===Ta)return d.onError(f.e);if(f.done)return d.onCompleted();var g=f.value;return Sa(e)&&(g=Ua(e)(g,a),g===Ta)?d.onError(g.e):(d.onNext(g),void b(a+1))}var b=Object(this.parent.iterable),c=z(b),d=this.o,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursive(0,a)},a}(),_c=Math.pow(2,53)-1;u.prototype[eb]=function(){return new v(this._s)},v.prototype[eb]=function(){return this},v.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:fb},w.prototype[eb]=function(){return new x(this._a)},x.prototype[eb]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:fb};var ad=Fc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Sa(b))throw new Error("mapFn when provided must be a function");if(b)var e=jb(b,c,2);return cc(d)||(d=jc),new Zc(a,e,d)},bd=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new C(a,this);return b.run()},b}(Gc);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,d=c.length;return this.parent.scheduler.scheduleRecursive(0,a)};var cd=Fc.fromArray=function(a,b){return cc(b)||(b=jc),new bd(a,b)},dd=function(a){function b(b,c,d,e,f){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,this._first=!0,a.call(this)}function c(a,b){if(a._first)a._first=!1;else if(a._state=Ua(a._itrFn)(a._state),a._state===Ta)return a._o.onError(a._state.e);var c=Ua(a._cndFn)(a._state);if(c===Ta)return a._o.onError(c.e);if(c){var d=Ua(a._resFn)(a._state);if(d===Ta)return a._o.onError(d.e);a._o.onNext(d),b(a)}else a._o.onCompleted()}return Jb(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(Gc);Fc.generate=function(a,b,c,d,e){return cc(e)||(e=jc),new dd(a,b,c,d,e)},Fc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new bd(b,jc)},Fc.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 bd(c,a)},Fc.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 Sf(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)}})},Fc.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 Sf(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 ed=function(a){function b(){a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return Sb},b}(Gc),fd=new ed,gd=Fc.never=function(){return fd},hd=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Gc);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.scheduleRecursive(0,a)},Fc.pairs=function(a,b){return b||(b=jc),new hd(a,b)};var id=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new jd(a,this);return b.run()},b}(Gc),jd=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.scheduleRecursive(0,a)},a}();Fc.range=function(a,b,c){return cc(c)||(c=jc),new id(a,b,c)};var kd=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new F(a,this);return b.run()},b}(Gc);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.scheduleRecursive(this.parent.repeatCount,a)},Fc.repeat=function(a,b,c){return cc(c)||(c=jc),new kd(a,b,c)};var ld=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(),Sb}return Jb(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===hc?d(null,a):this.scheduler.schedule(a,d)},b}(Gc),md=(Fc["return"]=Fc.just=function(a,b){return cc(b)||(b=hc),new ld(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 Jb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.schedule([this.p.error,this.o],d)},b}(Gc)),nd=Fc["throw"]=function(a,b){return cc(b)||(b=hc),new md(a,b)},od=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=Sb,c=Ua(this._resFn)();if(c===Ta)return new Yb(nd(c.e).subscribe(a),b);c&&(b=c);var d=Ua(this._obsFn)(c);return d===Ta?new Yb(nd(d.e).subscribe(a),b):new Yb(d.subscribe(a),b)},b}(Gc);Fc.using=function(a,b){return new od(a,b)},zc.amb=function(a){var b=this;return new Sf(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Wb,j=new Wb;Ra(a)&&(a=Sc(a));var k=yc(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=yc(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 Yb(i,j)})},Fc.amb=function(){var a,b=gd();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 pd=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new Wb,c=new Xb;return c.setDisposable(b),b.setDisposable(this.source.subscribe(new qd(a,c,this._fn))),c},b}(Gc),qd=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return Jb(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=Ua(this._fn)(a);if(b===Ta)return this._o.onError(b.e);Ra(b)&&(b=Sc(b));var c=new Wb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Ac);zc["catch"]=function(a){return Sa(a)?new pd(this,a):rd([this,a])};var rd=Fc["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 Oc(a).catchError()};zc.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),ud.apply(this,b)};var sd=function(a){function b(b,c){var d=b.length;this._params=b,this._cb=c,this._hv=p(d,H),this._hvAll=!1,this._done=p(d,H),this._v=new Array(d),a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._params.length,c=new Array(b),d=0;b>d;d++){var e=this._params[d],f=new Wb;c[d]=f,Ra(e)&&(e=Sc(e)),f.setDisposable(e.subscribe(new td(a,d,this)))}return new Zb(c)},b}(Gc),td=function(a){function b(b,c,d){this._o=b,this._i=c,this._p=d,a.call(this)}return Jb(b,a),b.prototype.next=function(a){if(this._p._v[this._i]=a,this._p._hv[this._i]=!0,this._p._hvAll||(this._p._hvAll=this._p._hv.every(Ma))){var b=Ua(this._p._cb).apply(null,this._p._v);if(b===Ta)return this._o.onError(b.e);this._o.onNext(b)}else this._p._done.filter(function(a,b){return b!==this._i},this).every(Ma)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._p._done[this._i]=!0,this._p._done.every(Ma)&&this._o.onComplet
8000
ed()},b}(Ac),ud=Fc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Sa(b[a-1])?b.pop():I;return Array.isArray(b[0])&&(b=b[0]),new sd(b,d)};zc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),wd.apply(null,a)};var vd=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Jb(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 Xb,c=this.sources,d=c.length,e=this.o,f=hc.scheduleRecursive(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];Ra(h)&&(h=Sc(h));var i=new Wb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new Ob(b,f,Rb(function(){a=!0}))},b}(Gc),wd=Fc.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 vd(a)};zc.concatAll=function(){return this.merge(1)};var xd=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new Ob;return b.add(this.source.subscribe(new yd(a,this.maxConcurrent,b))),b},b}(Gc),yd=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 Wb;this.g.add(c),Ra(a)&&(a=Sc(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}();zc.merge=function(a){return"number"!=typeof a?zd(this,a):new xd(this,a)};var zd=Fc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(cc(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=hc,b=0;d>b;b++)c.push(arguments[b]);else for(a=hc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),D(a,c).mergeAll()},Ad=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 Jb(b,a),b.prototype.subscribeCore=function(a){var b=new Ob,d=new Wb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype. b=new Wb;this.g.add(b),Ra(a)&&(a=Sc(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}(Gc);zc.mergeAll=function(){return new Ad(this)};var Bd=Ka.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};Bd.prototype=Error.prototype,Fc.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 Sf(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new Bd(g))}var c=new Ob,e=new Wb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new Wb;c.add(e),Ra(d)&&(d=Sc(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})},zc. new Error("Second observable is required");return Cd([this,a])};var Cd=Fc. 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 Sf(function(b){var c=0,d=new Xb,e=hc.scheduleRecursive(null,function(e,f){var g,h;c<a.length?(g=a[c++],Ra(g)&&(g=Sc(g)),h=new Wb,d.setDisposable(h),h.setDisposable(g.subscribe(b.onNext.bind(b),f,f))):b.onCompleted()});return new Yb(d,e)})},Dd=function(a){function b(b,c){this._s=b,this._o=Ra(c)?Sc(c):c,this._open=!1,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new Wb;b.setDisposable(this._s.subscribe(new Ed(a,this))),Ra(this._o)&&(this._o=Sc(this._o));var c=new Wb;return c.setDisposable(this._o.subscribe(new Fd(a,this,c))),new Yb(b,c)},b}(Gc),Ed=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype. b(b,c,d){this._o=b,this._p=c,this._r=d,a.call(this)}return Jb(b,a),b.prototype.next=function(){this._p._open=!0,this._r.dispose()},b.prototype.error=function(a){this._o.onError(a)},b.prototype. new Dd(this,a)};var Gd=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,Ac.call(this)}function d(a,b){this.parent=a,this.id=b,Ac.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new Xb,d=this.source.subscribe(new c(a,b));return new Yb(d,b)},Jb(c,Ac),c.prototype.next=function(a){var b=new Wb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),Ra(a)&&(a=Sc(a)),b.setDisposable(a.subscribe(new d(this,c)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.stopped=!0,!this.hasLatest&&this.o.onCompleted()},Jb(d,Ac),d.prototype.next=function(a){this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.error=function(a){this.parent.latest===this.id&&this.parent.o.onError(a)},d.prototype.completed=function(){this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted())},b}(Gc);zc["switch"]=zc.switchLatest=function(){return new Gd(this)};var Hd=function(a){function b(b,c){this.source=b,this.other=Ra(c)?Sc(c):c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return new Yb(this.source.subscribe(a),this.other.subscribe(new Id(a)))},b}(Gc),Id=function(a){function b(b){this._o=b,a.call(this)}return Jb(b,a),b.prototype.next=function(){this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype. new Hd(this,a)};var Jd=function(a){function b(b,c,d){var e=c.length;this._s=b,this._ss=c,this._cb=d,this._hv=p(e,H),this._hvAll=!1,this._v=new Array(e),a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._ss.length,c=new Array(b+1),d=0;b>d;d++){var e=this._ss[d],f=new Wb;Ra(e)&&(e=Sc(e)),f.setDisposable(e.subscribe(new Kd(a,d,this))),c[d]=f}var f=new Wb;return f.setDisposable(this._s.subscribe(new Ld(a,this))),c[b]=f,new Zb(c)},b}(Gc),Kd=function(a){function b(b,c,d){this._o=b,this._i=c,this._p=d,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._p._v[this._i]=a,this._p._hv[this._i]=!0,this._p._hvAll=this._p._hv.every(Ma)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=La,b}(Ac),Ld=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=[a].concat(this._p._v);if(this._p._hvAll){var c=Ua(this._p._cb).apply(null,b);return c===Ta?this._o.onError(c.e):void this._o.onNext(c)}},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.withLatestFrom=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 d=Sa(b[a-1])?b.pop():I;return Array.isArray(b[0])&&(b=b[0]),new Jd(this,b,d)};var Md=function(a){function b(b,c){var d=b.length;this._s=b,this._cb=c,this._done=p(d,H),this._q=p(d,J),a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._s.length,c=new Array(b),d=0;b>d;d++){var e=this._s[d],f=new Wb;c[d]=f,Ra(e)&&(e=Sc(e)),f.setDisposable(e.subscribe(new Nd(a,d,this)))}return new Zb(c)},b}(Gc),Nd=function(a){function b(b,c,d){this._o=b,this._i=c,this._p=d,a.call(this)}return Jb(b,a),b.prototype.next=function(a){if(this._p._q[this._i].push(a),this._p._q.every(function(a){return a.length>0})){var b=this._p._q.map(function(a){return a.shift()}),c=Ua(this._p._cb).apply(null,b);if(c===Ta)return this._o.onError(c.e);this._o.onNext(c)}else this._p._done.filter(function(a,b){return b!==this._i},this).every(Ma)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._p._done[this._i]=!0,this._p._done.every(Ma)&&this._o.onCompleted()},b}(Ac);zc.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 d=Sa(b[a-1])?b.pop():I;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new Md(b,d)},Fc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];Array.isArray(b[0])&&(b=Sa(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)},zc.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 d=Sa(b[a-1])?b.pop():I,e=this;return b.unshift(e),new Sf(function(a){for(var c=b.length,f=p(c,J),g=p(c,H),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new Wb;(hb(i)||gb(i))&&(i=ad(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=Ua(d).apply(e,h);if(i===Ta)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(Ma)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(Ma)&&a.onCompleted()})),h[c]=j}(i);return new Ob(h)},e)},zc.asObservable=function(){return new Sf(K(this),this)},zc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(L).filter(M)};var Od=function(a){function b(b){this.source=b,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Pd(a))},b}(Gc),Pd=function(a){function b(b){this._o=b,a.call(this)}return Jb(b,a),b.prototype.next=function(a){a.accept(this._o)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.dematerialize=function(){return new Od(this)};var Qd=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Rd(a,this.keyFn,this.comparer))},b}(Gc),Rd=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 Jb(b,a),b.prototype.next=function(a){var b,c=a;return Sa(this.keyFn)&&(c=Ua(this.keyFn)(a),c===Ta)?this.o.onError(c.e):this.hasCurrentKey&&(b=Ua(this.comparer)(this.currentKey,c),b===Ta)?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}(Ac);zc.distinctUntilChanged=function(a,b){return b||(b=Oa),new Qd(this,a,b)};var Sd=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||Sa(b._oN)?yc(b._oN||La,b._oE||La,b._oC||La):b._oN,this.isStopped=!1,Ac.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},Jb(c,Ac),c.prototype.next=function(a){var b=Ua(this.t.onNext).call(this.t,a);b===Ta&&this.o.onError(b.e),this.o.onNext(a)},c.prototype.error=function(a){var b=Ua(this.t.onError).call(this.t,a);return b===Ta?this.o.onError(b.e):void this.o.onError(a)},c.prototype.completed=function(){var a=Ua(this.t.onCompleted).call(this.t);return a===Ta?this.o.onError(a.e):void this.o.onCompleted();
},b}(Gc);zc["do"]=zc.tap=zc.doAction=function(a,b,c){return new Sd(this,a,b,c)},zc.doOnNext=zc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},zc.doOnError=zc.tapOnError=function(a,b){return this.tap(La,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},zc.doOnCompleted=zc.tapOnCompleted=function(a,b){return this.tap(La,null,"undefined"!=typeof b?function(){a.call(b)}:a)},zc["finally"]=function(a){var b=this;return new Sf(function(c){var e=Ua(b.subscribe).call(b,c);return e===Ta?(a(),d(e.e)):Rb(function(){var b=Ua(e.dispose).call(e);a(),b===Ta&&d(b.e)})},this)};var Td=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Jb(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}(Gc);zc.ignoreElements=function(){return new Td(this)};var Ud=function(a){function b(b,c){this.source=b,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Vd(a))},b}(Gc),Vd=function(a){function b(b){this._o=b,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._o.onNext(uc(a))},b.prototype.error=function(a){this._o.onNext(vc(a)),this._o.onCompleted()},b.prototype.completed=function(){this._o.onNext(wc()),this._o.onCompleted()},b}(Ac);zc.materialize=function(){return new Ud(this)},zc.repeat=function(a){return Mc(this,a).concat()},zc.retry=function(a){return Mc(this,a).catchError()},zc.retryWhen=function(a){return Mc(this).catchErrorWhen(a)};var Wd=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Xd(a,this))},b}(Gc),Xd=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=Ua(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?Ua(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===Ta?this._o.onError(this._a.e):(this._o.onNext(this._a),void this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._hv&&this._hs&&this._o.onNext(this._s),this._o.onCompleted()},b}(Ac);zc.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Wd(this,c,b,a)};var Yd=function(a){function b(b,c){this.source=b,this._c=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Zd(a,this._c))},b}(Gc),Zd=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._o.onNext(this._q.shift())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.skipLast=function(a){if(0>a)throw new ab;return new Yd(this,a)},zc.startWith=function(){var a,b=0;arguments.length&&cc(arguments[0])?(a=arguments[0],b=1):a=hc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Oc([cd(c,a),this]).concat()};var $d=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(;this._q.length>0;)this._o.onNext(this._q.shift());this._o.onCompleted()},b}(Ac);zc.takeLast=function(a){if(0>a)throw new ab;var b=this;return new Sf(function(c){return b.subscribe(new $d(c,a))},b)};var _d=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(Ac);zc.takeLastBuffer=function(a){if(0>a)throw new ab;var b=this;return new Sf(function(c){return b.subscribe(new _d(c,a))},b)},zc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new ab;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new ab;return new Sf(function(d){function e(){var a=new Wf;i.push(a),d.onNext(Lb(a,g))}var f=new Wb,g=new $b(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)},zc.selectConcat=zc.concatMap=function(a,b,c){return Sa(a)&&Sa(b)?this.concatMap(function(c,d){var e=a(c,d);return Ra(e)&&(e=Sc(e)),(hb(e)||gb(e))&&(e=ad(e)),e.map(function(a,e){return b(c,a,d,e)})}):Sa(a)?N(this,a,c):N(this,function(){return a})},zc.concatMapObserver=zc.selectConcatObserver=function(a,b,c,d){var e=this,f=jb(a,d,2),g=jb(b,d,1),h=jb(c,d,0);return new Sf(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Ra(d)&&(d=Sc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Ra(c)&&(c=Sc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Ra(b)&&(b=Sc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()};var ae=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(defaultValue),this._o.onCompleted()},b}(Ac);zc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Sf(function(a){return c.subscribe(new ae(a,b))},c)},P.prototype.push=function(a){var b=-1===O(this.set,a,this.comparer);return b&&this.set.push(a),b};var be=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ce(a,this._keyFn,this._cmpFn))},b}(Gc),ce=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new P(d),a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=a;return Sa(this._keyFn)&&(b=Ua(this._keyFn)(a),b===Ta)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.distinct=function(a,b){return b||(b=Oa),new be(this,a,b)},zc.groupBy=function(a,b){return this.groupByUntil(a,b,gd)},zc.groupByUntil=function(b,c,d){var e=this;return new Sf(function(f){var g=new mf,h=new Ob,i=new $b(h),j=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(e){var k=Ua(b)(e);if(k===Ta)return g.forEach(j(k.e)),f.onError(k.e);var l=!1,m=g.get(k);if(m===a&&(m=new Wf,g.set(k,m),l=!0),l){var n=new Vf(k,m,i),o=new Vf(k,m),p=Ua(d)(o);if(p===Ta)return g.forEach(j(p.e)),f.onError(p.e);f.onNext(n);var q=new Wb;h.add(q),q.setDisposable(p.take(1).subscribe(La,function(a){g.forEach(j(a)),f.onError(a)},function(){g["delete"](k)&&m.onCompleted(),h.remove(q)}))}var r=e;return Sa(c)&&(r=Ua(c)(e),r===Ta)?(g.forEach(j(r.e)),f.onError(r.e)):void m.onNext(r)},function(a){g.forEach(j(a)),f.onError(a)},function(){g.forEach(function(a){a.onCompleted()}),f.onCompleted()})),i},e)};var de=function(a){function b(b,c,d){this.source=b,this.selector=jb(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 d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,Ac.call(this)}return Jb(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 d(a,this.selector,this))},Jb(d,Ac),d.prototype.next=function(a){var b=Ua(this.selector)(a,this.i++,this.source);return b===Ta?this.o.onError(b.e):void this.o.onNext(b)},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(Gc);zc.map=zc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof de?this.internalMap(c,b):new de(this,c,b)},zc.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(Q(b,a))},zc.flatMap=zc.selectMany=function(a,b,c){return new Hc(this,a,b,c).mergeAll()},zc.flatMapObserver=zc.selectManyObserver=function(a,b,c,d){var e=this;return new Sf(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)}Ra(c)&&(c=Sc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Ra(c)&&(c=Sc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Ra(a)&&(a=Sc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Ka.Observable.prototype.flatMapLatest=function(a,b,c){return new Hc(this,a,b,c).switchLatest()};var ee=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 Jb(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}(Gc);zc.skip=function(a){if(0>a)throw new ab;return new ee(this,a)};var fe=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ge(a,this))},b}(Gc),ge=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!1,a.call(this)}return Jb(b,a),b.prototype.next=function(a){if(!this._r){var b=Ua(this._p._fn)(a,this._i++,this._p);if(b===Ta)return this._o.onError(b.e);this._r=!b}this._r&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.skipWhile=function(a,b){var c=jb(a,b,3);return new fe(this,c)};var he=function(a){function b(b,c){this.source=b,this.takeCount=c,a.call(this)}function c(a,b){this.o=a,this.c=b,this.r=b,this.isStopped=!1}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.takeCount))},c.prototype={onNext:function(a){this.isStopped||this.r-->0&&(this.o.onNext(a),this.r<=0&&this.o.onCompleted())},onError:function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},onCompleted:function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)}},b}(Gc);zc.take=function(a,b){if(0>a)throw new ab;return 0===a?Yc(b):new he(this,a)};var ie=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new je(a,this))},b}(Gc),je=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){return this._r&&(this._r=Ua(this._p._fn)(a,this._i++,this._p),this._r===Ta)?this._o.onError(this._r.e):void(this._r?this._o.onNext(a):this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.takeWhile=function(a,b){var c=jb(a,b,3);return new ie(this,c)};var ke=function(a){function b(b,c,d){this.source=b,this.predicate=jb(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 d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,Ac.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},Jb(d,Ac),d.prototype.next=function(a){var b=Ua(this.predicate)(a,this.i++,this.source);return b===Ta?this.o.onError(b.e):void(b&&this.o.onNext(a))},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(Gc);zc.filter=zc.where=function(a,b){return this instanceof ke?this.internalFilter(a,b):new ke(this,a,b)};var le=function(a){function b(b,c,d){this.source=b,this._k=c,this._c=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new me(a,this._k,this._c))},b}(Gc),me=function(a){function b(b,c,d){this._o=b,this._k=c,this._c=d,this._v=null,this._hv=!1,this._l=[],a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=Ua(this._k)(a);if(b===Ta)return this._o.onError(b.e);var c=0;if(this._hv){if(c=Ua(this._c)(b,this._v),c===Ta)return this._o.onError(c.e)}else this._hv=!0,this._v=b;c>0&&(this._v=b,this._l=[]),c>=0&&this._l.push(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._l),this._o.onCompleted()},b}(Ac),ne=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new oe(a,this))},b}(Gc),oe=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=Ua(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?Ua(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===Ta?this._o.onError(this._a.e):void this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv&&this._o.onNext(this._a),!this._hv&&this._hs&&this._o.onNext(this._s),!this._hv&&!this._hs&&this._o.onError(new $a),this._o.onCompleted()},b}(Ac);zc.reduce=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new ne(this,c,b,a)};var pe=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new qe(a,this._fn,this.source))},b}(Gc),qe=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=Ua(this._fn)(a,this._i++,this._s);return b===Ta?this._o.onError(b.e):void(Boolean(b)&&(this._o.onNext(!0),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(Ac);zc.some=function(a,b){var c=jb(a,b,3);return new pe(this,c)};var re=function(a){function b(b){this.source=b,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new se(a))},b}(Gc),se=function(a){function b(b){this._o=b,a.call(this)}return Jb(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}(Ac);zc.isEmpty=function(){return new re(this)};var te=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ue(a,this._fn,this.source))},b}(Gc),ue=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=Ua(this._fn)(a,this._i++,this._s);return b===Ta?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}(Ac);zc.every=function(a,b){var c=jb(a,b,3);return new te(this,c)};var ve=function(a){function b(b,c,d){var e=+d||0;Math.abs(e)===1/0&&(e=0),this.source=b,this._elem=c,this._n=e,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(!1),a.onCompleted(),Sb):this.source.subscribe(new we(a,this._elem,this._n))},b}(Gc),we=function(a){function b(b,c,d){this._o=b,this._elem=c,this._n=d,this._i=0,a.call(this)}function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}return Jb(b,a),b.prototype.next=function(a){this._i++>=this._n&&c(a,this._elem)&&(this._o.onNext(!0),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(Ac);zc.includes=function(a,b){return new ve(this,a,b)};var xe=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ye(a,this._fn,this.source))},b}(Gc),ye=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){if(
8BD0
this._fn){var b=Ua(this._fn)(a,this._i++,this._s);if(b===Ta)return this._o.onError(b.e);Boolean(b)&&this._c++}else this._c++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(Ac);zc.count=function(a,b){var c=jb(a,b,3);return new xe(this,c)};var ze=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),Sb):this.source.subscribe(new Ae(a,this._e,this._n))},b}(Gc),Ae=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._i=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._o.onNext(this._i),this._o.onCompleted()),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(-1),this._o.onCompleted()},b}(Ac);zc.indexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new ze(this,a,c)};var Be=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ce(a,this._fn,this.source))},b}(Gc),Ce=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){if(this._fn){var b=Ua(this._fn)(a,this._i++,this._s);if(b===Ta)return this._o.onError(b.e);this._c+=b}else this._c+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(Ac);zc.sum=function(a,b){var c=jb(a,b,3);return new Be(this,c)},zc.minBy=function(a,b){return b||(b=Pa),new le(this,a,function(a,c){return-1*b(a,c)})},zc.min=function(a){return this.minBy(Ma,a).map(function(a){return R(a)})},zc.maxBy=function(a,b){return b||(b=Pa),new le(this,a,b)},zc.max=function(a){return this.maxBy(Ma,a).map(function(a){return R(a)})};var De=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ee(a,this._fn,this.source))},b}(Gc),Ee=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 Jb(b,a),b.prototype.next=function(a){if(this._fn){var b=Ua(this._fn)(a,this._c++,this._s);if(b===Ta)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 $a):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(Ac);zc.average=function(a,b){var c,d=this;return Sa(a)&&(c=jb(a,b,3)),new De(d,c)},zc.sequenceEqual=function(a,b){var c=this;return b||(b=Oa),new Sf(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){if(h.length>0){var c=h.shift(),e=Ua(b)(c,a);if(e===Ta)return d.onError(e.e);e||(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()))});(hb(a)||gb(a))&&(a=ad(a)),Ra(a)&&(a=Sc(a));var j=a.subscribe(function(a){if(g.length>0){var c=g.shift(),f=Ua(b)(c,a);if(f===Ta)return d.onError(f.e);f||(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 Yb(i,j)},c)};var Fe=function(a){function b(b,c,d){this.source=b,this._i=c,this._d=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ge(a,this._i,this._d))},b}(Gc),Ge=function(b){function c(a,c,d){this._o=a,this._i=c,this._d=d,b.call(this)}return Jb(c,b),c.prototype.next=function(a){0===this._i--&&(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._d===a?this._o.onError(new ab):(this._o.onNext(this._d),this._o.onCompleted())},c}(Ac);zc.elementAt=function(a,b){if(0>a)throw new ab;return new Fe(this,a,b)};var He=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,b.call(this)}return Jb(c,b),c.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=Ua(this._obj.predicate)(a,this._i++,this._s);if(c===Ta)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);if(b){if(this._hv)return this._o.onError(new Error("Sequence contains more than one matching element"));this._hv=!0,this._v=a}},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===a?this._o.onError(new $a):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Ac);zc.single=function(a,b){var c={},d=this;if(c="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Sa(c.predicate)){var e=c.predicate;c.predicate=jb(e,c.thisArg,3)}return new Sf(function(a){return d.subscribe(new He(a,c,d))},d)};var Ie=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Je(a,this._obj,this.source))},b}(Gc),Je=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,b.call(this)}return Jb(c,b),c.prototype.next=function(a){if(this._obj.predicate){var b=Ua(this._obj.predicate)(a,this._i++,this._s);if(b===Ta)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 $a):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Ac);zc.first=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Sa(a.predicate)){var b=a.predicate;a.predicate=jb(b,a.thisArg,3)}return new Ie(this,a)};var Ke=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Le(a,this._obj,this.source))},b}(Gc),Le=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,b.call(this)}return Jb(c,b),c.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=Ua(this._obj.predicate)(a,this._i++,this._s);if(c===Ta)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);b&&(this._hv=!0,this._v=a)},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===a?this._o.onError(new $a):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Ac);zc.last=function(){var a={};if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Sa(a.predicate)){var b=a.predicate;a.predicate=jb(b,a.thisArg,3)}return new Ke(this,a)};var Me=function(a){function b(b,c,d,e){this._o=b,this._s=c,this._cb=d,this._y=e,this._i=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=Ua(this._cb)(a,this._i,this._s);return b===Ta?this._o.onError(b.e):void(b?(this._o.onNext(this._y?this._i:a),this._o.onCompleted()):this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._y&&this._o.onNext(-1),this._o.onCompleted()},b}(Ac);zc.find=function(a,b){return S(this,a,b,!1)},zc.findIndex=function(a,b){return S(this,a,b,!0)};var Ne=function(a){function b(b){this.source=b,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Oe(a))},b}(Gc),Oe=function(a){function b(b){this._o=b,this._s=new Ja.Set,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._s.add(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._s),this._o.onCompleted()},b}(Ac);zc.toSet=function(){if("undefined"==typeof Ja.Set)throw new TypeError;return new Ne(this)};var Pe=function(a){function b(b,c,d){this.source=b,this._k=c,this._e=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Qe(a,this._k,this._e))},b}(Gc),Qe=function(a){function b(b,c,d){this._o=b,this._k=c,this._e=d,this._m=new Ja.Map,a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=Ua(this._k)(a);if(b===Ta)return this._o.onError(b.e);var c=a;return this._e&&(c=Ua(this._e)(a),c===Ta)?this._o.onError(c.e):void this._m.set(b,c)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._m),this._o.onCompleted()},b}(Ac);zc.toMap=function(a,b){if("undefined"==typeof Ja.Map)throw new TypeError;return new Pe(this,a,b)};var Re=function(a){function b(b,c,d){this.source=b,this._b=c,this._e=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Se(a,this._b,this._e))},b}(Gc),Se=function(a){function b(b,c,d){this._o=b,this._b=c,this._e=d,this._i=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._i>=this._b&&(this._e===this._i?this._o.onCompleted():this._o.onNext(a)),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.slice=function(a,b){var c=a||0;if(0>c)throw new Ka.ArgumentOutOfRangeError;if("number"==typeof b&&c>b)throw new Ka.ArgumentOutOfRangeError;return new Re(this,c,b)};var Te=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),Sb):this.source.subscribe(new Ue(a,this._e,this._n))},b}(Gc),Ue=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._v=0,this._hv=!1,this._i=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._hv=!0,this._v=this._i),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?this._o.onNext(this._v):this._o.onNext(-1),this._o.onCompleted()},b}(Ac);zc.lastIndexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new Te(this,a,c)},Fc.wrap=function(a){function b(){return Fc.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var Ve=Fc.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new Sf(function(d){function e(b){var c=Ua(a.next).call(a,b);return c===Ta?d.onError(c.e):void g(c)}function f(b){var c=Ua(a.next).call(a,b);return c===Ta?d.onError(c.e):void g(c)}function g(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=T.call(b,a.value);Fc.isObservable(c)?h.add(c.subscribe(e,f)):f(new TypeError("type not supported"))}var h=new Ob;return Sa(a)&&(a=a.apply(b,c)),a&&Sa(a.next)?(e(),h):(d.onNext(a),d.onCompleted())})};Fc.start=function(a,b,c){return We(a,b,c)()};var We=Fc.toAsync=function(a,b,c){return cc(c)||(c=oc),function(){var d=arguments,e=new Xf;return c.schedule(null,function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};Fc.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 $(a,b,c,e)}},Fc.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 aa(a,b,c,e)}},ca.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},Ka.config.useNativeEvents=!1,Fc.fromEvent=function(a,b,c){return a.addListener?Xe(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Ka.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Sf(function(d){return da(a,b,ea(d,c))}).publish().refCount():Xe(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Xe=Fc.fromEventPattern=function(a,b,c,d){return cc(d)||(d=hc),new Sf(function(d){function e(){var a=arguments[0];return Sa(c)&&(a=Ua(c).apply(null,arguments),a===Ta)?d.onError(a.e):void d.onNext(a)}var f=a(e);return Rb(function(){Sa(b)&&b(e,f)})}).publish().refCount()};Fc.startAsync=function(a){var b=Ua(a)();return b===Ta?nd(b.e):Sc(b)};var Ye=function(a){function b(b,c){this.source=b,this.controller=new Wf,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,a.call(this)}return Jb(b,a),b.prototype._subscribe=function(a){var b=this.source.publish(),c=b.subscribe(a),d=Sb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Sb)});return new Zb([c,d,e])},b.prototype.pause=function(){this.controller.onNext(!1)},b.prototype.resume=function(){this.controller.onNext(!0)},b}(Fc);zc.pausable=function(a){return new Ye(this,a)};var Ze=function(b){function c(a,c){this.source=a,this.controller=new Wf,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,b.call(this)}return Jb(c,b),c.prototype._subscribe=function(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=fa(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},c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Fc);zc.pausableBuffered=function(a){return new Ze(this,a)};var $e=function(a){function b(b,c,d){a.call(this),this.subject=new _e(c,d),this.source=b.multicast(this.subject).refCount()}return Jb(b,a),b.prototype._subscribe=function(a){return this.source.subscribe(a)},b.prototype.request=function(a){return this.subject.request(null==a?-1:a)},b}(Fc),_e=function(a){function b(b,c){null==b&&(b=!0),a.call(this),this.subject=new Wf,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,
this.scheduler=c||jc}return Jb(b,a),Kb(b.prototype,xc,{_subscribe:function(a){return this.subject.subscribe(a)},onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(qc.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(qc.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(qc.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.schedule(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,Rb(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),b}(Fc);zc.controlled=function(a,b){return a&&cc(a)&&(b=a,a=!0),null==a&&(a=!0),new $e(this,a,b)};var af=function(a){function b(b){a.call(this),this.source=b}function c(a,b){b.source.request(1)}Jb(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new Yb(this.subscription,oc.schedule(this,c))};var d=function(a){function c(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d,this.scheduleDisposable=null}function d(a,b){b.observable.source.request(1)}return Jb(c,a),c.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},c.prototype.error=function(a){this.observer.onError(a),this.dispose()},c.prototype.next=function(a){this.observer.onNext(a),this.scheduleDisposable=oc.schedule(this,d)},b.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},c}(Ac);return b}(Fc);$e.prototype.stopAndWait=function(){return new af(this)};var bf=function(a){function b(b,c){a.call(this),this.source=b,this.windowSize=c}function c(a,b){b.source.request(b.windowSize)}Jb(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new Yb(this.subscription,oc.schedule(this,c))};var d=function(a){function b(b,c,d){this.observer=b,this.observable=c,this.cancel=d,this.received=0,this.scheduleDisposable=null,a.call(this)}function c(a,b){b.observable.source.request(b.observable.windowSize)}return Jb(b,a),b.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},b.prototype.error=function(a){this.observer.onError(a),this.dispose()},b.prototype.next=function(a){this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received&&(this.scheduleDisposable=oc.schedule(this,c))},b.prototype.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},b}(Ac);return b}(Fc);$e.prototype.windowed=function(a){return new bf(this,a)},zc.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};var cf=function(a){function b(b,c,d){this.source=b,this._fn1=c,this._fn2=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=this.source.multicast(this._fn1());return new Yb(this._fn2(b).subscribe(a),b.connect())},b}(Gc);zc.multicast=function(a,b){return Sa(a)?new cf(this,a,b):new hf(this,a)},zc.publish=function(a){return a&&Sa(a)?this.multicast(function(){return new Wf},a):this.multicast(new Wf)},zc.share=function(){return this.publish().refCount()},zc.publishLast=function(a){return a&&Sa(a)?this.multicast(function(){return new Xf},a):this.multicast(new Xf)},zc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new ef(b)},a):this.multicast(new ef(a))},zc.shareValue=function(a){return this.publishValue(a).refCount()},zc.replay=function(a,b,c,d){return a&&Sa(a)?this.multicast(function(){return new ff(b,c,d)},a):this.multicast(new ff(b,c,d))},zc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var df=function(a,b){this._s=a,this._o=b};df.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var ef=Ka.BehaviorSubject=function(a){function c(b){a.call(this),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Jb(c,a),Kb(c.prototype,xc,{_subscribe:function(a){return Ub(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Sb):(this.observers.push(a),a.onNext(this.value),new df(this,a))},getValue:function(){if(Ub(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Ub(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(Ub(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(Ub(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.error=null}}),c}(Fc),ff=Ka.ReplaySubject=function(a){function c(a,b){return Rb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(b,c,d){this.bufferSize=null==b?e:b,this.windowSize=null==c?e:c,this.scheduler=d||jc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this)}var e=Math.pow(2,53)-1;return Jb(d,a),Kb(d.prototype,xc.prototype,{_subscribe:function(a){Ub(this);var b=new Dc(this.scheduler,a),d=c(this,b);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},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(Ub(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(Ub(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(Ub(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}}),d}(Fc),gf=function(a){function b(b){this.source=b,this._count=0,this._connectableSubscription=null,a.call(this)}function c(a,b){this._p=a,this._s=b,this.isDisposed=!1}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=1===++this._count,d=this.source.subscribe(a);return b&&(this._connectableSubscription=this.source.connect()),new c(this,d)},c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.dispose(),0===--this._p._count&&this._p._connectableSubscription.dispose())},b}(Gc),hf=Ka.ConnectableObservable=function(a){function b(b,c){this.source=b,this._hasSubscription=!1,this._subscription=null,this._sourceObservable=b.asObservable(),this._subject=c,a.call(this)}function c(a){this._p=a,this.isDisposed=!1}return Jb(b,a),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._p._hasSubscription=!1)},b.prototype.connect=function(){return this._hasSubscription||(this._hasSubscription=!0,this._subscription=new Yb(this._sourceObservable.subscribe(this._subject),new c(this))),this._subscription},b.prototype._subscribe=function(a){return this._subject.subscribe(a)},b.prototype.refCount=function(){return new gf(this)},b}(Fc);zc.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 Sf(function(b){return a().subscribe(b)})},zc.join=function(a,b,c,d){var e=this;return new Sf(function(f){var g=new Ob,h=!1,i=!1,j=0,k=0,l=new mf,m=new mf,n=function(a){f.onError(a)};return g.add(e.subscribe(function(a){var c=j++,e=new Wb;l.set(c,a),g.add(e);var i=Ua(b)(a);return i===Ta?f.onError(i.e):(e.setDisposable(i.take(1).subscribe(La,n,function(){l["delete"](c)&&0===l.size&&h&&f.onCompleted(),g.remove(e)})),void m.forEach(function(b){var c=Ua(d)(a,b);return c===Ta?f.onError(c.e):void f.onNext(c)}))},n,function(){h=!0,(i||0===l.size)&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new Wb;m.set(b,a),g.add(e);var h=Ua(c)(a);return h===Ta?f.onError(h.e):(e.setDisposable(h.take(1).subscribe(La,n,function(){m["delete"](b)&&0===m.size&&i&&f.onCompleted(),g.remove(e)})),void l.forEach(function(b){var c=Ua(d)(b,a);return c===Ta?f.onError(c.e):void f.onNext(c)}))},n,function(){i=!0,(h||0===m.size)&&f.onCompleted()})),g},e)},zc.groupJoin=function(a,b,c,d){var e=this;return new Sf(function(f){function g(a){}var h=new Ob,i=new $b(h),j=new mf,k=new mf,l=0,m=0,g=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(a){var c=new Wf,e=l++;j.set(e,c);var m=Ua(d)(a,Lb(c,i));if(m===Ta)return j.forEach(g(m.e)),f.onError(m.e);f.onNext(m),k.forEach(function(a){c.onNext(a)});var n=new Wb;h.add(n);var o=Ua(b)(a);return o===Ta?(j.forEach(g(o.e)),f.onError(o.e)):void n.setDisposable(o.take(1).subscribe(La,function(a){j.forEach(g(a)),f.onError(a)},function(){j["delete"](e)&&c.onCompleted(),h.remove(n)}))},function(a){j.forEach(g(a)),f.onError(a)},function(){f.onCompleted()})),h.add(a.subscribe(function(a){var b=m++;k.set(b,a);var d=new Wb;h.add(d);var e=Ua(c)(a);return e===Ta?(j.forEach(g(e.e)),f.onError(e.e)):(d.setDisposable(e.take(1).subscribe(La,function(a){j.forEach(g(a)),f.onError(a)},function(){k["delete"](b),h.remove(d)})),void j.forEach(function(b){b.onNext(a)}))},function(a){j.forEach(g(a)),f.onError(a)})),i},e)},zc.buffer=function(){return this.window.apply(this,arguments).flatMap(L)},zc.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?ha.call(this,a):"function"==typeof a?ia.call(this,a):ga.call(this,a,b)},zc.pairwise=function(){var a=this;return new Sf(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)},zc.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]};var jf=function(a){function b(a,b){this.c=a,this.s=b}return Jb(b,a),b.prototype[eb]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(Ic);zc.letBind=zc.let=function(a){return a(this)},Fc["if"]=function(a,b,c){return Vc(function(){return c||(c=Yc()),Ra(b)&&(b=Sc(b)),Ra(c)&&(c=Sc(c)),"function"==typeof c.now&&(c=Yc(c)),a()?b:c})},Fc["for"]=Fc.forIn=function(a,b,c){return Oc(a,b,c).concat()};var kf=Fc["while"]=Fc.whileDo=function(a,b){return Ra(b)&&(b=Sc(b)),ja(a,b).concat()};zc.doWhile=function(a){return wd([this,kf(a,this)])},Fc["case"]=function(a,b,c){return Vc(function(){Ra(c)&&(c=Sc(c)),c||(c=Yc()),cc(c)&&(c=Yc(c));var d=b[a()];return Ra(d)&&(d=Sc(d)),d||c})},zc.expand=function(a,b){cc(b)||(b=hc);var c=this;return new Sf(function(d){var e=[],f=new Xb,g=new Ob(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(null,function(b,c){var f;if(!(e.length>0))return void(i=!1);f=e.shift();var k=new Wb;g.add(k),k.setDisposable(f.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},function(a){d.onError(a)},function(){g.remove(k),h--,0===h&&d.onCompleted()})),c()}))};return e.push(c),h++,j(),g},this)},Fc.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 Sf(function(b){var c=a.length;if(0===c)return b.onCompleted(),Sb;for(var d=new Ob,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];Ra(j)&&(j=Sc(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})},zc.forkJoin=function(a,b){var c=this;return new Sf(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new Wb,l=new Wb;return Ra(a)&&(a=Sc(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=Ua(b)(e,f);if(a===Ta)return d.onError(Db);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=Ua(b)(e,f);if(a===Ta)return d.onError(a.e);d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new Yb(k,l)},c)},zc.manySelect=zc.extend=function(a,b){cc(b)||(b=hc);var c=this;return Vc(function(){var d;return c.map(function(a){var b=new lf(a);return d&&d.onNext(a),d=b,b}).tap(La,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var lf=function(a){function b(b){a.call(this),this.head=b,this.tail=new Xf}return Jb(b,a),Kb(b.prototype,xc,{_subscribe:function(a){var b=new Ob;return b.add(jc.schedule(this,function(c,d){a.onNext(d.head),b.add(d.tail.mergeAll().subscribe(a))})),b},onCompleted:function(){this.onNext(Fc.empty())},onError:function(a){this.onNext(Fc["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),b}(Fc),mf=Ja.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}();ka.prototype.and=function(a){return new ka(this.patterns.concat(a))},ka.prototype.thenDo=function(a){return new la(this,a)},la.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,g=this.expression.patterns.length;g>f;f++)e.push(ma(a,this.expression.patterns[f],b.onError.bind(b)));var h=new na(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},na.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},na.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 nf=function(a){function b(b,c){a.call(this),this.source=b,this. Wb,this.isDisposed=!1}Jb(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.error);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=La,c.completed=La,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}(Ac);zc.and=function(a){return new ka([this,a])},zc.thenDo=function(a){return new ka([this]).thenDo(a)},Fc.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 Sf(function(b){var c=[],d=new mf,e=yc(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){nd(h).subscribe(b)}var i=new Ob;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};var of=function(a){function b(b,c){this._dt=b,this._s=c,a.call(this)}function c(a,b){b.onNext(0),b.onCompleted()}return Jb(b,a),b.prototype.subscribeCore=function(a){return this._s.scheduleFuture(a,this._dt,c)},b}(Gc),pf=Fc.interval=function(a,b){return qa(a,a,cc(b)?b:oc)};Fc.timer=function(b,c,d){var e;return cc(d)||(d=oc),null!=c&&"number"==typeof c?e=c:cc(c)&&(d=c),(b instanceof Date||"number"==typeof b)&&e===a?oa(b,d):b instanceof Date&&e!==a?pa(b.getTime(),c,d):qa(b,e,d)};zc.delay=function(){var a=arguments[0];if("number"==typeof a||a instanceof Date){var b=a,c=arguments[1];return cc(c)||(c=oc),b instanceof Date?sa(this,b,c):ra(this,b,c)}if(Fc.isObservable(a)||Sa(a))return ta(this,a,arguments[1]);throw new Error("Invalid arguments")};var qf=function(a){function b(b,c,d){cc(d)||(d=oc),this.source=b,this._dt=c,this._s=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new Xb;return new Yb(this.source.subscribe(new rf(a,this.source,this._dt,this._s,b)),b)},b}(Gc),rf=function(a){function b(b,c,d,e,f){this._o=b,this._s=c,this._d=d,this._scheduler=e,this._c=f,this._v=null,this._hv=!1,this._id=0,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._hv=!0,this._v=a;var b=++this._id,c=new Wb;this._c.setDisposable(c),c.setDisposable(this._scheduler.scheduleFuture(this,this._d,function(c,d){d._hv&&d._id===b&&d._o.onNext(a),d._hv=!1}))},b.prototype.error=function(a){this._c.dispose(),this._o.onError(a),this._hv=!1,this._id++},b.prototype.completed=function(){this._c.dispose(),this._hv&&this._o.onNext(this._v),this._o.onCompleted(),this._hv=!1,this._id++},b}(Ac);zc.debounce=function(){if(Sa(arguments[0]))return ua(this,arguments[0]);if("number"==typeof arguments[0])return new qf(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},zc.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),cc(c)||(c=oc),"number"==typeof b?d=b:cc(b)&&(d=a,c=b),new Sf(function(b){function f(){var a=new Wb,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!
85A7
0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleFuture(null,o,function(){if(g){var a=new Wf;k.push(a),b.onNext(Lb(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new Xb,m=0;return g=new Ob(l),h=new $b(g),k.push(new Wf),b.onNext(Lb(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)},zc.windowWithTimeOrCount=function(a,b,c){var d=this;return cc(c)||(c=oc),new Sf(function(e){function f(b){var d=new Wb;g.setDisposable(d),d.setDisposable(c.scheduleFuture(null,a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new Wf,e.onNext(Lb(l,i)),f(a)}}))}var g=new Xb,h=new Ob(g),i=new $b(h),j=0,k=0,l=new Wf;return e.onNext(Lb(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 Wf,e.onNext(Lb(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},zc.bufferWithTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(L)},zc.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(L)};var sf=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new tf(a,this._s))},b}(Gc),tf=function(a){function b(b,c){this._o=b,this._s=c,this._l=c.now(),a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=this._s.now(),c=b-this._l;this._l=b,this._o.onNext({value:a,interval:c})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.timeInterval=function(a){return cc(a)||(a=oc),new sf(this,a)};var uf=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new vf(a,this._s))},b}(Gc),vf=function(a){function b(b,c){this._o=b,this._s=c,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._o.onNext({value:a,timestamp:this._s.now()})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.timestamp=function(a){return cc(a)||(a=oc),new uf(this,a)},zc.sample=zc.throttleLatest=function(a,b){return cc(b)||(b=oc),"number"==typeof a?va(this,pf(a,b)):va(this,a)};var wf=Ka.TimeoutError=function(a){this.message=a||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};wf.prototype=Object.create(Error.prototype),zc.timeout=function(){var a=arguments[0];if(a instanceof Date||"number"==typeof a)return xa(this,a,arguments[1],arguments[2]);if(Fc.isObservable(a)||Sa(a))return wa(this,a,arguments[1],arguments[2]);throw new Error("Invalid arguments")};var xf=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,this._first=!0,this._hasResult=!1,a.call(this)}function c(a,b){if(a._hasResult&&a._o.onNext(a._state),a._first)a._first=!1;else if(a._state=Ua(a._itrFn)(a._state),a._state===Ta)return a._o.onError(a._state.e);if(a._hasResult=Ua(a._cndFn)(a._state),a._hasResult===Ta)return a._o.onError(a._hasResult.e);if(a._hasResult){var c=Ua(a._resFn)(a._state);if(c===Ta)return a._o.onError(c.e);var d=Ua(a._timeFn)(a._state);if(d===Ta)return a._o.onError(d.e);b(a,d)}else a._o.onCompleted()}return Jb(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursiveFuture(this,new Date(this._s.now()),c)},b}(Gc);Fc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return cc(f)||(f=oc),new xf(a,b,c,d,e,f)};var yf=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,this._first=!0,this._hasResult=!1,a.call(this)}function c(a,b){if(a._hasResult&&a._o.onNext(a._state),a._first)a._first=!1;else if(a._state=Ua(a._itrFn)(a._state),a._state===Ta)return a._o.onError(a._state.e);if(a._hasResult=Ua(a._cndFn)(a._state),a._hasResult===Ta)return a._o.onError(a._hasResult.e);if(a._hasResult){var c=Ua(a._resFn)(a._state);if(c===Ta)return a._o.onError(c.e);var d=Ua(a._timeFn)(a._state);if(d===Ta)return a._o.onError(d.e);b(a,d)}else a._o.onCompleted()}return Jb(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursiveFuture(this,0,c)},b}(Gc);Fc.generateWithRelativeTime=function(a,b,c,d,e,f){return cc(f)||(f=oc),new yf(a,b,c,d,e,f)};var zf=function(a){function b(b,c,d){this.source=b,this._dt=c,this._s=d,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];e.setDisposable(c.subscribe(d))}return Jb(b,a),b.prototype.subscribeCore=function(a){var b=new Xb;return b.setDisposable(this._s.scheduleFuture([this.source,a,b],this._dt,c)),b},b}(Gc);zc.delaySubscription=function(a,b){return cc(b)||(b=oc),new zf(this,a,b)};var Af=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Bf(a,this))},b}(Gc),Bf=function(a){function b(b,c){this._o=b,this._s=c._s,this._d=c._d,this._q=[],a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0&&a-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value);this._o.onCompleted()},b}(Ac);zc.skipLastWithTime=function(a,b){return cc(b)||(b=oc),new Af(this,a,b)};var Cf=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Df(a,this._d,this._s))},b}(Gc),Df=function(a){function b(b,c,d){this._o=b,this._d=c,this._s=d,this._q=[],a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0;){var b=this._q.shift();a-b.interval<=this._d&&this._o.onNext(b.value)}this._o.onCompleted()},b}(Ac);zc.takeLastWithTime=function(a,b){return cc(b)||(b=oc),new Cf(this,a,b)},zc.takeLastBufferWithTime=function(a,b){var c=this;return cc(b)||(b=oc),new Sf(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)};var Ef=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}function c(a,b){b.onCompleted()}return Jb(b,a),b.prototype.subscribeCore=function(a){return new Yb(this._s.scheduleFuture(a,this._d,c),this.source.subscribe(a))},b}(Gc);zc.takeWithTime=function(a,b){return cc(b)||(b=oc),new Ef(this,a,b)};var Ff=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,this._open=!1,a.call(this)}function c(a,b){b._open=!0}return Jb(b,a),b.prototype.subscribeCore=function(a){return new Yb(this._s.scheduleFuture(this,this._d,c),this.source.subscribe(new Gf(a,this)))},b}(Gc),Gf=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.skipWithTime=function(a,b){return cc(b)||(b=oc),new Ff(this,a,b)};var Hf=function(a){function b(b,c,d){this.source=b,this._st=c,this._s=d,a.call(this)}function c(a,b){b._open=!0}return Jb(b,a),b.prototype.subscribeCore=function(a){return this._open=!1,new Yb(this._s.scheduleFuture(this,this._st,c),this.source.subscribe(new If(a,this)))},b}(Gc),If=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Jb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Ac);zc.skipUntilWithTime=function(a,b){return cc(b)||(b=oc),new Hf(this,a,b)},zc.takeUntilWithTime=function(a,b){cc(b)||(b=oc);var c=this;return new Sf(function(d){return new Yb(b.scheduleFuture(d,a,function(a,b){b.onCompleted()}),c.subscribe(d))},c)},zc.throttle=function(a,b){cc(b)||(b=oc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Sf(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)};var Jf=function(a){function b(b,c){this._o=b,this._xform=c,a.call(this)}return Jb(b,a),b.prototype.next=function(a){var b=Ua(this._xform["@@transducer/step"]).call(this._xform,this._o,a);b===Ta&&this._o.onError(b.e)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._xform["@@transducer/result"](this._o)},b}(Ac);zc.transduce=function(a){var b=this;return new Sf(function(c){var d=a(ya(c));return b.subscribe(new Jf(c,d))},b)},zc.switchFirst=function(){var a=this;return new Sf(function(b){var c=!1,d=!1,e=new Wb,f=new Ob;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,Ra(a)&&(a=Sc(a));var e=new Wb;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)},zc.flatMapFirst=zc.selectManyFirst=function(a,b,c){return new Hc(this,a,b,c).switchFirst()},Ka.Observable.prototype.flatMapWithMaxConcurrent=function(a,b,c,d){return new Hc(this,b,c,d).merge(a)};var Kf=Ka.VirtualTimeScheduler=function(a){function b(b,c){this.clock=b,this.comparer=c,this.isEnabled=!1,this.queue=new Mb(1024),a.call(this)}Jb(b,a);var c=b.prototype;return c.now=function(){return this.toAbsoluteTime(this.clock)},c.schedule=function(a,b){return this.scheduleAbsolute(a,this.clock,b)},c.scheduleFuture=function(a,b,c){var d=b instanceof Date?this.toRelativeTime(b-this.now()):this.toRelativeTime(b);return this.scheduleRelative(a,d,c)},c.add=db,c.toAbsoluteTime=db,c.toRelativeTime=db,c.schedulePeriodic=function(a,b,c){var d=new fc(this,a,b,c);return d.start()},c.scheduleRelative=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsolute(a,d,c)},c.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)}},c.stop=function(){this.isEnabled=!1},c.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ab;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}},c.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ab;0!==c&&this.advanceTo(b)},c.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ab;this.clock=b},c.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},c.scheduleAbsolute=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new _b(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},b}(ac);Ka.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Pa;a.call(this,d,e)}Jb(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toAbsoluteTime=function(a){return new Date(a).getTime()},c.toRelativeTime=function(a){return a},b}(Ka.VirtualTimeScheduler),za.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},Aa.prototype.equals=function(a){
return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.error)};var Lf=Ka.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new Mf(a,new za(b)):new Mf(a,qc.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new Mf(a,new Aa(b)):new Mf(a,qc.createOnError(b))},onCompleted:function(a){return new Mf(a,qc.createOnCompleted())},subscribe:function(a,b){return new Nf(a,b)}},Mf=Ka.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||Oa};Mf.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},Mf.prototype.toString=function(){return this.value.toString()+"@"+this.time};var Nf=Ka.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};Nf.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},Nf.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var Of=Ka.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};Of.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var Pf=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}Jb(b,a);var c=b.prototype;return c. Mf(this.scheduler.clock,qc.createOnNext(a)))},c. Mf(this.scheduler.clock,qc.createOnError(a)))},c. Mf(this.scheduler.clock,qc.createOnCompleted()))},b}(xc);Ba.prototype.then=function(b,c){var d=this;this.subscriptions.push(new Nf(this.scheduler.clock));var e,f=this.subscriptions.length-1,g=Ka.Observer.create(function(c){var h=b(c);if(h&&"function"==typeof h.then)e=h;else{var i=d.scheduler.clock;e=new Ba(d.scheduler,[Ka.ReactiveTest.onNext(i,a),Ka.ReactiveTest.onCompleted(i)])}var j=d.observers.indexOf(g);d.observers.splice(j,1),d.subscriptions[f]=new Nf(d.subscriptions[f].subscribe,d.scheduler.clock)},function(a){c(a);var b=d.observers.indexOf(g);d.observers.splice(b,1),d.subscriptions[f]=new Nf(d.subscriptions[f].subscribe,d.scheduler.clock)});return this.observers.push(g),e||new Ba(this.scheduler,this.messages)};var Qf=function(a){function b(b,c){a.call(this);var d,e,f=this;this.scheduler=b,this.messages=c,this.subscriptions=[],this.observers=[];for(var g=0,h=this.messages.length;h>g;g++)d=this.messages[g],e=d.value,function(a){b.scheduleAbsolute(null,d.time,function(){for(var b=f.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return Sb})}(e)}return Jb(b,a),b.prototype._subscribe=function(a){var b=this;this.observers.push(a),this.subscriptions.push(new Nf(this.scheduler.clock));var c=this.subscriptions.length-1;return Rb(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new Nf(b.subscriptions[c].subscribe,b.scheduler.clock)})},b}(Fc),Rf=function(a){function b(b,c){a.call(this),this.scheduler=b,this.messages=c,this.subscriptions=[]}return Jb(b,a),b.prototype._subscribe=function(a){var b,c,d=this;this.subscriptions.push(new Nf(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new Ob,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelative(null,b.time,function(){return c.accept(a),Sb}))}(c);return Rb(function(){d.subscriptions[e]=new Nf(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})},b}(Fc);Ka.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function c(){a.call(this,0,b)}return Jb(c,a),c.prototype.scheduleAbsolute=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsolute.call(this,b,c,d)},c.prototype.add=function(a,b){return a+b},c.prototype.toAbsoluteTime=function(a){return new Date(a).getTime()},c.prototype.toRelativeTime=function(a){return a},c.prototype.startScheduler=function(a,b){b||(b={}),null==b.created&&(b.created=Lf.created),null==b.subscribed&&(b.subscribed=Lf.subscribed),null==b.disposed&&(b.disposed=Lf.disposed);var c,d,e=this.createObserver();return this.scheduleAbsolute(null,b.created,function(){return c=a(),Sb}),this.scheduleAbsolute(null,b.subscribed,function(){return d=c.subscribe(e),Sb}),this.scheduleAbsolute(null,b.disposed,function(){return d.dispose(),Sb}),this.start(),e},c.prototype.createHotObservable=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 Qf(this,a)},c.prototype.createColdObservable=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 Rf(this,a)},c.prototype.createResolvedPromise=function(a,b){return new Ba(this,[Ka.ReactiveTest.onNext(a,b),Ka.ReactiveTest.onCompleted(a)])},c.prototype.createRejectedPromise=function(a,b){return new Ba(this,[Ka.ReactiveTest.onError(a,b)])},c.prototype.createObserver=function(){return new Pf(this)},c}(Kf);var Sf=Ka.AnonymousObservable=function(a){function b(a){return a&&Sa(a.dispose)?a:Sa(a)?Rb(a):Sb}function c(a,c){var e=c[0],f=c[1],g=Ua(f.__subscribe).call(f,e);g!==Ta||e.fail(Ta.e)||d(Ta.e),e.setDisposable(b(g))}function e(b,c){this.source=c,this.__subscribe=b,a.call(this)}return Jb(e,a),e.prototype._subscribe=function(a){var b=new Tf(a),d=[b,this];return jc.scheduleRequired()?jc.schedule(d,c):c(null,d),b},e}(Fc),Tf=function(a){function b(b){a.call(this),this.observer=b,this.m=new Wb}Jb(b,a);var c=b.prototype;return c.next=function(a){var b=Ua(this.observer.onNext).call(this.observer,a);b===Ta&&(this.dispose(),d(b.e))},c.error=function(a){var b=Ua(this.observer.onError).call(this.observer,a);this.dispose(),b===Ta&&d(b.e)},c.completed=function(){var a=Ua(this.observer.onCompleted).call(this.observer);this.dispose(),a===Ta&&d(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}(Ac),Uf=function(a){function b(b,c){this._m=b,this._u=c,a.call(this)}return Jb(b,a),b.prototype.subscribeCore=function(a){return new Yb(this._m.getDisposable(),this._u.subscribe(a))},b}(Gc),Vf=function(a){function b(b,c,d){a.call(this),this.key=b,this.underlyingObservable=d?new Uf(d,c):c}return Jb(b,a),b.prototype._subscribe=function(a){return this.underlyingObservable.subscribe(a)},b}(Fc),Wf=Ka.Subject=function(a){function c(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Jb(c,a),Kb(c.prototype,xc.prototype,{_subscribe:function(a){return Ub(this),this.isStopped?this.hasError?(a.onError(this.error),Sb):(a.onCompleted(),Sb):(this.observers.push(a),new df(this,a))},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Ub(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(Ub(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(Ub(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}}),c.create=function(a,b){return new Yf(a,b)},c}(Fc),Xf=Ka.AsyncSubject=function(a){function c(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Jb(c,a),Kb(c.prototype,xc,{_subscribe:function(a){return Ub(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Sb):(this.observers.push(a),new df(this,a))},hasObservers:function(){return Ub(this),this.observers.length>0},onCompleted:function(){var a,c;if(Ub(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(Ub(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){Ub(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),c}(Fc),Yf=Ka.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return Jb(b,a),Kb(b.prototype,xc.prototype,{_subscribe:function(a){return this.observable.subscribe(a)},onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(Fc);Ka.Pauser=function(a){function b(){a.call(this)}return Jb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Wf),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ja.Rx=Ka,define(function(){return Ka})):Da&&Ga?Ha?(Ga.exports=Ka).Rx=Ka:Da.Rx=Ka:Ja.Rx=Ka;var Zf=i()}).call(this);
//# sourceMappingURL=rx.all.map