Repository navigation
Expand file tree
/
Copy pathrx.lite.min.js
More file actions
4 lines (4 loc) · 50.9 KB
/
Copy pathrx.lite.min.js
File metadata and controls
4 lines (4 loc) · 50.9 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(){if(this.isDisposed)throw new Error($)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;zb.nonEnumArgs&&a.length&&Ab(a)&&(a=Cb.call(a));var d=zb.enumPrototypes&&"function"==typeof a,e=zb.enumErrorProps&&(a===sb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(zb.nonEnumShadows&&a!==tb){var g=a.constructor,h=-1,i=xb.length;if(a===(g&&g.prototype))var j=a===ub?ob:a===sb?jb:pb.call(a),k=yb[j];for(;++h<i;)f=xb[h],k&&k[f]||!qb.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=pb.call(a),k=pb.call(b);if(j==fb&&(j=mb),k==fb&&(k=mb),j!=k)return!1;switch(j){case hb:case ib:return+a==+b;case lb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case nb:case ob:return a==String(b)}var l=j==gb;if(!l){if(j!=mb||!zb.nodeClass&&(g(a)||g(b)))return!1;var m=!zb.argsObject&&Ab(a)?Object:a.constructor,n=!zb.argsObject&&Ab(b)?Object:b.constructor;if(!(m==n||qb.call(a,"constructor")&&qb.call(b,"constructor")||Y(m)&&m instanceof m&&Y(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return qb.call(f,e)?(p++,q=qb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return qb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Cb.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(){this._s=s}function m(){this._s=s,this._l=s.length,this._i=0}function n(a){this._a=a}function o(a){this._a=a,this._l=t(a),this._i=0}function p(a){return"number"==typeof a&&K.isFinite(a)}function q(b){var c,d=b[_];if(!d&&"string"==typeof b)return c=new l(b),c[_]();if(!d&&b.length!==a)return c=new n(b),c[_]();if(!d)throw new TypeError("Object is not iterable");return b[_]()}function r(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function t(a){var b=+a.length;return isNaN(b)?0:0!==b&&p(b)?(b=r(b)*Math.floor(Math.abs(b)),0>=b?0:b>oc?oc:b):b}function u(a,b){return R(a)||(a=Tb),new Ic(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function v(a,b){return new Ic(function(c){var d=new Mb,e=new Nb;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)}X(f)&&(f=Bc(f)),d=new Mb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function w(a,b){var c=this;return new Ic(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 void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function x(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return X(f)&&(f=Bc(f)),(cb(f)||bb(f))&&(f=pc(f)),f}).concatAll()}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return X(f)&&(f=Bc(f)),(cb(f)||bb(f))&&(f=pc(f)),f}).mergeAll()}function z(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Kb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function A(a,b,c){var d=new Hb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(A(a.item(e),b,c));else a&&d.add(z(a,b,c));return d}function B(a,b){return new Ic(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function C(a,b,c){return new Ic(function(d){var e=0,f=a,g=Qb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function D(a,b){return new Ic(function(c){return b.scheduleWithRelative(Qb(a),function(){c.onNext(0),c.onCompleted()})})}function E(a,b,c){return a===b?new Ic(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):mc(function(){return C(c.now()+a,b,c)})}function F(a,b,c){return new Ic(function(d){var e,f=!1,g=new Nb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Mb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Hb(e,g)})}function G(a,b,c){return mc(function(){return F(a,b-c.now(),c)})}function H(a,b){return new Ic(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Hb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function I(a,b,c){return new Ic(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(S))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Hb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},K=J[typeof window]&&window||this,L=J[typeof exports]&&exports&&!exports.nodeType&&exports,M=J[typeof module]&&module&&!module.nodeType&&module,N=M&&M.exports===L&&L,O=J[typeof global]&&global;!O||O.global!==O&&O.window!==O||(K=O);var P={internals:{},config:{Promise:K.Promise},helpers:{}},Q=P.helpers.noop=function(){},R=(P.helpers.notDefined=function(a){return"undefined"==typeof a},P.helpers.isScheduler=function(a){return a instanceof P.Scheduler}),S=P.helpers.identity=function(a){return a},T=(P.helpers.pluck=function(a){return function(b){return b[a]}},P.helpers.just=function(a){return function(){return a}},P.helpers.defaultNow=Date.now),U=P.helpers.defaultComparer=function(a,b){return Bb(a,b)},V=P.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},W=(P.helpers.defaultKeySerializer=function(a){return a.toString()},P.helpers.defaultError=function(a){throw a}),X=P.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Y=(P.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},P.helpers.not=function(a){return!a},P.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==pb.call(a)}),a}()),Z="Argument out of range",$="Object has been disposed",_="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";K.Set&&"function"==typeof(new K.Set)["@@iterator"]&&(_="@@iterator");var ab=P.doneEnumerator={done:!0,value:a},bb=P.helpers.isIterable=function(b){return b[_]!==a},cb=P.helpers.isArrayLike=function(b){return b&&b.length!==a};P.helpers.iterator=_;var db,eb=P.helpers.deprecate=function(){},fb="[object Arguments]",gb="[object Array]",hb="[object Boolean]",ib="[object Date]",jb="[object Error]",kb="[object Function]",lb="[object Number]",mb="[object Object]",nb="[object RegExp]",ob="[object String]",pb=Object.prototype.toString,qb=Object.prototype.hasOwnProperty,rb=pb.call(arguments)==fb,sb=Error.prototype,tb=Object.prototype,ub=String.prototype,vb=tb.propertyIsEnumerable;try{db=!(pb.call(document)==mb&&!({toString:0}+""))}catch(wb){db=!0}var xb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yb={};yb[gb]=yb[ib]=yb[lb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},yb[hb]=yb[ob]={constructor:!0,toString:!0,valueOf:!0},yb[jb]=yb[kb]=yb[nb]={constructor:!0,toString:!0},yb[mb]={constructor:!0};var zb={};!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);zb.enumErrorProps=vb.call(sb,"message")||vb.call(sb,"name"),zb.enumPrototypes=vb.call(a,"prototype"),zb.nonEnumArgs=0!=c,zb.nonEnumShadows=!/valueOf/.test(b)}(1);var Ab=function(a){return a&&"object"==typeof a?pb.call(a)==fb:!1};rb||(Ab=function(a){return a&&"object"==typeof a?qb.call(a,"callee"):!1});{var Bb=P.internals.isEqual=function(a,b){return h(a,b,[],[])},Cb=Array.prototype.slice,Db=({}.hasOwnProperty,this.inherits=P.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Eb=P.internals.addProperties=function(a){for(var b=Cb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};P.internals.addRef=function(a,b){return new Ic(function(c){return new Hb(b.getDisposable(),a.subscribe(c))})}}k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Fb=P.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Gb=Fb.prototype;Gb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Gb.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)}}},Gb.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)}}},Gb.peek=function(){return this.items[0].value},Gb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Gb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Gb.enqueue=function(a){var b=this.length++;this.items[b]=new k(Fb.count++,a),this.percolate(b)},Gb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Fb.count=0;var Hb=P.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Ib=Hb.prototype;Ib.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Ib.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},Ib.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a
8000
.length;c>b;b++)a[b].dispose()}},Ib.toArray=function(){return this.disposables.slice(0)};var Jb=P.Disposable=function(a){this.isDisposed=!1,this.action=a||Q};Jb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Kb=Jb.create=function(a){return new Jb(a)},Lb=Jb.empty={dispose:Q},Mb=P.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,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Nb=P.SerialDisposable=Mb,Ob=(P.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?Lb:new a(this)},b}(),P.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||V,this.disposable=new Mb});Ob.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Ob.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Ob.prototype.isCancelled=function(){return this.disposable.isDisposed},Ob.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Pb=P.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(),Lb}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=T,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Qb=Pb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Hb,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),Lb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Hb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Lb});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")})}}(Pb.prototype),function(){Pb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Pb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof K.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=K.setInterval(function(){d=c(d)},b);return Kb(function(){K.clearInterval(e)})}}(Pb.prototype);var Rb,Sb=Pb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Qb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Pb(T,a,b,c)}(),Tb=Pb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Pb.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()+Pb.normalize(c),g=new Ob(this,b,d,f);if(e)e.enqueue(g);else{e=new Fb(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 Pb(T,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ub=(P.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Mb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Q),Vb=function(){var a,b=Q;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!K.setTimeout)throw new Error("No concurrency detected!");a=K.setTimeout,b=K.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Wb=Vb.setTimeout,Xb=Vb.clearTimeout;!function(){function a(){if(!K.postMessage||K.importScripts)return!1;var a=!1,b=K.onmessage;return K. b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(pb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=O&&N&&O.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=O&&N&&O.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Rb=d,Ub=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Rb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;K.addEventListener?K.addEventListener("message",b,!1):K.attachEvent("onmessage",b,!1),Rb=function(a){var b=h++;g[b]=a,K.postMessage(f+b,"*")}}else if(K.MessageChannel){var i=new K.MessageChannel,j={},k=0;i.port1. b=a.data,c=j[b];c(),delete j[b]},Rb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in K&&"onreadystatechange"in K.document.createElement("script")?Rb=function(a){var b=K.document.createElement("script");b. Wb(a,0)},Ub=Xb)}();var Yb=Pb.timeout=function(){function a(a,b){var c=this,d=new Mb,e=Rb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Hb(d,Kb(function(){Ub(e)}))}function b(a,b,c){var d=this,e=Pb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Mb,g=Wb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Hb(f,Kb(function(){Xb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Pb(T,a,b,c)}(),Zb=P.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 R(a)||(a=Sb),new Ic(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),$b=Zb.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 Zb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),_b=Zb.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 Zb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),ac=Zb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Zb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),bc=P.internals.Enumerator=function(a){this._next=a};bc.prototype.next=function(){return this._next()},bc.prototype[_]=function(){return this};var cc=P.internals.Enumerable=function(a){this._iterator=a};cc.prototype[_]=function(){return this._iterator()},cc.prototype.concat=function(){var a=this;return new Ic(function(b){var c;try{c=a[_]()}catch(d){return void b.onError(d)}var e,f=new Nb,g=Sb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next(),console.log("current item"+d)}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;X(h)&&(h=Bc(h));var i=new Mb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Hb(f,g,Kb(function(){e=!0}))})},cc.prototype.catchError=function(){var a=this;return new Ic(function(b){var c;try{c=a[_]()}catch(d){return void b.onError(d)}var e,f,g=new Nb,h=Sb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;X(i)&&(i=Bc(i));var j=new Mb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Hb(g,h,Kb(function(){e=!0}))})};var dc=cc.repeat=function(a,b){return null==b&&(b=-1),new cc(function(){var c=b;return new bc(function(){return 0===c?ab:(c>0&&c--,{done:!1,value:a})})})},ec=cc.of=function(a,b,c){return new cc(function(){var d=-1;return new bc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:ab})})},fc=P.Observer=function(){};fc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},fc.prototype.asObserver=function(){return new jc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var gc=fc.create=function(a,b,c){return a||(a=Q),b||(b=W),c||(c=Q),new jc(a,b,c)};fc.fromNotifier=function(a,b){return new jc(function(c){return a.call(b,$b(c))},function(c){return a.call(b,_b(c))},function(){return a.call(b,ac())})};var hc,ic=P.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Db(b,a),b.prototype. this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(fc),jc=P.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Db(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}(ic),kc=P.Observable=function(){function a(a){this._subscribe=a}return hc=a.prototype,hc.subscribe=hc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:gc(a,b,c))},hc.subscribeOnNext=function(a,b){return this._subscribe(gc(2===arguments.length?function(c){a.call(b,c)}:a))},hc.subscribeOnError=function(a,b){return this._subscribe(gc(null,2===arguments.length?function(c){a.call(b,c)}:a))},hc.subscribeOnCompleted=function(a,b){return this._subscribe(gc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),lc=P.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Nb}return Db(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}(ic);hc.toArray=function(){var a=this;return new Ic(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},kc.create=kc.createWithDisposable=function(a){return new Ic(a)};var mc=kc.defer=function(a){return new Ic(function(b){var c;try{c=a()}catch(d){return sc(d).subscribe(b)}return X(c)&&(c=Bc(c)),c.subscribe(b)})},nc=kc.empty=function(a){return R(a)||(a=Sb),new Ic(function(b){return a.schedule(function(){b.onCompleted()})})},oc=Math.pow(2,53)-1;l.prototype[_]=function(){return new m(this._s)},m.prototype[_]=function(){return this},m.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return ab},n.prototype[_]=function(){return new o(this._a)},o.prototype[_]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return ab};{var pc=kc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Y(b))throw new Error("mapFn when provided must be a function");R(d)||(d=Tb);var e=Object(a),f=q(e);return new Ic(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&Y(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},qc=kc.fromArray=function(a,b){return eb("fromArray","from"),R(b)||(b=Tb),new Ic(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};kc.never=function(){return new Ic(function(){return Lb})}}kc.of=function(){return u(null,arguments)},kc.ofWithScheduler=function(a){return u(a,Cb.call(arguments,1))},kc.range=function(a,b,c){return R(c)||(c=Tb),new Ic(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},kc.repeat=function(a,b,c){return R(c)||(c=Tb),rc(a,c).repeat(null==b?-1:b)};var rc=kc["return"]=kc.just=function(a,b){return R(b)||(b=Sb),new Ic(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};kc.returnValue=function(){return eb("returnValue","return or just"),rc.apply(null,arguments)};var sc=kc["throw"]=kc.throwException=kc.throwError=function(a,b){return R(b)||(b=Sb),new Ic(function(c){return b.schedule(function(){c.onError(a)})})};hc["catch"]=hc.catchError=function(a){return"function"==typeof a?v(this,a):tc([this,a])},hc.catchException=function(a){return eb("catchException","catch or catchError"),this.catchError(a)};var tc=kc.catchError=kc["catch"]=function(){return ec(i(arguments,0)).catchError()};kc.catchException=function(){return eb("catchException","catch or catchError"),tc.apply(null,arguments)},hc.combineLatest=function(){var a=Cb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),uc.apply(this,a)};var uc=kc.combineLatest=function(){var a=Cb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Ic(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(S))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(S)&&c.onCompleted()}function e(a){k[a]=!0,k.every(S)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Mb;X(f)&&(f=Bc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Hb(m)})};hc.concat=function(){var a=Cb.call(arguments,0);return a.unshift(this),vc.apply(this,a)};var vc=kc.concat=function(){return ec(i(arguments,0)).concat()};hc.concatAll=function(){return this.merge(1)},hc.concatObservable=function(){return eb("concatObservable","concatAll"),this.merge(1)},hc.merge=function(a){if("number"!=typeof a)return wc(this,a);var b=this;return new Ic(function(c){function d(a){var b=new Mb;f.add(b),X(a)&&(a=Bc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Hb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var wc=kc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Cb.call(arguments,1)):(a=Sb,b=Cb.call(arguments,0)):(a=Sb,b=Cb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),u(a,b).mergeAll()};hc.mergeAll=function(){var a=this;return new Ic(function(b){var c=new Hb,d=!1,e=new Mb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Mb;c.add(e),X(a)&&(a=Bc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},hc.mergeObservable=function(){return eb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},hc.skipUntil=function(a){var b=this;return new Ic(function(c){var d=!1,e=new Hb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));X(a)&&(a=Bc(a));var f=new Mb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},hc["switch"]=hc.switchLatest=function(){var a=this;return new Ic(function(b){var c=!1,d=new Nb,e=!1,f=0,g=a.subscribe(function(a){var g=new Mb,h=++f;c=!0,d.setDisposable(g),X(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())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Hb(g,d)})},hc.takeUntil=function(a){var b=this;return new Ic(function(c){return X(a)&&(a=Bc(a)),new Hb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),Q))})},hc.zip=function(){if(Array.isArray(arguments[0]))return w.apply(this,arguments);var a=this,b=Cb.call(arguments),c=b.pop();return b.unshift(a),new Ic(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(S)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Mb;X(c)&&(c=Bc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Hb(k)})},kc.zip=function(){var a=Cb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},kc.zipArray=function(){var a=i(arguments,0);return new Ic(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(S))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(S)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Mb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Hb(h);return k.add(Kb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},hc.asObservable=function(){return new Ic(this.subscribe.bind(this))},hc.dematerialize=function(){var a=this;return new Ic(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},hc.distinctUntilChanged=function(a,b){var c=this;return a||(a=S),b||(b=U),new Ic(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},hc["do"]=hc.tap=function(a,b,c){var d,e=this;
return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Ic(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},hc.doAction=function(){return eb("doAction","do or tap"),this.tap.apply(this,arguments)},hc.doOnNext=hc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},hc.doOnError=hc.tapOnError=function(a,b){return this.tap(Q,2===arguments.length?function(c){a.call(b,c)}:a)},hc.doOnCompleted=hc.tapOnCompleted=function(a,b){return this.tap(Q,null,2===arguments.length?function(){a.call(b)}:a)},hc["finally"]=hc.ensure=function(a){var b=this;return new Ic(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Kb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},hc.finallyAction=function(a){return eb("finallyAction","finally or ensure"),this.ensure(a)},hc.ignoreElements=function(){var a=this;return new Ic(function(b){return a.subscribe(Q,b.onError.bind(b),b.onCompleted.bind(b))})},hc.materialize=function(){var a=this;return new Ic(function(b){return a.subscribe(function(a){b.onNext($b(a))},function(a){b.onNext(_b(a)),b.onCompleted()},function(){b.onNext(ac()),b.onCompleted()})})},hc.repeat=function(a){return dc(this,a).concat()},hc.retry=function(a){return dc(this,a).catchError()},hc.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 Ic(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)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},hc.skipLast=function(a){var b=this;return new Ic(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},hc.startWith=function(){var a,b,c=0;return arguments.length&&R(arguments[0])?(b=arguments[0],c=1):b=Sb,a=Cb.call(arguments,c),ec([qc(a,b),this]).concat()},hc.takeLast=function(a){var b=this;return new Ic(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},hc.selectConcat=hc.concatMap=function(a,b,c){return Y(a)&&Y(b)?this.concatMap(function(c,d){var e=a(c,d);return X(e)&&(e=Bc(e)),(cb(e)||bb(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Y(a)?x(this,a,c):x(this,function(){return a})},hc.select=hc.map=function(a,b){var c=Y(a)?a:function(){return a},d=this;return new Ic(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},hc.pluck=function(a){return this.map(function(b){return b[a]})},hc.selectMany=hc.flatMap=function(a,b,c){return Y(a)&&Y(b)?this.flatMap(function(c,d){var e=a(c,d);return X(e)&&(e=Bc(e)),(cb(e)||bb(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Y(a)?y(this,a,c):y(this,function(){return a})},hc.selectSwitch=hc.flatMapLatest=hc.switchMap=function(a,b){return this.select(a,b).switchLatest()},hc.skip=function(a){if(0>a)throw new Error(Z);var b=this;return new Ic(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},hc.skipWhile=function(a,b){var c=this;return new Ic(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},hc.take=function(a,b){if(0>a)throw new RangeError(Z);if(0===a)return nc(b);var c=this;return new Ic(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},hc.takeWhile=function(a,b){var c=this;return new Ic(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},hc.where=hc.filter=function(a,b){var c=this;return new Ic(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},kc.fromCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Ic(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},kc.fromNodeCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Ic(function(e){function f(a){if(a)return void e.onError(a);var b=Cb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},P.config.useNativeEvents=!1;var xc=K.angular&&angular.element?angular.element:K.jQuery?K.jQuery:K.Zepto?K.Zepto:null,yc=!!K.Ember&&"function"==typeof K.Ember.addListener,zc=!!K.Backbone&&!!K.Backbone.Marionette;kc.fromEvent=function(a,b,c){if(a.addListener)return Ac(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!P.config.useNativeEvents){if(zc)return Ac(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(yc)return Ac(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(xc){var d=xc(a);return Ac(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Ic(function(d){return A(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Ac=kc.fromEventPattern=function(a,b,c){return new Ic(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Kb(function(){b&&b(e,f)})}).publish().refCount()},Bc=kc.fromPromise=function(a){return mc(function(){var b=new P.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};hc.toPromise=function(a){if(a||(a=P.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)})})},kc.startAsync=function(a){var b;try{b=a()}catch(c){return sc(c)}return Bc(b)},hc.multicast=function(a,b){var c=this;return"function"==typeof a?new Ic(function(d){var e=c.multicast(a());return new Hb(b(e).subscribe(d),e.connect())}):new Cc(c,a)},hc.publish=function(a){return a&&Y(a)?this.multicast(function(){return new Lc},a):this.multicast(new Lc)},hc.share=function(){return this.publish().refCount()},hc.publishLast=function(a){return a&&Y(a)?this.multicast(function(){return new Mc},a):this.multicast(new Mc)},hc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Oc(b)},a):this.multicast(new Oc(a))},hc.shareValue=function(a){return this.publishValue(a).refCount()},hc.replay=function(a,b,c,d){return a&&Y(a)?this.multicast(function(){return new Pc(b,c,d)},a):this.multicast(new Pc(b,c,d))},hc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Cc=P.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Hb(f.subscribe(c),Kb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Db(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Ic(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(kc),Dc=kc.interval=function(a,b){return E(a,a,R(b)?b:Yb)};kc.timer=function(b,c,d){var e;return R(d)||(d=Yb),c!==a&&"number"==typeof c?e=c:R(c)&&(d=c),b instanceof Date&&e===a?B(b.getTime(),d):b instanceof Date&&e!==a?(e=c,C(b.getTime(),e,d)):e===a?D(b,d):E(b,e,d)}}hc.delay=function(a,b){return R(b)||(b=Yb),a instanceof Date?G(this,a.getTime(),b):F(this,a,b)},hc.debounce=hc.throttleWithTimeout=function(a,b){R(b)||(b=Yb);var c=this;return new Ic(function(d){var e,f=new Nb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Mb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Hb(i,f)})},hc.throttle=function(a,b){return eb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},hc.timestamp=function(a){return R(a)||(a=Yb),this.map(function(b){return{value:b,timestamp:a.now()}})},hc.sample=hc.throttleLatest=function(a,b){return R(b)||(b=Yb),"number"==typeof a?H(this,Dc(a,b)):H(this,a)},hc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=sc(new Error(b||"Timeout"))),R(c)||(c=Yb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Ic(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(X(b)&&(b=Bc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Mb,j=new Nb,k=!1,l=new Nb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Hb(j,l)})},hc.throttleFirst=function(a,b){R(b)||(b=Yb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Ic(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Ec=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Lb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Lb)});return new Hb(c,d,e)}function c(c,d){this.source=c,this.controller=new L
5705
c,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Db(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(kc);hc.pausable=function(a){return new Ec(this,a)};var Fc=function(b){function c(b){var c,d=[],e=I(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Lc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Db(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(kc);hc.pausableBuffered=function(a){return new Fc(this,a)},hc.controlled=function(a){return null==a&&(a=!0),new Gc(this,a)};var Gc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Hc(d),this.source=c.multicast(this.subject).refCount()}return Db(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(kc),Hc=P.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Lc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Lb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Lb}return Db(d,a),Eb(d.prototype,fc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Lb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Lb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Lb:(this.requestedCount=a,this.requestedDisposable=Kb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Lb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(kc);hc.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 Ic(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)})})};var Ic=P.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Kb(a):Lb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Jc(a);return Tb.scheduleRequired()?Tb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Db(c,a),c}(kc),Jc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Mb}Db(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}(ic),Kc=function(a,b){this.subject=a,this.observer=b};Kc.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 Lc=P.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Lb):(a.onCompleted(),Lb):(this.observers.push(a),new Kc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Nc(a,b)},d}(kc),Mc=P.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Kc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Lb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(kc),Nc=P.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Db(b,a),Eb(b.prototype,fc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(kc),Oc=P.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Kc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Lb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(kc),Pc=P.ReplaySubject=function(a){function c(a,b){return Kb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new lc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Tb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Db(e,a),Eb(e.prototype,fc,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(kc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K.Rx=P,define(function(){return P})):L&&M?N?(M.exports=P).Rx=P:L.Rx=P:K.Rx=P}).call(this);
//# sourceMappingURL=rx.lite.map