forked from Reactive-Extensions/RxJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrx.min.js
More file actions
5 lines (5 loc) · 69.8 KB
/
Copy pathrx.min.js
File metadata and controls
5 lines (5 loc) · 69.8 KB
1
2
3
4
5
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){return a&&a.Object===Object?a:null}function c(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function d(a){return function(){try{return a.apply(this,arguments)}catch(b){return ka.e=b,ka}}}function e(a){throw a}function f(a,b){if(ma&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(qa)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+qa+"\n");a.stack=g(e)}}function g(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];h(f)||i(f)||!f||c.push(f)}return c.join("\n")}function h(a){var b=k(a);if(!b)return!1;var c=b[0],d=b[1];return c===oa&&d>=pa&&Jd>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if(ma)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=k(c);if(!d)return;return oa=d[0],d[1]}}function k(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function l(a){var b=[];if(!Za(a))return b;Ya.nonEnumArgs&&a.length&&$a(a)&&(a=ab.call(a));var c=Ya.enumPrototypes&&"function"==typeof a,d=Ya.enumErrorProps&&(a===Sa||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Ya.nonEnumShadows&&a!==Ta){var f=a.constructor,g=-1,h=Ea;if(a===(f&&f.prototype))var i=a===Ua?Oa:a===Sa?Ja:Pa.call(a),j=Xa[i];for(;++g<h;)e=Da[g],j&&j[e]||!Qa.call(a,e)||b.push(e)}return b}function m(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function n(a,b){return m(a,b,l)}function o(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function p(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Pa.call(a),h=Pa.call(b);if(g==Fa&&(g=Ma),h==Fa&&(h=Ma),g!=h)return!1;switch(g){case Ha:case Ia:return+a==+b;case La:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Na:case Oa:return a==String(b)}var i=g==Ga;if(!i){if(g!=Ma||!Ya.nodeClass&&(o(a)||o(b)))return!1;var j=!Ya.argsObject&&$a(a)?Object:a.constructor,k=!Ya.argsObject&&$a(b)?Object:b.constructor;if(!(j==k||Qa.call(a,"constructor")&&Qa.call(b,"constructor")||ja(j)&&j instanceof j&&ja(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var m=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,m=b.length,q=m==l)for(;m--;){var r=b[m];if(!(q=p(a[m],r,c,d)))break}}else n(b,function(b,e,f){return Qa.call(f,e)?(m++,q=Qa.call(a,e)&&p(a[e],b,c,d)):void 0}),q&&n(a,function(a,b,c){return Qa.call(c,b)?q=--m>-1:void 0});return c.pop(),d.pop(),q}function r(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function s(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function u(a,b){this.id=a,this.value=b}function v(a){this._s=a,this.isDisposed=!1}function w(a){this._s=a}function x(a){this._s=a,this._l=a.length,this._i=0}function y(a){this._a=a}function z(a){this._a=a,this._l=D(a),this._i=0}function A(a){return"number"==typeof a&&aa.isFinite(a)}function B(b){var c,d=b[xa];if(!d&&"string"==typeof b)return c=new w(b),c[xa]();if(!d&&b.length!==a)return c=new y(b),c[xa]();if(!d)throw new TypeError("Object is not iterable");return b[xa]()}function C(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function D(a){var b=+a.length;return isNaN(b)?0:0!==b&&A(b)?(b=C(b)*Math.floor(Math.abs(b)),0>=b?0:b>rc?rc:b):b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){var c=a.length;return function(d,e){c>d?(b.onNext(a[d]),e(d+1)):b.onCompleted()}}function G(a,b){return ub(a)||(a=Ab),new tc(b,a)}function H(a,b){this.observer=a,this.parent=b}function I(a,b){this.observer=a,this.parent=b}function J(a,b){return a.amb(b)}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function M(){return[]}function K(){return!1}function M(){return[]}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function N(a){return function(b){return a.subscribe(b)}}function O(a){return a.toArray()}function P(a){return a.length>0}function Q(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function R(a){this.comparer=a,this.set=[]}function S(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}function T(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var U={"function":!0,object:!0},V=U[typeof exports]&&exports&&!exports.nodeType?exports:null,W=U[typeof module]&&module&&!module.nodeType?module:null,X=b(V&&W&&"object"==typeof global&&global),Y=b(U[typeof self]&&self),Z=b(U[typeof window]&&window),$=W&&W.exports===V?V:null,_=b(U[typeof this]&&this),aa=X||Z!==(_&&_.window)&&Z||Y||_||Function("return this")(),ba={internals:{},config:{Promise:aa.Promise},helpers:{}},ca=ba.helpers.noop=function(){},da=ba.helpers.identity=function(a){return a},ea=ba.helpers.defaultNow=Date.now,fa=ba.helpers.defaultComparer=function(a,b){return _a(a,b)},ga=ba.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ha=(ba.helpers.defaultKeySerializer=function(a){return a.toString()},ba.helpers.defaultError=function(a){throw a}),ia=ba.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},ja=ba.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Pa.call(a)}),a}(),ka={e:{}},la=ba.internals.tryCatch=function(a){if(!ja(a))throw new TypeError("fn must be a function");return d(a)};ba.config.longStackSupport=!1;var ma=!1,na=la(function(){throw new Error})();ma=!!na.e&&!!na.e.stack;var oa,pa=j(),qa="From previous event:",ra=ba.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ra.prototype=Object.create(Error.prototype),ra.prototype.name="EmptyError";var sa=ba.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};sa.prototype=Object.create(Error.prototype),sa.prototype.name="ObjectDisposedError";var ta=ba.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};ta.prototype=Object.create(Error.prototype),ta.prototype.name="ArgumentOutOfRangeError";var ua=ba.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ua.prototype=Object.create(Error.prototype),ua.prototype.name="NotSupportedError";var va=ba.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};va.prototype=Object.create(Error.prototype),va.prototype.name="NotImplementedError";var wa=ba.helpers.notImplemented=function(){throw new va},xa=(ba.helpers.notSupported=function(){throw new ua},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");aa.Set&&"function"==typeof(new aa.Set)["@@iterator"]&&(xa="@@iterator");var ya=ba.doneEnumerator={done:!0,value:a},za=ba.helpers.isIterable=function(b){return b[xa]!==a},Aa=ba.helpers.isArrayLike=function(b){return b&&b.length!==a};ba.helpers.iterator=xa;var Ba,Ca=ba.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)}},Da=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ea=Da.length,Fa="[object Arguments]",Ga="[object Array]",Ha="[object Boolean]",Ia="[object Date]",Ja="[object Error]",Ka="[object Function]",La="[object Number]",Ma="[object Object]",Na="[object RegExp]",Oa="[object String]",Pa=Object.prototype.toString,Qa=Object.prototype.hasOwnProperty,Ra=Pa.call(arguments)==Fa,Sa=Error.prototype,Ta=Object.prototype,Ua=String.prototype,Va=Ta.propertyIsEnumerable;try{Ba=!(Pa.call(document)==Ma&&!({toString:0}+""))}catch(Wa){Ba=!0}var Xa={};Xa[Ga]=Xa[Ia]=Xa[La]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Xa[Ha]=Xa[Oa]={constructor:!0,toString:!0,valueOf:!0},Xa[Ja]=Xa[Ka]=Xa[Na]={constructor:!0,toString:!0},Xa[Ma]={constructor:!0};var Ya={};!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);Ya.enumErrorProps=Va.call(Sa,"message")||Va.call(Sa,"name"),Ya.enumPrototypes=Va.call(a,"prototype"),Ya.nonEnumArgs=0!=c,Ya.nonEnumShadows=!/valueOf/.test(b)}(1);var Za=ba.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},$a=function(a){return a&&"object"==typeof a?Pa.call(a)==Fa:!1};Ra||($a=function(a){return a&&"object"==typeof a?Qa.call(a,"callee"):!1});var _a=ba.internals.isEqual=function(a,b){return p(a,b,[],[])},ab=({}.hasOwnProperty,Array.prototype.slice),bb=ba.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},cb=ba.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]}},db=ba.internals.addRef=function(a,b){return new Ed(function(c){return new ob(b.getDisposable(),a.subscribe(c))})},eb=ba.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},fb=eb.prototype;fb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},fb.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},fb.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 gb=ba.Disposable=function(a){this.isDisposed=!1,this.action=a||ca};gb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var hb=gb.create=function(a){return new gb(a)},ib=gb.empty={dispose:ca},jb=gb.isDisposable=function(a){return a&&ja(a.dispose)},kb=gb.checkDisposed=function(a){if(a.isDisposed)throw new sa},lb=gb._fixup=function(a){return jb(a)?a:ib},mb=ba.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};mb.prototype.getDisposable=function(){return this.current},mb.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()},mb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var nb=ba.SerialDisposable=function(){this.isDisposed=!1,this.current=null};nb.prototype.getDisposable=function(){return this.current},nb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},nb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var ob=ba.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};ob.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 pb=ba.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};pb.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 qb=ba.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?ib:new a(this)},b}();s.prototype.dispose=function(){this.scheduler.schedule(this,t)};var rb=ba.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ga,this.disposable=new mb};rb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},rb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},rb.prototype.isCancelled=function(){return this.disposable.isDisposed},rb.prototype.invokeCore=function(){return lb(this.action(this.scheduler,this.state))};var sb=ba.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new va},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 va},a.now=ea,a.prototype.now=ea,a.normalize=function(a){return 0>a&&(a=0),a},a}(),tb=sb.normalize,ub=sb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),ib}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 eb;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),ib}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 eb;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)}}(sb.prototype),function(a){sb.prototype.schedulePeriodic=function(a,b,c){if("undefined"==typeof aa.setInterval)throw new ua;b=tb(b);var d=a,e=aa.setInterval(function(){d=c(d)},b);return hb(function(){aa.clearInterval(e)})}}(sb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Gb(this,a)}}(sb.prototype);var vb,wb,xb=(ba.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 mb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a.bind(this))),b},b}(),function(a){function b(){a.call(this)}return bb(b,a),b.prototype.schedule=function(a,b){return lb(b(this,a))},b}(sb)),yb=sb.immediate=new xb,zb=function(a){function b(){for(;d.length>0;){var a=d.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var d;return bb(c,a),c.prototype.schedule=function(a,c){var f=new rb(this,a,c,this.now());if(d)d.enqueue(f);else{d=new Hb(4),d.enqueue(f);var g=la(b)();d=null,g===ka&&e(g.e)}return f.disposable},c.prototype.scheduleRequired=function(){return!d},c}(sb),Ab=sb.currentThread=new zb,Bb=function(){var a,b=ca;if(aa.setTimeout)a=aa.setTimeout,b=aa.clearTimeout;else{if(!aa.WScript)throw new ua;a=function(a,b){aa.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),Cb=Bb.setTimeout,Db=Bb.clearTimeout;!function(){function a(b){if(f)Cb(function(){a(b)},0);else{var c=d[b];if(c){f=!0;var g=la(c)();wb(b),f=!1,g===ka&&e(g.e)}}}function b(){if(!aa.postMessage||aa.importScripts)return!1;var a=!1,b=aa.onmessage;return aa.onmessage=function(){a=!0},aa.postMessage("","*"),aa.onmessage=b,a}var c=1,d={},f=!1;wb=function(a){delete d[a]};var g=new RegExp("^"+String(Pa).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=X&&$&&X.setImmediate)&&!g.test(h)&&h;if(ja(h))vb=function(b){var e=c++;return d[e]=b,h(function(){a(e)}),e};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))vb=function(b){var e=c++;return d[e]=b,process.nextTick(function(){a(e)}),e};else if(b()){var i="ms.rx.schedule"+Math.random(),j=function(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))};aa.addEventListener("message",j,!1),vb=function(a){var b=c++;return d[b]=a,aa.postMessage(i+currentId,"*"),b}}else if(aa.MessageChannel){var k=new aa.MessageChannel;k.port1.onmessage=function(b){a(b.data)},vb=function(a){var b=c++;return d[b]=a,k.port2.postMessage(b),b}}else vb="document"in aa&&"onreadystatechange"in aa.document.createElement("script")?function(b){var e=aa.document.createElement("script"),f=c++;return d[f]=b,e.onreadystatechange=function(){a(f),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},aa.document.documentElement.appendChild(e),f}:function(b){var e=c++;return d[e]=b,Cb(function(){a(e)},0),e}}();var Eb=function(a){function b(){a.call(this)}function c(a,b,c,d){return function(){!a.isDisposed&&a.setDisposable(gb._fixup(b(c,d)))}}function d(a,b){this._id=b,this._method=a,this.isDisposed=!1}return bb(b,a),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._method.call(null,this._id))},b.prototype.schedule=function(a,b){var e=new mb,f=vb(c(e,b,this,a));return new ob(e,new d(wb,f))},b.prototype._scheduleFuture=function(a,b,e){if(0===b)return this.schedule(a,e);var f=new mb,g=Cb(c(f,e,this,a),b);return new ob(f,new d(Db,g))},b}(sb),Fb=sb["default"]=sb.async=new Eb,Gb=function(a){function b(b,c){this._scheduler=b,this._handler=c,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this)}return bb(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,d){var f=la(a)(b._getRecursiveWrapper(c),d);return f===ka?(b._handler(f.e)||e(f.e),ib):lb(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 d=this,f=!1,g=new mb;return g.setDisposable(this._scheduler.schedulePeriodic(a,b,function(a){if(f)return null;var b=la(c)(a);return b===ka?(f=!0,d._handler(b.e)||e(b.e),g.dispose(),null):ret})),g},b}(sb);u.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Hb=ba.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ib=Hb.prototype;Ib.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ib.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)}}},Ib.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Ib.peek=function(){return this.items[0].value},Ib.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Ib.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ib.enqueue=function(a){var b=this.length++;this.items[b]=new u(Hb.count++,a),this.percolate(b)},Ib.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Hb.count=0;var Jb=ba.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new va},a.prototype._acceptObservable=function(a,b,c){throw new va},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 ub(a)||(a=yb),new Ed(function(c){return a.schedule(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Kb=function(a){function b(a){this.value=a,this.kind="N"}return bb(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}(Jb),Lb=function(a){function b(a){this.error=a,this.kind="E"}return bb(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}(Jb),Mb=function(a){function b(){this.kind="C"}return bb(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}(Jb),Nb=Jb.createOnNext=function(a){return new Kb(a)},Ob=Jb.createOnError=function(a){return new Lb(a)},Pb=Jb.createOnCompleted=function(){return new Mb},Qb=ba.Observer=function(){};Qb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Qb.prototype.asObserver=function(){var a=this;return new Ub(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Qb.prototype.checked=function(){return new Vb(this)};var Rb=Qb.create=function(a,b,c){return a||(a=ca),b||(b=ha),c||(c=ca),new Ub(a,b,c)};Qb.fromNotifier=function(a,b){var c=Ca(a,b,1);return new Ub(function(a){return c(Nb(a))},function(a){return c(Ob(a))},function(){return c(Pb())})},Qb.prototype.notifyOn=function(a){return new Xb(a,this)},Qb.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Sb,Tb=ba.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return bb(b,a),b.prototype.next=wa,b.prototype.error=wa,b.prototype.completed=wa,b.prototype.onNext=function(a){!this.isStopped&&this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Qb),Ub=ba.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return bb(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}(Tb),Vb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}bb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=la(this._observer.onNext).call(this._observer,a);this._state=0,b===ka&&e(b.e)},c.onError=function(a){this.checkAccess();var b=la(this._observer.onError).call(this._observer,a);this._state=2,b===ka&&e(b.e)},c.onCompleted=function(){this.checkAccess();var a=la(this._observer.onCompleted).call(this._observer);this._state=2,a===ka&&e(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Qb),Wb=ba.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 nb}return bb(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 d=la(c)();return d===ka?(a.queue=[],a.hasFaulted=!0,e(d.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Tb),Xb=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return bb(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}(Wb),Yb=ba.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){f(b,a),d.call(c,b)},b.call(a,c)}}function b(){if(ba.config.longStackSupport&&ma){var b=this._subscribe,c=la(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}}return Sb=b.prototype,b.isObservable=function(a){return a&&ja(a.subscribe)},Sb.subscribe=Sb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Rb(a,b,c))},Sb.subscribeOnNext=function(a,b){return this._subscribe(Rb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Sb.subscribeOnError=function(a,b){return this._subscribe(Rb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Sb.subscribeOnCompleted=function(a,b){return this._subscribe(Rb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Zb=ba.ObservableBase=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?hb(a):ib}function c(a,c){var d=c[0],f=c[1],g=la(f.subscribeCore).call(f,d);g!==ka||d.fail(ka.e)||e(ka.e),d.setDisposable(b(g))}function d(){a.call(this)}return bb(d,a),d.prototype._subscribe=function(a){var b=new Fd(a),d=[b,this];return Ab.scheduleRequired()?Ab.schedule(d,c):c(null,d),b},d.prototype.subscribeCore=wa,d}(Yb),$b=ba.FlatMapObservable=function(a){function b(b,c,d,e){this.resultSelector=ja(d)?d:null,this.selector=Ca(ja(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,Tb.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},bb(c,Tb),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=la(this.selector)(a,b,this.source);return c===ka?this.o.onError(c.e):(ia(c)&&(c=jc(c)),(Aa(c)||za(c))&&(c=Yb.from(c)),void this.o.onNext(this._wrapResult(c,a,b)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.onCompleted=function(){this.o.onCompleted()},b}(Zb),_b=ba.internals.Enumerable=function(){};v.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var ac=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,Tb.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b={isDisposed:!1},d=new nb,e=Ab.scheduleRecursive(this.sources[xa](),function(e,f){if(!b.isDisposed){var g=la(e.next).call(e);if(g===ka)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;ia(h)&&(h=jc(h));var i=new mb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new pb([d,e,new v(b)])},bb(c,Tb),c.prototype.onNext=function(a){this._o.onNext(a)},c.prototype.onError=function(a){this._o.onError(a)},c.prototype.onCompleted=function(){this._s(this._e)},b}(Zb);_b.prototype.concat=function(){return new ac(this)};var bc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this._o=a,this._recurse=b,Tb.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=this.sources[xa](),d={isDisposed:!1},e=new nb,f=Ab.scheduleRecursive(null,function(f,g){if(!d.isDisposed){var h=la(b.next).call(b);if(h===ka)return a.onError(h.e);if(h.done)return null!==f?a.onError(f):a.onCompleted();var i=h.value;ia(i)&&(i=jc(i));var j=new mb;e.setDisposable(j),j.setDisposable(i.subscribe(new c(a,g)))}});return new pb([e,f,new v(d)])},bb(c,Tb),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}(Zb);_b.prototype.catchError=function(){return new bc(this)},_b.prototype.catchErrorWhen=function(a){var b=this;return new Ed(function(c){var d,e=new Hd,f=new Hd,g=a(e),h=g.subscribe(f),i=b[xa](),j={isDisposed:!1},k=new nb,l=Ab.scheduleRecursive(null,function(a,b){if(!j.isDisposed){var g=la(i.next).call(i);if(g===ka)return c.onError(g.e);if(g.done)return void(d?c.onError(d):c.onCompleted());var h=g.value;ia(h)&&(h=jc(h));var l=new mb,m=new mb;k.setDisposable(new ob(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 pb([h,k,l,new v(j)])})};var cc=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 bb(b,a),b.prototype[xa]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?ya:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(_b),dc=_b.repeat=function(a,b){return new cc(a,b)},ec=function(a){function b(a,b,c){this.s=a,this.fn=b?Ca(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return bb(b,a),b.prototype[xa]=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]}:ya},b}(_b),fc=_b.of=function(a,b,c){return new ec(a,b,c)},gc=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Xb(this._s,a))},b}(Zb);Sb.observeOn=function(a){return new gc(this,a)};var hc=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 s(a,c.subscribe(e)))}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new mb,d=new nb;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(Zb);Sb.subscribeOn=function(a){return new hc(this,a)};var ic=function(a){function b(b,c){this._p=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];c.onNext(d),c.onCompleted()}function d(a,b){var c=b[0],d=b[1];c.onError(d)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new mb,e=this;return this._p.then(function(d){b.setDisposable(e._s.schedule([a,d],c))},function(c){b.setDisposable(e._s.schedule([a,c],d))}),b},b}(Zb),jc=Yb.fromPromise=function(a,b){return b||(b=Fb),new ic(a,b)};Sb.toPromise=function(a){if(a||(a=ba.config.Promise),!a)throw new ua("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 kc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],Tb.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){
return this.source.subscribe(new c(a))},bb(c,Tb),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}(Zb);Sb.toArray=function(){return new kc(this)},Yb.create=function(a,b){return new Ed(a,b)};var lc=function(a){function b(b){this._f=b,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=la(this._f)();return b===ka?Fc(b.e).subscribe(a):(ia(b)&&(b=jc(b)),b.subscribe(a))},b}(Zb),mc=(Yb.defer=function(a){return new lc(a)},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(),ib}return bb(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===yb?d(null,a):this.scheduler.schedule(a,d)},b}(Zb)),nc=new mc(yb),oc=Yb.empty=function(a){return ub(a)||(a=yb),a===yb?nc:new mc(a)},pc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new qc(a,this);return b.run()},b}(Zb),qc=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var f=la(c.next).call(c);if(f===ka)return d.onError(f.e);if(f.done)return d.onCompleted();var g=f.value;return ja(e)&&(g=la(e)(g,a),g===ka)?d.onError(g.e):(d.onNext(g),void b(a+1))}var b=Object(this.parent.iterable),c=B(b),d=this.o,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursive(0,a)},a}(),rc=Math.pow(2,53)-1;w.prototype[xa]=function(){return new x(this._s)},x.prototype[xa]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ya},y.prototype[xa]=function(){return new z(this._a)},z.prototype[xa]=function(){return this},z.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ya};var sc=Yb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ja(b))throw new Error("mapFn when provided must be a function");if(b)var e=Ca(b,c,2);return ub(d)||(d=Ab),new pc(a,e,d)},tc=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Zb);E.prototype.run=function(){return this.parent.scheduler.scheduleRecursive(0,F(this.parent.args,this.observer))};var uc=Yb.fromArray=function(a,b){return ub(b)||(b=Ab),new tc(a,b)},vc=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=la(a._itrFn)(a._state),a._state===ka)return a._o.onError(a._state.e);var c=la(a._cndFn)(a._state);if(c===ka)return a._o.onError(c.e);if(c){var d=la(a._resFn)(a._state);if(d===ka)return a._o.onError(d.e);a._o.onNext(d),b(a)}else a._o.onCompleted()}return bb(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(Zb);Yb.generate=function(a,b,c,d,e){return ub(e)||(e=Ab),new vc(a,b,c,d,e)};var wc=function(a){function b(){a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return ib},b}(Zb),xc=new wc,yc=Yb.never=function(){return xc};Yb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new tc(b,Ab)},Yb.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 tc(c,a)};var zc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new H(a,this);return b.run()},b}(Zb);H.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)},Yb.pairs=function(a,b){return b||(b=Ab),new zc(a,b)};var Ac=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new Bc(a,this);return b.run()},b}(Zb),Bc=function(){function a(a,b){this.observer=a,this.parent=b}function b(a,b,c){return function(d,e){b>d?(c.onNext(a+d),e(d+1)):c.onCompleted()}}return a.prototype.run=function(){return this.parent.scheduler.scheduleRecursive(0,b(this.parent.start,this.parent.rangeCount,this.observer))},a}();Yb.range=function(a,b,c){return ub(c)||(c=Ab),new Ac(a,b,c)};var Cc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new I(a,this);return b.run()},b}(Zb);I.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)},Yb.repeat=function(a,b,c){return ub(c)||(c=Ab),new Cc(a,b,c)};var Dc=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(),ib}return bb(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===yb?d(null,a):this.scheduler.schedule(a,d)},b}(Zb),Ec=(Yb["return"]=Yb.just=function(a,b){return ub(b)||(b=yb),new Dc(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 bb(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}(Zb)),Fc=Yb["throw"]=function(a,b){return ub(b)||(b=yb),new Ec(a,b)},Gc=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=ib,c=la(this._resFn)();if(c===ka)return new ob(Fc(c.e).subscribe(a),b);c&&(b=c);var d=la(this._obsFn)(c);return d===ka?new ob(Fc(d.e).subscribe(a),b):new ob(d.subscribe(a),b)},b}(Zb);Yb.using=function(a,b){return new Gc(a,b)},Sb.amb=function(a){var b=this;return new Ed(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new mb,j=new mb;ia(a)&&(a=jc(a));var k=Rb(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Rb(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 ob(i,j)})},Yb.amb=function(){var a,b=yc();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=J(b,a[d]);return b};var Hc=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new mb,c=new nb;return c.setDisposable(b),b.setDisposable(this.source.subscribe(new Ic(a,c,this._fn))),c},b}(Zb),Ic=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return bb(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=la(this._fn)(a);if(b===ka)return this._o.onError(b.e);ia(b)&&(b=jc(b));var c=new mb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Tb);Sb["catch"]=function(a){return ja(a)?new Hc(this,a):Jc([this,a])};var Jc=Yb["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 fc(a).catchError()};Sb.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),Mc.apply(this,b)};var Kc=function(a){function b(b,c){var d=b.length;this._params=b,this._cb=c,this._hv=r(d,K),this._hvAll=!1,this._done=r(d,K),this._v=new Array(d),a.call(this)}return bb(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 mb;c[d]=f,ia(e)&&(e=jc(e)),f.setDisposable(e.subscribe(new Lc(a,d,this)))}return new pb(c)},b}(Zb),Lc=function(a){function b(b,c,d){this._o=b,this._i=c,this._p=d,a.call(this)}return bb(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(da))){var b=la(this._p._cb).apply(null,this._p._v);if(b===ka)return this._o.onError(b.e);this._o.onNext(b)}else this._p._done.filter(function(a,b){return b!==this._i},this).every(da)&&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(da)&&this._o.onCompleted()},b}(Tb),Mc=Yb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ja(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new Kc(b,d)};Sb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Oc.apply(null,a)};var Nc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return bb(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 nb,c=this.sources,d=c.length,e=this.o,f=yb.scheduleRecursive(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ia(h)&&(h=jc(h));var i=new mb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new eb(b,f,hb(function(){a=!0}))},b}(Zb),Oc=Yb.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 Nc(a)};Sb.concatAll=function(){return this.merge(1)};var Pc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new eb;return b.add(this.source.subscribe(new Qc(a,this.maxConcurrent,b))),b},b}(Zb),Qc=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 mb;this.g.add(c),ia(a)&&(a=jc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var 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}();Sb.merge=function(a){return"number"!=typeof a?Rc(this,a):new Pc(this,a)};var Rc=Yb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(ub(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=yb,b=0;d>b;b++)c.push(arguments[b]);else for(a=yb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),G(a,c).mergeAll()},Sc=ba.CompositeError=function(a){this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};Sc.prototype=Error.prototype,Sc.prototype.name="NotImplementedError",Yb.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=G(null,a);return new Ed(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new Sc(g))}var c=new eb,e=new mb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new mb;c.add(e),ia(d)&&(d=jc(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})};var Tc=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 bb(b,a),b.prototype.subscribeCore=function(a){var b=new eb,d=new mb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new mb;this.g.add(b),ia(a)&&(a=jc(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var 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}(Zb);Sb.mergeAll=function(){return new Tc(this)},Sb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Uc([this,a])};var Uc=Yb.onErrorResumeNext=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 Ed(function(b){var c=0,d=new nb,e=yb.scheduleRecursive(null,function(e,f){var g,h;c<a.length?(g=a[c++],ia(g)&&(g=jc(g)),h=new mb,d.setDisposable(h),h.setDisposable(g.subscribe(b.onNext.bind(b),f,f))):b.onCompleted()});return new ob(d,e)})},Vc=function(a){function b(b,c){this._s=b,this._o=ia(c)?jc(c):c,this._open=!1,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new mb;b.setDisposable(this._s.subscribe(new Wc(a,this))),ia(this._o)&&(this._o=jc(this._o));var c=new mb;return c.setDisposable(this._o.subscribe(new Xc(a,this,c))),new ob(b,c)},b}(Zb),Wc=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return bb(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.onCompleted=function(){this._p._open&&this._o.onCompleted()},b}(Tb),Xc=function(a){function b(b,c,d){this._o=b,this._p=c,this._r=d,a.call(this)}return bb(b,a),b.prototype.next=function(){this._p._open=!0,this._r.dispose()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._r.dispose()},b}(Tb);Sb.skipUntil=function(a){return new Vc(this,a)};var Yc=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,Tb.call(this)}function d(a,b){this.parent=a,this.id=b,Tb.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new nb,d=this.source.subscribe(new c(a,b));return new ob(d,b)},bb(c,Tb),c.prototype.next=function(a){var b=new mb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ia(a)&&(a=jc(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()},bb(d,Tb),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}(Zb);Sb["switch"]=Sb.switchLatest=function(){return new Yc(this)};var Zc=function(a){function b(b,c){this.source=b,this.other=ia(c)?jc(c):c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return new ob(this.source.subscribe(a),this.other.subscribe(new $c(a)))},b}(Zb),$c=function(a){function b(b){this._o=b,a.call(this)}return bb(b,a),b.prototype.next=function(){this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=ca,b}(Tb);Sb.takeUntil=function(a){return new Zc(this,a)};var _c=function(a){function b(b,c,d){var e=c.length;this._s=b,this._ss=c,this._cb=d,this._hv=r(e,K),this._hvAll=!1,this._v=new Array(e),a.call(this)}return bb(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 mb;ia(e)&&(e=jc(e)),f.setDisposable(e.subscribe(new ad(a,d,this))),c[d]=f}var f=new mb;return f.setDisposable(this._s.subscribe(new bd(a,this))),c[b]=f,new pb(c)},b}(Zb),ad=function(a){function b(b,c,d){this._o=b,this._i=c,this._p=d,a.call(this)}return bb(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(da)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=ca,b}(Tb),bd=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return bb(b,a),b.prototype.next=function(a){var b=[a].concat(this._p._v);if(this._p._hvAll){var c=la(this._p._cb).apply(null,b);return c===ka?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}(Tb);Sb.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=ja(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new _c(this,b,d)};var cd=function(a){function b(b,c){this._s=b,this._cb=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=this._s.length,c=new Array(b);done=r(b,K),q=r(b,M);for(var d=0;b>d;d++){var e=this._s[d],f=new mb;c[d]=f,ia(e)&&(e=jc(e)),f.setDisposable(e.subscribe(new dd(a,d,this,q,done)))}return new pb(c)},b}(Zb),dd=function(a){function b(b,c,d,e,f){this._o=b,this._i=c,this._p=d,this._q=e,this._d=f,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return bb(b,a),b.prototype.next=function(a){if(this._q[this._i].push(a),this._q.every(c)){var b=this._q.map(d),f=la(this._p._cb).apply(null,b);if(f===ka)return this._o.onError(f.e);this._o.onNext(f)}else this._d.filter(e(this._i)).every(da)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._d[this._i]=!0,this._d.every(da)&&this._o.onCompleted()},b}(Tb);Sb.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=ja(b[a-1])?b.pop():L;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new cd(b,d)},Yb.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=ja(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)},Sb.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=ja(b[a-1])?b.pop():L,e=this;return b.unshift(e),new Ed(function(a){for(var c=b.length,f=r(c,M),g=r(c,K),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new mb;(Aa(i)||za(i))&&(i=sc(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=la(d).apply(e,h);if(i===ka)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(da)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(da)&&a.onCompleted()})),h[c]=j}(i);return new eb(h)},e)},Sb.asObservable=function(){return new Ed(N(this),this)},Sb.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(O).filter(P)};var ed=function(a){function b(b){this.source=b,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new fd(a))},b}(Zb),fd=function(a){function b(b){this._o=b,a.call(this)}return bb(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}(Tb);Sb.dematerialize=function(){return new ed(this)};var gd=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new hd(a,this.keyFn,this.comparer))},b}(Zb),hd=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 bb(b,a),b.prototype.next=function(a){var b,c=a;return ja(this.keyFn)&&(c=la(this.keyFn)(a),c===ka)?this.o.onError(c.e):this.hasCurrentKey&&(b=la(this.comparer)(this.currentKey,c),b===ka)?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}(Tb);Sb.distinctUntilChanged=function(a,b){return b||(b=fa),new gd(this,a,b)};var id=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||ja(b._oN)?Rb(b._oN||ca,b._oE||ca,b._oC||ca):b._oN,this.isStopped=!1,Tb.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},bb(c,Tb),c.prototype.next=function(a){var b=la(this.t.onNext).call(this.t,a);b===ka&&this.o.onError(b.e),this.o.onNext(a)},c.prototype.error=function(a){var b=la(this.t.onError).call(this.t,a);return b===ka?this.o.onError(b.e):void this.o.onError(a)},c.prototype.completed=function(){var a=la(this.t.onCompleted).call(this.t);return a===ka?this.o.onError(a.e):void this.o.onCompleted()},b}(Zb);Sb["do"]=Sb.tap=Sb.doAction=function(a,b,c){return new id(this,a,b,c)},Sb.doOnNext=Sb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Sb.doOnError=Sb.tapOnError=function(a,b){return this.tap(ca,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Sb.doOnCompleted=Sb.tapOnCompleted=function(a,b){return this.tap(ca,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Sb["finally"]=function(a){var b=this;return new Ed(function(c){var d=la(b.subscribe).call(b,c);return d===ka?(a(),e(d.e)):hb(function(){var b=la(d.dispose).call(d);a(),b===ka&&e(b.e)})},this)};var jd=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=ca,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Zb);Sb.ignoreElements=function(){return new jd(this)};var kd=function(a){function b(b,c){this.source=b,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ld(a))},b}(Zb),ld=function(a){function b(b){this._o=b,a.call(this)}return bb(b,a),b.prototype.next=function(a){this._o.onNext(Nb(a))},b.prototype.error=function(a){this._o.onNext(Ob(a)),this._o.onCompleted()},b.prototype.completed=function(){this._o.onNext(Pb()),this._o.onCompleted()},b}(Tb);Sb.materialize=function(){return new kd(this)},Sb.repeat=function(a){return dc(this,a).concat()},Sb.retry=function(a){return dc(this,a).catchError()},Sb.retryWhen=function(a){return dc(this).catchErrorWhen(a)};var md=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new nd(a,this))},b}(Zb),nd=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 bb(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=la(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?la(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===ka?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}(Tb);Sb.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new md(this,c,b,a)};var od=function(a){function b(b,c){this.source=b,this._c=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new pd(a,this._c))},b}(Zb),pd=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return bb(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}(Tb);Sb.skipLast=function(a){if(0>a)throw new ta;return new od(this,a)},Sb.startWith=function(){var a,b=0;arguments.length&&ub(arguments[0])?(a=arguments[0],b=1):a=yb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return fc([uc(c,a),this]).concat()};var qd=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return bb(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}(Tb);Sb.takeLast=function(a){if(0>a)throw new ta;var b=this;return new Ed(function(c){return b.subscribe(new qd(c,a))},b)};var rd=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return bb(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}(Tb);Sb.takeLastBuffer=function(a){if(0>a)throw new ta;var b=this;return new Ed(function(c){return b.subscribe(new rd(c,a))},b)},Sb.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new ta;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new ta;return new Ed(function(d){function e(){var a=new Hd;i.push(a),d.onNext(db(a,g))}var f=new mb,g=new qb(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)},Sb.flatMapConcat=Sb.concatMap=function(a,b,c){return new $b(this,a,b,c).merge(1)},Sb.concatMapObserver=Sb.selectConcatObserver=function(a,b,c,d){var e=this,f=Ca(a,d,2),g=Ca(b,d,1),h=Ca(c,d,0);return new Ed(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ia(d)&&(d=jc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ia(c)&&(c=jc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ia(b)&&(b=jc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()};var sd=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return bb(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(this._d),this._o.onCompleted()},b}(Tb);Sb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Ed(function(a){return c.subscribe(new sd(a,b))},c)},R.prototype.push=function(a){var b=-1===Q(this.set,a,this.comparer);return b&&this.set.push(a),b};var td=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ud(a,this._keyFn,this._cmpFn))},b}(Zb),ud=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new R(d),a.call(this)}return bb(b,a),b.prototype.next=function(a){var b=a;return ja(this._keyFn)&&(b=la(this._keyFn)(a),b===ka)?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}(Tb);Sb.distinct=function(a,b){return b||(b=fa),new td(this,a,b)};var vd=function(a){function b(b,c,d){this.source=b,this.selector=Ca(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,Tb.call(this)}return bb(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))},bb(d,Tb),d.prototype.next=function(a){var b=la(this.selector)(a,this.i++,this.source);return b===ka?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}(Zb);Sb.map=Sb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof vd?this.internalMap(c,b):new vd(this,c,b)},Sb.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error("List of properties cannot be empty.");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(S(b,a))},Sb.flatMapObserver=Sb.selectManyObserver=function(a,b,c,d){var e=this;return new Ed(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)}ia(c)&&(c=jc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ia(c)&&(c=jc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ia(a)&&(a=jc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Sb.flatMap=Sb.selectMany=function(a,b,c){return new $b(this,a,b,c).mergeAll()},ba.Observable.prototype.flatMapLatest=function(a,b,c){return new $b(this,a,b,c).switchLatest()};var wd=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 bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,
this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Zb);Sb.skip=function(a){if(0>a)throw new ta;return new wd(this,a)};var xd=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new yd(a,this))},b}(Zb),yd=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!1,a.call(this)}return bb(b,a),b.prototype.next=function(a){if(!this._r){var b=la(this._p._fn)(a,this._i++,this._p);if(b===ka)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}(Tb);Sb.skipWhile=function(a,b){var c=Ca(a,b,3);return new xd(this,c)};var zd=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 bb(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}(Zb);Sb.take=function(a,b){if(0>a)throw new ta;return 0===a?oc(b):new zd(this,a)};var Ad=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Bd(a,this))},b}(Zb),Bd=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!0,a.call(this)}return bb(b,a),b.prototype.next=function(a){return this._r&&(this._r=la(this._p._fn)(a,this._i++,this._p),this._r===ka)?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}(Tb);Sb.takeWhile=function(a,b){var c=Ca(a,b,3);return new Ad(this,c)};var Cd=function(a){function b(b,c,d){this.source=b,this.predicate=Ca(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,Tb.call(this)}return bb(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)},bb(d,Tb),d.prototype.next=function(a){var b=la(this.predicate)(a,this.i++,this.source);return b===ka?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}(Zb);Sb.filter=Sb.where=function(a,b){return this instanceof Cd?this.internalFilter(a,b):new Cd(this,a,b)};var Dd=function(a){function b(b,c){this._o=b,this._xform=c,a.call(this)}return bb(b,a),b.prototype.next=function(a){var b=la(this._xform["@@transducer/step"]).call(this._xform,this._o,a);b===ka&&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}(Tb);Sb.transduce=function(a){var b=this;return new Ed(function(c){var d=a(T(c));return b.subscribe(new Dd(c,d))},b)};var Ed=ba.AnonymousObservable=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?hb(a):ib}function c(a,c){var d=c[0],f=c[1],g=la(f.__subscribe).call(f,d);g!==ka||d.fail(ka.e)||e(ka.e),d.setDisposable(b(g))}function d(b,c){this.source=c,this.__subscribe=b,a.call(this)}return bb(d,a),d.prototype._subscribe=function(a){var b=new Fd(a),d=[b,this];return Ab.scheduleRequired()?Ab.schedule(d,c):c(null,d),b},d}(Yb),Fd=function(a){function b(b){a.call(this),this.observer=b,this.m=new mb}bb(b,a);var c=b.prototype;return c.next=function(a){var b=la(this.observer.onNext).call(this.observer,a);b===ka&&(this.dispose(),e(b.e))},c.error=function(a){var b=la(this.observer.onError).call(this.observer,a);this.dispose(),b===ka&&e(b.e)},c.completed=function(){var a=la(this.observer.onCompleted).call(this.observer);this.dispose(),a===ka&&e(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Tb),Gd=function(a,b){this._s=a,this._o=b};Gd.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 Hd=ba.Subject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return bb(b,a),cb(b.prototype,Qb.prototype,{_subscribe:function(a){return kb(this),this.isStopped?this.hasError?(a.onError(this.error),ib):(a.onCompleted(),ib):(this.observers.push(a),new Gd(this,a))},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(kb(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=c(this.observers),d=b.length;d>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(kb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){if(kb(this),!this.isStopped)for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),b.create=function(a,b){return new Id(a,b)},b}(Yb),Id=(ba.AsyncSubject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return bb(b,a),cb(b.prototype,Qb.prototype,{_subscribe:function(a){return kb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),ib):(this.observers.push(a),new Gd(this,a))},hasObservers:function(){return kb(this),this.observers.length>0},onCompleted:function(){var a,b;if(kb(this),!this.isStopped){this.isStopped=!0;var d=c(this.observers),b=d.length;if(this.hasValue)for(a=0;b>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;b>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(kb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){kb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),b}(Yb),ba.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return bb(b,a),cb(b.prototype,Qb.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}(Yb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(aa.Rx=ba,define(function(){return ba})):V&&W?$?(W.exports=ba).Rx=ba:V.Rx=ba:aa.Rx=ba;var Jd=j()}).call(this);
//# sourceMappingURL=rx.map