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
4 lines (4 loc) · 51.7 KB
/
Copy pathrx.min.js
File metadata and controls
4 lines (4 loc) · 51.7 KB
1
2
3
4
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){if(a.isDisposed)throw new Error(cb)}function c(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function d(a,b){if(db&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(hb)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var f=c.join("\n"+hb+"\n");a.stack=e(f)}}function e(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var h=b[d];f(h)||g(h)||!h||c.push(h)}return c.join("\n")}function f(a){var b=j(a);if(!b)return!1;var c=b[0],d=b[1];return c===fb&&d>=gb&&Yc>=d}function g(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function h(){if(db)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=j(c);if(!d)return;return fb=d[0],d[1]}}function j(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function k(a){var b=[];if(!Jb(a))return b;Ib.nonEnumArgs&&a.length&&Kb(a)&&(a=Mb.call(a));var c=Ib.enumPrototypes&&"function"==typeof a,d=Ib.enumErrorProps&&(a===Db||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Ib.nonEnumShadows&&a!==Eb){var f=a.constructor,g=-1,h=pb;if(a===(f&&f.prototype))var i=a===Fb?zb:a===Db?ub:Ab.call(a),j=Hb[i];for(;++g<h;)e=ob[g],j&&j[e]||!Bb.call(a,e)||b.push(e)}return b}function l(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function m(a,b){return l(a,b,k)}function n(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function o(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Ab.call(a),h=Ab.call(b);if(g==qb&&(g=xb),h==qb&&(h=xb),g!=h)return!1;switch(g){case sb:case tb:return+a==+b;case wb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case yb:case zb:return a==String(b)}var i=g==rb;if(!i){if(g!=xb||!Ib.nodeClass&&(n(a)||n(b)))return!1;var j=!Ib.argsObject&&Kb(a)?Object:a.constructor,k=!Ib.argsObject&&Kb(b)?Object:b.constructor;if(!(j==k||Bb.call(a,"constructor")&&Bb.call(b,"constructor")||ab(j)&&j instanceof j&&ab(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,p=b.length,q=p==l)for(;p--;){var r=b[p];if(!(q=o(a[p],r,c,d)))break}}else m(b,function(b,e,f){return Bb.call(f,e)?(p++,q=Bb.call(a,e)&&o(a[e],b,c,d)):void 0}),q&&m(a,function(a,b,c){return Bb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a,b){this.id=a,this.value=b}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function u(){this._s=s}function v(){this._s=s,this._l=s.length,this._i=0}function w(a){this._a=a}function x(a){this._a=a,this._l=B(a),this._i=0}function y(a){return"number"==typeof a&&O.isFinite(a)}function z(b){var c,d=b[ib];if(!d&&"string"==typeof b)return c=new u(b),c[ib]();if(!d&&b.length!==a)return c=new w(b),c[ib]();if(!d)throw new TypeError("Object is not iterable");return b[ib]()}function A(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function B(a){var b=+a.length;return isNaN(b)?0:0!==b&&y(b)?(b=A(b)*Math.floor(Math.abs(b)),0>=b?0:b>Ec?Ec:b):b}function C(a,b){return V(a)||(a=dc),new Tc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function D(a,b){return new Tc(function(c){var d=new Xb,e=new Yb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}_(f)&&(f=Bc(f)),d=new Xb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e},a)}function E(a,b){var c=this;return new Tc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function F(){return!1}function G(){return[]}function H(a,b,c){var d=nb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return _(e)&&(e=Bc(e)),(lb(e)||kb(e))&&(e=Fc(e)),e}).concatAll()}function I(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function J(a){this.comparer=a,this.set=[]}function K(a,b,c){this.observer=a,this.selector=b,this.source=c,this.index=0,this.isStopped=!1}function L(a,b,c){var d=nb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return _(e)&&(e=Bc(e)),(lb(e)||kb(e))&&(e=Fc(e)),e}).mergeAll()}function M(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.index=0,this.isStopped=!1}var N={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},O=N[typeof window]&&window||this,P=N[typeof exports]&&exports&&!exports.nodeType&&exports,Q=N[typeof module]&&module&&!module.nodeType&&module,R=Q&&Q.exports===P&&P,S=N[typeof global]&&global;!S||S.global!==S&&S.window!==S||(O=S);var T={internals:{},config:{Promise:O.Promise},helpers:{}},U=T.helpers.noop=function(){},V=(T.helpers.notDefined=function(a){return"undefined"==typeof a},T.helpers.isScheduler=function(a){return a instanceof T.Scheduler}),W=T.helpers.identity=function(a){return a},X=(T.helpers.pluck=function(a){return function(b){return b[a]}},T.helpers.just=function(a){return function(){return a}},T.helpers.defaultNow=Date.now),Y=T.helpers.defaultComparer=function(a,b){return Lb(a,b)},Z=T.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},$=(T.helpers.defaultKeySerializer=function(a){return a.toString()},T.helpers.defaultError=function(a){throw a}),_=T.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},ab=(T.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},T.helpers.not=function(a){return!a},T.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ab.call(a)}),a}()),bb="Argument out of range",cb="Object has been disposed";T.config.longStackSupport=!1;var db=!1;try{throw new Error}catch(eb){db=!!eb.stack}var fb,gb=h(),hb="From previous event:",ib="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";O.Set&&"function"==typeof(new O.Set)["@@iterator"]&&(ib="@@iterator");var jb=T.doneEnumerator={done:!0,value:a},kb=T.helpers.isIterable=function(b){return b[ib]!==a},lb=T.helpers.isArrayLike=function(b){return b&&b.length!==a};T.helpers.iterator=ib;var mb,nb=T.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)}},ob=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],pb=ob.length,qb="[object Arguments]",rb="[object Array]",sb="[object Boolean]",tb="[object Date]",ub="[object Error]",vb="[object Function]",wb="[object Number]",xb="[object Object]",yb="[object RegExp]",zb="[object String]",Ab=Object.prototype.toString,Bb=Object.prototype.hasOwnProperty,Cb=Ab.call(arguments)==qb,Db=Error.prototype,Eb=Object.prototype,Fb=String.prototype,Gb=Eb.propertyIsEnumerable;try{mb=!(Ab.call(document)==xb&&!({toString:0}+""))}catch(eb){mb=!0}var Hb={};Hb[rb]=Hb[tb]=Hb[wb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Hb[sb]=Hb[zb]={constructor:!0,toString:!0,valueOf:!0},Hb[ub]=Hb[vb]=Hb[yb]={constructor:!0,toString:!0},Hb[xb]={constructor:!0};var Ib={};!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);Ib.enumErrorProps=Gb.call(Db,"message")||Gb.call(Db,"name"),Ib.enumPrototypes=Gb.call(a,"prototype"),Ib.nonEnumArgs=0!=c,Ib.nonEnumShadows=!/valueOf/.test(b)}(1);var Jb=T.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Kb=function(a){return a&&"object"==typeof a?Ab.call(a)==qb:!1};Cb||(Kb=function(a){return a&&"object"==typeof a?Bb.call(a,"callee"):!1});var Lb=T.internals.isEqual=function(a,b){return o(a,b,[],[])},Mb=({}.hasOwnProperty,Array.prototype.slice),Nb=this.inherits=T.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Ob=T.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]}},Pb=T.internals.addRef=function(a,b){return new Tc(function(c){return new Sb(b.getDisposable(),a.subscribe(c))})};q.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Qb=T.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Rb=Qb.prototype;Rb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Rb.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)}}},Rb.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)}}},Rb.peek=function(){return this.items[0].value},Rb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Rb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Rb.enqueue=function(a){var b=this.length++;this.items[b]=new q(Qb.count++,a),this.percolate(b)},Rb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Qb.count=0;var Sb=T.CompositeDisposable=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]);this.disposables=a,this.isDisposed=!1,this.length=this.disposables.length},Tb=Sb.prototype;Tb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Tb.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},Tb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=[],b=0,c=this.disposables.length;c>b;b++)a.push(this.disposables[b]);for(this.disposables=[],this.length=0,b=0,c=a.length;c>b;b++)a[b].dispose()}},Tb.toArray=function(){for(var a=[],b=this.disposables.length;b>i;i++)a.push(this.disposables[i]);return a};var Ub=T.Disposable=function(a){this.isDisposed=!1,this.action=a||U};Ub.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Vb=Ub.create=function(a){return new Ub(a)},Wb=Ub.empty={dispose:U},Xb=T.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},b.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()},a}(),Yb=T.SerialDisposable=Xb,Zb=T.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?Wb:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.scheduleWithState(this,t)};var $b=T.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Z,this.disposable=new Xb};$b.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},$b.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},$b.prototype.isCancelled=function(){return this.disposable.isDisposed},$b.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var _b=T.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Wb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=X,a.normalize=function(a){return 0>a&&(a=0),a},a}(),ac=_b.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Sb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Wb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Sb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c](b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Wb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(_b.prototype),function(){_b.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},_b.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof O.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=O.setInterval(function(){d=c(d)},b);return Vb(function(){O.clearInterval(e)})}}(_b.prototype),function(a){a.catchError=a["catch"]=function(a){return new ic(this,a)}}(_b.prototype);var bc,cc=(T.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 Xb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),_b.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=this.now()+ac(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new _b(X,a,b,c)}()),dc=_b.currentThread=function(){function a(a){for(;a.length>0;){var b=a.dequeue();if(!b.isCancelled()){for(;b.dueTime-_b.now()>0;);!b.isCancelled()&&b.invoke()}}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+_b.normalize(c),g=new $b(this,b,d,f);if(e)e.enqueue(g);else{e=new Qb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new _b(X,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),ec=U,fc=function(){var a,b=U;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!O.setTimeout)throw new Error("No concurrency detected!");a=O.setTimeout,b=O.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),gc=fc.setTimeout,hc=fc.clearTimeout;!function(){function a(){if(!O.postMessage||O.importScripts)return!1;var a=!1,b=O.onmessage;return O.onmessage=function(){a=!0},O.postMessage("","*"),O.onmessage=b,a}var b=RegExp("^"+String(Ab).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=S&&R&&S.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=S&&R&&S.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)bc=c,ec=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))bc=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};O.addEventListener?O.addEventListener("message",h,!1):O.attachEvent("onmessage",h,!1),bc=function(a){var b=g++;f[b]=a,O.postMessage(e+b,"*")}}else if(O.MessageChannel){var i=new O.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},bc=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in O&&"onreadystatechange"in O.document.createElement("script")?bc=function(a){var b=O.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},O.document.documentElement.appendChild(b)}:(bc=function(a){return gc(a,0)},ec=hc)}();var ic=(_b.timeout=function(){function a(a,b){var c=this,d=new Xb,e=bc(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Sb(d,Vb(function(){ec(e)}))}function b(a,b,c){var d=this,e=_b.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Xb,g=gc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Sb(f,Vb(function(){hc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new _b(X,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Nb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Wb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Xb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(_b)),jc=T.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return V(a)||(a=cc),new Tc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),kc=jc.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new jc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),lc=jc.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new jc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),mc=jc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new jc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),nc=T.internals.Enumerator=function(a){this._next=a};nc.prototype.next=function(){return this._next()},nc.prototype[ib]=function(){return this};var oc=T.internals.Enumerable=function(a){this._iterator=a};oc.prototype[ib]=function(){return this._iterator()},oc.prototype.concat=function(){var a=this;return new Tc(function(b){var c,d=a[ib](),e=new Yb,f=cc.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;_(h)&&(h=Bc(h));var i=new Xb;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new Sb(e,f,Vb(function(){c=!0}))})},oc.prototype.catchError=function(){var a=this;return new Tc(function(b){var c,d=a[ib](),e=new Yb,f=cc.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;_(i)&&(i=Bc(i));var j=new Xb;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new Sb(e,f,Vb(function(){c=!0}))})},oc.prototype.catchErrorWhen=function(a){var b=this;return new Tc(function(c){var d,e,f=new Wc,g=new Wc,h=a(f),i=h.subscribe(g),j=b[ib](),k=new Yb,l=cc.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;_(i)&&(i=Bc(i));var l=new Xb,m=new Xb;k.setDisposable(new Sb(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new Sb(i,k,l,Vb(function(){d=!0}))})};var pc=oc.repeat=function(a,b){return null==b&&(b=-1),new oc(function(){var c=b;return new nc(function(){return 0===c?jb:(c>0&&c--,{done:!1,value:a})})})},qc=oc.of=function(a,b,c){if(b)var d=nb(b,c,3);return new oc(function(){var c=-1;return new nc(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:jb})})},rc=T.Observer=function(){};rc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},rc.prototype.asObserver=function(){return new vc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},rc.prototype.checked=function(){return new wc(this)};var sc=rc.create=function(a,b,c){return a||(a=U),b||(b=$),c||(c=U),new vc(a,b,c)};rc.fromNotifier=function(a,b){return new vc(function(c){return a.call(b,kc(c))},function(c){return a.call(b,lc(c))},function(){return a.call(b,mc())})},rc.prototype.notifyOn=function(a){return new yc(a,this)},rc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var tc,uc=T.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Nb(b,a),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}(rc),vc=T.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Nb(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}(uc),wc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Nb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},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}(rc),xc=T.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 Yb}return Nb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(uc),yc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Nb(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}(xc),zc=T.Observable=function(){function a(a){if(T.config.longStackSupport&&db){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var c=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){d(a,c),e(a)},a.call(c,b)}}else this._subscribe=a}return tc=a.prototype,tc.subscribe=tc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:sc(a,b,c))},tc.subscribeOnNext=function(a,b){return this._subscribe(sc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},tc.subscribeOnError=function(a,b){return this._subscribe(sc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},tc.subscribeOnCompleted=function(a,b){return this._subscribe(sc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Ac=T.ObservableBase=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Vb(a):Wb}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e.subscribeCore(d)))}catch(f){if(!d.fail(f))throw f}}function d(a){var b=new Uc(a),d=[b,this];return dc.scheduleRequired()?dc.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Nb(e,a),e.prototype.subscribeCore=function(){throw new Error("Not implemeneted")},e}(zc);tc.observeOn=function(a){var b=this;return new Tc(function(c){return b.subscribe(new yc(a,c))},b)},tc.subscribeOn=function(a){var b=this;return new Tc(function(c){var d=new Xb,e=new Yb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var Bc=zc.fromPromise=function(a){return Cc(function(){var b=new T.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};tc.toPromise=function(a){if(a||(a=T.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},tc.toArray=function(){var a=this;return new Tc(function(b){var c=[];return a.subscribe(function(a){c.push(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},zc.create=zc.createWithDisposable=function(a,b){return new Tc(a,b)};var Cc=zc.defer=function(a){return new Tc(function(b){var c;try{c=a()}catch(d){return Lc(d).subscribe(b)}return _(c)&&(c=Bc(c)),c.subscribe(b)})},Dc=zc.empty=function(a){return V(a)||(a=cc),new Tc(function(b){return a.schedule(function(){b.onCompleted()})})},Ec=Math.pow(2,53)-1;u.prototype[ib]=function(){return new v(this._s)},v.prototype[ib]=function(){return this},v.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return jb},w.prototype[ib]=function(){return new x(this._a)},x.prototype[ib]=function(){return this},x.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return jb};var Fc=zc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ab(b))throw new Error("mapFn when provided must be a function");if(b)var e=nb(b,c,2);V(d)||(d=dc);var f=Object(a),g=z(f);return new Tc(function(a){return d.scheduleRecursiveWithState(0,function(b,c){try{var d=g.next()}catch(f){return void a.onError(f)}if(d.done)return void a.onCompleted();var h=d.value;if(e)try{h=e(h,b)}catch(f){return void a.onError(f)}a.onNext(h),c(b+1)})})},Gc=function(a){function b(b,c){this.args=b,this.scheduler=c||dc,a.call(this)}return Nb(b,a),b.prototype.subscribeCore=function(a){var b=new Hc(a,this);return b.run()},b}(Ac),Hc=function(){function a(a,b){this.observer=a,this.parent=b}function b(a,b){a.i<a.len?(a.observer.onNext(a.args[a.i++]),b(a)):a.observer.onCompleted()}return a.prototype.run=function(){return this.parent.scheduler.scheduleRecursiveWithState({i:0,args:this.parent.args,len:this.parent.args.length,observer:this.observer},b)},a}(),Ic=zc.fromArray=function(a,b){return new Gc(a,b)};zc.generate=function(a,b,c,d,e){return V(e)||(e=dc),new Tc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var Jc=zc.never=function(){return new Tc(function(){return Wb})};zc.of=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return C(null,a)},zc.ofWithScheduler=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);return C(a,b)},zc.pairs=function(a,b){return b||(b=T.Scheduler.currentThread),new Tc(function(c){var d=Object.keys(a),e=d.length;return b.scheduleRecursiveWithState(0,function(b,f){if(e>b){var g=d[b];c.onNext([g,a[g]]),f(b+1)}else c.onCompleted()})})},zc.range=function(a,b,c){return V(c)||(c=dc),new Tc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},zc.repeat=function(a,b,c){return V(c)||(c=dc),Kc(a,c).repeat(null==b?-1:b)};var Kc=zc["return"]=zc.just=function(a,b){return V(b)||(b=cc),new Tc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};zc.returnValue=function(){return Kc.apply(null,arguments)};var Lc=zc["throw"]=zc.throwError=function(a,b){return V(b)||(b=cc),new Tc(function(c){return b.schedule(function(){c.onError(a)})})};zc.throwException=function(){return zc.throwError.apply(null,arguments)},zc.using=function(a,b){return new Tc(function(c){var d,e,f=Wb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Sb(Lc(g).subscribe(c),f)}return new Sb(e.subscribe(c),f)})},tc.amb=function(a){var b=this;return new Tc(function(c){function d(){f||(f=g,j.dispose())
}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Xb,j=new Xb;return _(a)&&(a=Bc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Sb(i,j)})},zc.amb=function(){function a(a,b){return a.amb(b)}var b=Jc(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},tc["catch"]=tc.catchError=function(a){return"function"==typeof a?D(this,a):Mc([this,a])},tc.catchException=function(a){return this.catchError(a)};var Mc=zc.catchError=zc["catch"]=zc.catchException=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 qc(a).catchError()};tc.combineLatest=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Nc.apply(this,a)};var Nc=zc.combineLatest=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);var d=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Tc(function(b){function c(a){var c;if(h[a]=!0,i||(i=h.every(W))){try{c=d.apply(null,k)}catch(e){return void b.onError(e)}b.onNext(c)}else j.filter(function(b,c){return c!==a}).every(W)&&b.onCompleted()}function e(a){j[a]=!0,j.every(W)&&b.onCompleted()}for(var f=function(){return!1},g=a.length,h=p(g,f),i=!1,j=p(g,f),k=new Array(g),l=new Array(g),m=0;g>m;m++)!function(d){var f=a[d],g=new Xb;_(f)&&(f=Bc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(a){b.onError(a)},function(){e(d)})),l[d]=g}(m);return new Sb(l)},this)};tc.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 Oc=zc.concat=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 qc(a).concat()};tc.concatAll=tc.concatObservable=function(){return this.merge(1)},tc.merge=function(a){if("number"!=typeof a)return Pc(this,a);var b=this;return new Tc(function(c){function d(a){var b=new Xb;f.add(b),_(a)&&(a=Bc(a)),b.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){c.onError(a)},function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Sb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},function(a){c.onError(a)},function(){g=!0,0===e&&c.onCompleted()})),f},b)};var Pc=zc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(V(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=cc,b=0;d>b;b++)c.push(arguments[b]);else for(a=cc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),C(a,c).mergeAll()};tc.mergeAll=function(){var a=this;return new Tc(function(b){var c=new Sb,d=!1,e=new Xb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Xb;c.add(e),_(a)&&(a=Bc(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},function(a){b.onError(a)},function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},tc.mergeObservable=function(){return this.mergeAll.apply(this,arguments)},tc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Qc([this,a])};var Qc=zc.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 Tc(function(b){var c=0,d=new Yb,e=cc.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],_(f)&&(f=Bc(f)),g=new Xb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Sb(d,e)})};tc.skipUntil=function(a){var b=this;return new Tc(function(c){var d=!1,e=new Sb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));_(a)&&(a=Bc(a));var f=new Xb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},tc["switch"]=tc.switchLatest=function(){var a=this;return new Tc(function(b){var c=!1,d=new Yb,e=!1,f=0,g=a.subscribe(function(a){var g=new Xb,h=++f;c=!0,d.setDisposable(g),_(a)&&(a=Bc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new Sb(g,d)},a)},tc.takeUntil=function(a){var b=this;return new Tc(function(c){return _(a)&&(a=Bc(a)),new Sb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},U))},b)},tc.withLatestFrom=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);var d=a.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(a[0])&&(a=a[0]),new Tc(function(b){for(var c=function(){return!1},f=a.length,g=p(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=a[c],e=new Xb;_(d)&&(d=Bc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(W)},b.onError.bind(b),function(){})),j[c]=e}(k);var l=new Xb;return l.setDisposable(e.subscribe(function(a){var c,e=[a].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void b.onError(f)}b.onNext(c)}},b.onError.bind(b),function(){b.onCompleted()})),j[f]=l,new Sb(j)},this)},tc.zip=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);if(Array.isArray(a[0]))return E.apply(this,a);var d=this,e=a.pop();return a.unshift(d),new Tc(function(b){function c(a){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void b.onError(g)}b.onNext(c)}else i.filter(function(b,c){return c!==a}).every(W)&&b.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&b.onCompleted()}for(var g=a.length,h=p(g,G),i=p(g,F),j=new Array(g),k=0;g>k;k++)!function(d){var e=a[d],g=new Xb;_(e)&&(e=Bc(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(a){b.onError(a)},function(){f(d)})),j[d]=g}(k);return new Sb(j)},d)},zc.zip=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);var d=a.shift();return d.zip.apply(d,a)},zc.zipArray=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 Tc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(W))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(W)?void b.onCompleted():void 0}for(var e=a.length,f=p(e,function(){return[]}),g=p(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Xb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},function(a){b.onError(a)},function(){d(e)}))}(i);return new Sb(h)})},tc.asObservable=function(){var a=this;return new Tc(function(b){return a.subscribe(b)},this)},tc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},tc.dematerialize=function(){var a=this;return new Tc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},tc.distinctUntilChanged=function(a,b){var c=this;return b||(b=Y),new Tc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},tc["do"]=tc.tap=tc.doAction=function(a,b,c){var d=this,e="function"==typeof a||"undefined"==typeof a?sc(a||U,b||U,c||U):a;return new Tc(function(a){return d.subscribe(function(b){try{e.onNext(b)}catch(c){a.onError(c)}a.onNext(b)},function(b){try{e.onError(b)}catch(c){a.onError(c)}a.onError(b)},function(){try{e.onCompleted()}catch(b){a.onError(b)}a.onCompleted()})},this)},tc.doOnNext=tc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},tc.doOnError=tc.tapOnError=function(a,b){return this.tap(U,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},tc.doOnCompleted=tc.tapOnCompleted=function(a,b){return this.tap(U,null,"undefined"!=typeof b?function(){a.call(b)}:a)},tc["finally"]=tc.ensure=function(a){var b=this;return new Tc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Vb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},tc.finallyAction=function(a){return this.ensure(a)},tc.ignoreElements=function(){var a=this;return new Tc(function(b){return a.subscribe(U,function(a){b.onError(a)},function(){b.onCompleted()})},a)},tc.materialize=function(){var a=this;return new Tc(function(b){return a.subscribe(function(a){b.onNext(kc(a))},function(a){b.onNext(lc(a)),b.onCompleted()},function(){b.onNext(mc()),b.onCompleted()})},a)},tc.repeat=function(a){return pc(this,a).concat()},tc.retry=function(a){return pc(this,a).catchError()},tc.retryWhen=function(a){return pc(this).catchErrorWhen(a)},tc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Tc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},tc.skipLast=function(a){var b=this;return new Tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},tc.startWith=function(){var a,b=0;arguments.length&&V(arguments[0])?(a=arguments[0],b=1):a=cc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return qc([Ic(c,a),this]).concat()},tc.takeLast=function(a){var b=this;return new Tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},tc.takeLastBuffer=function(a){var b=this;return new Tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},tc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(bb);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(bb);return new Tc(function(d){function e(){var a=new Wc;i.push(a),d.onNext(Pb(a,g))}var f=new Xb,g=new Zb(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)},tc.selectConcat=tc.concatMap=function(a,b,c){return ab(a)&&ab(b)?this.concatMap(function(c,d){var e=a(c,d);return _(e)&&(e=Bc(e)),(lb(e)||kb(e))&&(e=Fc(e)),e.map(function(a,e){return b(c,a,d,e)})}):ab(a)?H(this,a,c):H(this,function(){return a})},tc.concatMapObserver=tc.selectConcatObserver=function(a,b,c,d){var e=this,f=nb(a,d,2),g=nb(b,d,1),h=nb(c,d,0);return new Tc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}_(d)&&(d=Bc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}_(c)&&(c=Bc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}_(b)&&(b=Bc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},tc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Tc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},J.prototype.push=function(a){var b=-1===I(this.set,a,this.comparer);return b&&this.set.push(a),b},tc.distinct=function(a,b){var c=this;return b||(b=Y),new Tc(function(d){var e=new J(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var Rc=function(a){function b(b,c,d){this.source=b,this.selector=nb(c,d,3),a.call(this)}return Nb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a(d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new K(a,this.selector,this))},b}(Ac);K.prototype.onNext=function(a){if(!this.isStopped){try{var b=this.selector(a,this.index++,this.source)}catch(c){return this.observer.onError(c)}this.observer.onNext(b)}},K.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},K.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},K.prototype.dispose=function(){this.isStopped=!0},K.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},tc.map=tc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Rc?this.internalMap(a,b):new Rc(this,c,b)},tc.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(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})},tc.flatMapObserver=tc.selectManyObserver=function(a,b,c,d){var e=this;return new Tc(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)}_(c)&&(c=Bc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}_(c)&&(c=Bc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}_(a)&&(a=Bc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},tc.selectMany=tc.flatMap=function(a,b,c){return ab(a)&&ab(b)?this.flatMap(function(c,d){var e=a(c,d);return _(e)&&(e=Bc(e)),(lb(e)||kb(e))&&(e=Fc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):ab(a)?L(this,a,c):L(this,function(){return a})},tc.selectSwitch=tc.flatMapLatest=tc.switchMap=function(a,b){return this.select(a,b).switchLatest()},tc.skip=function(a){if(0>a)throw new Error(bb);var b=this;return new Tc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},tc.skipWhile=function(a,b){var c=this,d=nb(a,b,3);return new Tc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},tc.take=function(a,b){if(0>a)throw new RangeError(bb);if(0===a)return Dc(b);var c=this;return new Tc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},tc.takeWhile=function(a,b){var c=this,d=nb(a,b,3);return new Tc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var Sc=function(a){function b(b,c,d){this.source=b,this.predicate=nb(c,d,3),a.call(this)}return Nb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new M(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a(b,c,e)},c)},b}(Ac);M.prototype.onNext=function(a){try{var b=this.predicate(a,this.index++,this.source)}catch(c){return this.observer.onError(c)}b&&this.observer.onNext(a)},M.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},M.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},M.prototype.dispose=function(){this.isStopped=!0},M.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},tc.filter=tc.where=function(a,b){return this instanceof Sc?this.internalFilter(a,b):new Sc(this,a,b)},tc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Tc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})},c)};var Tc=T.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Vb(a):Wb}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e(d)))}catch(f){if(!d.fail(f))throw f}}function d(b,d){function e(a){var d=new Uc(a),e=[d,b];return dc.scheduleRequired()?dc.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Nb(d,a),d}(zc),Uc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Xb}Nb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(uc),Vc=function(a,b){this.subject=a,this.observer=b};Vc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Wc=T.Subject=function(a){function d(a){return b(this),this.isStopped?this.hasError?(a.onError(this.error),Wb):(a.onCompleted(),Wb):(this.observers.push(a),new Vc(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Nb(e,a),Ob(e.prototype,rc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b(this),!this.isStopped){this.isStopped=!0;for(var a=0,d=c(this.observers),e=d.length;e>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){if(b(this),!this.isStopped)for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),e.create=function(a,b){return new Xc(a,b)},e}(zc),Xc=(T.AsyncSubject=function(a){function d(a){return b(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Wb):(this.observers.push(a),new Vc(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Nb(e,a),Ob(e.prototype,rc,{hasObservers:function(){return b(this),this.observers.length>0},onCompleted:function(){var a,d;if(b(this),!this.isStopped){this.isStopped=!0;var e=c(this.observers),d=e.length;if(this.hasValue)for(a=0;d>a;a++){var f=e[a];f.onNext(this.value),f.onCompleted()}else for(a=0;d>a;a++)e[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){b(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),e}(zc),T.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Nb(c,a),Ob(c.prototype,rc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(zc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(O.Rx=T,define(function(){return T})):P&&Q?R?(Q.exports=T).Rx=T:P.Rx=T:O.Rx=T;var Yc=h()}).call(this);
//# sourceMappingURL=rx.map