UNPKG

72.5 kBJavaScriptView Raw
1/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2(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&&Xd>=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(b,c,d,e,f,g){var h=db(b),i=h.length,j=db(c),k=j.length;if(i!==k&&!e)return!1;for(var l,m=i;m--;)if(l=h[m],!(e?l in c:ab.call(c,l)))return!1;for(var n=e;++m<i;){l=h[m];var o,p=b[l],q=c[l];if(!(o===a?d(p,q,e,f,g):o))return!1;n||(n="constructor"===l)}if(!n){var r=b.constructor,s=c.constructor;if(r!==s&&"constructor"in b&&"constructor"in c&&!("function"==typeof r&&r instanceof r&&"function"==typeof s&&s instanceof s))return!1}return!0}function m(a,b,c){switch(c){case Fa:case Ga:return+a===+b;case Ha:return a.name===b.name&&a.message===b.message;case Ka:return a!==+a?b!==+b:a===+b;case Ma:case Oa:return a===b+""}return!1}function n(a){return!!a&&"object"==typeof a}function o(a){return"number"==typeof a&&a>-1&&a%1===0&&cb>=a}function p(a){return n(a)&&o(a.length)&&!!$a[bb.call(a)]}function q(a,b){for(var c=-1,d=a.length;++c<d;)if(b(a[c],c,a))return!0;return!1}function r(b,c,d,e,f,g){var h=-1,i=b.length,j=c.length;if(i!==j&&!(e&&j>i))return!1;for(;++h<i;){var k,l=b[h],m=c[h];if(k!==a){if(k)continue;return!1}if(e){if(!q(c,function(a){return l===a||d(l,a,e,f,g)}))return!1}else if(l!==m&&!d(l,m,e,f,g))return!1}return!0}function s(a,b,c,d,e,f){var g=gb(a),h=gb(b),i=Ea,j=Ea;g||(i=bb.call(a),i===Da?i=La:i!==La&&(g=p(a))),h||(j=bb.call(b),j===Da&&(j=La));var k=i===La&&!fb(a),n=j===La&&!fb(b),o=i===j;if(o&&!g&&!k)return m(a,b,i);if(!d){var q=k&&ab.call(a,"__wrapped__"),s=n&&ab.call(b,"__wrapped__");if(q||s)return c(q?a.value():a,s?b.value():b,d,e,f)}if(!o)return!1;e||(e=[]),f||(f=[]);for(var t=e.length;t--;)if(e[t]===a)return f[t]===b;e.push(a),f.push(b);var u=(g?r:l)(a,b,c,d,e,f);return e.pop(),f.pop(),u}function t(a,b,c,d,e){return a===b?!0:null==a||null==b||!eb(a)&&!n(b)?a!==a&&b!==b:s(a,b,t,c,d,e)}function u(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function v(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function w(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function x(a,b){this.id=a,this.value=b}function y(a){this._s=a,this.isDisposed=!1}function z(a){this._s=a}function A(a){this._s=a,this._l=a.length,this._i=0}function B(a){this._a=a}function C(a){this._a=a,this._l=G(a),this._i=0}function D(a){return"number"==typeof a&&aa.isFinite(a)}function E(b){var c,d=b[xa];if(!d&&"string"==typeof b)return c=new z(b),c[xa]();if(!d&&b.length!==a)return c=new B(b),c[xa]();if(!d)throw new TypeError("Object is not iterable");return b[xa]()}function F(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function G(a){var b=+a.length;return isNaN(b)?0:0!==b&&D(b)?(b=F(b)*Math.floor(Math.abs(b)),0>=b?0:b>xc?xc:b):b}function H(a,b){return Bb(a)||(a=Hb),new zc(b,a)}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 hb(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]"==toString.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&&b[xa]!==a},Aa=ba.helpers.isArrayLike=function(b){return b&&b.length!==a};ba.helpers.iterator=xa;var Ba=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)}},Ca=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Da=(Ca.length,"[object Arguments]"),Ea="[object Array]",Fa="[object Boolean]",Ga="[object Date]",Ha="[object Error]",Ia="[object Function]",Ja="[object Map]",Ka="[object Number]",La="[object Object]",Ma="[object RegExp]",Na="[object Set]",Oa="[object String]",Pa="[object WeakMap]",Qa="[object ArrayBuffer]",Ra="[object Float32Array]",Sa="[object Float64Array]",Ta="[object Int8Array]",Ua="[object Int16Array]",Va="[object Int32Array]",Wa="[object Uint8Array]",Xa="[object Uint8ClampedArray]",Ya="[object Uint16Array]",Za="[object Uint32Array]",$a={};$a[Ra]=$a[Sa]=$a[Ta]=$a[Ua]=$a[Va]=$a[Wa]=$a[Xa]=$a[Ya]=$a[Za]=!0,$a[Da]=$a[Ea]=$a[Qa]=$a[Fa]=$a[Ga]=$a[Ha]=$a[Ia]=$a[Ja]=$a[Ka]=$a[La]=$a[Ma]=$a[Na]=$a[Oa]=$a[Pa]=!1;var _a=Object.prototype,ab=_a.hasOwnProperty,bb=_a.toString,cb=Math.pow(2,53)-1,db=Object.keys||function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}(),eb=ba.internals.isObject=function(a){var b=typeof a;return!!a&&("object"===b||"function"===b)},fb=function(){try{Object({toString:0}+"")}catch(a){return function(){return!1}}return function(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}}(),gb=Array.isArray||function(a){return n(a)&&o(a.length)&&bb.call(a)===Ea},hb=ba.internals.isEqual=function(a,b){return t(a,b)},ib=({}.hasOwnProperty,Array.prototype.slice,ba.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),jb=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]}},kb=ba.internals.addRef=function(a,b){return new Sd(function(c){return new vb(b.getDisposable(),a.subscribe(c))})},lb=ba.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0];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},mb=lb.prototype;mb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},mb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},mb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var nb=ba.Disposable=function(a){this.isDisposed=!1,this.action=a||ca};nb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ob=nb.create=function(a){return new nb(a)},pb=nb.empty={dispose:ca},qb=nb.isDisposable=function(a){return a&&ja(a.dispose)},rb=nb.checkDisposed=function(a){if(a.isDisposed)throw new sa},sb=nb._fixup=function(a){return qb(a)?a:pb},tb=ba.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};tb.prototype.getDisposable=function(){return this.current},tb.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()},tb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var ub=ba.SerialDisposable=function(){this.isDisposed=!1,this.current=null};ub.prototype.getDisposable=function(){return this.current},ub.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},ub.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var vb=ba.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};vb.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 wb=ba.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};wb.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 xb=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?pb:new a(this)},b}();v.prototype.dispose=function(){this.scheduler.schedule(this,w)};var yb=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 tb};yb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},yb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},yb.prototype.isCancelled=function(){return this.disposable.isDisposed},yb.prototype.invokeCore=function(){return sb(this.action(this.scheduler,this.state))};var zb=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}(),Ab=zb.normalize,Bb=zb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),pb}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new lb;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),pb}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 lb;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)}}(zb.prototype),function(a){a.schedulePeriodic=function(a,b,c){if("undefined"==typeof aa.setInterval)throw new ua;b=Ab(b);var d=a,e=aa.setInterval(function(){d=c(d)},b);return ob(function(){aa.clearInterval(e)})}}(zb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Nb(this,a)}}(zb.prototype);var Cb,Db,Eb=(ba.internals.SchedulePeriodicRecursive=function(){function a(a){return function(b,c){c(0,a._period);var d=la(a._action)(a._state);d===ka&&(a._cancel.dispose(),e(d.e)),a._state=d}}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 tb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a(this))),b},b}(),function(a){function b(){a.call(this)}return ib(b,a),b.prototype.schedule=function(a,b){return sb(b(this,a))},b}(zb)),Fb=zb.immediate=new Eb,Gb=function(a){function b(){for(;d.length>0;){var a=d.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var d;return ib(c,a),c.prototype.schedule=function(a,c){var f=new yb(this,a,c,this.now());if(d)d.enqueue(f);else{d=new Ob(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}(zb),Hb=zb.currentThread=new Gb,Ib=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}}(),Jb=Ib.setTimeout,Kb=Ib.clearTimeout;!function(){function a(b){if(f)Jb(function(){a(b)},0);else{var c=d[b];if(c){f=!0;var g=la(c)();Db(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;Db=function(a){delete d[a]};var g=new RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=X&&$&&X.setImmediate)&&!g.test(h)&&h;if(ja(h))Cb=function(b){var e=c++;return d[e]=b,h(function(){a(e)}),e};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Cb=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),Cb=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)},Cb=function(a){var b=c++;return d[b]=a,k.port2.postMessage(b),b}}else Cb="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,Jb(function(){a(e)},0),e}}();var Lb=function(a){function b(){a.call(this)}function c(a,b,c,d){return function(){a.setDisposable(nb._fixup(b(c,d)))}}function d(a){this._id=a,this.isDisposed=!1}function e(a){this._id=a,this.isDisposed=!1}return ib(b,a),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,Db(this._id))},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,Kb(this._id))},b.prototype.schedule=function(a,b){var e=new tb,f=Cb(c(e,b,this,a));return new vb(e,new d(f))},b.prototype._scheduleFuture=function(a,b,d){if(0===b)return this.schedule(a,d);var f=new tb,g=Jb(c(f,d,this,a),b);return new vb(f,new e(g))},b}(zb),Mb=zb["default"]=zb.async=new Lb,Nb=function(a){function b(b,c){this._scheduler=b,this._handler=c,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this)}return ib(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),pb):sb(f)}},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 tb;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):b})),g},b}(zb);x.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Ob=ba.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Pb=Ob.prototype;Pb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Pb.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)}}},Pb.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)}}},Pb.peek=function(){return this.items[0].value},Pb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Pb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Pb.enqueue=function(a){var b=this.length++;this.items[b]=new x(Ob.count++,a),this.percolate(b)},Pb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Ob.count=0;var Qb=ba.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new va},a.prototype._acceptObserver=function(a,b,c){throw new va},a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObserver(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return Bb(a)||(a=Fb),new Sd(function(c){return a.schedule(b,function(a,b){b._acceptObserver(c),"N"===b.kind&&c.onCompleted()})})},a}(),Rb=function(a){function b(a){this.value=a,this.kind="N"}return ib(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObserver=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return"OnNext("+this.value+")"},b}(Qb),Sb=function(a){function b(a){this.error=a,this.kind="E"}return ib(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObserver=function(a){return a.onError(this.error)},b.prototype.toString=function(){return"OnError("+this.error+")"},b}(Qb),Tb=function(a){function b(){this.kind="C"}return ib(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObserver=function(a){return a.onCompleted()},b.prototype.toString=function(){return"OnCompleted()"},b}(Qb),Ub=Qb.createOnNext=function(a){return new Rb(a)},Vb=Qb.createOnError=function(a){return new Sb(a)},Wb=Qb.createOnCompleted=function(){return new Tb},Xb=ba.Observer=function(){};Xb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Xb.prototype.asObserver=function(){var a=this;return new _b(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Xb.prototype.checked=function(){return new ac(this)};var Yb=Xb.create=function(a,b,c){return a||(a=ca),b||(b=ha),c||(c=ca),new _b(a,b,c)};Xb.fromNotifier=function(a,b){var c=Ba(a,b,1);return new _b(function(a){return c(Ub(a))},function(a){return c(Vb(a))},function(){return c(Wb())})},Xb.prototype.notifyOn=function(a){return new cc(a,this)},Xb.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Zb,$b=ba.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return ib(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}(Xb),_b=ba.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return ib(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}($b),ac=function(a){function b(b){a.call(this),this._observer=b,this._state=0}ib(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}(Xb),bc=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 ub}function c(a,b){return function(){a.onNext(b)}}function d(a,b){return function(){a.onError(b)}}function f(a){return function(){a.onCompleted()}}function g(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)}return ib(b,a),b.prototype.next=function(a){this.queue.push(c(this.observer,a))},b.prototype.error=function(a){this.queue.push(d(this.observer,a))},b.prototype.completed=function(){this.queue.push(f(this.observer))},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,g))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}($b),cc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return ib(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}(bc),dc=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 Zb=b.prototype,b.isObservable=function(a){return a&&ja(a.subscribe)},Zb.subscribe=Zb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Yb(a,b,c))},Zb.subscribeOnNext=function(a,b){return this._subscribe(Yb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Zb.subscribeOnError=function(a,b){return this._subscribe(Yb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Zb.subscribeOnCompleted=function(a,b){return this._subscribe(Yb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),ec=ba.ObservableBase=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?ob(a):pb}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 ib(d,a),d.prototype._subscribe=function(a){var b=new Td(a),d=[b,this];return Hb.scheduleRequired()?Hb.schedule(d,c):c(null,d),b},d.prototype.subscribeCore=wa,d}(dc),fc=ba.FlatMapObservable=function(a){function b(b,c,d,e){this.resultSelector=ja(d)?d:null,this.selector=Ba(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,$b.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},ib(c,$b),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=qc(c)),(Aa(c)||za(c))&&(c=dc.from(c)),void this.o.onNext(this._wrapResult(c,a,b)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onCompleted()},b}(ec),gc=ba.internals.Enumerable=function(){};y.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var hc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=la(a.e.next).call(a.e);if(c===ka)return a.o.onError(c.e);if(c.done)return a.o.onCompleted();var e=c.value;ia(e)&&(e=qc(e));var f=new tb;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,$b.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new ub,d={isDisposed:!1,o:a,subscription:b,e:this.sources[xa]()},e=Hb.scheduleRecursive(d,c);return new wb([b,e,new y(d)])},ib(d,$b),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.o.onError(a)},d.prototype.completed=function(){this._recurse(this._state)},b}(ec);gc.prototype.concat=function(){return new hc(this)};var ic=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=la(a.e.next).call(a.e);if(c===ka)return a.o.onError(c.e);if(c.done)return null!==a.lastError?a.o.onError(a.lastError):a.o.onCompleted();var e=c.value;ia(e)&&(e=qc(e));var f=new tb;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,$b.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new ub,d={isDisposed:!1,e:this.sources[xa](),subscription:b,lastError:null,o:a},e=Hb.scheduleRecursive(d,c);return new wb([b,e,new y(d)])},ib(d,$b),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.lastError=a,this._recurse(this._state)},d.prototype.completed=function(){this._state.o.onCompleted()},b}(ec);gc.prototype.catchError=function(){return new ic(this)},gc.prototype.catchErrorWhen=function(a){var b=this;return new Sd(function(c){var d,e=new Vd,f=new Vd,g=a(e),h=g.subscribe(f),i=b[xa](),j={isDisposed:!1},k=new ub,l=Hb.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=qc(h));var l=new tb,m=new tb;k.setDisposable(new vb(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 wb([h,k,l,new y(j)])})};var jc=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 ib(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}(gc),kc=gc.repeat=function(a,b){return new jc(a,b)},lc=function(a){function b(a,b,c){this.s=a,this.fn=b?Ba(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return ib(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}(gc),mc=gc.of=function(a,b,c){return new lc(a,b,c)},nc=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new cc(this._s,a))},b}(ec);Zb.observeOn=function(a){return new nc(this,a)};var oc=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 v(a,c.subscribe(e)))}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new tb,d=new ub;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(ec);Zb.subscribeOn=function(a){return new oc(this,a)};var pc=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 ib(b,a),b.prototype.subscribeCore=function(a){var b=new tb,e=this;return this._p.then(function(d){b.setDisposable(e._s.schedule([a,d],c));
3},function(c){b.setDisposable(e._s.schedule([a,c],d))}),b},b}(ec),qc=dc.fromPromise=function(a,b){return b||(b=Mb),new pc(a,b)};Zb.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 rc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],$b.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},ib(c,$b),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}(ec);Zb.toArray=function(){return new rc(this)},dc.create=function(a,b){return new Sd(a,b)};var sc=function(a){function b(b){this._f=b,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=la(this._f)();return b===ka?Kc(b.e).subscribe(a):(ia(b)&&(b=qc(b)),b.subscribe(a))},b}(ec),tc=(dc.defer=function(a){return new sc(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(),pb}return ib(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===Fb?d(null,a):this.scheduler.schedule(a,d)},b}(ec)),uc=new tc(Fb),vc=dc.empty=function(a){return Bb(a)||(a=Fb),a===Fb?uc:new tc(a)},wc=function(a){function b(b,c,d){this._iterable=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){var f=la(b.next).call(b);if(f===ka)return a.onError(f.e);if(f.done)return a.onCompleted();var g=f.value;return ja(c)&&(g=la(c)(g,d),g===ka)?a.onError(g.e):(a.onNext(g),void e(d+1))}}return ib(b,a),b.prototype.subscribeCore=function(a){var b=Object(this._iterable),d=E(b);return this._scheduler.scheduleRecursive(0,c(a,d,this._fn))},b}(ec),xc=Math.pow(2,53)-1;z.prototype[xa]=function(){return new A(this._s)},A.prototype[xa]=function(){return this},A.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ya},B.prototype[xa]=function(){return new C(this._a)},C.prototype[xa]=function(){return this},C.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ya};var yc=dc.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=Ba(b,c,2);return Bb(d)||(d=Hb),new wc(a,e,d)},zc=function(a){function b(b,c){this._args=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b.length;return function(d,e){c>d?(a.onNext(b[d]),e(d+1)):a.onCompleted()}}return ib(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._args))},b}(ec),Ac=dc.fromArray=function(a,b){return Bb(b)||(b=Hb),new zc(a,b)},Bc=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 ib(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(ec);dc.generate=function(a,b,c,d,e){return Bb(e)||(e=Hb),new Bc(a,b,c,d,e)};var Cc=function(a){function b(){a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return pb},b}(ec),Dc=new Cc,Ec=dc.never=function(){return Dc};dc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new zc(b,Hb)},dc.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 zc(c,a)};var Fc=function(a){function b(b,c){this._o=b,this._keys=Object.keys(b),this._scheduler=c,a.call(this)}function c(a,b,c){return function(d,e){if(d<c.length){var f=c[d];a.onNext([f,b[f]]),e(d+1)}else a.onCompleted()}}return ib(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._o,this._keys))},b}(ec);dc.pairs=function(a,b){return b||(b=Hb),new Fc(a,b)};var Gc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){b>d?(c.onNext(a+d),e(d+1)):c.onCompleted()}}return ib(b,a),b.prototype.subscribeCore=function(a){return this.scheduler.scheduleRecursive(0,c(this.start,this.rangeCount,a))},b}(ec);dc.range=function(a,b,c){return Bb(c)||(c=Hb),new Gc(a,b,c)};var Hc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new I(a,this);return b.run()},b}(ec);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)},dc.repeat=function(a,b,c){return Bb(c)||(c=Hb),new Hc(a,b,c)};var Ic=function(a){function b(b,c){this._value=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),pb}return ib(b,a),b.prototype.subscribeCore=function(a){var b=[this._value,a];return this._scheduler===Fb?c(null,b):this._scheduler.schedule(b,c)},b}(ec),Jc=(dc["return"]=dc.just=function(a,b){return Bb(b)||(b=Fb),new Ic(a,b)},function(a){function b(b,c){this._error=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onError(c),pb}return ib(b,a),b.prototype.subscribeCore=function(a){var b=[this._error,a];return this._scheduler===Fb?c(null,b):this._scheduler.schedule(b,c)},b}(ec)),Kc=dc["throw"]=function(a,b){return Bb(b)||(b=Fb),new Jc(a,b)},Lc=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=pb,c=la(this._resFn)();if(c===ka)return new vb(Kc(c.e).subscribe(a),b);c&&(b=c);var d=la(this._obsFn)(c);return d===ka?new vb(Kc(d.e).subscribe(a),b):new vb(d.subscribe(a),b)},b}(ec);dc.using=function(a,b){return new Lc(a,b)},Zb.amb=function(a){var b=this;return new Sd(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new tb,j=new tb;ia(a)&&(a=qc(a));var k=Yb(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Yb(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 vb(i,j)})},dc.amb=function(){var a,b=Ec();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 Mc=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new tb,c=new ub;return c.setDisposable(b),b.setDisposable(this.source.subscribe(new Nc(a,c,this._fn))),c},b}(ec),Nc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return ib(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=qc(b));var c=new tb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}($b);Zb["catch"]=function(a){return ja(a)?new Mc(this,a):Oc([this,a])};var Oc=dc["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 mc(a).catchError()};Zb.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),Rc.apply(this,b)};var Pc=function(a){function b(b,c){this._params=b,this._cb=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){for(var b=this._params.length,c=new Array(b),d={hasValue:u(b,K),hasValueAll:!1,isDone:u(b,K),values:new Array(b)},e=0;b>e;e++){var f=this._params[e],g=new tb;c[e]=g,ia(f)&&(f=qc(f)),g.setDisposable(f.subscribe(new Qc(a,e,this._cb,d)))}return new wb(c)},b}(ec),Qc=function(a){function b(b,c,d,e){this._o=b,this._i=c,this._cb=d,this._state=e,a.call(this)}function c(a){return function(b,c){return c!==a}}return ib(b,a),b.prototype.next=function(a){if(this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll||(this._state.hasValueAll=this._state.hasValue.every(da))){var b=la(this._cb).apply(null,this._state.values);if(b===ka)return this._o.onError(b.e);this._o.onNext(b)}else this._state.isDone.filter(c(this._i)).every(da)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._state.isDone[this._i]=!0,this._state.isDone.every(da)&&this._o.onCompleted()},b}($b),Rc=dc.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 Pc(b,d)};Zb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Uc.apply(null,a)};var Sc=function(a){function b(b,c){this._s=b,this._fn=c,a.call(this)}return ib(b,a),b.prototype.next=function(a){this._s.o.onNext(a)},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.i++,this._fn(this._s)},b}($b),Tc=function(a){function b(b){this._sources=b,a.call(this)}function c(a,b){if(!a.disposable.isDisposed){if(a.i===a.sources.length)return a.o.onCompleted();var c=a.sources[a.i];ia(c)&&(c=qc(c));var d=new tb;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new Sc(a,b)))}}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new ub,d=ob(ca),e={o:a,i:0,subscription:b,disposable:d,sources:this._sources},f=Fb.scheduleRecursive(e,c);return new wb([b,d,f])},b}(ec),Uc=dc.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 Tc(a)};Zb.concatAll=function(){return this.merge(1)};var Vc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new lb;return b.add(this.source.subscribe(new Wc(a,this.maxConcurrent,b))),b},b}(ec),Wc=function(a){function b(b,c,d){this.o=b,this.max=c,this.g=d,this.done=!1,this.q=[],this.activeCount=0,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return ib(b,a),b.prototype.handleSubscribe=function(a){var b=new tb;this.g.add(b),ia(a)&&(a=qc(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.next=function(a){this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a)},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,0===this.activeCount&&this.o.onCompleted()},ib(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.q.length>0?this.parent.handleSubscribe(this.parent.q.shift()):(this.parent.activeCount--,this.parent.done&&0===this.parent.activeCount&&this.parent.o.onCompleted())},b}($b);Zb.merge=function(a){return"number"!=typeof a?Xc(this,a):new Vc(this,a)};var Xc=dc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Bb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=Fb,b=0;d>b;b++)c.push(arguments[b]);else for(a=Fb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),H(a,c).mergeAll()},Yc=ba.CompositeError=function(a){this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};Yc.prototype=Object.create(Error.prototype),Yc.prototype.name="CompositeError";var Zc=function(a){function b(b){this.source=b,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new lb,c=new tb,d={isStopped:!1,errors:[],o:a};return b.add(c),c.setDisposable(this.source.subscribe(new $c(b,d))),b},b}(ec),$c=function(a){function b(b,c){this._group=b,this._state=c,a.call(this)}function c(a,b){0===b.length?a.onCompleted():1===b.length?a.onError(b[0]):a.onError(new Yc(b))}function d(b,c,d){this._inner=b,this._group=c,this._state=d,a.call(this)}return ib(b,a),b.prototype.next=function(a){var b=new tb;this._group.add(b),ia(a)&&(a=qc(a)),b.setDisposable(a.subscribe(new d(b,this._group,this._state)))},b.prototype.error=function(a){this._state.errors.push(a),this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},b.prototype.completed=function(){this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},ib(d,a),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.errors.push(a),this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},d.prototype.completed=function(){this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},b}($b);dc.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=H(null,a);return new Zc(d)};var _c=function(a){function b(b){this.source=b,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new lb,c=new tb;return b.add(c),c.setDisposable(this.source.subscribe(new ad(a,b))),b},b}(ec),ad=function(a){function b(b,c){this.o=b,this.g=c,this.done=!1,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return ib(b,a),b.prototype.next=function(a){var b=new tb;this.g.add(b),ia(a)&&(a=qc(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,1===this.g.length&&this.o.onCompleted()},ib(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.done&&1===this.parent.g.length&&this.parent.o.onCompleted()},b}($b);Zb.mergeAll=function(){return new _c(this)},Zb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return dd([this,a])};var bd=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(a.pos<a.sources.length){var c=a.sources[a.pos++];ia(c)&&(c=qc(c));var d=new tb;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new cd(a,b)))}else a.o.onCompleted()}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new ub,d={pos:0,subscription:b,o:a,sources:this.sources},e=Fb.scheduleRecursive(d,c);return new vb(b,e)},b}(ec),cd=function(a){function b(b,c){this._state=b,this._recurse=c,a.call(this)}return ib(b,a),b.prototype.next=function(a){this._state.o.onNext(a)},b.prototype.error=function(){this._recurse(this._state)},b.prototype.completed=function(){this._recurse(this._state)},b}($b),dd=dc.onErrorResumeNext=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 new bd(a)},ed=function(a){function b(b,c){this._s=b,this._o=ia(c)?qc(c):c,this._open=!1,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new tb;b.setDisposable(this._s.subscribe(new fd(a,this))),ia(this._o)&&(this._o=qc(this._o));var c=new tb;return c.setDisposable(this._o.subscribe(new gd(a,this,c))),new vb(b,c)},b}(ec),fd=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return ib(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}($b),gd=function(a){function b(b,c,d){this._o=b,this._p=c,this._r=d,a.call(this)}return ib(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}($b);Zb.skipUntil=function(a){return new ed(this,a)};var hd=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,$b.call(this)}function d(a,b){this.parent=a,this.id=b,$b.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){var b=new ub,d=this.source.subscribe(new c(a,b));return new vb(d,b)},ib(c,$b),c.prototype.next=function(a){var b=new tb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ia(a)&&(a=qc(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()},ib(d,$b),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.stopped&&this.parent.o.onCompleted())},b}(ec);Zb["switch"]=Zb.switchLatest=function(){return new hd(this)};var id=function(a){function b(b,c){this.source=b,this.other=ia(c)?qc(c):c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return new vb(this.source.subscribe(a),this.other.subscribe(new jd(a)))},b}(ec),jd=function(a){function b(b){this._o=b,a.call(this)}return ib(b,a),b.prototype.next=function(){this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=ca,b}($b);Zb.takeUntil=function(a){return new id(this,a)};var kd=function(a){function b(b,c,d){this._s=b,this._ss=c,this._cb=d,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){for(var b=this._ss.length,c={hasValue:u(b,K),hasValueAll:!1,values:new Array(b)},d=this._ss.length,e=new Array(d+1),f=0;d>f;f++){var g=this._ss[f],h=new tb;ia(g)&&(g=qc(g)),h.setDisposable(g.subscribe(new ld(a,f,c))),e[f]=h}var i=new tb;return i.setDisposable(this._s.subscribe(new md(a,this._cb,c))),e[d]=i,new wb(e)},b}(ec),ld=function(a){function b(b,c,d){this._o=b,this._i=c,this._state=d,a.call(this)}return ib(b,a),b.prototype.next=function(a){this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll=this._state.hasValue.every(da)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=ca,b}($b),md=function(a){function b(b,c,d){this._o=b,this._cb=c,this._state=d,a.call(this)}return ib(b,a),b.prototype.next=function(a){var b=[a].concat(this._state.values);if(this._state.hasValueAll){var c=la(this._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}($b);Zb.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 kd(this,b,d)};var nd=function(a){function b(b,c){this._s=b,this._cb=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){for(var b=this._s.length,c=new Array(b),d=u(b,K),e=u(b,M),f=0;b>f;f++){var g=this._s[f],h=new tb;c[f]=h,ia(g)&&(g=qc(g)),h.setDisposable(g.subscribe(new od(a,f,this,e,d)))}return new wb(c)},b}(ec),od=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 ib(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}($b);Zb.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 nd(b,d)},dc.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)};var pd=function(a){function b(b,c){this.sources=b,this._cb=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){for(var b=this.sources,c=b.length,d=new Array(c),e={q:u(c,M),done:u(c,K),cb:this._cb,o:a},f=0;c>f;f++)!function(a){var c=b[a],f=new tb;(Aa(c)||za(c))&&(c=yc(c)),d[a]=f,f.setDisposable(c.subscribe(new qd(e,a)))}(f);return new wb(d)},b}(ec),qd=function(a){function b(b,c){this._s=b,this._i=c,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 ib(b,a),b.prototype.next=function(a){if(this._s.q[this._i].push(a),this._s.q.every(c)){var b=this._s.q.map(d),f=la(this._s.cb).apply(null,b);if(f===ka)return this._s.o.onError(f.e);this._s.o.onNext(f)}else this._s.done.filter(e(this._i)).every(da)&&this._s.o.onCompleted()},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.done[this._i]=!0,this._s.done.every(da)&&this._s.o.onCompleted()},b}($b);Zb.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 pd(b,d)},Zb.asObservable=function(){return new Sd(N(this),this)},Zb.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(O).filter(P)};var rd=function(a){function b(b){this.source=b,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new sd(a))},b}(ec),sd=function(a){function b(b){this._o=b,a.call(this)}return ib(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}($b);Zb.dematerialize=function(){return new rd(this)};var td=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ud(a,this.keyFn,this.comparer))},b}(ec),ud=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 ib(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}($b);Zb.distinctUntilChanged=function(a,b){return b||(b=fa),new td(this,a,b)};var vd=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)?Yb(b._oN||ca,b._oE||ca,b._oC||ca):b._oN,this.isStopped=!1,$b.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},ib(c,$b),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}(ec);Zb["do"]=Zb.tap=Zb.doAction=function(a,b,c){return new vd(this,a,b,c)},Zb.doOnNext=Zb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Zb.doOnError=Zb.tapOnError=function(a,b){return this.tap(ca,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Zb.doOnCompleted=Zb.tapOnCompleted=function(a,b){return this.tap(ca,null,"undefined"!=typeof b?function(){a.call(b)}:a)};var wd=function(a){function b(b,c,d){this.source=b,this._fn=Ba(c,d,0),a.call(this)}function c(a,b){this.isDisposed=!1,this._s=a,this._fn=b}return ib(b,a),b.prototype.subscribeCore=function(a){var b=la(this.source.subscribe).call(this.source,a);return b===ka&&(this._fn(),e(b.e)),new c(b,this._fn)},c.prototype.dispose=function(){if(!this.isDisposed){var a=la(this._s.dispose).call(this._s);this._fn(),a===ka&&e(a.e)}},b}(ec);Zb["finally"]=function(a,b){return new wd(this,a,b)};var xd=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return ib(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}(ec);Zb.ignoreElements=function(){return new xd(this)};var yd=function(a){function b(b,c){this.source=b,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new zd(a))},b}(ec),zd=function(a){function b(b){this._o=b,a.call(this)}return ib(b,a),b.prototype.next=function(a){this._o.onNext(Ub(a))},b.prototype.error=function(a){this._o.onNext(Vb(a)),this._o.onCompleted()},b.prototype.completed=function(){this._o.onNext(Wb()),this._o.onCompleted()},b}($b);Zb.materialize=function(){return new yd(this)},Zb.repeat=function(a){return kc(this,a).concat()},Zb.retry=function(a){return kc(this,a).catchError()},Zb.retryWhen=function(a){return kc(this).catchErrorWhen(a)};var Ad=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Bd(a,this))},b}(ec),Bd=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 ib(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}($b);Zb.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Ad(this,c,b,a)};var Cd=function(a){function b(b,c){this.source=b,this._c=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Dd(a,this._c))},b}(ec),Dd=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return ib(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}($b);Zb.skipLast=function(a){if(0>a)throw new ta;return new Cd(this,a)},Zb.startWith=function(){var a,b=0;arguments.length&&Bb(arguments[0])?(a=arguments[0],b=1):a=Fb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return mc([Ac(c,a),this]).concat()};var Ed=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return ib(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}($b);Zb.takeLast=function(a){if(0>a)throw new ta;var b=this;return new Sd(function(c){return b.subscribe(new Ed(c,a))},b)};var Fd=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return ib(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}($b);Zb.takeLastBuffer=function(a){if(0>a)throw new ta;var b=this;return new Sd(function(c){return b.subscribe(new Fd(c,a))},b)},Zb.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 Sd(function(d){function e(){var a=new Vd;i.push(a),d.onNext(kb(a,g))}var f=new tb,g=new xb(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)},Zb.flatMapConcat=Zb.concatMap=function(a,b,c){return new fc(this,a,b,c).merge(1)},Zb.concatMapObserver=Zb.selectConcatObserver=function(a,b,c,d){var e=this,f=Ba(a,d,2),g=Ba(b,d,1),h=Ba(c,d,0);return new Sd(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ia(d)&&(d=qc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ia(c)&&(c=qc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ia(b)&&(b=qc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()};var Gd=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return ib(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}($b);Zb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Sd(function(a){return c.subscribe(new Gd(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 Hd=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Id(a,this._keyFn,this._cmpFn))},b}(ec),Id=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new R(d),a.call(this)}return ib(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}($b);Zb.distinct=function(a,b){return b||(b=fa),new Hd(this,a,b)};var Jd=function(a){function b(b,c,d){this.source=b,this.selector=Ba(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,$b.call(this)}return ib(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))},ib(d,$b),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}(ec);Zb.map=Zb.select=function(a,b){
4var c="function"==typeof a?a:function(){return a};return this instanceof Jd?this.internalMap(c,b):new Jd(this,c,b)},Zb.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))},Zb.flatMapObserver=Zb.selectManyObserver=function(a,b,c,d){var e=this;return new Sd(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}ia(c)&&(c=qc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ia(c)&&(c=qc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ia(a)&&(a=qc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Zb.flatMap=Zb.selectMany=function(a,b,c){return new fc(this,a,b,c).mergeAll()},ba.Observable.prototype.flatMapLatest=function(a,b,c){return new fc(this,a,b,c).switchLatest()};var Kd=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._r=b,$b.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},ib(c,$b),c.prototype.next=function(a){this._r<=0?this._o.onNext(a):this._r--},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(ec);Zb.skip=function(a){if(0>a)throw new ta;return new Kd(this,a)};var Ld=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Md(a,this))},b}(ec),Md=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!1,a.call(this)}return ib(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}($b);Zb.skipWhile=function(a,b){var c=Ba(a,b,3);return new Ld(this,c)};var Nd=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._c=b,this._r=b,$b.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},ib(c,$b),c.prototype.next=function(a){this._r-->0&&(this._o.onNext(a),this._r<=0&&this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(ec);Zb.take=function(a,b){if(0>a)throw new ta;return 0===a?vc(b):new Nd(this,a)};var Od=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return ib(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Pd(a,this))},b}(ec),Pd=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!0,a.call(this)}return ib(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}($b);Zb.takeWhile=function(a,b){var c=Ba(a,b,3);return new Od(this,c)};var Qd=function(a){function b(b,c,d){this.source=b,this.predicate=Ba(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,$b.call(this)}return ib(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)},ib(d,$b),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}(ec);Zb.filter=Zb.where=function(a,b){return this instanceof Qd?this.internalFilter(a,b):new Qd(this,a,b)};var Rd=function(a){function b(b,c){this._o=b,this._xform=c,a.call(this)}return ib(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}($b);Zb.transduce=function(a){var b=this;return new Sd(function(c){var d=a(T(c));return b.subscribe(new Rd(c,d))},b)};var Sd=ba.AnonymousObservable=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?ob(a):pb}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 ib(d,a),d.prototype._subscribe=function(a){var b=new Td(a),d=[b,this];return Hb.scheduleRequired()?Hb.schedule(d,c):c(null,d),b},d}(dc),Td=function(a){function b(b){a.call(this),this.observer=b,this.m=new tb}ib(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}($b),Ud=function(a,b){this._s=a,this._o=b};Ud.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 Vd=ba.Subject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return ib(b,a),jb(b.prototype,Xb.prototype,{_subscribe:function(a){return rb(this),this.isStopped?this.hasError?(a.onError(this.error),pb):(a.onCompleted(),pb):(this.observers.push(a),new Ud(this,a))},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(rb(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(rb(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(rb(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 Wd(a,b)},b}(dc),Wd=(ba.AsyncSubject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return ib(b,a),jb(b.prototype,Xb.prototype,{_subscribe:function(a){return rb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),pb):(this.observers.push(a),new Ud(this,a))},hasObservers:function(){return rb(this),this.observers.length>0},onCompleted:function(){var a,b;if(rb(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(rb(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){rb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),b}(dc),ba.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return ib(b,a),jb(b.prototype,Xb.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}(dc));"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 Xd=j()}).call(this);
5//# sourceMappingURL=rx.map
\No newline at end of file