UNPKG

webappengine

Version:

A web application platform that can host multiple web apps running with Node.js.

3 lines 71.2 kB
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/ (function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(){try{return $.apply(this,arguments)}catch(a){return qa.e=a,qa}}function d(a){if(!pa(a))throw new TypeError("fn must be a function");return $=a,c}function e(a){throw a}function f(a,b){if(ra&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(va)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+va+"\n");a.stack=g(e)}}function g(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];h(f)||i(f)||!f||c.push(f)}return c.join("\n")}function h(a){var b=k(a);if(!b)return!1;var c=b[0],d=b[1];return c===ta&&d>=ua&&Vc>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if(ra)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=k(c);if(!d)return;return ta=d[0],d[1]}}function k(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function l(a){var b=[];if(!bb(a))return b;ab.nonEnumArgs&&a.length&&cb(a)&&(a=eb.call(a));var c=ab.enumPrototypes&&"function"==typeof a,d=ab.enumErrorProps&&(a===Wa||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(ab.nonEnumShadows&&a!==Xa){var f=a.constructor,g=-1,h=Ia;if(a===(f&&f.prototype))var i=a===Ya?Sa:a===Wa?Na:Ta.call(a),j=_a[i];for(;++g<h;)e=Ha[g],j&&j[e]||!Ua.call(a,e)||b.push(e)}return b}function m(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function n(a,b){return m(a,b,l)}function o(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function p(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Ta.call(a),h=Ta.call(b);if(g==Ja&&(g=Qa),h==Ja&&(h=Qa),g!=h)return!1;switch(g){case La:case Ma:return+a==+b;case Pa:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ra:case Sa:return a==String(b)}var i=g==Ka;if(!i){if(g!=Qa||!ab.nodeClass&&(o(a)||o(b)))return!1;var j=!ab.argsObject&&cb(a)?Object:a.constructor,k=!ab.argsObject&&cb(b)?Object:b.constructor;if(!(j==k||Ua.call(a,"constructor")&&Ua.call(b,"constructor")||pa(j)&&j instanceof j&&pa(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var m=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,m=b.length,q=m==l)for(;m--;){var r=b[m];if(!(q=p(a[m],r,c,d)))break}}else n(b,function(b,e,f){return Ua.call(f,e)?(m++,q=Ua.call(a,e)&&p(a[e],b,c,d)):void 0}),q&&n(a,function(a,b,c){return Ua.call(c,b)?q=--m>-1:void 0});return c.pop(),d.pop(),q}function q(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function r(a){this._s=a}function s(a){this._s=a,this._l=a.length,this._i=0}function t(a){this._a=a}function u(a){this._a=a,this._l=y(a),this._i=0}function v(a){return"number"==typeof a&&ga.isFinite(a)}function w(b){var c,d=b[Da];if(!d&&"string"==typeof b)return c=new r(b),c[Da]();if(!d&&b.length!==a)return c=new t(b),c[Da]();if(!d)throw new TypeError("Object is not iterable");return b[Da]()}function x(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function y(a){var b=+a.length;return isNaN(b)?0:0!==b&&v(b)?(b=x(b)*Math.floor(Math.abs(b)),0>=b?0:b>ac?ac:b):b}function z(a,b){this.observer=a,this.parent=b}function A(a,b){return tb(a)||(a=xb),new bc(b,a)}function B(a,b){this.observer=a,this.parent=b}function C(a,b){this.observer=a,this.parent=b}function D(a,b){return new Nc(function(c){var d=new ob,e=new pb;return e.setDisposable(d),d.setDisposable(a.subscribe(new lc(c,e,b))),e},a)}function E(){return!1}function F(a,b){var c=this;return new Nc(function(e){var f=0,g=a.length;return c.subscribe(function(c){if(g>f){var h=a[f++],i=d(b)(c,h);if(i===qa)return e.onError(i.e);e.onNext(i)}else e.onCompleted()},function(a){e.onError(a)},function(){e.onCompleted()})},c)}function E(){return!1}function G(){return[]}function E(){return!1}function H(){return[]}function I(a){return function(b){return a.subscribe(b)}}function J(a,b,c){this.o=a,this.keyFn=b,this.comparer=c,this.hasCurrentKey=!1,this.currentKey=null,this.isStopped=!1}function K(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function L(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}function M(a,b,c,d){var e=new Rc;return d.push(N(e,b,c)),a.apply(b,d),e.asObservable()}function N(a,b,c){return function(){for(var e=arguments.length,f=new Array(e),g=0;e>g;g++)f[g]=arguments[g];if(pa(c)){if(f=d(c).apply(b,f),f===qa)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function O(a,b,c,d){var e=new Rc;return d.push(P(e,b,c)),a.apply(b,d),e.asObservable()}function P(a,b,c){return function(){var e=arguments[0];if(e)return a.onError(e);for(var f=arguments.length,g=[],h=1;f>h;h++)g[h-1]=arguments[h];if(pa(c)){var g=d(c).apply(b,g);if(g===qa)return a.onError(g.e);a.onNext(g)}else g.length<=1?a.onNext(g[0]):a.onNext(g);a.onCompleted()}}function Q(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function R(a,b,c){var d=new hb,e=Object.prototype.toString;if("[object NodeList]"===e.call(a)||"[object HTMLCollection]"===e.call(a))for(var f=0,g=a.length;g>f;f++)d.add(R(a.item(f),b,c));else a&&d.add(new Q(a,b,c));return d}function S(a,b){return new Nc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function T(a,b,c){return new Nc(function(d){var e=a,f=sb(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function U(a,b){return new Nc(function(c){return b.scheduleWithRelative(sb(a),function(){c.onNext(0),c.onCompleted()})})}function V(a,b,c){return a===b?new Nc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Xb(function(){return T(c.now()+a,b,c)})}function W(a,b,c){return new Nc(function(d){var e,f=!1,g=new pb,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 ob,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)},a)}function X(a,b,c){return Xb(function(){return W(a,b-c.now(),c)})}function Y(a,b){return new Nc(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new ob;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new hb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function Z(a,b,c){return new Nc(function(e){function f(a,b){if(k[b]=a,h[b]=!0,i||(i=h.every(ja))){if(g)return e.onError(g);var f=d(c).apply(null,k);if(f===qa)return e.onError(f.e);e.onNext(f)}j&&k[1]&&e.onCompleted()}var g,h=[!1,!1],i=!1,j=!1,k=new Array(2);return new hb(a.subscribe(function(a){f(a,0)},function(a){k[1]?e.onError(a):g=a},function(){j=!0,k[1]&&e.onCompleted()}),b.subscribe(function(a){f(a,1)},function(a){e.onError(a)},function(){j=!0,f(!0,1)}))},a)}var $,_={"function":!0,object:!0},aa=_[typeof exports]&&exports&&!exports.nodeType&&exports,ba=_[typeof self]&&self.Object&&self,ca=_[typeof window]&&window&&window.Object&&window,da=_[typeof module]&&module&&!module.nodeType&&module,ea=da&&da.exports===aa&&aa,fa=aa&&da&&"object"==typeof global&&global&&global.Object&&global,ga=ga=fa||ca!==(this&&this.window)&&ca||ba||this,ha={internals:{},config:{Promise:ga.Promise},helpers:{}},ia=ha.helpers.noop=function(){},ja=ha.helpers.identity=function(a){return a},ka=ha.helpers.defaultNow=Date.now,la=ha.helpers.defaultComparer=function(a,b){return db(a,b)},ma=ha.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},na=(ha.helpers.defaultKeySerializer=function(a){return a.toString()},ha.helpers.defaultError=function(a){throw a}),oa=ha.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},pa=ha.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ta.call(a)}),a}(),qa={e:{}};ha.config.longStackSupport=!1;var ra=!1,sa=d(function(){throw new Error})();ra=!!sa.e&&!!sa.e.stack;var ta,ua=j(),va="From previous event:",wa=ha.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};wa.prototype=Error.prototype;var xa=ha.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};xa.prototype=Error.prototype;var ya=ha.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};ya.prototype=Error.prototype;var za=ha.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};za.prototype=Error.prototype;var Aa=ha.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};Aa.prototype=Error.prototype;var Ba=ha.helpers.notImplemented=function(){throw new Aa},Ca=ha.helpers.notSupported=function(){throw new za},Da="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";ga.Set&&"function"==typeof(new ga.Set)["@@iterator"]&&(Da="@@iterator");var Ea=ha.doneEnumerator={done:!0,value:a};ha.helpers.isIterable=function(b){return b[Da]!==a},ha.helpers.isArrayLike=function(b){return b&&b.length!==a};ha.helpers.iterator=Da;var Fa,Ga=ha.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)}},Ha=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ia=Ha.length,Ja="[object Arguments]",Ka="[object Array]",La="[object Boolean]",Ma="[object Date]",Na="[object Error]",Oa="[object Function]",Pa="[object Number]",Qa="[object Object]",Ra="[object RegExp]",Sa="[object String]",Ta=Object.prototype.toString,Ua=Object.prototype.hasOwnProperty,Va=Ta.call(arguments)==Ja,Wa=Error.prototype,Xa=Object.prototype,Ya=String.prototype,Za=Xa.propertyIsEnumerable;try{Fa=!(Ta.call(document)==Qa&&!({toString:0}+""))}catch($a){Fa=!0}var _a={};_a[Ka]=_a[Ma]=_a[Pa]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},_a[La]=_a[Sa]={constructor:!0,toString:!0,valueOf:!0},_a[Na]=_a[Oa]=_a[Ra]={constructor:!0,toString:!0},_a[Qa]={constructor:!0};var ab={};!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);ab.enumErrorProps=Za.call(Wa,"message")||Za.call(Wa,"name"),ab.enumPrototypes=Za.call(a,"prototype"),ab.nonEnumArgs=0!=c,ab.nonEnumShadows=!/valueOf/.test(b)}(1);var bb=ha.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},cb=function(a){return a&&"object"==typeof a?Ta.call(a)==Ja:!1};Va||(cb=function(a){return a&&"object"==typeof a?Ua.call(a,"callee"):!1});var db=ha.internals.isEqual=function(a,b){return p(a,b,[],[])},eb=({}.hasOwnProperty,Array.prototype.slice),fb=this.inherits=ha.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},gb=ha.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]}},hb=(ha.internals.addRef=function(a,b){return new Nc(function(c){return new hb(b.getDisposable(),a.subscribe(c))})},ha.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!mb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.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;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var jb=ha.Disposable=function(a){this.isDisposed=!1,this.action=a||ia};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:ia},mb=jb.isDisposable=function(a){return a&&pa(a.dispose)},nb=jb.checkDisposed=function(a){if(a.isDisposed)throw new xa},ob=ha.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};ob.prototype.getDisposable=function(){return this.current},ob.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},ob.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var pb=ha.SerialDisposable=function(){this.isDisposed=!1,this.current=null};pb.prototype.getDisposable=function(){return this.current},pb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},pb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var qb=(ha.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}(),ha.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ma,this.disposable=new ob});qb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},qb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},qb.prototype.isCancelled=function(){return this.disposable.isDisposed},qb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var rb=ha.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}a.isScheduler=function(b){return b instanceof a};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=ka,a.normalize=function(a){return 0>a&&(a=0),a},a}(),sb=rb.normalize,tb=rb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),lb}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new hb;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),lb}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new hb;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}(rb.prototype),function(a){rb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},rb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof ga.setInterval)throw new za;b=sb(b);var d=a,e=ga.setInterval(function(){d=c(d)},b);return kb(function(){ga.clearInterval(e)})}}(rb.prototype);var ub,vb,wb=rb.immediate=function(){function a(a,b){return b(this,a)}return new rb(ka,a,Ca,Ca)}(),xb=rb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,f){var g=new qb(this,b,f,this.now());if(c)c.push(g);else{c=[g];var h=d(a)();if(c=null,h===qa)return e(h.e)}return g.disposable}var c,f=new rb(ka,b,Ca,Ca);return f.scheduleRequired=function(){return!c},f}(),yb=(ha.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 ob;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),function(){var a,b=ia;if(ga.setTimeout)a=ga.setTimeout,b=ga.clearTimeout;else{if(!ga.WScript)throw new za;a=function(a,b){ga.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}()),zb=yb.setTimeout,Ab=yb.clearTimeout;!function(){function a(b){if(h)zb(function(){a(b)},0);else{var c=g[b];if(c){h=!0;var f=d(c)();if(vb(b),h=!1,f===qa)return e(f.e)}}}function b(){if(!ga.postMessage||ga.importScripts)return!1;var a=!1,b=ga.onmessage;return ga.onmessage=function(){a=!0},ga.postMessage("","*"),ga.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,k.length)===k&&a(b.data.substring(k.length))}var f=1,g={},h=!1;vb=function(a){delete g[a]};var i=RegExp("^"+String(Ta).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),j="function"==typeof(j=fa&&ea&&fa.setImmediate)&&!i.test(j)&&j;if(pa(j))ub=function(b){var c=f++;return g[c]=b,j(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))ub=function(b){var c=f++;return g[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var k="ms.rx.schedule"+Math.random();ga.addEventListener?ga.addEventListener("message",c,!1):ga.attachEvent?ga.attachEvent("onmessage",c):ga.onmessage=c,ub=function(a){var b=f++;return g[b]=a,ga.postMessage(k+currentId,"*"),b}}else if(ga.MessageChannel){var l=new ga.MessageChannel;l.port1.onmessage=function(b){a(b.data)},ub=function(a){var b=f++;return g[b]=a,l.port2.postMessage(b),b}}else ub="document"in ga&&"onreadystatechange"in ga.document.createElement("script")?function(b){var c=ga.document.createElement("script"),d=f++;return g[d]=b,c.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},ga.document.documentElement.appendChild(c),d}:function(b){var c=f++;return g[c]=b,zb(function(){a(c)},0),c}}();var Bb,Cb=rb.timeout=rb["default"]=function(){function a(a,b){var c=this,d=new ob,e=ub(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new hb(d,kb(function(){vb(e)}))}function b(a,b,c){var d=this,e=rb.normalize(b),f=new ob;if(0===e)return d.scheduleWithState(a,c);var g=zb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new hb(f,kb(function(){Ab(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new rb(ka,a,b,c)}(),Db=ha.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}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 tb(a)||(a=wb),new Nc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Eb=Db.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){return new Db("N",d,null,a,b,c)}}(),Fb=Db.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){return new Db("E",null,d,a,b,c)}}(),Gb=Db.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new Db("C",null,null,a,b,c)}}(),Hb=ha.Observer=function(){},Ib=Hb.create=function(a,b,c){return a||(a=ia),b||(b=na),c||(c=ia),new Kb(a,b,c)},Jb=ha.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return fb(b,a),b.prototype.next=Ba,b.prototype.error=Ba,b.prototype.completed=Ba,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}(Hb),Kb=ha.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return fb(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}(Jb),Lb=ha.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){f(b,a),d.call(c,b)},b.call(a,c)}}function b(b){if(ha.config.longStackSupport&&ra){var c=d(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return Bb=b.prototype,b.isObservable=function(a){return a&&pa(a.subscribe)},Bb.subscribe=Bb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Ib(a,b,c))},Bb.subscribeOnNext=function(a,b){return this._subscribe(Ib("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Bb.subscribeOnError=function(a,b){return this._subscribe(Ib(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Bb.subscribeOnCompleted=function(a,b){return this._subscribe(Ib(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Mb=ha.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 pb}return fb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var f=d(c)();return f===qa?(a.queue=[],a.hasFaulted=!0,e(f.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Jb),Nb=ha.ObservableBase=function(a){function b(a){return a&&pa(a.dispose)?a:pa(a)?kb(a):lb}function c(a,c){var f=c[0],g=c[1],h=d(g.subscribeCore).call(g,f);return h!==qa||f.fail(qa.e)?void f.setDisposable(b(h)):e(qa.e)}function f(a){var b=new Oc(a),d=[b,this];return xb.scheduleRequired()?xb.scheduleWithState(d,c):c(null,d),b}function g(){a.call(this,f)}return fb(g,a),g.prototype.subscribeCore=Ba,g}(Lb),Ob=function(a){function b(b,c,d,e){this.resultSelector=ha.helpers.isFunction(d)?d:null,this.selector=ha.internals.bindCallback(ha.helpers.isFunction(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.isStopped=!1,this.o=a}return fb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype.onNext=function(a){if(!this.isStopped){var b=this.i++,c=d(this.selector)(a,b,this.source);if(c===qa)return this.o.onError(c.e);ha.helpers.isPromise(c)&&(c=ha.Observable.fromPromise(c)),(ha.helpers.isArrayLike(c)||ha.helpers.isIterable(c))&&(c=ha.Observable.from(c)),this.o.onNext(this._wrapResult(c,a,b))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},b}(Nb),Pb=ha.internals.Enumerable=function(){},Qb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return fb(b,a),b.prototype.subscribeCore=function(a){var b,e=new pb,f=wb.scheduleRecursiveWithState(this.sources[Da](),function(f,g){if(!b){var h=d(f.next).call(f);if(h===qa)return a.onError(h.e);if(h.done)return a.onCompleted();var i=h.value;oa(i)&&(i=Gc(i));var j=new ob;e.setDisposable(j),j.setDisposable(i.subscribe(new c(a,g,f)))}});return new hb(e,f,kb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Nb);Pb.prototype.concat=function(){return new Qb(this)};var Rb=function(a){function b(b){this.sources=b,a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[Da](),e=new pb,f=wb.scheduleRecursiveWithState(null,function(f,g){if(!b){var h=d(c.next).call(c);if(h===qa)return a.onError(h.e);if(h.done)return null!==f?a.onError(f):a.onCompleted();var i=h.value;oa(i)&&(i=Gc(i));var j=new ob;e.setDisposable(j),j.setDisposable(i.subscribe(function(b){a.onNext(b)},g,function(){a.onCompleted()}))}});return new hb(e,f,kb(function(){b=!0}))},b}(Nb);Pb.prototype.catchError=function(){return new Rb(this)},Pb.prototype.catchErrorWhen=function(a){var b=this;return new Nc(function(c){var e,f,g=new Qc,h=new Qc,i=a(g),j=i.subscribe(h),k=b[Da](),l=new pb,m=wb.scheduleRecursive(function(a){if(!e){var b=d(k.next).call(k);if(b===qa)return c.onError(b.e);if(b.done)return void(f?c.onError(f):c.onCompleted());var i=b.value;oa(i)&&(i=Gc(i));var j=new ob,m=new ob;l.setDisposable(new hb(m,j)),j.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(h.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),g.onNext(b)},function(){c.onCompleted()}))}});return new hb(j,l,m,kb(function(){e=!0}))})};var Sb=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return fb(b,a),b.prototype[Da]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?Ea:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Pb),Tb=Pb.repeat=function(a,b){return new Sb(a,b)},Ub=function(a){function b(a,b,c){this.s=a,this.fn=b?Ga(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return fb(b,a),b.prototype[Da]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:Ea},b}(Pb),Vb=Pb.of=function(a,b,c){return new Ub(a,b,c)},Wb=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return fb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Nb);Bb.toArray=function(){return new Wb(this)},Lb.create=function(a,b){return new Nc(a,b)};var Xb=Lb.defer=function(a){return new Nc(function(b){var c;try{c=a()}catch(d){return kc(d).subscribe(b)}return oa(c)&&(c=Gc(c)),c.subscribe(b)})},Yb=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(Nb),Zb=Lb.empty=function(a){return tb(a)||(a=wb),new Yb(a)},$b=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new _b(a,this);return b.run()},b}(Nb),_b=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var g=d(c.next).call(c);if(g===qa)return e.onError(g.e);if(g.done)return e.onCompleted();var h=g.value;return pa(f)&&(h=d(f)(h,a),h===qa)?e.onError(h.e):(e.onNext(h),void b(a+1))}var b=Object(this.parent.iterable),c=w(b),e=this.o,f=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),ac=Math.pow(2,53)-1;r.prototype[Da]=function(){return new s(this._s)},s.prototype[Da]=function(){return this},s.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:Ea},t.prototype[Da]=function(){return new u(this._a)},u.prototype[Da]=function(){return this},u.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:Ea};var bc=(Lb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!pa(b))throw new Error("mapFn when provided must be a function");if(b)var e=Ga(b,c,2);return tb(d)||(d=xb),new $b(a,e,d)},function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new z(a,this);return b.run()},b}(Nb));z.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var cc=Lb.fromArray=function(a,b){return tb(b)||(b=xb),new bc(a,b)},dc=function(a){function b(){a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){ return lb},b}(Nb);Lb.never=function(){return new dc};Lb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new bc(b,xb)},Lb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new bc(c,a)};var ec=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Nb);B.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Lb.pairs=function(a,b){return b||(b=xb),new ec(a,b)};var fc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new gc(a,this);return b.run()},b}(Nb),gc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Lb.range=function(a,b,c){return tb(c)||(c=xb),new fc(a,b,c)};var hc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new C(a,this);return b.run()},b}(Nb);C.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Lb.repeat=function(a,b,c){return tb(c)||(c=xb),new hc(a,b,c)};var ic=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(Nb),jc=(Lb["return"]=Lb.just=function(a,b){return tb(b)||(b=wb),new ic(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Nb)),kc=Lb["throw"]=function(a,b){return tb(b)||(b=wb),new jc(a,b)},lc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return fb(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=d(this._fn)(a);if(b===qa)return this._o.onError(b.e);oa(b)&&(b=Gc(b));var c=new ob;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Jb);Bb["catch"]=function(a){return pa(a)?D(this,a):mc([this,a])};var mc=Lb["catch"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return Vb(a).catchError()};Bb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),nc.apply(this,b)};var nc=Lb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Nc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(ja))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(ja)&&a.onCompleted()}function e(b){j[b]=!0,j.every(ja)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=q(f,g),i=!1,j=q(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new ob;oa(f)&&(f=Gc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new hb(l)},this)};Bb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),pc.apply(null,a)};var oc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new pb,c=this.sources,d=c.length,e=this.o,f=wb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];oa(h)&&(h=Gc(h));var i=new ob;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new hb(b,f,kb(function(){a=!0}))},b}(Nb),pc=Lb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new oc(a)};Bb.concatAll=function(){return this.merge(1)};var qc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new hb;return b.add(this.source.subscribe(new rc(a,this.maxConcurrent,b))),b},b}(Nb),rc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new ob;this.g.add(c),oa(a)&&(a=Gc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Bb.merge=function(a){return"number"!=typeof a?sc(this,a):new qc(this,a)};var sc=Lb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(tb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=wb,b=0;d>b;b++)c.push(arguments[b]);else for(a=wb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),A(a,c).mergeAll()},tc=ha.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};tc.prototype=Error.prototype,Lb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=A(null,a);return new Nc(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new tc(g))}var c=new hb,e=new ob,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new ob;c.add(e),oa(d)&&(d=Gc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var uc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new hb,d=new ob;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new ob;this.g.add(b),oa(a)&&(a=Gc(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Nb);Bb.mergeAll=function(){return new uc(this)},Bb.skipUntil=function(a){var b=this;return new Nc(function(c){var d=!1,e=new hb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));oa(a)&&(a=Gc(a));var f=new ob;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var vc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return fb(b,a),b.prototype.subscribeCore=function(a){var b=new pb,d=this.source.subscribe(new c(a,b));return new hb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new ob,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),oa(a)&&(a=Gc(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Nb);Bb["switch"]=Bb.switchLatest=function(){return new vc(this)};var wc=function(a){function b(b,c){this.source=b,this.other=oa(c)?Gc(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return fb(b,a),b.prototype.subscribeCore=function(a){return new hb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Nb);Bb.takeUntil=function(a){return new wc(this,a)},Bb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=b.pop(),f=this;return Array.isArray(b[0])&&(b=b[0]),new Nc(function(a){for(var c=b.length,g=q(c,E),h=!1,i=new Array(c),j=new Array(c+1),k=0;c>k;k++)!function(c){var d=b[c],e=new ob;oa(d)&&(d=Gc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(ja)},function(b){a.onError(b)},ia)),j[c]=e}(k);var l=new ob;return l.setDisposable(f.subscribe(function(b){var c=[b].concat(i);if(h){var f=d(e).apply(null,c);return f===qa?a.onError(f.e):void a.onNext(f)}},function(b){a.onError(b)},function(){a.onCompleted()})),j[c]=l,new hb(j)},this)},Bb.zip=function(){if(Array.isArray(arguments[0]))return F.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=this,f=b.pop();return b.unshift(e),new Nc(function(a){for(var c=b.length,g=q(c,G),h=q(c,E),i=new Array(c),j=0;c>j;j++)!function(c){var j=b[c],k=new ob;oa(j)&&(j=Gc(j)),k.setDisposable(j.subscribe(function(b){if(g[c].push(b),g.every(function(a){return a.length>0})){var i=g.map(function(a){return a.shift()}),j=d(f).apply(e,i);if(j===qa)return a.onError(j.e);a.onNext(j)}else h.filter(function(a,b){return b!==c}).every(ja)&&a.onCompleted()},function(b){a.onError(b)},function(){h[c]=!0,h.every(ja)&&a.onCompleted()})),i[c]=k}(j);return new hb(i)},e)},Lb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Lb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Nc(function(b){for(var c=a.length,d=q(c,H),e=q(c,E),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new ob,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(ja))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(ja)&&b.onCompleted()}))}(g);return new hb(f)})},Bb.asObservable=function(){return new Nc(I(this),this)},Bb.dematerialize=function(){var a=this;return new Nc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var xc=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return fb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new J(a,this.keyFn,this.comparer))},b}(Nb);J.prototype.onNext=function(a){if(!this.isStopped){var b=a;return pa(this.keyFn)&&(b=d(this.keyFn)(a),b===qa)?this.o.onError(b.e):this.hasCurrentKey&&(comparerEquals=d(this.comparer)(this.currentKey,b),comparerEquals===qa)?this.o.onError(comparerEquals.e):void(this.hasCurrentKey&&comparerEquals||(this.hasCurrentKey=!0,this.currentKey=b,this.o.onNext(a)))}},J.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},J.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},J.prototype.dispose=function(){this.isStopped=!0},J.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},Bb.distinctUntilChanged=function(a,b){return b||(b=la),new xc(this,a,b)};var yc=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||pa(b._oN)?Ib(b._oN||ia,b._oE||ia,b._oC||ia):b._oN,this.isStopped=!1}return fb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype.onNext=function(a){if(!this.isStopped){var b=d(this.t.onNext).call(this.t,a);b===qa&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=d(this.t.onError).call(this.t,a);if(b===qa)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=d(this.t.onCompleted).call(this.t);if(a===qa)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Nb);Bb["do"]=Bb.tap=Bb.doAction=function(a,b,c){return new yc(this,a,b,c)},Bb.doOnNext=Bb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Bb.doOnError=Bb.tapOnError=function(a,b){return this.tap(ia,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Bb.doOnCompleted=Bb.tapOnCompleted=function(a,b){return this.tap(ia,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Bb["finally"]=Bb.ensure=function(a){var b=this;return new Nc(function(c){var f=d(b.subscribe).call(b,c);return f===qa?(a(),e(f.e)):kb(function(){var b=d(f.dispose).call(f);a(),b===qa&&e(b.e)})},this)};var zc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return fb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=ia,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Nb);Bb.ignoreElements=function(){return new zc(this)},Bb.materialize=function(){var a=this;return new Nc(function(b){return a.subscribe(function(a){b.onNext(Eb(a))},function(a){b.onNext(Fb(a)),b.onCompleted()},function(){b.onNext(Gb()),b.onCompleted()})},a)},Bb.repeat=function(a){return Tb(this,a).concat()},Bb.retry=function(a){return Tb(this,a).catchError()},Bb.retryWhen=function(a){return Tb(this).catchErrorWhen(a)};var Ac=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return fb(b,a),b.pr